diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/powerpc/aim/machdep.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/sys/powerpc/aim/machdep.c b/sys/powerpc/aim/machdep.c index fdbe48b..d0aac4c 100644 --- a/sys/powerpc/aim/machdep.c +++ b/sys/powerpc/aim/machdep.c @@ -224,6 +224,10 @@ cpu_startup(void *dummy) } extern vm_offset_t __startkernel, __endkernel; +extern unsigned char __bss_start[]; +extern unsigned char __sbss_start[]; +extern unsigned char __sbss_end[]; +extern unsigned char _end[]; #ifndef __powerpc64__ /* Bits for running on 64-bit systems in 32-bit mode. */ @@ -272,9 +276,6 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offset_t ofentry, void *mdp) trap_offset = 0; cacheline_warn = 0; - /* Store boot environment state */ - OF_initial_setup((void *)fdt, NULL, (int (*)(void *))ofentry); - /* First guess at start/end kernel positions */ startkernel = __startkernel; endkernel = __endkernel; @@ -289,6 +290,10 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offset_t ofentry, void *mdp) mdp = NULL; #endif + /* Check for ePAPR loader, which puts a magic value into r6 */ + if (mdp == (void *)0x65504150) + mdp = NULL; + /* * Parse metadata if present and fetch parameters. Must be done * before console is inited so cninit gets the right value of @@ -308,8 +313,14 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offset_t ofentry, void *mdp) db_fetch_ksymtab(ksym_start, ksym_end); #endif } + } else { + bzero(__sbss_start, __sbss_end - __sbss_start); + bzero(__bss_start, _end - __bss_start); } + /* Store boot environment state */ + OF_initial_setup((void *)fdt, NULL, (int (*)(void *))ofentry); + /* * Init params/tunables that can be overridden by the loader */ |