Commit 892e6ce5 authored by David S. Miller's avatar David S. Miller Committed by David S. Miller

[SPARC64]: Fix assumptions about data section ordering and objects ending up in .data vs .bss

parent 751c0a58
...@@ -66,7 +66,7 @@ sparc_ramdisk_image: ...@@ -66,7 +66,7 @@ sparc_ramdisk_image:
sparc_ramdisk_size: sparc_ramdisk_size:
.word 0 .word 0
.xword reboot_command .xword reboot_command
.xword bootstr_len .xword bootstr_info
.word _end .word _end
/* We must be careful, 32-bit OpenBOOT will get confused if it /* We must be careful, 32-bit OpenBOOT will get confused if it
...@@ -740,8 +740,9 @@ swapper_pg_dir: ...@@ -740,8 +740,9 @@ swapper_pg_dir:
.data .data
.align 8 .align 8
.globl prom_tba .globl prom_tba, tlb_type
prom_tba: .xword 0 prom_tba: .xword 0
tlb_type: .word 0 /* Must NOT end up in BSS */
.section ".fixup",#alloc,#execinstr .section ".fixup",#alloc,#execinstr
.globl __ret_efault .globl __ret_efault
__ret_efault: __ret_efault:
......
...@@ -48,8 +48,6 @@ unsigned long *sparc64_valid_addr_bitmap; ...@@ -48,8 +48,6 @@ unsigned long *sparc64_valid_addr_bitmap;
unsigned long phys_base; unsigned long phys_base;
unsigned long pfn_base; unsigned long pfn_base;
enum ultra_tlb_layout tlb_type = spitfire;
/* get_new_mmu_context() uses "cache + 1". */ /* get_new_mmu_context() uses "cache + 1". */
spinlock_t ctx_alloc_lock = SPIN_LOCK_UNLOCKED; spinlock_t ctx_alloc_lock = SPIN_LOCK_UNLOCKED;
unsigned long tlb_context_cache = CTX_FIRST_VERSION - 1; unsigned long tlb_context_cache = CTX_FIRST_VERSION - 1;
......
...@@ -15,16 +15,22 @@ ...@@ -15,16 +15,22 @@
*/ */
#define BARG_LEN 256 #define BARG_LEN 256
int bootstr_len = BARG_LEN; struct {
static int bootstr_valid = 0; int bootstr_len;
static char bootstr_buf[BARG_LEN] = { 0 }; int bootstr_valid;
char bootstr_buf[BARG_LEN];
} bootstr_info = {
.bootstr_len = BARG_LEN,
};
char * __init char * __init
prom_getbootargs(void) prom_getbootargs(void)
{ {
/* This check saves us from a panic when bootfd patches args. */ /* This check saves us from a panic when bootfd patches args. */
if (bootstr_valid) return bootstr_buf; if (bootstr_info.bootstr_valid)
prom_getstring(prom_chosen_node, "bootargs", bootstr_buf, BARG_LEN); return bootstr_info.bootstr_buf;
bootstr_valid = 1; prom_getstring(prom_chosen_node, "bootargs",
return bootstr_buf; bootstr_info.bootstr_buf, BARG_LEN);
bootstr_info.bootstr_valid = 1;
return bootstr_info.bootstr_buf;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment