From owner-p4-projects@FreeBSD.ORG Wed Mar 22 01:44:35 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A7DE416A422; Wed, 22 Mar 2006 01:44:35 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 86BB516A424 for ; Wed, 22 Mar 2006 01:44:35 +0000 (UTC) (envelope-from cognet@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 15D8243D69 for ; Wed, 22 Mar 2006 01:44:31 +0000 (GMT) (envelope-from cognet@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k2M1iVtl008502 for ; Wed, 22 Mar 2006 01:44:31 GMT (envelope-from cognet@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k2M1iVZu008499 for perforce@freebsd.org; Wed, 22 Mar 2006 01:44:31 GMT (envelope-from cognet@freebsd.org) Date: Wed, 22 Mar 2006 01:44:31 GMT Message-Id: <200603220144.k2M1iVZu008499@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to cognet@freebsd.org using -f From: Olivier Houchard To: Perforce Change Reviews Cc: Subject: PERFORCE change 93776 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Mar 2006 01:44:35 -0000 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 -__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 @@ -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,