diff options
author | gonzo <gonzo@FreeBSD.org> | 2010-01-25 00:44:05 +0000 |
---|---|---|
committer | gonzo <gonzo@FreeBSD.org> | 2010-01-25 00:44:05 +0000 |
commit | 8a360e9b895718c149bf576ebd23292d08b902bc (patch) | |
tree | 3f8bc1e7f0c14859d089fd83f187631956bd080c | |
parent | 5b71974232932d6b97061977abe1f7766cf0e61a (diff) | |
download | FreeBSD-src-8a360e9b895718c149bf576ebd23292d08b902bc.zip FreeBSD-src-8a360e9b895718c149bf576ebd23292d08b902bc.tar.gz |
- Call post-boot fixup function in order to get proper static
symbols resolving in DDB
- When zeroing .bss/.sbss do not round end address to page boundary,
it's not neccessary and might destroy data pased by trampoline or
boot loader
-rw-r--r-- | sys/mips/adm5120/adm5120_machdep.c | 6 | ||||
-rw-r--r-- | sys/mips/alchemy/alchemy_machdep.c | 6 | ||||
-rw-r--r-- | sys/mips/atheros/ar71xx_machdep.c | 17 | ||||
-rw-r--r-- | sys/mips/idt/idt_machdep.c | 6 | ||||
-rw-r--r-- | sys/mips/malta/malta_machdep.c | 6 | ||||
-rw-r--r-- | sys/mips/sentry5/s5_machdep.c | 6 | ||||
-rw-r--r-- | sys/mips/sibyte/sb_machdep.c | 6 |
7 files changed, 33 insertions, 20 deletions
diff --git a/sys/mips/adm5120/adm5120_machdep.c b/sys/mips/adm5120/adm5120_machdep.c index b0f26ab..90a6b90 100644 --- a/sys/mips/adm5120/adm5120_machdep.c +++ b/sys/mips/adm5120/adm5120_machdep.c @@ -94,7 +94,7 @@ mips_init(void) } /* 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 @@ platform_start(__register_t a0 __unused, __register_t a1 __unused, 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(); diff --git a/sys/mips/alchemy/alchemy_machdep.c b/sys/mips/alchemy/alchemy_machdep.c index f3438f9..a94d995 100644 --- a/sys/mips/alchemy/alchemy_machdep.c +++ b/sys/mips/alchemy/alchemy_machdep.c @@ -94,7 +94,7 @@ mips_init(void) } /* 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 @@ platform_start(__register_t a0 __unused, __register_t a1 __unused, 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(); diff --git a/sys/mips/atheros/ar71xx_machdep.c b/sys/mips/atheros/ar71xx_machdep.c index 9428b79..6cb68ce 100644 --- a/sys/mips/atheros/ar71xx_machdep.c +++ b/sys/mips/atheros/ar71xx_machdep.c @@ -57,8 +57,8 @@ __FBSDID("$FreeBSD$"); #include <mips/atheros/ar71xxreg.h> -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 @@ void 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 @@ platform_start(__register_t a0 __unused, __register_t a1 __unused, 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; diff --git a/sys/mips/idt/idt_machdep.c b/sys/mips/idt/idt_machdep.c index c41e4c3..0dfee66 100644 --- a/sys/mips/idt/idt_machdep.c +++ b/sys/mips/idt/idt_machdep.c @@ -134,9 +134,11 @@ platform_start(__register_t a0, __register_t a1, /* 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 @@ platform_start(__register_t a0, __register_t a1, } /* 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; diff --git a/sys/mips/malta/malta_machdep.c b/sys/mips/malta/malta_machdep.c index df70e24..6cbdcd8 100644 --- a/sys/mips/malta/malta_machdep.c +++ b/sys/mips/malta/malta_machdep.c @@ -178,7 +178,7 @@ mips_init(void) } /* 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 @@ platform_start(__register_t a0, __register_t a1, __register_t a2, 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); diff --git a/sys/mips/sentry5/s5_machdep.c b/sys/mips/sentry5/s5_machdep.c index 238a2b4..00e6231 100644 --- a/sys/mips/sentry5/s5_machdep.c +++ b/sys/mips/sentry5/s5_machdep.c @@ -119,7 +119,7 @@ mips_init(void) * 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 @@ platform_start(__register_t a0, __register_t a1, __register_t a2, 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(); diff --git a/sys/mips/sibyte/sb_machdep.c b/sys/mips/sibyte/sb_machdep.c index 4e4d81a..9dade89 100644 --- a/sys/mips/sibyte/sb_machdep.c +++ b/sys/mips/sibyte/sb_machdep.c @@ -169,7 +169,7 @@ mips_init(void) * 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 @@ void 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 @@ platform_start(__register_t a0, __register_t a1, __register_t a2, /* 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(); |