diff options
author | imp <imp@FreeBSD.org> | 2008-04-03 16:44:50 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2008-04-03 16:44:50 +0000 |
commit | 13cdc14d99cf239f182cf5a8e35c432efd12e2dd (patch) | |
tree | b9e41999f5b8c9663227d9c29b642b69a7e21ce0 /sys/arm/xscale/i80321/ep80219_machdep.c | |
parent | c60a524cb1cf560ebf95db2dafc77b1de66faf7d (diff) | |
download | FreeBSD-src-13cdc14d99cf239f182cf5a8e35c432efd12e2dd.zip FreeBSD-src-13cdc14d99cf239f182cf5a8e35c432efd12e2dd.tar.gz |
Take the first baby step towards unifying and cleaning up arminit():
- Pull all the code to deal with the trampoline stuff into one
centeralized place and use it from everywhere.
- Some minor style tidiness
Reviewed by: tinguely
Diffstat (limited to 'sys/arm/xscale/i80321/ep80219_machdep.c')
-rw-r--r-- | sys/arm/xscale/i80321/ep80219_machdep.c | 55 |
1 files changed, 2 insertions, 53 deletions
diff --git a/sys/arm/xscale/i80321/ep80219_machdep.c b/sys/arm/xscale/i80321/ep80219_machdep.c index c0dda49..a3815ca 100644 --- a/sys/arm/xscale/i80321/ep80219_machdep.c +++ b/sys/arm/xscale/i80321/ep80219_machdep.c @@ -46,7 +46,6 @@ */ #include "opt_msgbuf.h" -#include "opt_ddb.h" #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); @@ -186,73 +185,26 @@ static const struct pmap_devmap ep80219_devmap[] = { } }; -#ifdef DDB -extern vm_offset_t ksym_start, ksym_end; -#endif - extern vm_offset_t xscale_cache_clean_addr; void * initarm(void *arg, void *arg2) { struct pv_addr kernel_l1pt; - int loop; + int loop, i; u_int l1pagetable; vm_offset_t freemempos; vm_offset_t freemem_pt; vm_offset_t afterkern; vm_offset_t freemem_after; vm_offset_t lastaddr; -#ifdef DDB - vm_offset_t zstart = 0, zend = 0; -#endif - int i = 0; - uint32_t fake_preload[35]; uint32_t memsize, memstart; - i = 0; - set_cpufuncs(); - fake_preload[i++] = MODINFO_NAME; - fake_preload[i++] = strlen("elf kernel") + 1; - strcpy((char*)&fake_preload[i++], "elf kernel"); - i += 2; - fake_preload[i++] = MODINFO_TYPE; - fake_preload[i++] = strlen("elf kernel") + 1; - strcpy((char*)&fake_preload[i++], "elf kernel"); - i += 2; - fake_preload[i++] = MODINFO_ADDR; - fake_preload[i++] = sizeof(vm_offset_t); - fake_preload[i++] = KERNBASE + 0x00200000; - fake_preload[i++] = MODINFO_SIZE; - fake_preload[i++] = sizeof(uint32_t); - fake_preload[i++] = (uint32_t)&end - KERNBASE - 0x00200000; -#ifdef DDB - if (*(uint32_t *)KERNVIRTADDR == MAGIC_TRAMP_NUMBER) { - fake_preload[i++] = MODINFO_METADATA|MODINFOMD_SSYM; - fake_preload[i++] = sizeof(vm_offset_t); - fake_preload[i++] = *(uint32_t *)(KERNVIRTADDR + 4); - fake_preload[i++] = MODINFO_METADATA|MODINFOMD_ESYM; - fake_preload[i++] = sizeof(vm_offset_t); - fake_preload[i++] = *(uint32_t *)(KERNVIRTADDR + 8); - lastaddr = *(uint32_t *)(KERNVIRTADDR + 8); - zend = lastaddr; - zstart = *(uint32_t *)(KERNVIRTADDR + 4); - ksym_start = zstart; - ksym_end = zend; - } else -#endif - lastaddr = (vm_offset_t)&end; - - fake_preload[i++] = 0; - fake_preload[i] = 0; - preload_metadata = (void *)fake_preload; - - + lastaddr = fake_preload_metadata(); pcpu_init(pcpup, 0, sizeof(struct pcpu)); PCPU_SET(curthread, &thread0); -#define KERNEL_TEXT_BASE (KERNBASE + 0x00200000) freemempos = 0xa0200000; /* Define a macro to simplify memory allocation */ #define valloc_pages(var, np) \ @@ -437,9 +389,6 @@ initarm(void *arg, void *arg2) /* Enable MMU, I-cache, D-cache, write buffer. */ arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); - - - pmap_curmaxkvaddr = afterkern + PAGE_SIZE; dump_avail[0] = 0xa0000000; dump_avail[1] = 0xa0000000 + memsize; |