summaryrefslogtreecommitdiffstats
path: root/sys/mips/atheros/ar71xx_machdep.c
diff options
context:
space:
mode:
authorgonzo <gonzo@FreeBSD.org>2010-01-25 00:44:05 +0000
committergonzo <gonzo@FreeBSD.org>2010-01-25 00:44:05 +0000
commit8a360e9b895718c149bf576ebd23292d08b902bc (patch)
tree3f8bc1e7f0c14859d089fd83f187631956bd080c /sys/mips/atheros/ar71xx_machdep.c
parent5b71974232932d6b97061977abe1f7766cf0e61a (diff)
downloadFreeBSD-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
Diffstat (limited to 'sys/mips/atheros/ar71xx_machdep.c')
-rw-r--r--sys/mips/atheros/ar71xx_machdep.c17
1 files changed, 11 insertions, 6 deletions
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;
OpenPOWER on IntegriCloud