--- adm5120/adm5120_machdep.c (revision 203504) +++ adm5120/adm5120_machdep.c (local) @@ -94,7 +94,7 @@ } /* phys_avail regions are in bytes */ - phys_avail[0] = MIPS_KSEG0_TO_PHYS((vm_offset_t)&end); + phys_avail[0] = MIPS_KSEG0_TO_PHYS(kernel_kseg0_end); phys_avail[1] = ctob(realmem); physmem = realmem; @@ -153,9 +153,11 @@ uint64_t platform_counter_freq = 175 * 1000 * 1000; /* clear the BSS and SBSS segments */ - kernend = round_page((vm_offset_t)&end); + kernend = (vm_offset_t)&end; memset(&edata, 0, kernend - (vm_offset_t)(&edata)); + mips_postboot_fixup(); + /* Initialize pcpu stuff */ mips_pcpu0_init(); --- alchemy/alchemy_machdep.c (revision 203504) +++ alchemy/alchemy_machdep.c (local) @@ -94,7 +94,7 @@ } /* phys_avail regions are in bytes */ - phys_avail[0] = MIPS_KSEG0_TO_PHYS((vm_offset_t)&end); + phys_avail[0] = MIPS_KSEG0_TO_PHYS(kernel_kseg0_end); phys_avail[1] = ctob(realmem); physmem = realmem; @@ -154,9 +154,11 @@ uint64_t platform_counter_freq = 175 * 1000 * 1000; /* clear the BSS and SBSS segments */ - kernend = round_page((vm_offset_t)&end); + kernend = (vm_offset_t)&end; memset(&edata, 0, kernend - (vm_offset_t)(&edata)); + mips_postboot_fixup(); + /* Initialize pcpu stuff */ mips_pcpu0_init(); --- atheros/ar71xx_machdep.c (revision 203504) +++ atheros/ar71xx_machdep.c (local) @@ -57,8 +57,8 @@ #include -extern int *edata; -extern int *end; +extern char edata[], end[]; + uint32_t ar711_base_mac[ETHER_ADDR_LEN]; /* 4KB static data aread to keep a copy of the bootload env until the dynamic kenv is setup */ @@ -142,16 +142,21 @@ platform_start(__register_t a0 __unused, __register_t a1 __unused, __register_t a2 __unused, __register_t a3 __unused) { - vm_offset_t kernend; uint64_t platform_counter_freq; uint32_t reg; int argc, i, count = 0; char **argv, **envp; + vm_offset_t kernend; - /* clear the BSS and SBSS segments */ - kernend = round_page((vm_offset_t)&end); + /* + * clear the BSS and SBSS segments, this should be first call in + * the function + */ + kernend = (vm_offset_t)&end; memset(&edata, 0, kernend - (vm_offset_t)(&edata)); + mips_postboot_fixup(); + /* Initialize pcpu stuff */ mips_pcpu0_init(); @@ -186,7 +191,7 @@ realmem = btoc(32*1024*1024); /* phys_avail regions are in bytes */ - phys_avail[0] = MIPS_KSEG0_TO_PHYS((vm_offset_t)&end); + phys_avail[0] = MIPS_KSEG0_TO_PHYS(kernel_kseg0_end); phys_avail[1] = ctob(realmem); physmem = realmem; --- idt/idt_machdep.c (revision 203504) +++ idt/idt_machdep.c (local) @@ -134,9 +134,11 @@ /* clear the BSS and SBSS segments */ - kernend = round_page((vm_offset_t)&end); + kernend = (vm_offset_t)&end; memset(&edata, 0, kernend - (vm_offset_t)(&edata)); + mips_postboot_fixup(); + /* Initialize pcpu stuff */ mips_pcpu0_init(); @@ -162,7 +164,7 @@ } /* phys_avail regions are in bytes */ - phys_avail[0] = MIPS_KSEG0_TO_PHYS((vm_offset_t)&end); + phys_avail[0] = MIPS_KSEG0_TO_PHYS(kernel_kseg0_end); phys_avail[1] = ctob(realmem); physmem = realmem; --- malta/malta_machdep.c (revision 203504) +++ malta/malta_machdep.c (local) @@ -178,7 +178,7 @@ } /* phys_avail regions are in bytes */ - phys_avail[0] = MIPS_KSEG0_TO_PHYS((vm_offset_t)&end); + phys_avail[0] = MIPS_KSEG0_TO_PHYS(kernel_kseg0_end); phys_avail[1] = ctob(realmem); physmem = realmem; @@ -293,9 +293,11 @@ int i; /* clear the BSS and SBSS segments */ - kernend = round_page((vm_offset_t)&end); + kernend = (vm_offset_t)&end; memset(&edata, 0, kernend - (vm_offset_t)(&edata)); + mips_postboot_fixup(); + mips_pcpu0_init(); platform_counter_freq = malta_cpu_freq(); mips_timer_early_init(platform_counter_freq); --- sentry5/s5_machdep.c (revision 203504) +++ sentry5/s5_machdep.c (local) @@ -119,7 +119,7 @@ * from CFE, omit the region at the start of physical * memory where the kernel has been loaded. */ - phys_avail[i] += MIPS_KSEG0_TO_PHYS((vm_offset_t)&end); + phys_avail[i] += MIPS_KSEG0_TO_PHYS(kernel_kseg0_end); } phys_avail[i + 1] = addr + len; physmem += len; @@ -187,9 +187,11 @@ uint64_t platform_counter_freq; /* clear the BSS and SBSS segments */ - kernend = round_page((vm_offset_t)&end); + kernend = (vm_offset_t)&end; memset(&edata, 0, kernend - (vm_offset_t)(&edata)); + mips_postboot_fixup(); + /* Initialize pcpu stuff */ mips_pcpu0_init(); --- sibyte/sb_machdep.c (revision 203504) +++ sibyte/sb_machdep.c (local) @@ -169,7 +169,7 @@ * from CFE, omit the region at the start of physical * memory where the kernel has been loaded. */ - phys_avail[i] += MIPS_KSEG0_TO_PHYS((vm_offset_t)&end); + phys_avail[i] += MIPS_KSEG0_TO_PHYS(kernel_kseg0_end); } phys_avail[i + 1] = addr + len; physmem += len; @@ -246,8 +246,6 @@ platform_start(__register_t a0, __register_t a1, __register_t a2, __register_t a3) { - vm_offset_t kernend; - /* * Make sure that kseg0 is mapped cacheable-coherent */ @@ -255,7 +253,7 @@ /* clear the BSS and SBSS segments */ memset(&edata, 0, (vm_offset_t)&end - (vm_offset_t)&edata); - kernend = round_page((vm_offset_t)&end); + mips_postboot_fixup(); /* Initialize pcpu stuff */ mips_pcpu0_init();