Date: Sat, 17 Nov 2007 23:34:05 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 129183 for review Message-ID: <200711172334.lAHNY5wS047098@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=129183 Change 129183 by jb@jb_freebsd1 on 2007/11/17 23:33:27 IF6 Affected files ... .. //depot/projects/dtrace6/src/contrib/openbsm/etc/audit_control#3 integrate .. //depot/projects/dtrace6/src/gnu/usr.bin/gdb/kgdb/kgdb.1#2 integrate .. //depot/projects/dtrace6/src/gnu/usr.bin/gdb/kgdb/kgdb.h#2 integrate .. //depot/projects/dtrace6/src/gnu/usr.bin/gdb/kgdb/kthr.c#2 integrate .. //depot/projects/dtrace6/src/gnu/usr.bin/gdb/kgdb/trgt.c#2 integrate .. //depot/projects/dtrace6/src/gnu/usr.bin/gdb/kgdb/trgt_arm.c#2 integrate .. //depot/projects/dtrace6/src/sys/arm/xscale/ixp425/files.ixp425#2 integrate .. //depot/projects/dtrace6/src/sys/arm/xscale/ixp425/if_npe.c#2 integrate .. //depot/projects/dtrace6/src/sys/arm/xscale/ixp425/ixp425_npe.c#2 integrate .. //depot/projects/dtrace6/src/sys/arm/xscale/ixp425/ixp425_npevar.h#2 integrate .. //depot/projects/dtrace6/src/sys/contrib/dev/npe/IxNpeMicrocode.dat.uu#1 branch .. //depot/projects/dtrace6/src/sys/contrib/dev/npe/LICENSE#1 branch Differences ... ==== //depot/projects/dtrace6/src/contrib/openbsm/etc/audit_control#3 (text) ==== @@ -1,5 +1,6 @@ # # $P4: //depot/projects/trustedbsd/openbsm/etc/audit_control#5 $ +# $FreeBSD: src/contrib/openbsm/etc/audit_control,v 1.2.2.4 2007/11/17 22:14:29 rwatson Exp $ # dir:/var/audit flags:lo ==== //depot/projects/dtrace6/src/gnu/usr.bin/gdb/kgdb/kgdb.1#2 (text+ko) ==== @@ -22,8 +22,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/gnu/usr.bin/gdb/kgdb/kgdb.1,v 1.7.2.1 2005/09/15 05:32:10 marcel Exp $ -.Dd March 2, 2005 +.\" $FreeBSD: src/gnu/usr.bin/gdb/kgdb/kgdb.1,v 1.7.2.3 2007/11/17 16:51:58 jhb Exp $ +.\" +.Dd October 11, 2006 .Os .Dt KGDB 1 .Sh NAME @@ -34,6 +35,7 @@ .Op Fl a | Fl f | Fl fullname .Op Fl q | Fl quiet .Op Fl v +.Op Fl w .Op Fl d Ar crashdir .Op Fl c Ar core | Fl n Ar dumpnr | Fl r Ar device .Op Ar kernel Op Ar core @@ -67,6 +69,13 @@ form is supported for compatibility as well. .It Fl v Increase verbosity. +.It Fl w +Opens kmem-based targets in read-write mode. +(This is identical to what +.Fl -wcore +used to do in previous +gdb versions for +.Fx . ) .It Fl d Ar crashdir Use .Ar crashdir ==== //depot/projects/dtrace6/src/gnu/usr.bin/gdb/kgdb/kgdb.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/gnu/usr.bin/gdb/kgdb/kgdb.h,v 1.2.2.1 2005/09/15 05:32:10 marcel Exp $ + * $FreeBSD: src/gnu/usr.bin/gdb/kgdb/kgdb.h,v 1.2.2.2 2007/11/17 16:45:38 jhb Exp $ */ #ifndef _KGDB_H_ @@ -62,4 +62,6 @@ struct kthr *kgdb_thr_select(struct kthr *); char *kgdb_thr_extra_thread_info(int); +uintptr_t kgdb_lookup(const char *sym); + #endif /* _KGDB_H_ */ ==== //depot/projects/dtrace6/src/gnu/usr.bin/gdb/kgdb/kthr.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/gnu/usr.bin/gdb/kgdb/kthr.c,v 1.2.2.3 2007/02/02 13:48:19 rodrigc Exp $"); +__FBSDID("$FreeBSD: src/gnu/usr.bin/gdb/kgdb/kthr.c,v 1.2.2.5 2007/11/17 16:50:20 jhb Exp $"); #include <sys/param.h> #include <sys/proc.h> @@ -52,8 +52,8 @@ static struct kthr *first; struct kthr *curkthr; -static uintptr_t -lookup(const char *sym) +uintptr_t +kgdb_lookup(const char *sym) { struct nlist nl[2]; @@ -80,29 +80,29 @@ struct kthr *kt; uintptr_t addr, paddr; - addr = lookup("_allproc"); + addr = kgdb_lookup("_allproc"); if (addr == 0) return (NULL); kvm_read(kvm, addr, &paddr, sizeof(paddr)); - dumppcb = lookup("_dumppcb"); + dumppcb = kgdb_lookup("_dumppcb"); if (dumppcb == 0) return (NULL); - addr = lookup("_dumptid"); + addr = kgdb_lookup("_dumptid"); if (addr != 0) kvm_read(kvm, addr, &dumptid, sizeof(dumptid)); else dumptid = -1; - addr = lookup("_stopped_cpus"); + addr = kgdb_lookup("_stopped_cpus"); if (addr != 0) kvm_read(kvm, addr, &stopped_cpus, sizeof(stopped_cpus)); else stopped_cpus = 0; - stoppcbs = lookup("_stoppcbs"); - + stoppcbs = kgdb_lookup("_stoppcbs"); + while (paddr != 0) { if (kvm_read(kvm, paddr, &p, sizeof(p)) != sizeof(p)) { warnx("kvm_read: %s", kvm_geterr(kvm)); @@ -123,7 +123,7 @@ else if (td.td_state == TDS_RUNNING && ((1 << td.td_oncpu) & stopped_cpus) && stoppcbs != 0) kt->pcb = (uintptr_t) stoppcbs + sizeof(struct pcb) * td.td_oncpu; - else + else kt->pcb = (uintptr_t)td.td_pcb; kt->kstack = td.td_kstack; kt->tid = td.td_tid; ==== //depot/projects/dtrace6/src/gnu/usr.bin/gdb/kgdb/trgt.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/gnu/usr.bin/gdb/kgdb/trgt.c,v 1.2.2.2 2005/09/15 05:32:10 marcel Exp $"); +__FBSDID("$FreeBSD: src/gnu/usr.bin/gdb/kgdb/trgt.c,v 1.2.2.3 2007/11/17 16:50:20 jhb Exp $"); #include <sys/param.h> #include <sys/proc.h> @@ -53,9 +53,8 @@ { static CORE_ADDR kernbase; struct minimal_symbol *sym; - - if (kernbase == 0) - { + + if (kernbase == 0) { sym = lookup_minimal_symbol ("kernbase", NULL, NULL); if (sym == NULL) { kernbase = KERNBASE; @@ -205,9 +204,8 @@ ti = add_thread(ptid_build(kt->pid, 0, kt->tid)); kt = kgdb_thr_next(kt); } - if (curkthr != NULL) + if (curkthr != 0) inferior_ptid = ptid_build(curkthr->pid, 0, curkthr->tid); - add_com ("proc", class_obscure, kgdb_set_proc_cmd, "Set current process context"); } ==== //depot/projects/dtrace6/src/gnu/usr.bin/gdb/kgdb/trgt_arm.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/gnu/usr.bin/gdb/kgdb/trgt_arm.c,v 1.2.2.1 2006/10/13 14:27:51 obrien Exp $"); +__FBSDID("$FreeBSD: src/gnu/usr.bin/gdb/kgdb/trgt_arm.c,v 1.2.2.2 2007/11/17 16:50:20 jhb Exp $"); #include <sys/types.h> #ifndef CROSS_DEBUGGER @@ -54,7 +54,7 @@ struct kthr *kt; struct pcb pcb; int i, reg; - + kt = kgdb_thr_lookup_tid(ptid_get_tid(inferior_ptid)); if (kt == NULL) return; @@ -63,7 +63,7 @@ memset(&pcb, 0, sizeof(pcb)); } for (i = ARM_A1_REGNUM + 8; i <= ARM_SP_REGNUM; i++) { - supply_register(i, (char *)&pcb.un_32.pcb32_r8 + + supply_register(i, (char *)&pcb.un_32.pcb32_r8 + (i - (ARM_A1_REGNUM + 8 )) * 4); } if (pcb.un_32.pcb32_sp != 0) { @@ -174,7 +174,7 @@ return; cache = kgdb_trgt_frame_cache(next_frame, this_cache); - + if (is_undef && (regnum == ARM_SP_REGNUM || regnum == ARM_PC_REGNUM)) { *addrp = cache->sp + offsetof(struct trapframe, tf_spsr); target_read_memory(*addrp, valuep, regsz); ==== //depot/projects/dtrace6/src/sys/arm/xscale/ixp425/files.ixp425#2 (text+ko) ==== @@ -1,4 +1,4 @@ -#$FreeBSD: src/sys/arm/xscale/ixp425/files.ixp425,v 1.2.2.1 2007/02/26 23:13:09 cognet Exp $ +#$FreeBSD: src/sys/arm/xscale/ixp425/files.ixp425,v 1.2.2.2 2007/11/17 18:24:46 cognet Exp $ arm/arm/cpufunc_asm_xscale.S standard arm/arm/irq_dispatch.S standard arm/xscale/ixp425/ixp425.c standard @@ -16,12 +16,7 @@ arm/xscale/ixp425/ixp425_a4x_io.S optional uart dev/uart/uart_dev_ns8250.c optional uart # -# NPE-based Ethernet support (requires qmgr also). Note the -# firmware images must be downloaded from the Intel web site. -# The URL seems to change frequently; try this as a starting -# place: -# -# http://www.intel.com/design/network/products/npfamily/download_ixp400.htm +# NPE-based Ethernet support (requires qmgr also). # arm/xscale/ixp425/if_npe.c optional npe arm/xscale/ixp425/ixp425_npe.c optional npe @@ -41,7 +36,7 @@ clean "IxNpeMicrocode.fwo" IxNpeMicrocode.dat optional npe_fw \ dependency ".PHONY" \ - compile-with "if [ -e $S/arm/xscale/ixp425/IxNpeMicrocode.dat ]; then ln -sf $S/arm/xscale/ixp425/IxNpeMicrocode.dat .; else echo 'WARNING, no IxNpeMicrocode.dat file; you must obtain this from the Intel web site'; false; fi" \ + compile-with "uudecode < $S/contrib/dev/npe/IxNpeMicrocode.dat.uu" \ no-obj no-implicit-rule \ clean "IxNpeMicrocode.dat" # ==== //depot/projects/dtrace6/src/sys/arm/xscale/ixp425/if_npe.c#2 (text+ko) ==== @@ -23,7 +23,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/if_npe.c,v 1.5.2.1 2007/02/26 23:13:09 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/if_npe.c,v 1.5.2.2 2007/11/17 18:22:57 cognet Exp $"); /* * Intel XScale NPE Ethernet driver. @@ -546,11 +546,27 @@ struct npe_softc * sc = device_get_softc(dev); int unit = device_get_unit(dev); int error, i; + uint32_t imageid; - /* load NPE firmware and start it running */ - error = ixpnpe_init(sc->sc_npe, "npe_fw", npeconfig[unit].imageid); - if (error != 0) - return error; + /* + * Load NPE firmware and start it running. We assume + * that minor version bumps remain compatible so probe + * the firmware image starting with the expected version + * and then bump the minor version up to the max. + */ + imageid = npeconfig[unit].imageid; + for (;;) { + error = ixpnpe_init(sc->sc_npe, "npe_fw", imageid); + if (error == 0) + break; + /* ESRCH is returned when the requested image is not present */ + if (error != ESRCH) + return error; + /* bump the minor version up to the max possible */ + if (NPEIMAGE_MINOR(imageid) == 0xff) + return error; + imageid++; + } if (bus_space_map(sc->sc_iot, npeconfig[unit].regbase, npeconfig[unit].regsize, 0, &sc->sc_ioh)) { ==== //depot/projects/dtrace6/src/sys/arm/xscale/ixp425/ixp425_npe.c#2 (text+ko) ==== @@ -57,7 +57,7 @@ * SUCH DAMAGE. */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/ixp425_npe.c,v 1.3.2.1 2007/02/26 23:13:09 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/ixp425_npe.c,v 1.3.2.2 2007/11/17 18:22:57 cognet Exp $"); /* * Intel XScale Network Processing Engine (NPE) support. @@ -407,14 +407,14 @@ } /* 2 consecutive NPE_IMAGE_MARKER's indicates end of library */ if (image->id == NPE_IMAGE_MARKER) { - device_printf(sc->sc_dev, + DPRINTF(sc->sc_dev, "imageId 0x%08x not found in image library header\n", imageId); /* reached end of library, image not found */ - return EIO; + return ESRCH; } offset += image->size; } - return EIO; + return ESRCH; } int ==== //depot/projects/dtrace6/src/sys/arm/xscale/ixp425/ixp425_npevar.h#2 (text+ko) ==== @@ -21,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/arm/xscale/ixp425/ixp425_npevar.h,v 1.1.2.1 2007/02/26 23:13:09 cognet Exp $ + * $FreeBSD: src/sys/arm/xscale/ixp425/ixp425_npevar.h,v 1.1.2.2 2007/11/17 18:22:57 cognet Exp $ */ #ifndef _IXP425_NPEVAR_H_ @@ -32,7 +32,17 @@ * * Firmware Id's for current firmware image. These are typed by * NPE ID and the feature set. Not all features are available - * on all NPE's. + * on all NPE's. The Image ID has the following structure: + * + * Field [Bit Location] + * ----------------------------------- + * Device ID [28..31] + * NPE ID [24..27] + * NPE Functionality ID [16..23] + * Major Release Number [8..15] + * Minor Release Number [0..7] + * + * The following "feature sets" are known to exist: * * HSS-0: supports 32 channelized and 4 packetized. * HSS-0 + ATM + SPHY: @@ -56,6 +66,15 @@ * ETH+VLAN+HDR: Ethernet Rx/Tx which includes: * SPANNING_TREE, FIREWALL, VLAN_QOS, HEADER_CONVERSION */ +#define NPEIMAGE_DEVID(id) (((id) >> 28) & 0xf) +#define NPEIMAGE_NPEID(id) (((id) >> 24) & 0xf) +#define NPEIMAGE_FUNCID(id) (((id) >> 16) & 0xff) +#define NPEIMAGE_MAJOR(id) (((id) >> 8) & 0xff) +#define NPEIMAGE_MINOR(id) (((id) >> 0) & 0xff) +#define NPEIMAGE_MAKEID(dev, npe, func, maj, min) \ + ((((dev) & 0xf) << 28) | (((npe) & 0xf) << 24) | \ + (((func) & 0xff) << 16) (((maj) & 0xff) << 8) | (((min) & 0xff) << 0)) + /* XXX not right, revise */ /* NPE A Firmware Image Id's */ #define NPEFW_A_HSS0 0x00010000 /* HSS-0: 32 chan+4 packet */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200711172334.lAHNY5wS047098>