Date: Wed, 22 Mar 2006 01:44:31 GMT From: Olivier Houchard <cognet@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 93776 for review Message-ID: <200603220144.k2M1iVZu008499@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=93776 Change 93776 by cognet@cognet on 2006/03/22 01:44:26 Make the KB920x bits aware on where the ELF trampoline puts the symtab and the strtab, to get more meaningful backtraces. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/kb920x_machdep.c#17 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/kb920x_machdep.c#17 (text+ko) ==== @@ -47,7 +47,7 @@ #include "opt_ddb.h" #include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); +__FBSDID("$FreeBSD: src/sys/arm/at91/kb920x_machdep.c,v 1.2 2006/03/18 01:43:54 imp Exp $"); #define _ARM32_BUS_DMA_PRIVATE #include <sys/param.h> @@ -195,6 +195,10 @@ int i = 0; uint32_t fake_preload[35]; uint32_t memsize = 32 * 1024 * 1024; + vm_offset_t lastaddr; +#ifdef DDB + vm_offset_t zstart = 0, zend = 0; +#endif i = 0; @@ -215,6 +219,23 @@ fake_preload[i++] = MODINFO_SIZE; fake_preload[i++] = sizeof(uint32_t); fake_preload[i++] = (uint32_t)&end - KERNBASE; +#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; @@ -224,7 +245,7 @@ PCPU_SET(curthread, &thread0); #define KERNEL_TEXT_BASE (KERNBASE) - freemempos = ((vm_offset_t)&end + PAGE_MASK) & ~PAGE_MASK; + freemempos = (lastaddr + PAGE_MASK) & ~PAGE_MASK; /* Define a macro to simplify memory allocation */ #define valloc_pages(var, np) \ alloc_pages((var).pv_va, (np)); \ @@ -280,9 +301,9 @@ pmap_link_l2pt(l1pagetable, KERNBASE + i * 0x100000, &kernel_pt_table[KERNEL_PT_KERN + i]); pmap_map_chunk(l1pagetable, KERNBASE, KERNPHYSADDR, - (((uint32_t)(&end) - KERNBASE) + PAGE_SIZE) & ~(PAGE_SIZE - 1), + (((uint32_t)(lastaddr) - KERNBASE) + PAGE_SIZE) & ~(PAGE_SIZE - 1), VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); - afterkern = round_page(((vm_offset_t)&end + L1_S_SIZE) & ~(L1_S_SIZE + afterkern = round_page((lastaddr + L1_S_SIZE) & ~(L1_S_SIZE - 1)); for (i = 0; i < KERNEL_PT_AFKERNEL_NUM; i++) { pmap_link_l2pt(l1pagetable, afterkern + i * 0x00100000,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603220144.k2M1iVZu008499>