From owner-p4-projects@FreeBSD.ORG Fri Aug 15 09:47:31 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9B28A1065671; Fri, 15 Aug 2008 09:47:31 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E4DB106567A for ; Fri, 15 Aug 2008 09:47:31 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 3D3CE8FC1D for ; Fri, 15 Aug 2008 09:47:31 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.2/8.14.2) with ESMTP id m7F9lVgV057487 for ; Fri, 15 Aug 2008 09:47:31 GMT (envelope-from ed@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m7F9lUuh057485 for perforce@freebsd.org; Fri, 15 Aug 2008 09:47:30 GMT (envelope-from ed@FreeBSD.org) Date: Fri, 15 Aug 2008 09:47:30 GMT Message-Id: <200808150947.m7F9lUuh057485@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to ed@FreeBSD.org using -f From: Ed Schouten To: Perforce Change Reviews Cc: Subject: PERFORCE change 147432 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: Fri, 15 Aug 2008 09:47:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=147432 Change 147432 by ed@ed_dull on 2008/08/15 09:46:52 IFC. Affected files ... .. //depot/projects/mpsafetty/lib/libbluetooth/Makefile#2 integrate .. //depot/projects/mpsafetty/lib/libbluetooth/bluetooth.3#2 integrate .. //depot/projects/mpsafetty/lib/libbluetooth/bluetooth.h#2 integrate .. //depot/projects/mpsafetty/lib/libc/stdlib/malloc.c#4 integrate .. //depot/projects/mpsafetty/lib/libc/uuid/Makefile.inc#2 integrate .. //depot/projects/mpsafetty/lib/libc/uuid/uuid.3#2 integrate .. //depot/projects/mpsafetty/lib/libc/uuid/uuid_stream.c#1 branch .. //depot/projects/mpsafetty/sbin/ifconfig/ifieee80211.c#5 integrate .. //depot/projects/mpsafetty/share/man/man4/bpf.4#2 integrate .. //depot/projects/mpsafetty/sys/amd64/amd64/bpf_jit_machdep.c#3 integrate .. //depot/projects/mpsafetty/sys/amd64/amd64/bpf_jit_machdep.h#3 integrate .. //depot/projects/mpsafetty/sys/conf/files#12 integrate .. //depot/projects/mpsafetty/sys/dev/age/if_age.c#3 integrate .. //depot/projects/mpsafetty/sys/dev/pcn/if_pcn.c#1 branch .. //depot/projects/mpsafetty/sys/dev/pcn/if_pcnreg.h#1 branch .. //depot/projects/mpsafetty/sys/dev/ste/if_ste.c#1 branch .. //depot/projects/mpsafetty/sys/dev/ste/if_stereg.h#1 branch .. //depot/projects/mpsafetty/sys/dev/tl/if_tl.c#1 branch .. //depot/projects/mpsafetty/sys/dev/tl/if_tlreg.h#1 branch .. //depot/projects/mpsafetty/sys/dev/wb/if_wb.c#1 branch .. //depot/projects/mpsafetty/sys/dev/wb/if_wbreg.h#1 branch .. //depot/projects/mpsafetty/sys/dev/xen/console/console.c#2 integrate .. //depot/projects/mpsafetty/sys/dev/xen/console/xencons_ring.c#2 integrate .. //depot/projects/mpsafetty/sys/i386/i386/bpf_jit_machdep.c#3 integrate .. //depot/projects/mpsafetty/sys/i386/i386/bpf_jit_machdep.h#3 integrate .. //depot/projects/mpsafetty/sys/i386/i386/trap.c#2 integrate .. //depot/projects/mpsafetty/sys/i386/include/xen/xen-os.h#2 integrate .. //depot/projects/mpsafetty/sys/i386/include/xen/xenpmap.h#2 integrate .. //depot/projects/mpsafetty/sys/i386/xen/clock.c#2 integrate .. //depot/projects/mpsafetty/sys/i386/xen/locore.s#2 integrate .. //depot/projects/mpsafetty/sys/i386/xen/pmap.c#2 integrate .. //depot/projects/mpsafetty/sys/i386/xen/xen_machdep.c#2 integrate .. //depot/projects/mpsafetty/sys/kern/kern_thread.c#3 integrate .. //depot/projects/mpsafetty/sys/kern/subr_witness.c#3 integrate .. //depot/projects/mpsafetty/sys/libkern/strcspn.c#1 branch .. //depot/projects/mpsafetty/sys/modules/pcn/Makefile#2 integrate .. //depot/projects/mpsafetty/sys/modules/ste/Makefile#2 integrate .. //depot/projects/mpsafetty/sys/modules/tl/Makefile#2 integrate .. //depot/projects/mpsafetty/sys/modules/wb/Makefile#2 integrate .. //depot/projects/mpsafetty/sys/pci/if_pcn.c#2 delete .. //depot/projects/mpsafetty/sys/pci/if_pcnreg.h#2 delete .. //depot/projects/mpsafetty/sys/pci/if_ste.c#2 delete .. //depot/projects/mpsafetty/sys/pci/if_stereg.h#2 delete .. //depot/projects/mpsafetty/sys/pci/if_tl.c#2 delete .. //depot/projects/mpsafetty/sys/pci/if_tlreg.h#2 delete .. //depot/projects/mpsafetty/sys/pci/if_wb.c#2 delete .. //depot/projects/mpsafetty/sys/pci/if_wbreg.h#2 delete .. //depot/projects/mpsafetty/sys/sparc64/include/asi.h#2 integrate .. //depot/projects/mpsafetty/sys/sparc64/include/cache.h#2 integrate .. //depot/projects/mpsafetty/sys/sparc64/include/cpufunc.h#2 integrate .. //depot/projects/mpsafetty/sys/sparc64/include/pcpu.h#2 integrate .. //depot/projects/mpsafetty/sys/sparc64/sparc64/cheetah.c#2 integrate .. //depot/projects/mpsafetty/sys/sparc64/sparc64/clock.c#2 integrate .. //depot/projects/mpsafetty/sys/sparc64/sparc64/exception.S#2 integrate .. //depot/projects/mpsafetty/sys/sparc64/sparc64/locore.S#2 integrate .. //depot/projects/mpsafetty/sys/sparc64/sparc64/machdep.c#2 integrate .. //depot/projects/mpsafetty/sys/sparc64/sparc64/mp_locore.S#2 integrate .. //depot/projects/mpsafetty/sys/sparc64/sparc64/mp_machdep.c#2 integrate .. //depot/projects/mpsafetty/sys/sparc64/sparc64/pmap.c#2 integrate .. //depot/projects/mpsafetty/sys/sparc64/sparc64/prof_machdep.c#2 integrate .. //depot/projects/mpsafetty/sys/sparc64/sparc64/spitfire.c#2 integrate .. //depot/projects/mpsafetty/sys/sparc64/sparc64/support.S#2 integrate .. //depot/projects/mpsafetty/sys/sparc64/sparc64/swtch.S#2 integrate .. //depot/projects/mpsafetty/sys/sparc64/sparc64/tick.c#2 integrate .. //depot/projects/mpsafetty/sys/sparc64/sparc64/tlb.c#2 integrate .. //depot/projects/mpsafetty/sys/sparc64/sparc64/trap.c#2 integrate .. //depot/projects/mpsafetty/sys/sys/libkern.h#3 integrate .. //depot/projects/mpsafetty/sys/sys/lock.h#2 integrate .. //depot/projects/mpsafetty/sys/sys/param.h#4 integrate .. //depot/projects/mpsafetty/sys/vm/redzone.c#2 integrate .. //depot/projects/mpsafetty/sys/xen/evtchn/evtchn.c#2 integrate .. //depot/projects/mpsafetty/sys/xen/xenbus/xenbus_client.c#2 integrate .. //depot/projects/mpsafetty/sys/xen/xenbus/xenbus_comms.c#2 integrate .. //depot/projects/mpsafetty/sys/xen/xenbus/xenbus_dev.c#2 integrate .. //depot/projects/mpsafetty/sys/xen/xenbus/xenbus_probe.c#2 integrate .. //depot/projects/mpsafetty/sys/xen/xenbus/xenbus_probe_backend.c#2 integrate .. //depot/projects/mpsafetty/sys/xen/xenbus/xenbus_xs.c#2 integrate .. //depot/projects/mpsafetty/tools/tools/nanobsd/nanobsd.sh#5 integrate .. //depot/projects/mpsafetty/usr.bin/tar/test/test_copy.c#2 integrate .. //depot/projects/mpsafetty/usr.bin/tar/test/test_option_T.c#2 integrate .. //depot/projects/mpsafetty/usr.bin/tar/test/test_patterns.c#2 integrate .. //depot/projects/mpsafetty/usr.bin/tar/test/test_patterns.tgz.err.uu#1 branch .. //depot/projects/mpsafetty/usr.bin/tar/test/test_patterns.tgz.out.uu#1 branch .. //depot/projects/mpsafetty/usr.bin/tar/test/test_patterns.tgz.uu#1 branch .. //depot/projects/mpsafetty/usr.sbin/sysinstall/dist.c#2 integrate .. //depot/projects/mpsafetty/usr.sbin/sysinstall/dist.h#2 integrate .. //depot/projects/mpsafetty/usr.sbin/sysinstall/menus.c#2 integrate Differences ... ==== //depot/projects/mpsafetty/lib/libbluetooth/Makefile#2 (text+ko) ==== @@ -1,5 +1,5 @@ # $Id: Makefile,v 1.5 2003/07/22 18:38:04 max Exp $ -# $FreeBSD: src/lib/libbluetooth/Makefile,v 1.3 2007/05/21 02:49:02 deischen Exp $ +# $FreeBSD: src/lib/libbluetooth/Makefile,v 1.4 2008/08/13 19:35:31 emax Exp $ LIB= bluetooth MAN= bluetooth.3 @@ -27,4 +27,8 @@ MLINKS+= bluetooth.3 bt_ntoa.3 MLINKS+= bluetooth.3 bt_aton.3 +MLINKS+= bluetooth.3 bdaddr_same.3 +MLINKS+= bluetooth.3 bdaddr_any.3 +MLINKS+= bluetooth.3 bdaddr_copy.3 + .include ==== //depot/projects/mpsafetty/lib/libbluetooth/bluetooth.3#2 (text+ko) ==== @@ -23,9 +23,9 @@ .\" SUCH DAMAGE. .\" .\" $Id: bluetooth.3,v 1.5 2003/05/20 23:04:30 max Exp $ -.\" $FreeBSD: src/lib/libbluetooth/bluetooth.3,v 1.7 2005/01/21 10:26:11 ru Exp $ +.\" $FreeBSD: src/lib/libbluetooth/bluetooth.3,v 1.8 2008/08/13 19:35:31 emax Exp $ .\" -.Dd May 7, 2003 +.Dd August 13, 2008 .Dt BLUETOOTH 3 .Os .Sh NAME @@ -40,7 +40,10 @@ .Nm bt_setprotoent , .Nm bt_endprotoent , .Nm bt_aton , -.Nm bt_ntoa +.Nm bt_ntoa , +.Nm bdaddr_same , +.Nm bdaddr_any , +.Nm bdaddr_copy .Nd Bluetooth routines .Sh LIBRARY .Lb libbluetooth @@ -70,6 +73,12 @@ .Fn bt_aton "const char *str" "bdaddr_t *ba" .Ft const char * .Fn bt_ntoa "const bdaddr_t *ba" "char *str" +.Ft int +.Fn bdaddr_same "const bdaddr_t *a" "const bdaddr_t *b" +.Ft int +.Fn bdaddr_any "const bdaddr_t *a" +.Ft int +.Fn bdaddr_copy "const bdaddr_t *dst" "const bdaddr_t *src" .Sh DESCRIPTION The .Fn bt_gethostent , @@ -186,6 +195,28 @@ string representing the address into the buffer provided. It is up to the caller to ensure that provided buffer has enough space. If no buffer was provided then internal static buffer will be used. +.Pp +The +.Fn bdaddr_same , +.Fn bdaddr_any +and +.Fn bdaddr_copy +are handy shorthand Bluetooth address utility functions. +The +.Fn bdaddr_same +function will test if two provided BD_ADDRs are the same. +The +.Fn bdaddr_any +function will test if provided BD_ADDR is +.Dv ANY +BD_ADDR. +The +.Fn bdaddr_copy +function will copy provided +.Fa src +BD_ADDR into provided +.Fa dst +BD_ADDR. .Sh FILES .Bl -tag -width ".Pa /etc/bluetooth/hosts" -compact .It Pa /etc/bluetooth/hosts ==== //depot/projects/mpsafetty/lib/libbluetooth/bluetooth.h#2 (text+ko) ==== @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $Id: bluetooth.h,v 1.5 2003/09/14 23:28:42 max Exp $ - * $FreeBSD: src/lib/libbluetooth/bluetooth.h,v 1.2 2005/03/17 21:39:44 emax Exp $ + * $FreeBSD: src/lib/libbluetooth/bluetooth.h,v 1.3 2008/08/13 19:35:31 emax Exp $ */ #ifndef _BLUETOOTH_H_ @@ -72,6 +72,36 @@ char const * bt_ntoa (bdaddr_t const *ba, char *str); int bt_aton (char const *str, bdaddr_t *ba); +/* + * bdaddr utility functions (from NetBSD) + */ + +static __inline int +bdaddr_same(const bdaddr_t *a, const bdaddr_t *b) +{ + return (a->b[0] == b->b[0] && a->b[1] == b->b[1] && + a->b[2] == b->b[2] && a->b[3] == b->b[3] && + a->b[4] == b->b[4] && a->b[5] == b->b[5]); +} + +static __inline int +bdaddr_any(const bdaddr_t *a) +{ + return (a->b[0] == 0 && a->b[1] == 0 && a->b[2] == 0 && + a->b[3] == 0 && a->b[4] == 0 && a->b[5] == 0); +} + +static __inline void +bdaddr_copy(bdaddr_t *d, const bdaddr_t *s) +{ + d->b[0] = s->b[0]; + d->b[1] = s->b[1]; + d->b[2] = s->b[2]; + d->b[3] = s->b[3]; + d->b[4] = s->b[4]; + d->b[5] = s->b[5]; +} + __END_DECLS #endif /* ndef _BLUETOOTH_H_ */ ==== //depot/projects/mpsafetty/lib/libc/stdlib/malloc.c#4 (text+ko) ==== @@ -128,7 +128,7 @@ #define MALLOC_DSS #include -__FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.174 2008/08/08 20:42:42 cperciva Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.176 2008/08/14 17:31:42 jasone Exp $"); #include "libc_private.h" #ifdef MALLOC_DEBUG @@ -1012,10 +1012,11 @@ /* Exponentially back off. */ for (i = 1; i <= SPIN_LIMIT_2POW; i++) { - for (j = 0; j < (1U << i); j++) + for (j = 0; j < (1U << i); j++) { ret++; + CPU_SPINWAIT; + } - CPU_SPINWAIT; if (_pthread_mutex_trylock(lock) == 0) return (ret); } @@ -2209,8 +2210,8 @@ */ regind = diff / size; } - } else if (size <= ((sizeof(size_invs) / sizeof(unsigned)) - << QUANTUM_2POW_MIN) + 2) { + } else if (size <= (((sizeof(size_invs) / sizeof(unsigned)) + 2) + << QUANTUM_2POW_MIN)) { regind = size_invs[(size >> QUANTUM_2POW_MIN) - 3] * diff; regind >>= SIZE_INV_SHIFT; } else { ==== //depot/projects/mpsafetty/lib/libc/uuid/Makefile.inc#2 (text+ko) ==== @@ -1,11 +1,12 @@ -# $FreeBSD: src/lib/libc/uuid/Makefile.inc,v 1.4 2006/03/13 01:15:01 deischen Exp $ +# $FreeBSD: src/lib/libc/uuid/Makefile.inc,v 1.5 2008/08/14 22:23:16 emax Exp $ # DCE 1.1 UUID implementation sources .PATH: ${.CURDIR}/uuid SRCS+= uuid_compare.c uuid_create.c uuid_create_nil.c uuid_equal.c \ - uuid_from_string.c uuid_hash.c uuid_is_nil.c uuid_to_string.c + uuid_from_string.c uuid_hash.c uuid_is_nil.c uuid_stream.c \ + uuid_to_string.c SYM_MAPS+= ${.CURDIR}/uuid/Symbol.map MAN+= uuid.3 @@ -16,4 +17,8 @@ MLINKS+=uuid.3 uuid_from_string.3 MLINKS+=uuid.3 uuid_hash.3 MLINKS+=uuid.3 uuid_is_nil.3 +MLINKS+=uuid.3 uuid_enc_le.3 +MLINKS+=uuid.3 uuid_dec_le.3 +MLINKS+=uuid.3 uuid_enc_be.3 +MLINKS+=uuid.3 uuid_dec_be.3 MLINKS+=uuid.3 uuid_to_string.3 ==== //depot/projects/mpsafetty/lib/libc/uuid/uuid.3#2 (text+ko) ==== @@ -23,9 +23,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/lib/libc/uuid/uuid.3,v 1.6 2005/11/24 07:04:20 ru Exp $ +.\" $FreeBSD: src/lib/libc/uuid/uuid.3,v 1.7 2008/08/14 22:23:16 emax Exp $ .\" -.Dd January 3, 2005 +.Dd August 13, 2008 .Dt UUID 3 .Os .Sh NAME @@ -52,6 +52,14 @@ .Fn uuid_is_nil "const uuid_t *uuid" "uint32_t *status" .Ft void .Fn uuid_to_string "const uuid_t *uuid" "char **str" "uint32_t *status" +.Ft void +.Fn uuid_enc_le "void *buf" "const uuid_t *uuid" +.Ft void +.Fn uuid_dec_le "const void *buf" "uuid_t *" +.Ft void +.Fn uuid_enc_be "void *buf" "const uuid_t *uuid" +.Ft void +.Fn uuid_dec_be "const void *buf" "uuid_t *" .Sh DESCRIPTION The family of DCE 1.1 compliant UUID functions allow applications to operate on universally unique identifiers, or UUIDs. @@ -74,6 +82,26 @@ respectively. A 16-bit hash value can be obtained by calling .Fn uuid_hash . +.Pp +The +.Fn uuid_enc_le +and +.Fn uuid_enc_be +functions encode a binary representation of a UUID into an octet stream +in little-endian and big-endian byte-order, respectively. +The destination buffer must be pre-allocated by the caller, and must be +large enough to hold the 16-octet binary UUID. +These routines are not part of the DCE RPC API. +They are provided for convenience. +.Pp +The +.Fn uuid_dec_le +and +.Fn uuid_dec_be +functions decode a UUID from an octet stream in little-endian and +big-endian byte-order, respectively. +These routines are not part of the DCE RPC API. +They are provided for convenience. .Sh RETURN VALUES The successful or unsuccessful completion of the function is returned in the ==== //depot/projects/mpsafetty/sbin/ifconfig/ifieee80211.c#5 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sbin/ifconfig/ifieee80211.c,v 1.56 2008/08/09 05:37:22 sam Exp $ + * $FreeBSD: src/sbin/ifconfig/ifieee80211.c,v 1.57 2008/08/14 03:49:14 thompsa Exp $ */ /*- @@ -670,8 +670,10 @@ getchaninfo(s); v = strtol(val, &ep, 10); - if (val[0] == '\0' || ep[0] != '\0' || errno == ERANGE) - errx(1, "invalid channel number"); + if (val[0] == '\0' || val == ep || errno == ERANGE || + /* channel may be suffixed with nothing, :flag, or /width */ + (ep[0] != '\0' && ep[0] != ':' && ep[0] != '/')) + errx(1, "invalid channel specification"); flags = getchannelflags(val, v); if (v > 255) { /* treat as frequency */ mapfreq(&chan, v, flags); ==== //depot/projects/mpsafetty/share/man/man4/bpf.4#2 (text+ko) ==== @@ -47,7 +47,7 @@ .\" This document is derived in part from the enet man page (enet.4) .\" distributed with 4.3BSD Unix. .\" -.\" $FreeBSD: src/share/man/man4/bpf.4,v 1.51 2008/07/07 09:27:02 dwmalone Exp $ +.\" $FreeBSD: src/share/man/man4/bpf.4,v 1.52 2008/08/13 17:45:06 ed Exp $ .\" .Dd February 26, 2007 .Dt BPF 4 @@ -65,9 +65,7 @@ are accessible through this mechanism. .Pp The packet filter appears as a character special device, -.Pa /dev/bpf0 , -.Pa /dev/bpf1 , -etc. +.Pa /dev/bpf . After opening the device, the file descriptor must be bound to a specific network interface with the .Dv BIOCSETIF @@ -881,8 +879,8 @@ and .Fn BPF_JUMP opcode operand true_offset false_offset . .Sh FILES -.Bl -tag -compact -width /dev/bpfXXX -.It Pa /dev/bpf Ns Sy n +.Bl -tag -compact -width /dev/bpf +.It Pa /dev/bpf the packet filter device .El .Sh EXAMPLES ==== //depot/projects/mpsafetty/sys/amd64/amd64/bpf_jit_machdep.c#3 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/bpf_jit_machdep.c,v 1.8 2008/08/12 21:31:31 jkim Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/bpf_jit_machdep.c,v 1.10 2008/08/13 19:52:00 jkim Exp $"); #include "opt_bpf.h" @@ -157,9 +157,9 @@ case BPF_LD|BPF_W|BPF_ABS: MOVid(ins->k, ECX); MOVrd(ECX, ESI); - ADDib(sizeof(int), ECX); + ADDib(sizeof(int32_t), ECX); CMPrd(EDI, ECX); - JLEb(6); + JBEb(6); ZEROrd(EAX); MOVrq3(R8, RBX); RET(); @@ -171,9 +171,9 @@ ZEROrd(EAX); MOVid(ins->k, ECX); MOVrd(ECX, ESI); - ADDib(sizeof(short), ECX); + ADDib(sizeof(int16_t), ECX); CMPrd(EDI, ECX); - JLEb(4); + JBEb(4); MOVrq3(R8, RBX); RET(); MOVobw(RBX, RSI, AX); @@ -184,7 +184,7 @@ ZEROrd(EAX); MOVid(ins->k, ECX); CMPrd(EDI, ECX); - JLEb(4); + JBEb(4); MOVrq3(R8, RBX); RET(); MOVobb(RBX, RCX, AL); @@ -202,9 +202,9 @@ MOVid(ins->k, ECX); ADDrd(EDX, ECX); MOVrd(ECX, ESI); - ADDib(sizeof(int), ECX); + ADDib(sizeof(int32_t), ECX); CMPrd(EDI, ECX); - JLEb(6); + JBEb(6); ZEROrd(EAX); MOVrq3(R8, RBX); RET(); @@ -217,9 +217,9 @@ MOVid(ins->k, ECX); ADDrd(EDX, ECX); MOVrd(ECX, ESI); - ADDib(sizeof(short), ECX); + ADDib(sizeof(int16_t), ECX); CMPrd(EDI, ECX); - JLEb(4); + JBEb(4); MOVrq3(R8, RBX); RET(); MOVobw(RBX, RSI, AX); @@ -231,7 +231,7 @@ MOVid(ins->k, ECX); ADDrd(EDX, ECX); CMPrd(EDI, ECX); - JLEb(4); + JBEb(4); MOVrq3(R8, RBX); RET(); MOVobb(RBX, RCX, AL); @@ -240,7 +240,7 @@ case BPF_LDX|BPF_MSH|BPF_B: MOVid(ins->k, ECX); CMPrd(EDI, ECX); - JLEb(6); + JBEb(6); ZEROrd(EAX); MOVrq3(R8, RBX); RET(); @@ -293,70 +293,59 @@ break; case BPF_JMP|BPF_JGT|BPF_K: + if (ins->jt == 0 && ins->jf == 0) + break; CMPid(ins->k, EAX); - /* 5 is the size of the following JMP */ - JG(stream.refs[stream.bpf_pc + ins->jt] - - stream.refs[stream.bpf_pc] + 5 ); - JMP(stream.refs[stream.bpf_pc + ins->jf] - - stream.refs[stream.bpf_pc]); + JCC(JA, JBE); break; case BPF_JMP|BPF_JGE|BPF_K: + if (ins->jt == 0 && ins->jf == 0) + break; CMPid(ins->k, EAX); - JGE(stream.refs[stream.bpf_pc + ins->jt] - - stream.refs[stream.bpf_pc] + 5); - JMP(stream.refs[stream.bpf_pc + ins->jf] - - stream.refs[stream.bpf_pc]); + JCC(JAE, JB); break; case BPF_JMP|BPF_JEQ|BPF_K: + if (ins->jt == 0 && ins->jf == 0) + break; CMPid(ins->k, EAX); - JE(stream.refs[stream.bpf_pc + ins->jt] - - stream.refs[stream.bpf_pc] + 5); - JMP(stream.refs[stream.bpf_pc + ins->jf] - - stream.refs[stream.bpf_pc]); + JCC(JE, JNE); break; case BPF_JMP|BPF_JSET|BPF_K: - MOVrd(EAX, ECX); - ANDid(ins->k, ECX); - JE(stream.refs[stream.bpf_pc + ins->jf] - - stream.refs[stream.bpf_pc] + 5); - JMP(stream.refs[stream.bpf_pc + ins->jt] - - stream.refs[stream.bpf_pc]); + if (ins->jt == 0 && ins->jf == 0) + break; + TESTid(ins->k, EAX); + JCC(JNE, JE); break; case BPF_JMP|BPF_JGT|BPF_X: + if (ins->jt == 0 && ins->jf == 0) + break; CMPrd(EDX, EAX); - JA(stream.refs[stream.bpf_pc + ins->jt] - - stream.refs[stream.bpf_pc] + 5); - JMP(stream.refs[stream.bpf_pc + ins->jf] - - stream.refs[stream.bpf_pc]); + JCC(JA, JBE); break; case BPF_JMP|BPF_JGE|BPF_X: + if (ins->jt == 0 && ins->jf == 0) + break; CMPrd(EDX, EAX); - JAE(stream.refs[stream.bpf_pc + ins->jt] - - stream.refs[stream.bpf_pc] + 5); - JMP(stream.refs[stream.bpf_pc + ins->jf] - - stream.refs[stream.bpf_pc]); + JCC(JAE, JB); break; case BPF_JMP|BPF_JEQ|BPF_X: + if (ins->jt == 0 && ins->jf == 0) + break; CMPrd(EDX, EAX); - JE(stream.refs[stream.bpf_pc + ins->jt] - - stream.refs[stream.bpf_pc] + 5); - JMP(stream.refs[stream.bpf_pc + ins->jf] - - stream.refs[stream.bpf_pc]); + JCC(JE, JNE); break; case BPF_JMP|BPF_JSET|BPF_X: - MOVrd(EAX, ECX); - ANDrd(EDX, ECX); - JE(stream.refs[stream.bpf_pc + ins->jf] - - stream.refs[stream.bpf_pc] + 5); - JMP(stream.refs[stream.bpf_pc + ins->jt] - - stream.refs[stream.bpf_pc]); + if (ins->jt == 0 && ins->jf == 0) + break; + TESTrd(EDX, EAX); + JCC(JNE, JE); break; case BPF_ALU|BPF_ADD|BPF_X: @@ -374,7 +363,7 @@ break; case BPF_ALU|BPF_DIV|BPF_X: - CMPid(0, EDX); + TESTrd(EDX, EDX); JNEb(6); ZEROrd(EAX); MOVrq3(R8, RBX); ==== //depot/projects/mpsafetty/sys/amd64/amd64/bpf_jit_machdep.h#3 (text+ko) ==== @@ -28,7 +28,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/amd64/amd64/bpf_jit_machdep.h,v 1.7 2008/08/12 21:31:31 jkim Exp $ + * $FreeBSD: src/sys/amd64/amd64/bpf_jit_machdep.h,v 1.8 2008/08/13 19:25:09 jkim Exp $ */ #ifndef _BPF_JIT_MACHDEP_H_ @@ -294,6 +294,24 @@ (3 << 6) | ((sr32 & 0x7) << 3) | (dr32 & 0x7), 1); \ } while (0) +/* testl i32,r32 */ +#define TESTid(i32, r32) do { \ + if (r32 == EAX) { \ + emitm(&stream, 0xa9, 1); \ + } else { \ + emitm(&stream, 0xf7, 1); \ + emitm(&stream, (3 << 6) | r32, 1); \ + } \ + emitm(&stream, i32, 4); \ +} while (0) + +/* testl sr32,dr32 */ +#define TESTrd(sr32, dr32) do { \ + emitm(&stream, 0x85, 1); \ + emitm(&stream, \ + (3 << 6) | ((sr32 & 0x7) << 3) | (dr32 & 0x7), 1); \ +} while (0) + /* orl sr32,dr32 */ #define ORrd(sr32, dr32) do { \ emitm(&stream, 0x09, 1); \ @@ -369,42 +387,12 @@ emitm(&stream, off8, 1); \ } while (0) -/* je off32 */ -#define JE(off32) do { \ - emitm(&stream, 0x840f, 2); \ - emitm(&stream, off32, 4); \ -} while (0) - -/* jle off8 */ -#define JLEb(off8) do { \ - emitm(&stream, 0x7e, 1); \ +/* jbe off8 */ +#define JBEb(off8) do { \ + emitm(&stream, 0x76, 1); \ emitm(&stream, off8, 1); \ } while (0) -/* ja off32 */ -#define JA(off32) do { \ - emitm(&stream, 0x870f, 2); \ - emitm(&stream, off32, 4); \ -} while (0) - -/* jae off32 */ -#define JAE(off32) do { \ - emitm(&stream, 0x830f, 2); \ - emitm(&stream, off32, 4); \ -} while (0) - -/* jg off32 */ -#define JG(off32) do { \ - emitm(&stream, 0x8f0f, 2); \ - emitm(&stream, off32, 4); \ -} while (0) - -/* jge off32 */ -#define JGE(off32) do { \ - emitm(&stream, 0x8d0f, 2); \ - emitm(&stream, off32, 4); \ -} while (0) - /* jmp off32 */ #define JMP(off32) do { \ emitm(&stream, 0xe9, 1); \ @@ -417,4 +405,33 @@ emitm(&stream, (3 << 6) | ((r32 & 0x7) << 3) | (r32 & 0x7), 1); \ } while (0) +/* + * Conditional long jumps + */ +#define JB 0x82 +#define JAE 0x83 +#define JE 0x84 +#define JNE 0x85 +#define JBE 0x86 +#define JA 0x87 + +#define JCC(t, f) do { \ + if (ins->jt != 0 && ins->jf != 0) { \ + /* 5 is the size of the following jmp */ \ + emitm(&stream, ((t) << 8) | 0x0f, 2); \ + emitm(&stream, stream.refs[stream.bpf_pc + ins->jt] - \ + stream.refs[stream.bpf_pc] + 5, 4); \ + JMP(stream.refs[stream.bpf_pc + ins->jf] - \ + stream.refs[stream.bpf_pc]); \ + } else if (ins->jt != 0) { \ + emitm(&stream, ((t) << 8) | 0x0f, 2); \ + emitm(&stream, stream.refs[stream.bpf_pc + ins->jt] - \ + stream.refs[stream.bpf_pc], 4); \ + } else { \ + emitm(&stream, ((f) << 8) | 0x0f, 2); \ + emitm(&stream, stream.refs[stream.bpf_pc + ins->jf] - \ + stream.refs[stream.bpf_pc], 4); \ + } \ +} while (0) + #endif /* _BPF_JIT_MACHDEP_H_ */ ==== //depot/projects/mpsafetty/sys/conf/files#12 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.1325 2008/08/12 00:27:32 kmacy Exp $ +# $FreeBSD: src/sys/conf/files,v 1.1329 2008/08/14 21:26:29 imp Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -977,6 +977,7 @@ dev/pci/pci_user.c optional pci dev/pci/pcib_if.m standard dev/pci/vga_pci.c optional pci +dev/pcn/if_pcn.c optional pcn pci dev/pdq/if_fea.c optional fea eisa dev/pdq/if_fpa.c optional fpa pci dev/pdq/pdq.c optional nowerror fea eisa | fpa pci @@ -1193,6 +1194,7 @@ dev/spibus/spibus_if.m optional spibus dev/sr/if_sr.c optional sr dev/sr/if_sr_pci.c optional sr pci +dev/ste/if_ste.c optional ste pci dev/stg/tmc18c30.c optional stg dev/stg/tmc18c30_isa.c optional stg isa dev/stg/tmc18c30_pccard.c optional stg pccard @@ -1224,6 +1226,7 @@ dev/tdfx/tdfx_linux.c optional tdfx_linux tdfx compat_linux dev/tdfx/tdfx_pci.c optional tdfx pci dev/ti/if_ti.c optional ti pci +dev/tl/if_tl.c optional tl pci dev/trm/trm.c optional trm dev/twa/tw_cl_init.c optional twa \ compile-with "${NORMAL_C} -I$S/dev/twa" @@ -1325,6 +1328,7 @@ dev/vx/if_vx_eisa.c optional vx eisa dev/vx/if_vx_pci.c optional vx pci dev/watchdog/watchdog.c standard +dev/wb/if_wb.c optional wb pci dev/wds/wd7000.c optional wds isa dev/wi/if_wi.c optional wi dev/wi/if_wi_pccard.c optional wi pccard @@ -2085,11 +2089,7 @@ pci/amdpm.c optional amdpm pci | nfpm pci pci/amdsmb.c optional amdsmb pci pci/if_mn.c optional mn pci -pci/if_pcn.c optional pcn pci pci/if_rl.c optional rl pci -pci/if_ste.c optional ste pci -pci/if_tl.c optional tl pci -pci/if_wb.c optional wb pci pci/intpm.c optional intpm pci pci/ncr.c optional ncr pci pci/nfsmb.c optional nfsmb pci ==== //depot/projects/mpsafetty/sys/dev/age/if_age.c#3 (text+ko) ==== @@ -28,7 +28,7 @@ /* Driver for Attansic Technology Corp. L1 Gigabit Ethernet. */ #include -__FBSDID("$FreeBSD: src/sys/dev/age/if_age.c,v 1.3 2008/07/18 01:00:54 yongari Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/age/if_age.c,v 1.4 2008/08/14 02:43:18 kevlo Exp $"); #include #include @@ -1427,7 +1427,7 @@ MII_BMCR, BMCR_RESET | BMCR_AUTOEN | BMCR_STARTNEG); DELAY(1000); if (aneg != 0) { - /* Poll link state until jme(4) get a 10/100 link. */ + /* Poll link state until age(4) get a 10/100 link. */ for (i = 0; i < MII_ANEGTICKS_GIGE; i++) { mii_pollstat(mii); if ((mii->mii_media_status & IFM_AVALID) != 0) { ==== //depot/projects/mpsafetty/sys/dev/xen/console/console.c#2 (text+ko) ==== @@ -1,5 +1,5 @@ #include -__FBSDID("$FreeBSD: src/sys/dev/xen/console/console.c,v 1.1 2008/08/12 20:01:57 kmacy Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/xen/console/console.c,v 1.2 2008/08/15 04:00:44 kmacy Exp $"); #include #include @@ -276,7 +276,6 @@ NULL, SHUTDOWN_PRI_DEFAULT)) == NULL) printf("xencons: shutdown event registration failed!\n"); - TRACE_EXIT; return (0); } @@ -368,7 +367,6 @@ if (sc == NULL) return (ENXIO); - TRACE_ENTER; tp = dev->si_tty; s = spltty(); if (!ISTTYOPEN(tp)) { @@ -390,7 +388,6 @@ xen_console_up = 1; error = (*linesw[tp->t_line]->l_open)(dev, tp); - TRACE_EXIT; return error; } ==== //depot/projects/mpsafetty/sys/dev/xen/console/xencons_ring.c#2 (text+ko) ==== @@ -1,5 +1,5 @@ #include -__FBSDID("$FreeBSD: src/sys/dev/xen/console/xencons_ring.c,v 1.1 2008/08/12 20:01:57 kmacy Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/xen/console/xencons_ring.c,v 1.2 2008/08/15 04:00:44 kmacy Exp $"); #include #include @@ -119,7 +119,6 @@ "xencons", xencons_handle_input, NULL, INTR_TYPE_MISC | INTR_MPSAFE, NULL); if (err) { - XENPRINTF("XEN console request irq failed %i\n", err); return err; } ==== //depot/projects/mpsafetty/sys/i386/i386/bpf_jit_machdep.c#3 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/i386/i386/bpf_jit_machdep.c,v 1.8 2008/08/12 21:31:31 jkim Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/i386/bpf_jit_machdep.c,v 1.10 2008/08/13 19:52:00 jkim Exp $"); #include "opt_bpf.h" @@ -164,9 +164,9 @@ case BPF_LD|BPF_W|BPF_ABS: MOVid(ins->k, ECX); MOVrd(ECX, ESI); - ADDib(sizeof(int), ECX); + ADDib(sizeof(int32_t), ECX); CMPrd(EDI, ECX); - JLEb(7); + JBEb(7); ZEROrd(EAX); POP(EBX); POP(ESI); @@ -180,9 +180,9 @@ ZEROrd(EAX); MOVid(ins->k, ECX); MOVrd(ECX, ESI); - ADDib(sizeof(short), ECX); + ADDib(sizeof(int16_t), ECX); CMPrd(EDI, ECX); - JLEb(5); + JBEb(5); POP(EBX); POP(ESI); POP(EDI); @@ -195,7 +195,7 @@ ZEROrd(EAX); MOVid(ins->k, ECX); CMPrd(EDI, ECX); - JLEb(5); + JBEb(5); POP(EBX); POP(ESI); POP(EDI); @@ -215,9 +215,9 @@ MOVid(ins->k, ECX); ADDrd(EDX, ECX); MOVrd(ECX, ESI); - ADDib(sizeof(int), ECX); + ADDib(sizeof(int32_t), ECX); CMPrd(EDI, ECX); - JLEb(7); + JBEb(7); ZEROrd(EAX); POP(EBX); POP(ESI); @@ -232,9 +232,9 @@ MOVid(ins->k, ECX); ADDrd(EDX, ECX); MOVrd(ECX, ESI); - ADDib(sizeof(short), ECX); + ADDib(sizeof(int16_t), ECX); CMPrd(EDI, ECX); - JLEb(5); + JBEb(5); POP(EBX); POP(ESI); POP(EDI); @@ -248,7 +248,7 @@ MOVid(ins->k, ECX); ADDrd(EDX, ECX); CMPrd(EDI, ECX); - JLEb(5); + JBEb(5); POP(EBX); POP(ESI); POP(EDI); @@ -259,7 +259,7 @@ case BPF_LDX|BPF_MSH|BPF_B: MOVid(ins->k, ECX); CMPrd(EDI, ECX); - JLEb(7); + JBEb(7); ZEROrd(EAX); POP(EBX); POP(ESI); @@ -314,70 +314,59 @@ break; case BPF_JMP|BPF_JGT|BPF_K: + if (ins->jt == 0 && ins->jf == 0) + break; CMPid(ins->k, EAX); - /* 5 is the size of the following JMP */ - JG(stream.refs[stream.bpf_pc + ins->jt] - - stream.refs[stream.bpf_pc] + 5 ); - JMP(stream.refs[stream.bpf_pc + ins->jf] - - stream.refs[stream.bpf_pc]); + JCC(JA, JBE); break; case BPF_JMP|BPF_JGE|BPF_K: + if (ins->jt == 0 && ins->jf == 0) + break; CMPid(ins->k, EAX); - JGE(stream.refs[stream.bpf_pc + ins->jt] - - stream.refs[stream.bpf_pc] + 5); - JMP(stream.refs[stream.bpf_pc + ins->jf] - - stream.refs[stream.bpf_pc]); + JCC(JAE, JB); break; case BPF_JMP|BPF_JEQ|BPF_K: + if (ins->jt == 0 && ins->jf == 0) + break; CMPid(ins->k, EAX); - JE(stream.refs[stream.bpf_pc + ins->jt] - - stream.refs[stream.bpf_pc] + 5); - JMP(stream.refs[stream.bpf_pc + ins->jf] - - stream.refs[stream.bpf_pc]); + JCC(JE, JNE); break; case BPF_JMP|BPF_JSET|BPF_K: - MOVrd(EAX, ECX); - ANDid(ins->k, ECX); - JE(stream.refs[stream.bpf_pc + ins->jf] - - stream.refs[stream.bpf_pc] + 5); - JMP(stream.refs[stream.bpf_pc + ins->jt] - - stream.refs[stream.bpf_pc]); + if (ins->jt == 0 && ins->jf == 0) + break; + TESTid(ins->k, EAX); + JCC(JNE, JE); break; case BPF_JMP|BPF_JGT|BPF_X: + if (ins->jt == 0 && ins->jf == 0) + break; CMPrd(EDX, EAX); - JA(stream.refs[stream.bpf_pc + ins->jt] - - stream.refs[stream.bpf_pc] + 5); - JMP(stream.refs[stream.bpf_pc + ins->jf] - - stream.refs[stream.bpf_pc]); + JCC(JA, JBE); break; case BPF_JMP|BPF_JGE|BPF_X: + if (ins->jt == 0 && ins->jf == 0) + break; CMPrd(EDX, EAX); >>> TRUNCATED FOR MAIL (1000 lines) <<<