From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 00:18:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44AC9106566C; Sun, 22 Mar 2009 00:18:49 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 191C48FC0A; Sun, 22 Mar 2009 00:18:49 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2M0ImiL051449; Sun, 22 Mar 2009 00:18:48 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2M0ImTl051448; Sun, 22 Mar 2009 00:18:48 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200903220018.n2M0ImTl051448@svn.freebsd.org> From: Rui Paulo Date: Sun, 22 Mar 2009 00:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190231 - head/etc/mtree X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 00:18:50 -0000 Author: rpaulo Date: Sun Mar 22 00:18:48 2009 New Revision: 190231 URL: http://svn.freebsd.org/changeset/base/190231 Log: Add /usr/include/pcap (new in libpcap 1.0.0). Modified: head/etc/mtree/BSD.include.dist Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Sat Mar 21 23:13:48 2009 (r190230) +++ head/etc/mtree/BSD.include.dist Sun Mar 22 00:18:48 2009 (r190231) @@ -257,6 +257,8 @@ .. openssl .. + pcap + .. protocols .. readline From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 00:29:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FFD4106566B; Sun, 22 Mar 2009 00:29:49 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E4678FC1E; Sun, 22 Mar 2009 00:29:49 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2M0TmMX051681; Sun, 22 Mar 2009 00:29:48 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2M0Tmkt051680; Sun, 22 Mar 2009 00:29:48 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <200903220029.n2M0Tmkt051680@svn.freebsd.org> From: Ivan Voras Date: Sun, 22 Mar 2009 00:29:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190232 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 00:29:49 -0000 Author: ivoras Date: Sun Mar 22 00:29:48 2009 New Revision: 190232 URL: http://svn.freebsd.org/changeset/base/190232 Log: Be more explicit and complain if kernel dumps are perfomed on unsupported partition types. This is to help users used to the old behaviour. Reviewed by: marcel Approved by: gnn (mentor) Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Sun Mar 22 00:18:48 2009 (r190231) +++ head/sys/geom/part/g_part.c Sun Mar 22 00:29:48 2009 (r190232) @@ -1726,7 +1726,10 @@ g_part_start(struct bio *bp) * used. */ if (!G_PART_DUMPTO(table, entry)) { - g_io_deliver(bp, ENXIO); + g_io_deliver(bp, ENODEV); + printf("GEOM_PART: Partition '%s' not suitable" + " for kernel dumps (wrong type?)\n", + pp->name); return; } gkd = (struct g_kerneldump *)bp->bio_data; From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 00:45:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56841106566C; Sun, 22 Mar 2009 00:45:48 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44EF48FC14; Sun, 22 Mar 2009 00:45:48 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2M0jmk0052027; Sun, 22 Mar 2009 00:45:48 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2M0jmJ9052026; Sun, 22 Mar 2009 00:45:48 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <200903220045.n2M0jmJ9052026@svn.freebsd.org> From: Juli Mallett Date: Sun, 22 Mar 2009 00:45:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190233 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 00:45:48 -0000 Author: jmallett Date: Sun Mar 22 00:45:47 2009 New Revision: 190233 URL: http://svn.freebsd.org/changeset/base/190233 Log: Remove local in6_addr variables for local and foreign addresses in sysctl_drop, they were passed uninitialized to in6_pcblookup_hash. Instead, do as is done for IPv4 and use the addresses within the sockaddr structure, which are correctly populated. This fixes tcpdrop(8) for IPv6 address pairs. Reviewed by: bz Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Sun Mar 22 00:29:48 2009 (r190232) +++ head/sys/netinet/tcp_subr.c Sun Mar 22 00:45:47 2009 (r190233) @@ -2114,7 +2114,6 @@ sysctl_drop(SYSCTL_HANDLER_ARGS) struct sockaddr_in *fin, *lin; #ifdef INET6 struct sockaddr_in6 *fin6, *lin6; - struct in6_addr f6, l6; #endif int error; @@ -2174,8 +2173,9 @@ sysctl_drop(SYSCTL_HANDLER_ARGS) switch (addrs[0].ss_family) { #ifdef INET6 case AF_INET6: - inp = in6_pcblookup_hash(&V_tcbinfo, &f6, fin6->sin6_port, - &l6, lin6->sin6_port, 0, NULL); + inp = in6_pcblookup_hash(&V_tcbinfo, &fin6->sin6_addr, + fin6->sin6_port, &lin6->sin6_addr, lin6->sin6_port, 0, + NULL); break; #endif case AF_INET: From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 00:47:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31153106564A; Sun, 22 Mar 2009 00:47:42 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1FB568FC15; Sun, 22 Mar 2009 00:47:42 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2M0lgS3052097; Sun, 22 Mar 2009 00:47:42 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2M0lfjA052096; Sun, 22 Mar 2009 00:47:42 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200903220047.n2M0lfjA052096@svn.freebsd.org> From: Rui Paulo Date: Sun, 22 Mar 2009 00:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190234 - head/contrib/libpcap/pcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 00:47:42 -0000 Author: rpaulo Date: Sun Mar 22 00:47:41 2009 New Revision: 190234 URL: http://svn.freebsd.org/changeset/base/190234 Log: bpf_filter() and bpf_validate() can't live here if they already live in bpf.h Modified: head/contrib/libpcap/pcap/pcap.h Modified: head/contrib/libpcap/pcap/pcap.h ============================================================================== --- head/contrib/libpcap/pcap/pcap.h Sun Mar 22 00:45:47 2009 (r190233) +++ head/contrib/libpcap/pcap/pcap.h Sun Mar 22 00:47:41 2009 (r190234) @@ -336,8 +336,8 @@ void pcap_freealldevs(pcap_if_t *); const char *pcap_lib_version(void); /* XXX this guy lives in the bpf tree */ -u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int); -int bpf_validate(const struct bpf_insn *f, int len); +/* u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int); +int bpf_validate(const struct bpf_insn *f, int len); */ char *bpf_image(const struct bpf_insn *, int); void bpf_dump(const struct bpf_program *, int); From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 01:06:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6094106566B; Sun, 22 Mar 2009 01:06:39 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C4BF28FC20; Sun, 22 Mar 2009 01:06:39 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2M16dEg052500; Sun, 22 Mar 2009 01:06:39 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2M16d82052499; Sun, 22 Mar 2009 01:06:39 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200903220106.n2M16d82052499@svn.freebsd.org> From: Rui Paulo Date: Sun, 22 Mar 2009 01:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190235 - head/lib/libpcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 01:06:40 -0000 Author: rpaulo Date: Sun Mar 22 01:06:39 2009 New Revision: 190235 URL: http://svn.freebsd.org/changeset/base/190235 Log: Install the new headers. Modified: head/lib/libpcap/Makefile Modified: head/lib/libpcap/Makefile ============================================================================== --- head/lib/libpcap/Makefile Sun Mar 22 00:47:41 2009 (r190234) +++ head/lib/libpcap/Makefile Sun Mar 22 01:06:39 2009 (r190235) @@ -10,7 +10,14 @@ SRCS= grammar.y tokdefs.h version.h pcap pcap.c inet.c fad-getad.c gencode.c optimize.c nametoaddr.c \ etherent.c savefile.c bpf_filter.c bpf_image.c bpf_dump.c \ scanner.l version.c + +# Old compatibility headers INCS= pcap.h pcap-int.h pcap-namedb.h pcap-bpf.h + +PCAPINCS= pcap/pcap.h pcap/namedb.h pcap/bpf.h +PCAPINCSDIR= ${INCLUDEDIR}/pcap +INCSGROUPS= INCS PCAPINCS + MAN= pcap.3 \ pcap_activate.3 \ pcap_breakloop.3 \ From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 01:24:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE818106566B; Sun, 22 Mar 2009 01:24:32 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD5478FC18; Sun, 22 Mar 2009 01:24:32 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2M1OWOu052878; Sun, 22 Mar 2009 01:24:32 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2M1OWoa052877; Sun, 22 Mar 2009 01:24:32 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200903220124.n2M1OWoa052877@svn.freebsd.org> From: Rui Paulo Date: Sun, 22 Mar 2009 01:24:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190236 - head/lib/libpcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 01:24:33 -0000 Author: rpaulo Date: Sun Mar 22 01:24:32 2009 New Revision: 190236 URL: http://svn.freebsd.org/changeset/base/190236 Log: Fix typo in comment. Modified: head/lib/libpcap/Makefile Modified: head/lib/libpcap/Makefile ============================================================================== --- head/lib/libpcap/Makefile Sun Mar 22 01:06:39 2009 (r190235) +++ head/lib/libpcap/Makefile Sun Mar 22 01:24:32 2009 (r190236) @@ -81,7 +81,7 @@ MLINKS= pcap_datalink_val_to_name.3 pcap pcap_open_offline.3 pcap_fopen_offline.3 \ pcap_setnonblock.3 pcap_getnonblock.3 -# Our man pages are a special copy from the distdir. See bellow. +# Our man pages are a special copy from the distdir. See below. CLEANFILES+=${MAN} CLEANFILES+=tokdefs.h version.h version.c From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 02:33:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 175F7106566B; Sun, 22 Mar 2009 02:33:49 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05D698FC0A; Sun, 22 Mar 2009 02:33:49 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2M2XmTv054203; Sun, 22 Mar 2009 02:33:48 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2M2Xmxu054201; Sun, 22 Mar 2009 02:33:48 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200903220233.n2M2Xmxu054201@svn.freebsd.org> From: Alan Cox Date: Sun, 22 Mar 2009 02:33:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190237 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 02:33:49 -0000 Author: alc Date: Sun Mar 22 02:33:48 2009 New Revision: 190237 URL: http://svn.freebsd.org/changeset/base/190237 Log: Eliminate the recomputation of pcb_cr3 from cpu_set_upcall(). The bcopy()ed value from the old thread is the correct value because the new thread and the old thread will share a page table. Modified: head/sys/amd64/amd64/vm_machdep.c head/sys/i386/i386/vm_machdep.c Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Sun Mar 22 01:24:32 2009 (r190236) +++ head/sys/amd64/amd64/vm_machdep.c Sun Mar 22 02:33:48 2009 (r190237) @@ -287,7 +287,6 @@ cpu_set_upcall(struct thread *td, struct * Set registers for trampoline to user mode. Leave space for the * return address on stack. These are the kernel mode register values. */ - pcb2->pcb_cr3 = vtophys(vmspace_pmap(td->td_proc->p_vmspace)->pm_pml4); pcb2->pcb_r12 = (register_t)fork_return; /* trampoline arg */ pcb2->pcb_rbp = 0; pcb2->pcb_rsp = (register_t)td->td_frame - sizeof(void *); /* trampoline arg */ @@ -295,6 +294,7 @@ cpu_set_upcall(struct thread *td, struct pcb2->pcb_rip = (register_t)fork_trampoline; /* * If we didn't copy the pcb, we'd need to do the following registers: + * pcb2->pcb_cr3: cloned above. * pcb2->pcb_dr*: cloned above. * pcb2->pcb_savefpu: cloned above. * pcb2->pcb_onfault: cloned above (always NULL here?). Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Sun Mar 22 01:24:32 2009 (r190236) +++ head/sys/i386/i386/vm_machdep.c Sun Mar 22 02:33:48 2009 (r190237) @@ -424,11 +424,6 @@ cpu_set_upcall(struct thread *td, struct * Set registers for trampoline to user mode. Leave space for the * return address on stack. These are the kernel mode register values. */ -#ifdef PAE - pcb2->pcb_cr3 = vtophys(vmspace_pmap(td->td_proc->p_vmspace)->pm_pdpt); -#else - pcb2->pcb_cr3 = vtophys(vmspace_pmap(td->td_proc->p_vmspace)->pm_pdir); -#endif pcb2->pcb_edi = 0; pcb2->pcb_esi = (int)fork_return; /* trampoline arg */ pcb2->pcb_ebp = 0; @@ -439,6 +434,7 @@ cpu_set_upcall(struct thread *td, struct pcb2->pcb_gs = rgs(); /* * If we didn't copy the pcb, we'd need to do the following registers: + * pcb2->pcb_cr3: cloned above. * pcb2->pcb_dr*: cloned above. * pcb2->pcb_savefpu: cloned above. * pcb2->pcb_flags: cloned above. From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 04:19:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1A7B1065670; Sun, 22 Mar 2009 04:19:36 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BFEF48FC0A; Sun, 22 Mar 2009 04:19:36 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2M4Ja20056396; Sun, 22 Mar 2009 04:19:36 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2M4JaZo056395; Sun, 22 Mar 2009 04:19:36 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200903220419.n2M4JaZo056395@svn.freebsd.org> From: Andrew Thompson Date: Sun, 22 Mar 2009 04:19:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190238 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 04:19:37 -0000 Author: thompsa Date: Sun Mar 22 04:19:36 2009 New Revision: 190238 URL: http://svn.freebsd.org/changeset/base/190238 Log: Improve debugging output around ioctls. Modified: head/sys/dev/usb/usb_dev.c Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Sun Mar 22 02:33:48 2009 (r190237) +++ head/sys/dev/usb/usb_dev.c Sun Mar 22 04:19:36 2009 (r190238) @@ -821,7 +821,7 @@ usb2_open(struct cdev *dev, int fflags, struct usb2_cdev_privdata *cpd; int err, ep; - DPRINTFN(2, "fflags=0x%08x\n", fflags); + DPRINTFN(2, "%s fflags=0x%08x\n", dev->si_name, fflags); KASSERT(fflags & (FREAD|FWRITE), ("invalid open flags")); if (((fflags & FREAD) && !(pd->mode & FREAD)) || @@ -990,6 +990,7 @@ usb2_ioctl_f_sub(struct usb2_fifo *f, u_ default: return (ENOIOCTL); } + DPRINTFN(3, "cmd 0x%lx = %d\n", cmd, error); return (error); } @@ -1004,6 +1005,8 @@ usb2_ioctl(struct cdev *dev, u_long cmd, int fflags; int err; + DPRINTFN(2, "cmd=0x%lx\n", cmd); + err = devfs_get_cdevpriv((void **)&cpd); if (err != 0) return (err); @@ -1019,8 +1022,6 @@ usb2_ioctl(struct cdev *dev, u_long cmd, } fflags = cpd->fflags; - DPRINTFN(2, "fflags=%u, cmd=0x%lx\n", fflags, cmd); - f = NULL; /* set default value */ err = ENOIOCTL; /* set default value */ @@ -1035,12 +1036,14 @@ usb2_ioctl(struct cdev *dev, u_long cmd, KASSERT(f != NULL, ("fifo not found")); if (err == ENOIOCTL) { err = (f->methods->f_ioctl) (f, cmd, addr, fflags); + DPRINTFN(2, "f_ioctl cmd 0x%lx = %d\n", cmd, err); if (err == ENOIOCTL) { if (usb2_uref_location(cpd)) { err = ENXIO; goto done; } err = (f->methods->f_ioctl_post) (f, cmd, addr, fflags); + DPRINTFN(2, "f_ioctl_post cmd 0x%lx = %d\n", cmd, err); } } if (err == ENOIOCTL) { From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 04:32:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57766106564A; Sun, 22 Mar 2009 04:32:06 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A7348FC13; Sun, 22 Mar 2009 04:32:06 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2M4W5WZ056685; Sun, 22 Mar 2009 04:32:05 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2M4W5bH056682; Sun, 22 Mar 2009 04:32:05 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200903220432.n2M4W5bH056682@svn.freebsd.org> From: Alan Cox Date: Sun, 22 Mar 2009 04:32:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190239 - in head/sys/amd64: amd64 include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 04:32:06 -0000 Author: alc Date: Sun Mar 22 04:32:05 2009 New Revision: 190239 URL: http://svn.freebsd.org/changeset/base/190239 Log: In general, the kernel virtual address of the pml4 page table page that is stored in the pmap is from the direct map region. The two exceptions have been the kernel pmap and the swapper's pmap. These pmaps have used a kernel virtual address established by pmap_bootstrap() for their shared pml4 page table page. However, there is no reason not to use the direct map for these pmaps as well. Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/amd64/vm_machdep.c head/sys/amd64/include/pmap.h Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Mar 22 04:19:36 2009 (r190238) +++ head/sys/amd64/amd64/pmap.c Sun Mar 22 04:32:05 2009 (r190239) @@ -542,7 +542,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr) * Initialize the kernel pmap (which is statically allocated). */ PMAP_LOCK_INIT(kernel_pmap); - kernel_pmap->pm_pml4 = (pdp_entry_t *) (KERNBASE + KPML4phys); + kernel_pmap->pm_pml4 = (pdp_entry_t *)PHYS_TO_DMAP(KPML4phys); kernel_pmap->pm_root = NULL; kernel_pmap->pm_active = -1; /* don't allow deactivation */ TAILQ_INIT(&kernel_pmap->pm_pvchunk); @@ -1351,7 +1351,7 @@ pmap_pinit0(pmap_t pmap) { PMAP_LOCK_INIT(pmap); - pmap->pm_pml4 = (pml4_entry_t *)(KERNBASE + KPML4phys); + pmap->pm_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(KPML4phys); pmap->pm_root = NULL; pmap->pm_active = 0; TAILQ_INIT(&pmap->pm_pvchunk); @@ -4695,7 +4695,7 @@ if (oldpmap) /* XXX FIXME */ oldpmap->pm_active &= ~PCPU_GET(cpumask); pmap->pm_active |= PCPU_GET(cpumask); #endif - cr3 = vtophys(pmap->pm_pml4); + cr3 = DMAP_TO_PHYS((vm_offset_t)pmap->pm_pml4); td->td_pcb->pcb_cr3 = cr3; load_cr3(cr3); critical_exit(); Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Sun Mar 22 04:19:36 2009 (r190238) +++ head/sys/amd64/amd64/vm_machdep.c Sun Mar 22 04:32:05 2009 (r190239) @@ -103,6 +103,7 @@ cpu_fork(td1, p2, td2, flags) register struct proc *p1; struct pcb *pcb2; struct mdproc *mdp2; + pmap_t pmap2; p1 = td1->td_proc; if ((flags & RFPROC) == 0) @@ -150,7 +151,8 @@ cpu_fork(td1, p2, td2, flags) * Set registers for trampoline to user mode. Leave space for the * return address on stack. These are the kernel mode register values. */ - pcb2->pcb_cr3 = vtophys(vmspace_pmap(p2->p_vmspace)->pm_pml4); + pmap2 = vmspace_pmap(p2->p_vmspace); + pcb2->pcb_cr3 = DMAP_TO_PHYS((vm_offset_t)pmap2->pm_pml4); pcb2->pcb_r12 = (register_t)fork_return; /* fork_trampoline argument */ pcb2->pcb_rbp = 0; pcb2->pcb_rsp = (register_t)td2->td_frame - sizeof(void *); Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Sun Mar 22 04:19:36 2009 (r190238) +++ head/sys/amd64/include/pmap.h Sun Mar 22 04:32:05 2009 (r190239) @@ -243,6 +243,10 @@ struct md_page { TAILQ_HEAD(,pv_entry) pv_list; }; +/* + * The kernel virtual address (KVA) of the level 4 page table page is always + * within the direct map (DMAP) region. + */ struct pmap { struct mtx pm_mtx; pml4_entry_t *pm_pml4; /* KVA of level 4 page table */ From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 08:37:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C9671065670; Sun, 22 Mar 2009 08:37:03 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 06EFE8FC12; Sun, 22 Mar 2009 08:37:01 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA02135; Sun, 22 Mar 2009 10:36:31 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1] helo=edge.pp.kiev.ua) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1LlJAV-000AZX-3O; Sun, 22 Mar 2009 10:36:31 +0200 Message-ID: <49C5F88C.3070600@freebsd.org> Date: Sun, 22 Mar 2009 10:36:28 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.19 (X11/20090114) MIME-Version: 1.0 To: "M. Warner Losh" References: <49C4C974.5050209@gmx.de> <20090321130332.GD67783@alchemy.franken.de> <49C5737F.1050902@gmx.de> <20090321.175756.-434257642.imp@bsdimp.com> In-Reply-To: <20090321.175756.-434257642.imp@bsdimp.com> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, christoph.mallon@gmx.de, src-committers@freebsd.org, marius@alchemy.franken.de Subject: Re: svn commit: r190098 - in head/sys/sparc64: fhc sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 08:37:03 -0000 on 22/03/2009 01:57 M. Warner Losh said the following: > I'll point out that style(9) doesn't say use as few local variables as > possible... That part is completely unspecified. But it does say: Do not put declarations inside blocks unless the routine is unusually complicated. "unusually complicated" is, of course, a very subjective measure. But still this guideline contradicts typical guidelines for C and its offspring which name we do not say to declare variables as close to their first usage as possible. E.g. you can have a simple 3 line block where you need a local variable but that block is located 50 lines from start of an enclosing function. Very convenient when you need to quickly glance the variable's type (not). So add me to the count of people who has problem with this rule. P.S. And 80 symbol line rule (which is not even in style) is also not justified in modern times, if you'll ask me :) -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 08:54:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DDB11065672 for ; Sun, 22 Mar 2009 08:54:39 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id E13178FC15 for ; Sun, 22 Mar 2009 08:54:38 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 22 Mar 2009 08:54:37 -0000 Received: from p54A3FD39.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.253.57] by mail.gmx.net (mp006) with SMTP; 22 Mar 2009 09:54:37 +0100 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX1+/eR9+0HC/JaGkOyakpLioqrt5SD08Yb7Oy+nDmD 7PfIFj/l/mujJm Message-ID: <49C5FCCA.5010509@gmx.de> Date: Sun, 22 Mar 2009 09:54:34 +0100 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Andriy Gapon References: <49C4C974.5050209@gmx.de> <20090321130332.GD67783@alchemy.franken.de> <49C5737F.1050902@gmx.de> <20090321.175756.-434257642.imp@bsdimp.com> <49C5F88C.3070600@freebsd.org> In-Reply-To: <49C5F88C.3070600@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.57 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "M. Warner Losh" , marius@alchemy.franken.de Subject: Re: svn commit: r190098 - in head/sys/sparc64: fhc sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 08:54:39 -0000 Andriy Gapon schrieb: > on 22/03/2009 01:57 M. Warner Losh said the following: >> I'll point out that style(9) doesn't say use as few local variables as >> possible... That part is completely unspecified. > > But it does say: > Do not put declarations inside blocks unless the routine is unusually > complicated. > > "unusually complicated" is, of course, a very subjective measure. > But still this guideline contradicts typical guidelines for C and its > offspring which name we do not say to declare variables as close to > their first usage as possible. > > E.g. you can have a simple 3 line block where you need a local variable > but that block is located 50 lines from start of an enclosing function. > Very convenient when you need to quickly glance the variable's type (not). ACK > So add me to the count of people who has problem with this rule. I'm glad that I'm not the only one who thinks this rule hinders comprehensibility. > P.S. > And 80 symbol line rule (which is not even in style) is also not > justified in modern times, if you'll ask me :) I'm ok with 80 columns. But at the same time having tab stops every 8 spaces - I consider this silly. I prefer 2, I'm ok with 4, but 8 with a maximum of 80 columns is somehow contradictory. I've seen quite some places in the source code which are very hard to read because they are indented several levels (two loops plus three if ()s, which can easily happen in a non-trivial algorithm, and you start at column 48 of 80) and then have to try very hard to fit into 80 columns - a newline after every token in one statement does not exactly improve readability. But this is a can of worms I do not want to open now. Christoph From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 09:19:02 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 501CF1065670 for ; Sun, 22 Mar 2009 09:19:02 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: from xps.daemonology.net (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx2.freebsd.org (Postfix) with SMTP id 485DB14F3F6 for ; Sun, 22 Mar 2009 09:19:01 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: (qmail 29445 invoked from network); 22 Mar 2009 09:17:29 -0000 Received: from unknown (HELO xps.daemonology.net) (127.0.0.1) by localhost with SMTP; 22 Mar 2009 09:17:29 -0000 Message-ID: <49C60229.2040400@freebsd.org> Date: Sun, 22 Mar 2009 02:17:29 -0700 From: Colin Percival User-Agent: Thunderbird 2.0.0.17 (X11/20081002) MIME-Version: 1.0 To: Christoph Mallon References: <49C4C974.5050209@gmx.de> <20090321130332.GD67783@alchemy.franken.de> <49C5737F.1050902@gmx.de> <20090321.175756.-434257642.imp@bsdimp.com> <49C5F88C.3070600@freebsd.org> <49C5FCCA.5010509@gmx.de> In-Reply-To: <49C5FCCA.5010509@gmx.de> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, marius@alchemy.franken.de Subject: Re: svn commit: r190098 - in head/sys/sparc64: fhc sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 09:19:02 -0000 Christoph Mallon wrote: > (two loops plus three if ()s, which can easily > happen in a non-trivial algorithm, and you start at column 48 of 80) I've found that this is usually a very good point at which to ask myself if the code in question can be refactored. I'm not saying that I refactor code just to make it fit into an 80 character width -- it's just that I often don't notice how complex a routine is getting while I'm writing it, unless I have some external prompt; and finding that I'm wrapping lots of lines provides exactly the sort of reminder I need. -- Colin Percival Security Officer, FreeBSD | freebsd.org | The power to serve Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 13:05:07 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6983106566C; Sun, 22 Mar 2009 13:05:07 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 817068FC19; Sun, 22 Mar 2009 13:05:07 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n2MD3Dk7042446; Sun, 22 Mar 2009 07:03:14 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 22 Mar 2009 07:03:49 -0600 (MDT) Message-Id: <20090322.070349.195750067.imp@bsdimp.com> To: avg@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <49C5F88C.3070600@freebsd.org> References: <49C5737F.1050902@gmx.de> <20090321.175756.-434257642.imp@bsdimp.com> <49C5F88C.3070600@freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, christoph.mallon@gmx.de, src-committers@FreeBSD.org, marius@alchemy.franken.de Subject: Re: svn commit: r190098 - in head/sys/sparc64: fhc sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 13:05:08 -0000 In message: <49C5F88C.3070600@freebsd.org> Andriy Gapon writes: : on 22/03/2009 01:57 M. Warner Losh said the following: : > I'll point out that style(9) doesn't say use as few local variables as : > possible... That part is completely unspecified. : : But it does say: : Do not put declarations inside blocks unless the routine is unusually : complicated. Yea, so? Just put them at the top of the function where they belong and don't worry about it. Christoph has a long reason why this isn't bad. : "unusually complicated" is, of course, a very subjective measure. : But still this guideline contradicts typical guidelines for C and its : offspring which name we do not say to declare variables as close to : their first usage as possible. thousands of lines is unusually complicated. : E.g. you can have a simple 3 line block where you need a local variable : but that block is located 50 lines from start of an enclosing function. : Very convenient when you need to quickly glance the variable's type (not). No you don't. There's absolutely nothing wrong with putting them at the top. In fact, it is simpler, really, than having to go hunting for dozens of different declarations. As someone who has spent a lot of time looking at code, the time wasted looking for these damn-fool things really adds up. The original point is valid: the code changes obfuscated perfectly readable code for no gain in the object code. Warner From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 13:05:27 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 905001065686; Sun, 22 Mar 2009 13:05:27 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 4BBF98FC15; Sun, 22 Mar 2009 13:05:27 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n2MD41lH042449; Sun, 22 Mar 2009 07:04:01 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 22 Mar 2009 07:04:37 -0600 (MDT) Message-Id: <20090322.070437.570083689.imp@bsdimp.com> To: christoph.mallon@gmx.de From: "M. Warner Losh" In-Reply-To: <49C5FCCA.5010509@gmx.de> References: <20090321.175756.-434257642.imp@bsdimp.com> <49C5F88C.3070600@freebsd.org> <49C5FCCA.5010509@gmx.de> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, avg@FreeBSD.org, marius@alchemy.franken.de Subject: Re: svn commit: r190098 - in head/sys/sparc64: fhc sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 13:05:28 -0000 In message: <49C5FCCA.5010509@gmx.de> Christoph Mallon writes: : Andriy Gapon schrieb: : > on 22/03/2009 01:57 M. Warner Losh said the following: : >> I'll point out that style(9) doesn't say use as few local variables as : >> possible... That part is completely unspecified. : > : > But it does say: : > Do not put declarations inside blocks unless the routine is unusually : > complicated. : > : > "unusually complicated" is, of course, a very subjective measure. : > But still this guideline contradicts typical guidelines for C and its : > offspring which name we do not say to declare variables as close to : > their first usage as possible. : > : > E.g. you can have a simple 3 line block where you need a local variable : > but that block is located 50 lines from start of an enclosing function. : > Very convenient when you need to quickly glance the variable's type (not). : : ACK : : > So add me to the count of people who has problem with this rule. : : I'm glad that I'm not the only one who thinks this rule hinders : comprehensibility. : : > P.S. : > And 80 symbol line rule (which is not even in style) is also not : > justified in modern times, if you'll ask me :) : : I'm ok with 80 columns. But at the same time having tab stops every 8 : spaces - I consider this silly. I prefer 2, I'm ok with 4, but 8 with a : maximum of 80 columns is somehow contradictory. I've seen quite some : places in the source code which are very hard to read because they are : indented several levels (two loops plus three if ()s, which can easily : happen in a non-trivial algorithm, and you start at column 48 of 80) and : then have to try very hard to fit into 80 columns - a newline after : every token in one statement does not exactly improve readability. : But this is a can of worms I do not want to open now. 8 space tabs with 80 columns is supposed to help enforce simplicity. Warner From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 13:17:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61716106566B; Sun, 22 Mar 2009 13:17:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FF328FC14; Sun, 22 Mar 2009 13:17:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2MDHkuv069499; Sun, 22 Mar 2009 13:17:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MDHk6G069498; Sun, 22 Mar 2009 13:17:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200903221317.n2MDHk6G069498@svn.freebsd.org> From: Warner Losh Date: Sun, 22 Mar 2009 13:17:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190263 - head/sys/dev/usb/storage X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 13:17:47 -0000 Author: imp Date: Sun Mar 22 13:17:46 2009 New Revision: 190263 URL: http://svn.freebsd.org/changeset/base/190263 Log: NO_INQUIRY is wrong for this device. Alternatively, if it is right, it is right for only a tiny fraction of these devices and this wild-card entry is too broad. # I run a kernel without this entry at all without ill effects... Modified: head/sys/dev/usb/storage/umass.c Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Sun Mar 22 11:07:13 2009 (r190262) +++ head/sys/dev/usb/storage/umass.c Sun Mar 22 13:17:46 2009 (r190263) @@ -610,7 +610,7 @@ static const struct umass_devdescr umass }, {USB_VENDOR_MYSON, USB_PRODUCT_MYSON_HEDEN, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, - NO_INQUIRY | IGNORE_RESIDUE | NO_SYNCHRONIZE_CACHE + IGNORE_RESIDUE | NO_SYNCHRONIZE_CACHE }, {USB_VENDOR_MYSON, USB_PRODUCT_MYSON_STARREADER, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 13:33:43 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB58E1065673 for ; Sun, 22 Mar 2009 13:33:43 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 1524D8FC1C for ; Sun, 22 Mar 2009 13:33:42 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 22 Mar 2009 13:33:41 -0000 Received: from p54A3FD39.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.253.57] by mail.gmx.net (mp036) with SMTP; 22 Mar 2009 14:33:41 +0100 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX1++hawlWA++RbcH54C+Jy2jZjHwZx9+N28Fs2BZ8J DzHd4X//wSD4gZ Message-ID: <49C63E34.4030303@gmx.de> Date: Sun, 22 Mar 2009 14:33:40 +0100 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: "M. Warner Losh" References: <49C5737F.1050902@gmx.de> <20090321.175756.-434257642.imp@bsdimp.com> <49C5F88C.3070600@freebsd.org> <20090322.070349.195750067.imp@bsdimp.com> In-Reply-To: <20090322.070349.195750067.imp@bsdimp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.5600000000000001 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, avg@FreeBSD.org, marius@alchemy.franken.de Subject: Re: svn commit: r190098 - in head/sys/sparc64: fhc sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 13:33:44 -0000 M. Warner Losh schrieb: > In message: <49C5F88C.3070600@freebsd.org> > Andriy Gapon writes: > : on 22/03/2009 01:57 M. Warner Losh said the following: > : > I'll point out that style(9) doesn't say use as few local variables as > : > possible... That part is completely unspecified. > : > : But it does say: > : Do not put declarations inside blocks unless the routine is unusually > : complicated. > > Yea, so? Just put them at the top of the function where they belong > and don't worry about it. Christoph has a long reason why this isn't bad. Maybe I misunderstand your sentence here, but I'm *against putting all declarations at the top* of the function and I'm *for declaring and initialising* variables right where you need them. > : "unusually complicated" is, of course, a very subjective measure. > : But still this guideline contradicts typical guidelines for C and its > : offspring which name we do not say to declare variables as close to > : their first usage as possible. > > thousands of lines is unusually complicated. So every function of FreeBSD's kernel is trivial? Or is "ordinary complicated" not a reason enough for better readability? > : E.g. you can have a simple 3 line block where you need a local variable > : but that block is located 50 lines from start of an enclosing function. > : Very convenient when you need to quickly glance the variable's type (not). > > No you don't. There's absolutely nothing wrong with putting them at > the top. In fact, it is simpler, really, than having to go hunting > for dozens of different declarations. As someone who has spent a lot > of time looking at code, the time wasted looking for these damn-fool > things really adds up. I fully disagree. I prefer seeing the declaration right where the assignment/initialisation is instead of hunting for it two pages up. Also for the rare case that you cannot directly spot the declartaion a few lines up, every editor/IDE I know, which is more advanced than ed, has a "jump to declaration" key combination and I prefer when it just moves a few lines up instead of two pages and puts me totally somewhere else. E.g. for vim the key combination is "gd". Others (e.g. Eclipse) highlight the declaration when you move the cursor over a use of the variable and if it is two pages up you do not see the highlight. > The original point is valid: the code changes obfuscated perfectly > readable code for no gain in the object code. I agree here, but probably for mostly different reasons. Christoph From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 13:42:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02FAF106564A; Sun, 22 Mar 2009 13:42:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB9A38FC08; Sun, 22 Mar 2009 13:42:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2MDgfij069986; Sun, 22 Mar 2009 13:42:41 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MDgfkt069985; Sun, 22 Mar 2009 13:42:41 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200903221342.n2MDgfkt069985@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 22 Mar 2009 13:42:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190264 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 13:42:42 -0000 Author: kib Date: Sun Mar 22 13:42:41 2009 New Revision: 190264 URL: http://svn.freebsd.org/changeset/base/190264 Log: Fix several issues with parsing the notes for ELF objects. Badly formed ELF note may cause the caclulated pointer to the next note to point both after the note region, that was checked in the code, but also to point before the region, that was not checked [1]. Remember the first note location in note0 and leap out if the note is not between note0 and note_end. In the similar way, badly formed note may cause infinite loop by pointing next note into the same or previous note. Guard against this by limiting amount of loop iterations by arbitrary choosen big number. For clarity, check the calculated note alignment in each iteration. Reported by: Chris Palmer [1] PR: kern/132886 Reviewed and tested by: dchagin MFC after: 3 days Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Sun Mar 22 13:17:46 2009 (r190263) +++ head/sys/kern/imgact_elf.c Sun Mar 22 13:42:41 2009 (r190264) @@ -1331,7 +1331,7 @@ static boolean_t __elfN(check_note)(struct image_params *imgp, Elf_Brandnote *checknote, int32_t *osrel) { - const Elf_Note *note, *note_end; + const Elf_Note *note, *note0, *note_end; const Elf_Phdr *phdr, *pnote; const Elf_Ehdr *hdr; const char *note_name; @@ -1352,12 +1352,12 @@ __elfN(check_note)(struct image_params * pnote->p_offset + pnote->p_filesz >= PAGE_SIZE) return (FALSE); - note = (const Elf_Note *)(imgp->image_header + pnote->p_offset); - if (!aligned(note, Elf32_Addr)) - return (FALSE); + note = note0 = (const Elf_Note *)(imgp->image_header + pnote->p_offset); note_end = (const Elf_Note *)(imgp->image_header + pnote->p_offset + pnote->p_filesz); - while (note < note_end) { + for (i = 0; i < 100 && note >= note0 && note < note_end; i++) { + if (!aligned(note, Elf32_Addr)) + return (FALSE); if (note->n_namesz != checknote->hdr.n_namesz || note->n_descsz != checknote->hdr.n_descsz || note->n_type != checknote->hdr.n_type) From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 14:39:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 208E1106566C; Sun, 22 Mar 2009 14:39:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F40F8FC16; Sun, 22 Mar 2009 14:39:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2MEdbpE071129; Sun, 22 Mar 2009 14:39:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MEdbA1071128; Sun, 22 Mar 2009 14:39:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200903221439.n2MEdbA1071128@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 22 Mar 2009 14:39:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190265 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 14:39:38 -0000 Author: kib Date: Sun Mar 22 14:39:37 2009 New Revision: 190265 URL: http://svn.freebsd.org/changeset/base/190265 Log: Bump __FreeBSD_version for dynamic token string support added in ld.so. Requested by: maho Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Mar 22 13:42:41 2009 (r190264) +++ head/sys/sys/param.h Sun Mar 22 14:39:37 2009 (r190265) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 800072 /* Master, propagated to newvers */ +#define __FreeBSD_version 800073 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 15:29:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC4E4106566B; Sun, 22 Mar 2009 15:29:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB0AE8FC16; Sun, 22 Mar 2009 15:29:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2MFTCpY072227; Sun, 22 Mar 2009 15:29:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MFTCdC072226; Sun, 22 Mar 2009 15:29:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200903221529.n2MFTCdC072226@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 22 Mar 2009 15:29:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190266 - head/lib/libc/string X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 15:29:13 -0000 Author: kib Date: Sun Mar 22 15:29:12 2009 New Revision: 190266 URL: http://svn.freebsd.org/changeset/base/190266 Log: 7.2 will be the first release where strndup() appears. Submitted by: Florian Smeets MFC after: 3 days Modified: head/lib/libc/string/strdup.3 Modified: head/lib/libc/string/strdup.3 ============================================================================== --- head/lib/libc/string/strdup.3 Sun Mar 22 14:39:37 2009 (r190265) +++ head/lib/libc/string/strdup.3 Sun Mar 22 15:29:12 2009 (r190266) @@ -80,4 +80,4 @@ function first appeared in The .Fn strndup function was added in -.Fx 8.0 . +.Fx 7.2 . From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 17:09:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 068CB1065677; Sun, 22 Mar 2009 17:09:57 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E91A08FC12; Sun, 22 Mar 2009 17:09:56 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2MH9uA1074473; Sun, 22 Mar 2009 17:09:56 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MH9uGi074472; Sun, 22 Mar 2009 17:09:56 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200903221709.n2MH9uGi074472@svn.freebsd.org> From: Andrew Thompson Date: Sun, 22 Mar 2009 17:09:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190269 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 17:09:57 -0000 Author: thompsa Date: Sun Mar 22 17:09:56 2009 New Revision: 190269 URL: http://svn.freebsd.org/changeset/base/190269 Log: Set the endpoint on the preallocated fifo so it doesnt get matched as an endpoint fifo. Reported by: Pieter de Goeje Modified: head/sys/dev/usb/usb_dev.c Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Sun Mar 22 16:27:14 2009 (r190268) +++ head/sys/dev/usb/usb_dev.c Sun Mar 22 17:09:56 2009 (r190269) @@ -1610,6 +1610,7 @@ usb2_fifo_attach(struct usb2_device *ude /* initialise FIFO structures */ f_tx->fifo_index = n + USB_FIFO_TX; + f_tx->dev_ep_index = -1; f_tx->priv_mtx = priv_mtx; f_tx->priv_sc0 = priv_sc; f_tx->methods = pm; @@ -1617,6 +1618,7 @@ usb2_fifo_attach(struct usb2_device *ude f_tx->udev = udev; f_rx->fifo_index = n + USB_FIFO_RX; + f_rx->dev_ep_index = -1; f_rx->priv_mtx = priv_mtx; f_rx->priv_sc0 = priv_sc; f_rx->methods = pm; From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 17:20:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A1911065670; Sun, 22 Mar 2009 17:20:43 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 361A88FC16; Sun, 22 Mar 2009 17:20:43 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2MHKhdn074760; Sun, 22 Mar 2009 17:20:43 GMT (envelope-from stefanf@svn.freebsd.org) Received: (from stefanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MHKhwB074759; Sun, 22 Mar 2009 17:20:43 GMT (envelope-from stefanf@svn.freebsd.org) Message-Id: <200903221720.n2MHKhwB074759@svn.freebsd.org> From: Stefan Farfeleder Date: Sun, 22 Mar 2009 17:20:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190270 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 17:20:46 -0000 Author: stefanf Date: Sun Mar 22 17:20:42 2009 New Revision: 190270 URL: http://svn.freebsd.org/changeset/base/190270 Log: Make the output of the alias built-in POSIX-compliant: Drop the leading 'alias' and suppress printing the trailing space which is added for internal purposes. Modified: head/bin/sh/alias.c Modified: head/bin/sh/alias.c ============================================================================== --- head/bin/sh/alias.c Sun Mar 22 17:09:56 2009 (r190269) +++ head/bin/sh/alias.c Sun Mar 22 17:20:42 2009 (r190270) @@ -203,8 +203,13 @@ aliascmd(int argc, char **argv) for (i = 0; i < ATABSIZE; i++) for (ap = atab[i]; ap; ap = ap->next) { if (*ap->name != '\0') { - out1fmt("alias %s=", ap->name); + out1fmt("%s=", ap->name); + /* Don't print the space added + * above. */ + v = ap->val + strlen(ap->val) - 1; + *v = '\0'; out1qstr(ap->val); + *v = ' '; out1c('\n'); } } From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 17:22:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D95C10656D6; Sun, 22 Mar 2009 17:22:15 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BEBC8FC0C; Sun, 22 Mar 2009 17:22:15 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2MHMFtP074844; Sun, 22 Mar 2009 17:22:15 GMT (envelope-from stefanf@svn.freebsd.org) Received: (from stefanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MHME4m074842; Sun, 22 Mar 2009 17:22:14 GMT (envelope-from stefanf@svn.freebsd.org) Message-Id: <200903221722.n2MHME4m074842@svn.freebsd.org> From: Stefan Farfeleder Date: Sun, 22 Mar 2009 17:22:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190271 - head/tools/regression/bin/sh/builtins X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 17:22:15 -0000 Author: stefanf Date: Sun Mar 22 17:22:14 2009 New Revision: 190271 URL: http://svn.freebsd.org/changeset/base/190271 Log: Update and extend the tests for alias. Modified: head/tools/regression/bin/sh/builtins/alias.0 head/tools/regression/bin/sh/builtins/alias.0.stdout Modified: head/tools/regression/bin/sh/builtins/alias.0 ============================================================================== --- head/tools/regression/bin/sh/builtins/alias.0 Sun Mar 22 17:20:42 2009 (r190270) +++ head/tools/regression/bin/sh/builtins/alias.0 Sun Mar 22 17:22:14 2009 (r190271) @@ -3,4 +3,6 @@ set -e unalias -a alias foo=bar +alias bar= +alias quux="1 2 3" alias Modified: head/tools/regression/bin/sh/builtins/alias.0.stdout ============================================================================== --- head/tools/regression/bin/sh/builtins/alias.0.stdout Sun Mar 22 17:20:42 2009 (r190270) +++ head/tools/regression/bin/sh/builtins/alias.0.stdout Sun Mar 22 17:22:14 2009 (r190271) @@ -1 +1,3 @@ -foo='bar' +foo=bar +bar='' +quux='1 2 3' From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 18:15:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E2E21065722 for ; Sun, 22 Mar 2009 18:15:49 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outK.internet-mail-service.net (outk.internet-mail-service.net [216.240.47.234]) by mx1.freebsd.org (Postfix) with ESMTP id 59E878FC1B for ; Sun, 22 Mar 2009 18:15:49 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 283C622066; Sun, 22 Mar 2009 11:15:49 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 83BF52D6015; Sun, 22 Mar 2009 11:15:46 -0700 (PDT) Message-ID: <49C68062.2000407@elischer.org> Date: Sun, 22 Mar 2009 11:16:02 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: Christoph Mallon References: <49C4C974.5050209@gmx.de> <20090321130332.GD67783@alchemy.franken.de> <49C5737F.1050902@gmx.de> <20090321.175756.-434257642.imp@bsdimp.com> <49C5F88C.3070600@freebsd.org> <49C5FCCA.5010509@gmx.de> In-Reply-To: <49C5FCCA.5010509@gmx.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Andriy Gapon , marius@alchemy.franken.de, svn-src-head@freebsd.org, "M. Warner Losh" Subject: Re: svn commit: r190098 - in head/sys/sparc64: fhc sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 18:15:51 -0000 Christoph Mallon wrote: > Andriy Gapon schrieb: >> compliants about style (9) > agreement and disagreement. basically almost every single committer who comes into the group usually starts up by objecting to one part or another of the style guide. However the problem is that we all object to different parts and those parts that others disagree with are often parts that we see as being reasonable. examples: " I wan to go > 80 columns". and "I often end up debugging on the console. thank goodness the sources fit in 80 columns". The style guide IS open to change but not by any individual contributer. Most of the things in there are there for a reason that is non obvious. Sometimes they are arbitrary. If one has read BSD code and other system code however, one is sometimes struck with how uniform the BSD code is. Once you get the style into your head you can start taking shortcuts.. For example you know where all the locals are, and you can see from an quick look how much stack space a particular function is contributing to using up the very limited stack space available in kernel. At this stage you will find that there are just some things you will have to live with because changing them now would make new sources just too different too old sources. (I'd put indent rules and 8-char tabs into that category.) There are other things that will be amenable to change with sufficient discussion. Due to different compiler rules for example, there may be reason to drop some rules because they were there to stop people from making mistakes that teh compiler now warns about. But generally every change needs to pass one question. "Will the code still largely 'smell' like BSD code?" From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 18:20:57 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1A4A1065677 for ; Sun, 22 Mar 2009 18:20:57 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outG.internet-mail-service.net (outg.internet-mail-service.net [216.240.47.230]) by mx1.freebsd.org (Postfix) with ESMTP id 904D28FC20 for ; Sun, 22 Mar 2009 18:20:57 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 4D4A712C17; Sun, 22 Mar 2009 11:20:57 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id A8C532D600D; Sun, 22 Mar 2009 11:20:54 -0700 (PDT) Message-ID: <49C68197.1060204@elischer.org> Date: Sun, 22 Mar 2009 11:21:11 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: "M. Warner Losh" References: <49C5737F.1050902@gmx.de> <20090321.175756.-434257642.imp@bsdimp.com> <49C5F88C.3070600@freebsd.org> <20090322.070349.195750067.imp@bsdimp.com> In-Reply-To: <20090322.070349.195750067.imp@bsdimp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, avg@FreeBSD.org, marius@alchemy.franken.de, svn-src-head@FreeBSD.org, christoph.mallon@gmx.de Subject: Re: svn commit: r190098 - in head/sys/sparc64: fhc sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 18:20:58 -0000 M. Warner Losh wrote: > In message: <49C5F88C.3070600@freebsd.org> > Andriy Gapon writes: > : on 22/03/2009 01:57 M. Warner Losh said the following: > : > I'll point out that style(9) doesn't say use as few local variables as > : > possible... That part is completely unspecified. > : > : But it does say: > : Do not put declarations inside blocks unless the routine is unusually > : complicated. > > Yea, so? Just put them at the top of the function where they belong > and don't worry about it. Christoph has a long reason why this isn't bad. > > : "unusually complicated" is, of course, a very subjective measure. > : But still this guideline contradicts typical guidelines for C and its > : offspring which name we do not say to declare variables as close to > : their first usage as possible. > > thousands of lines is unusually complicated. > > : E.g. you can have a simple 3 line block where you need a local variable > : but that block is located 50 lines from start of an enclosing function. > : Very convenient when you need to quickly glance the variable's type (not). > > No you don't. There's absolutely nothing wrong with putting them at > the top. In fact, it is simpler, really, than having to go hunting > for dozens of different declarations. As someone who has spent a lot > of time looking at code, the time wasted looking for these damn-fool > things really adds up. and in a complicated function, if you have them all over the place you have no idea as to what the potential stack usage of the function is.. This matters in the kernel. > > The original point is valid: the code changes obfuscated perfectly > readable code for no gain in the object code. > > Warner From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 18:56:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C1BD1065670; Sun, 22 Mar 2009 18:56:27 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A9348FC1A; Sun, 22 Mar 2009 18:56:27 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2MIuRj3076968; Sun, 22 Mar 2009 18:56:27 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MIuRhW076966; Sun, 22 Mar 2009 18:56:27 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200903221856.n2MIuRhW076966@svn.freebsd.org> From: Alan Cox Date: Sun, 22 Mar 2009 18:56:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190272 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 18:56:27 -0000 Author: alc Date: Sun Mar 22 18:56:26 2009 New Revision: 190272 URL: http://svn.freebsd.org/changeset/base/190272 Log: Update stale comments. The alternate address space mapping was eliminated when PAE support was added to i386. The direct mapping exists on amd64. Modified: head/sys/amd64/include/pmap.h head/sys/i386/include/pmap.h Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Sun Mar 22 17:22:14 2009 (r190271) +++ head/sys/amd64/include/pmap.h Sun Mar 22 18:56:26 2009 (r190272) @@ -160,13 +160,7 @@ typedef u_int64_t pml4_entry_t; #define PDESHIFT (3) /* - * Address of current and alternate address space page table maps - * and directories. - * XXX it might be saner to just direct map all of physical memory - * into the kernel using 2MB pages. We have enough space to do - * it (2^47 bits of KVM, while current max physical addressability - * is 2^40 physical bits). Then we can get rid of the evil hole - * in the page tables and the evil overlapping. + * Address of current address space page table maps and directories. */ #ifdef _KERNEL #define addr_PTmap (KVADDR(PML4PML4I, 0, 0, 0)) Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Sun Mar 22 17:22:14 2009 (r190271) +++ head/sys/i386/include/pmap.h Sun Mar 22 18:56:26 2009 (r190272) @@ -174,8 +174,7 @@ typedef uint32_t pt_entry_t; #endif /* - * Address of current and alternate address space page table maps - * and directories. + * Address of current address space page table maps and directories. */ #ifdef _KERNEL extern pt_entry_t PTmap[]; From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 19:16:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66905106567A; Sun, 22 Mar 2009 19:16:59 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 1378A8FC1E; Sun, 22 Mar 2009 19:16:58 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n2MJDAgY046746; Sun, 22 Mar 2009 13:13:10 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 22 Mar 2009 13:13:46 -0600 (MDT) Message-Id: <20090322.131346.1411164415.imp@bsdimp.com> To: christoph.mallon@gmx.de From: "M. Warner Losh" In-Reply-To: <49C63E34.4030303@gmx.de> References: <49C5F88C.3070600@freebsd.org> <20090322.070349.195750067.imp@bsdimp.com> <49C63E34.4030303@gmx.de> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, avg@freebsd.org, marius@alchemy.franken.de Subject: Re: svn commit: r190098 - in head/sys/sparc64: fhc sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 19:17:00 -0000 In message: <49C63E34.4030303@gmx.de> Christoph Mallon writes: : M. Warner Losh schrieb: : > In message: <49C5F88C.3070600@freebsd.org> : > Andriy Gapon writes: : > : on 22/03/2009 01:57 M. Warner Losh said the following: : > : > I'll point out that style(9) doesn't say use as few local variables as : > : > possible... That part is completely unspecified. : > : : > : But it does say: : > : Do not put declarations inside blocks unless the routine is unusually : > : complicated. : > : > Yea, so? Just put them at the top of the function where they belong : > and don't worry about it. Christoph has a long reason why this isn't bad. : : Maybe I misunderstand your sentence here, but I'm *against putting all : declarations at the top* of the function and I'm *for declaring and : initialising* variables right where you need them. : > : "unusually complicated" is, of course, a very subjective measure. : > : But still this guideline contradicts typical guidelines for C and its : > : offspring which name we do not say to declare variables as close to : > : their first usage as possible. : > : > thousands of lines is unusually complicated. : : So every function of FreeBSD's kernel is trivial? Or is "ordinary : complicated" not a reason enough for better readability? Maybe I'm exaggerating a little. Anything more than "one screen" which is to say about 100 lines starts to get complicated. In those simple cases, having the variables in multiple places is just distracting.... But clearly we differ on this point.. : > : E.g. you can have a simple 3 line block where you need a local variable : > : but that block is located 50 lines from start of an enclosing function. : > : Very convenient when you need to quickly glance the variable's type (not). : > : > No you don't. There's absolutely nothing wrong with putting them at : > the top. In fact, it is simpler, really, than having to go hunting : > for dozens of different declarations. As someone who has spent a lot : > of time looking at code, the time wasted looking for these damn-fool : > things really adds up. : : I fully disagree. I prefer seeing the declaration right where the : assignment/initialisation is instead of hunting for it two pages up. : Also for the rare case that you cannot directly spot the declartaion a : few lines up, every editor/IDE I know, which is more advanced than ed, : has a "jump to declaration" key combination and I prefer when it just : moves a few lines up instead of two pages and puts me totally somewhere : else. E.g. for vim the key combination is "gd". Others (e.g. Eclipse) : highlight the declaration when you move the cursor over a use of the : variable and if it is two pages up you do not see the highlight. The problem is when things get really complicated and you have an expression that's made up of, say, 10 different things. Some scope local, some next scope out local, some local to the function, some parameters to the function and some global variables. Where do you find them all? Even with the navigation aides, this can be non-trivial. Especially with global variables. vim certainly doesn't cope with that if they are declared outside of the file. I've also had problems where nested scopes shadowed greater scopes' variables. This isn't so much a problem since compilers started whining about this, but I've been burned by junior people cut and pasting code from one place and slamming it into another without thinking. I guess spending half a week tracking this sort of problem down a couple of times makes it a hot-button for me :). Of course, times do change, so maybe I should reevaluate my stance. : > The original point is valid: the code changes obfuscated perfectly : > readable code for no gain in the object code. : : I agree here, but probably for mostly different reasons. Most likely. Warner From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 20:58:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A75E1065673; Sun, 22 Mar 2009 20:58:29 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E7558FC0C; Sun, 22 Mar 2009 20:58:29 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2MKwTmh083421; Sun, 22 Mar 2009 20:58:29 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MKwT03083419; Sun, 22 Mar 2009 20:58:29 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903222058.n2MKwT03083419@svn.freebsd.org> From: Robert Noland Date: Sun, 22 Mar 2009 20:58:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190282 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 20:58:30 -0000 Author: rnoland Date: Sun Mar 22 20:58:29 2009 New Revision: 190282 URL: http://svn.freebsd.org/changeset/base/190282 Log: Fix up the flags to bus_dmamem again. The man page incorrectly showed the BUS_DMA_NOCACHE flags as being a valid flag for load instead of alloc. Discussed with: kib MFC after: 3 days Modified: head/sys/dev/drm/ati_pcigart.c head/sys/dev/drm/drm_scatter.c Modified: head/sys/dev/drm/ati_pcigart.c ============================================================================== --- head/sys/dev/drm/ati_pcigart.c Sun Mar 22 20:54:22 2009 (r190281) +++ head/sys/dev/drm/ati_pcigart.c Sun Mar 22 20:58:29 2009 (r190282) @@ -82,8 +82,11 @@ drm_ati_alloc_pcigart_table(struct drm_d return ENOMEM; } - ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr, - BUS_DMA_WAITOK | BUS_DMA_ZERO, &dmah->map); + flags = BUS_DMA_WAITOK | BUS_DMA_ZERO; + if (gart_info->gart_reg_if == DRM_ATI_GART_IGP) + flags |= BUS_DMA_NOCACHE; + + ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr, flags, &dmah->map); if (ret != 0) { bus_dma_tag_destroy(dmah->tag); free(dmah, DRM_MEM_DMA); @@ -91,12 +94,9 @@ drm_ati_alloc_pcigart_table(struct drm_d } DRM_LOCK(); - flags = BUS_DMA_NOWAIT; - if (gart_info->gart_reg_if == DRM_ATI_GART_IGP) - flags |= BUS_DMA_NOCACHE; - ret = bus_dmamap_load(dmah->tag, dmah->map, dmah->vaddr, - gart_info->table_size, drm_ati_alloc_pcigart_table_cb, dmah, flags); + gart_info->table_size, drm_ati_alloc_pcigart_table_cb, dmah, + BUS_DMA_NOWAIT); if (ret != 0) { bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); bus_dma_tag_destroy(dmah->tag); Modified: head/sys/dev/drm/drm_scatter.c ============================================================================== --- head/sys/dev/drm/drm_scatter.c Sun Mar 22 20:54:22 2009 (r190281) +++ head/sys/dev/drm/drm_scatter.c Sun Mar 22 20:58:29 2009 (r190282) @@ -92,7 +92,7 @@ drm_sg_alloc(struct drm_device *dev, str } ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr, - BUS_DMA_WAITOK | BUS_DMA_ZERO, &dmah->map); + BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_NOCACHE, &dmah->map); if (ret != 0) { bus_dma_tag_destroy(dmah->tag); free(dmah, DRM_MEM_DMA); @@ -102,8 +102,7 @@ drm_sg_alloc(struct drm_device *dev, str } ret = bus_dmamap_load(dmah->tag, dmah->map, dmah->vaddr, - request->size, drm_sg_alloc_cb, entry, - BUS_DMA_NOWAIT | BUS_DMA_NOCACHE); + request->size, drm_sg_alloc_cb, entry, BUS_DMA_NOWAIT); if (ret != 0) { bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); bus_dma_tag_destroy(dmah->tag); From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 21:00:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A49371065672; Sun, 22 Mar 2009 21:00:58 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92CC88FC1C; Sun, 22 Mar 2009 21:00:58 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2ML0woH083538; Sun, 22 Mar 2009 21:00:58 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2ML0wwG083537; Sun, 22 Mar 2009 21:00:58 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903222100.n2ML0wwG083537@svn.freebsd.org> From: Robert Noland Date: Sun, 22 Mar 2009 21:00:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190283 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 21:00:59 -0000 Author: rnoland Date: Sun Mar 22 21:00:58 2009 New Revision: 190283 URL: http://svn.freebsd.org/changeset/base/190283 Log: Correct the documentation to reflect the fact that BUS_DMA_NOCACHE is a flag to bus_dmamem_alloc() rather than bus_dmamap_load(); Discussed with: kib MFC after: 3 days Modified: head/share/man/man9/bus_dma.9 Modified: head/share/man/man9/bus_dma.9 ============================================================================== --- head/share/man/man9/bus_dma.9 Sun Mar 22 20:58:29 2009 (r190282) +++ head/share/man/man9/bus_dma.9 Sun Mar 22 21:00:58 2009 (r190283) @@ -561,15 +561,6 @@ Are as follows: .It Dv BUS_DMA_NOWAIT The load should not be deferred in case of insufficient mapping resources, and instead should return immediately with an appropriate error. -.It Dv BUS_DMA_NOCACHE -The allocated memory will not be cached in the processor caches. -All memory accesses appear on the bus and are executed -without reordering. -On the amd64 and i386 architectures this flag results in the -Strong Uncacheable PAT to be set for the allocated virtual address range. -The -.Dv BUS_DMA_NOCACHE -flag is currently implemented on amd64, i386 and sparc64. .El .El .Pp @@ -785,6 +776,15 @@ the flag is currently implemented on arm and sparc64. .It Dv BUS_DMA_ZERO Causes the allocated memory to be set to all zeros. +.It Dv BUS_DMA_NOCACHE +The allocated memory will not be cached in the processor caches. +All memory accesses appear on the bus and are executed +without reordering. +On the amd64 and i386 architectures this flag results in the +Strong Uncacheable PAT to be set for the allocated virtual address range. +The +.Dv BUS_DMA_NOCACHE +flag is currently implemented on amd64, i386 and sparc64. .El .It Fa mapp Pointer to a From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 21:09:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66FC3106566B; Sun, 22 Mar 2009 21:09:22 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55E0C8FC0A; Sun, 22 Mar 2009 21:09:22 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2ML9Mac083737; Sun, 22 Mar 2009 21:09:22 GMT (envelope-from stefanf@svn.freebsd.org) Received: (from stefanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2ML9MX2083736; Sun, 22 Mar 2009 21:09:22 GMT (envelope-from stefanf@svn.freebsd.org) Message-Id: <200903222109.n2ML9MX2083736@svn.freebsd.org> From: Stefan Farfeleder Date: Sun, 22 Mar 2009 21:09:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190284 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 21:09:23 -0000 Author: stefanf Date: Sun Mar 22 21:09:22 2009 New Revision: 190284 URL: http://svn.freebsd.org/changeset/base/190284 Log: - Apply the r190270 changes to printing of single aliases too. - Sort the aliases before printing them. Modified: head/bin/sh/alias.c Modified: head/bin/sh/alias.c ============================================================================== --- head/bin/sh/alias.c Sun Mar 22 21:00:58 2009 (r190283) +++ head/bin/sh/alias.c Sun Mar 22 21:09:22 2009 (r190284) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #define ATABSIZE 39 STATIC struct alias *atab[ATABSIZE]; +STATIC int aliases; STATIC void setalias(char *, char *); STATIC int unalias(const char *); @@ -106,6 +107,7 @@ setalias(char *name, char *val) ap->flag = 0; ap->next = *app; *app = ap; + aliases++; INTON; } @@ -135,6 +137,7 @@ unalias(const char *name) ckfree(ap); INTON; } + aliases--; return (0); } } @@ -168,6 +171,7 @@ rmaliases(void) ckfree(tmp); } } + aliases = 0; INTON; } @@ -187,9 +191,47 @@ lookupalias(char *name, int check) return (NULL); } -/* - * TODO - sort output - */ +static int +comparealiases(const void *p1, const void *p2) +{ + const struct alias *const *a1 = p1; + const struct alias *const *a2 = p2; + + return strcmp((*a1)->name, (*a2)->name); +} + +static void +printalias(const struct alias *a) +{ + char *p; + + out1fmt("%s=", a->name); + /* Don't print the space added above. */ + p = a->val + strlen(a->val) - 1; + *p = '\0'; + out1qstr(a->val); + *p = ' '; + out1c('\n'); +} + +static void +printaliases(void) +{ + int i, j; + struct alias **sorted, *ap; + + sorted = ckmalloc(aliases * sizeof(*sorted)); + j = 0; + for (i = 0; i < ATABSIZE; i++) + for (ap = atab[i]; ap; ap = ap->next) + if (*ap->name != '\0') + sorted[j++] = ap; + qsort(sorted, aliases, sizeof(*sorted), comparealiases); + for (i = 0; i < aliases; i++) + printalias(sorted[i]); + ckfree(sorted); +} + int aliascmd(int argc, char **argv) { @@ -198,21 +240,7 @@ aliascmd(int argc, char **argv) struct alias *ap; if (argc == 1) { - int i; - - for (i = 0; i < ATABSIZE; i++) - for (ap = atab[i]; ap; ap = ap->next) { - if (*ap->name != '\0') { - out1fmt("%s=", ap->name); - /* Don't print the space added - * above. */ - v = ap->val + strlen(ap->val) - 1; - *v = '\0'; - out1qstr(ap->val); - *v = ' '; - out1c('\n'); - } - } + printaliases(); return (0); } while ((n = *++argv) != NULL) { @@ -220,11 +248,8 @@ aliascmd(int argc, char **argv) if ((ap = lookupalias(n, 0)) == NULL) { outfmt(out2, "alias: %s not found\n", n); ret = 1; - } else { - out1fmt("alias %s=", n); - out1qstr(ap->val); - out1c('\n'); - } + } else + printalias(ap); else { *v++ = '\0'; setalias(n, v); From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 21:09:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD281106566C; Sun, 22 Mar 2009 21:09:24 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 533358FC15; Sun, 22 Mar 2009 21:09:23 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.3/8.14.3/ALCHEMY.FRANKEN.DE) with ESMTP id n2ML91sC029758; Sun, 22 Mar 2009 22:09:23 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.3/8.14.3/Submit) id n2ML91nS029757; Sun, 22 Mar 2009 22:09:01 +0100 (CET) (envelope-from marius) Date: Sun, 22 Mar 2009 22:09:00 +0100 From: Marius Strobl To: Robert Noland Message-ID: <20090322210900.GE67783@alchemy.franken.de> References: <200903222100.n2ML0wwG083537@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200903222100.n2ML0wwG083537@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190283 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 21:09:25 -0000 On Sun, Mar 22, 2009 at 09:00:58PM +0000, Robert Noland wrote: > Author: rnoland > Date: Sun Mar 22 21:00:58 2009 > New Revision: 190283 > URL: http://svn.freebsd.org/changeset/base/190283 > > Log: > Correct the documentation to reflect the fact that BUS_DMA_NOCACHE is a > flag to bus_dmamem_alloc() rather than bus_dmamap_load(); > > Discussed with: kib > MFC after: 3 days > > Modified: > head/share/man/man9/bus_dma.9 > > Modified: head/share/man/man9/bus_dma.9 > ============================================================================== > --- head/share/man/man9/bus_dma.9 Sun Mar 22 20:58:29 2009 (r190282) > +++ head/share/man/man9/bus_dma.9 Sun Mar 22 21:00:58 2009 (r190283) > @@ -561,15 +561,6 @@ Are as follows: > .It Dv BUS_DMA_NOWAIT > The load should not be deferred in case of insufficient mapping resources, > and instead should return immediately with an appropriate error. > -.It Dv BUS_DMA_NOCACHE > -The allocated memory will not be cached in the processor caches. > -All memory accesses appear on the bus and are executed > -without reordering. > -On the amd64 and i386 architectures this flag results in the > -Strong Uncacheable PAT to be set for the allocated virtual address range. > -The > -.Dv BUS_DMA_NOCACHE > -flag is currently implemented on amd64, i386 and sparc64. > .El > .El > .Pp > @@ -785,6 +776,15 @@ the > flag is currently implemented on arm and sparc64. > .It Dv BUS_DMA_ZERO > Causes the allocated memory to be set to all zeros. > +.It Dv BUS_DMA_NOCACHE > +The allocated memory will not be cached in the processor caches. > +All memory accesses appear on the bus and are executed > +without reordering. > +On the amd64 and i386 architectures this flag results in the > +Strong Uncacheable PAT to be set for the allocated virtual address range. > +The > +.Dv BUS_DMA_NOCACHE > +flag is currently implemented on amd64, i386 and sparc64. > .El > .It Fa mapp > Pointer to a Uhm, on sparc64 BUS_DMA_NOCACHE actually is only valid for bus_dmamap_load(). Marius From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 21:12:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5CA71065670; Sun, 22 Mar 2009 21:12:00 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A44CC8FC1A; Sun, 22 Mar 2009 21:12:00 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2MLC0Ms083851; Sun, 22 Mar 2009 21:12:00 GMT (envelope-from stefanf@svn.freebsd.org) Received: (from stefanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MLC0wh083849; Sun, 22 Mar 2009 21:12:00 GMT (envelope-from stefanf@svn.freebsd.org) Message-Id: <200903222112.n2MLC0wh083849@svn.freebsd.org> From: Stefan Farfeleder Date: Sun, 22 Mar 2009 21:12:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190285 - head/tools/regression/bin/sh/builtins X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 21:12:01 -0000 Author: stefanf Date: Sun Mar 22 21:12:00 2009 New Revision: 190285 URL: http://svn.freebsd.org/changeset/base/190285 Log: Update test for r190284. Modified: head/tools/regression/bin/sh/builtins/alias.0 head/tools/regression/bin/sh/builtins/alias.0.stdout Modified: head/tools/regression/bin/sh/builtins/alias.0 ============================================================================== --- head/tools/regression/bin/sh/builtins/alias.0 Sun Mar 22 21:09:22 2009 (r190284) +++ head/tools/regression/bin/sh/builtins/alias.0 Sun Mar 22 21:12:00 2009 (r190285) @@ -6,3 +6,4 @@ alias foo=bar alias bar= alias quux="1 2 3" alias +alias foo Modified: head/tools/regression/bin/sh/builtins/alias.0.stdout ============================================================================== --- head/tools/regression/bin/sh/builtins/alias.0.stdout Sun Mar 22 21:09:22 2009 (r190284) +++ head/tools/regression/bin/sh/builtins/alias.0.stdout Sun Mar 22 21:12:00 2009 (r190285) @@ -1,3 +1,4 @@ -foo=bar bar='' +foo=bar quux='1 2 3' +foo=bar From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 21:32:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53A95106564A; Sun, 22 Mar 2009 21:32:27 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from kientzle.com (kientzle.com [66.166.149.50]) by mx1.freebsd.org (Postfix) with ESMTP id 1E9D08FC0C; Sun, 22 Mar 2009 21:32:27 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: (from root@localhost) by kientzle.com (8.14.3/8.14.3) id n2MLWDGj082287; Sun, 22 Mar 2009 14:32:13 -0700 (PDT) (envelope-from kientzle@freebsd.org) Received: from [10.123.2.23] (fw2.kientzle.com [10.123.1.2]) by kientzle.com with SMTP id 48emj7gcjqv8ybchwpfgdcpk9e; Sun, 22 Mar 2009 14:32:13 -0700 (PDT) (envelope-from kientzle@freebsd.org) Message-ID: <49C6AE5D.9090208@freebsd.org> Date: Sun, 22 Mar 2009 14:32:13 -0700 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20060422 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Julian Elischer References: <49C4C974.5050209@gmx.de> <20090321130332.GD67783@alchemy.franken.de> <49C5737F.1050902@gmx.de> <20090321.175756.-434257642.imp@bsdimp.com> <49C5F88C.3070600@freebsd.org> <49C5FCCA.5010509@gmx.de> <49C68062.2000407@elischer.org> In-Reply-To: <49C68062.2000407@elischer.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Andriy Gapon , marius@alchemy.franken.de, svn-src-head@freebsd.org, Christoph Mallon , "M. Warner Losh" Subject: Re: svn commit: r190098 - in head/sys/sparc64: fhc sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 21:32:27 -0000 Julian Elischer wrote: > Christoph Mallon wrote: >> Andriy Gapon schrieb: > >> compliants about style (9) > > agreement and disagreement. > > basically almost every single committer who comes into the group > usually starts up by objecting to one part or another of the style > guide. ... The style guide IS open to change but not by any individual > contributer. Most of the things in there are there for a reason that > is non obvious. Sometimes they are arbitrary. The most important style question when contributing to *any* existing project is "does it match?" Consistency contributes far more to readability than any other style issue, especially on very large bodies of code. Tim From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 22:07:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88291106567E; Sun, 22 Mar 2009 22:07:52 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 738D88FC13; Sun, 22 Mar 2009 22:07:52 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2MM7quX085367; Sun, 22 Mar 2009 22:07:52 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MM7qK3085361; Sun, 22 Mar 2009 22:07:52 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903222207.n2MM7qK3085361@svn.freebsd.org> From: Robert Watson Date: Sun, 22 Mar 2009 22:07:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190293 - in head/sys: cddl/dev/dtnfsclient modules/dtrace modules/dtrace/dtnfsclient modules/dtrace/dtraceall nfsclient sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 22:07:53 -0000 Author: rwatson Date: Sun Mar 22 22:07:52 2009 New Revision: 190293 URL: http://svn.freebsd.org/changeset/base/190293 Log: Add dtnfsclient, a first cut at an NFSv2/v3 client reuest DTrace provider. The NFS client exposes 'start' and 'done' probes for NFSv2 and NFSv3 RPCs when using the new RPC implementation, passing in the vnode, mbuf chain, credential, and NFSv2 or NFSv3 procedure number. For 'done' probes, the error number is also available. Probes are named in the following way: ... nfsclient:nfs2:write:start nfsclient:nfs2:write:done ... nfsclient:nfs3:access:start nfsclient:nfs3:access:done ... Access to the unmarshalled arguments is not easily available at this point in the stack, but the passed probe arguments are sufficient to to a lot of interesting things in practice. Technically, these probes may cover multiple RPC retransmits, and even transactions if the transaction ID change as a result of authentication failure or a jukebox error from the server, but usefully capture the intent of a single NFS request, such as access, getattr, write, etc. Typical use might involve profiling RPC latency by system call, number of RPCs, how often a getattr leads to a call to access, when failed access control checks occur, etc. More detailed RPC information might best be provided by adding a krpc provider. It would also be useful to add NFS client probes for events such as the access cache or attribute cache satisfying requests without an RPC. Sponsored by: Google, Inc. MFC after: 1 month Added: head/sys/cddl/dev/dtnfsclient/ head/sys/cddl/dev/dtnfsclient/dtnfsclient.c (contents, props changed) head/sys/modules/dtrace/dtnfsclient/ head/sys/modules/dtrace/dtnfsclient/Makefile (contents, props changed) Modified: head/sys/modules/dtrace/Makefile head/sys/modules/dtrace/dtraceall/dtraceall.c head/sys/nfsclient/nfs_krpc.c head/sys/sys/dtrace_bsd.h Added: head/sys/cddl/dev/dtnfsclient/dtnfsclient.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/dev/dtnfsclient/dtnfsclient.c Sun Mar 22 22:07:52 2009 (r190293) @@ -0,0 +1,343 @@ +/*- + * Copyright (c) 2009 Robert N. M. Watson + * All rights reserved. + * + * This software was developed at the University of Cambridge Computer + * Laboratory with support from a grant from Google, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +/* + * dtnfsclient is a DTrace provider that tracks the intent to perform RPCs + * in the NFS client. This is not quite the same as RPCs, because NFS may + * issue multiple RPC transactions in the event that authentication fails, + * there's a jukebox error, etc. However, it cleanly represents the logical + * layer between RPC transmission and vnode/vfs operations, providing access + * to state linking the two. + */ + +static int dtnfsclient_unload(void); +static void dtnfsclient_getargdesc(void *, dtrace_id_t, void *, + dtrace_argdesc_t *); +static void dtnfsclient_provide(void *, dtrace_probedesc_t *); +static void dtnfsclient_destroy(void *, dtrace_id_t, void *); +static void dtnfsclient_enable(void *, dtrace_id_t, void *); +static void dtnfsclient_disable(void *, dtrace_id_t, void *); +static void dtnfsclient_load(void *); + +static dtrace_pattr_t dtnfsclient_attr = { +{ DTRACE_STABILITY_STABLE, DTRACE_STABILITY_STABLE, DTRACE_CLASS_COMMON }, +{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN }, +{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN }, +{ DTRACE_STABILITY_STABLE, DTRACE_STABILITY_STABLE, DTRACE_CLASS_COMMON }, +{ DTRACE_STABILITY_STABLE, DTRACE_STABILITY_STABLE, DTRACE_CLASS_COMMON }, +}; + +struct dtnfsclient_rpc { + char *nr_v3_name; + char *nr_v2_name; /* Or NULL if none. */ + + /* + * IDs for the start and done cases, for both NFSv2 and NFSv3. + */ + uint32_t nr_v2_id_start, nr_v2_id_done; + uint32_t nr_v3_id_start, nr_v3_id_done; +}; + +/* + * This table is indexed by NFSv3 procedure number, but also used for NFSv2 + * procedure names. + */ +static struct dtnfsclient_rpc dtnfsclient_rpcs[NFS_NPROCS] = { + { "null", "null" }, + { "getattr", "getattr" }, + { "setattr", "setattr" }, + { "lookup", "lookup" }, + { "access" }, + { "readlink", "readlink" }, + { "read", "read" }, + { "write", "write" }, + { "create", "create" }, + { "mkdir", "mkdir" }, + { "symlink", "symlink" }, + { "mknod" }, + { "remove", "remove" }, + { "rmdir", "rmdir" }, + { "rename", "rename" }, + { "link", "link" }, + { "readdir", "readdir" }, + { "readdirplus" }, + { "fsstat", "statfs" }, + { "fsinfo" }, + { "pathconf" }, + { "commit" }, + { "noop" }, +}; + +static char *dtnfsclient_v2modulename = "nfs2"; +static char *dtnfsclient_v3modulename = "nfs3"; + +static char *dtnfsclient_start = "start"; +static char *dtnfsclient_done = "done"; + +static dtrace_pops_t dtnfsclient_pops = { + dtnfsclient_provide, + NULL, + dtnfsclient_enable, + dtnfsclient_disable, + NULL, + NULL, + dtnfsclient_getargdesc, + NULL, + NULL, + dtnfsclient_destroy +}; + +static dtrace_provider_id_t dtnfsclient_id; + +/* + * When tracing on a procedure is enabled, the DTrace ID for the event is + * stored in one of these two NFS client-allocated arrays; 0 indicates that + * the event is not being traced so probes should not be called. + * + * For simplicity, we allocate both v2 and v3 arrays as NFS_NPROCS, and the + * v2 array is simply sparse. + */ +extern uint32_t nfsclient_nfs2_start_probes[NFS_NPROCS]; +extern uint32_t nfsclient_nfs2_done_probes[NFS_NPROCS]; + +extern uint32_t nfsclient_nfs3_start_probes[NFS_NPROCS]; +extern uint32_t nfsclient_nfs3_done_probes[NFS_NPROCS]; + +/* + * Look up a DTrace probe ID to see if it's associated with a "done" event -- + * if so, we will return a fourth argument type of "int". + */ +static int +dtnfs23_isdoneprobe(dtrace_id_t id) +{ + int i; + + for (i = 0; i < NFS_NPROCS; i++) { + if (dtnfsclient_rpcs[i].nr_v3_id_done == id || + dtnfsclient_rpcs[i].nr_v2_id_done == id) + return (1); + } + return (0); +} + +static void +dtnfsclient_getargdesc(void *arg, dtrace_id_t id, void *parg, + dtrace_argdesc_t *desc) +{ + const char *p = NULL; + + switch (desc->dtargd_ndx) { + case 0: + p = "struct vnode *"; + break; + case 1: + p = "struct mbuf *"; + break; + case 2: + p = "struct ucred *"; + break; + case 3: + p = "int"; + break; + case 4: + if (dtnfs23_isdoneprobe(id)) { + p = "int"; + break; + } + /* FALLSTHROUGH */ + default: + desc->dtargd_ndx = DTRACE_ARGNONE; + break; + } + if (p != NULL) + strlcpy(desc->dtargd_native, p, sizeof(desc->dtargd_native)); +} + +static void +dtnfsclient_provide(void *arg, dtrace_probedesc_t *desc) +{ + int i; + + if (desc != NULL) + return; + + /* + * First, register NFSv2 RPC procedures; note sparseness check for + * each slot in the NFSv3 procnum-indexed array. + */ + for (i = 0; i < NFS_NPROCS; i++) { + if (dtnfsclient_rpcs[i].nr_v2_name != NULL && + dtrace_probe_lookup(dtnfsclient_id, + dtnfsclient_v2modulename, dtnfsclient_rpcs[i].nr_v2_name, + dtnfsclient_start) == 0) { + dtnfsclient_rpcs[i].nr_v2_id_start = + dtrace_probe_create(dtnfsclient_id, + dtnfsclient_v2modulename, + dtnfsclient_rpcs[i].nr_v2_name, + dtnfsclient_start, 0, + &nfsclient_nfs2_start_probes[i]); + } + if (dtnfsclient_rpcs[i].nr_v2_name != NULL && + dtrace_probe_lookup(dtnfsclient_id, + dtnfsclient_v2modulename, dtnfsclient_rpcs[i].nr_v2_name, + dtnfsclient_done) == 0) { + dtnfsclient_rpcs[i].nr_v2_id_done = + dtrace_probe_create(dtnfsclient_id, + dtnfsclient_v2modulename, + dtnfsclient_rpcs[i].nr_v2_name, + dtnfsclient_done, 0, + &nfsclient_nfs2_done_probes[i]); + } + } + + /* + * Now, register NFSv3 RPC procedures. + */ + for (i = 0; i < NFS_NPROCS; i++) { + if (dtrace_probe_lookup(dtnfsclient_id, + dtnfsclient_v3modulename, dtnfsclient_rpcs[i].nr_v3_name, + dtnfsclient_start) == 0) { + dtnfsclient_rpcs[i].nr_v3_id_start = + dtrace_probe_create(dtnfsclient_id, + dtnfsclient_v3modulename, + dtnfsclient_rpcs[i].nr_v3_name, + dtnfsclient_start, 0, + &nfsclient_nfs3_start_probes[i]); + } + if (dtrace_probe_lookup(dtnfsclient_id, + dtnfsclient_v3modulename, dtnfsclient_rpcs[i].nr_v3_name, + dtnfsclient_done) == 0) { + dtnfsclient_rpcs[i].nr_v3_id_done = + dtrace_probe_create(dtnfsclient_id, + dtnfsclient_v3modulename, + dtnfsclient_rpcs[i].nr_v3_name, + dtnfsclient_done, 0, + &nfsclient_nfs3_done_probes[i]); + } + } +} + +static void +dtnfsclient_destroy(void *arg, dtrace_id_t id, void *parg) +{ +} + +static void +dtnfsclient_enable(void *arg, dtrace_id_t id, void *parg) +{ + uint32_t *p = parg; + + *p = id; +} + +static void +dtnfsclient_disable(void *arg, dtrace_id_t id, void *parg) +{ + uint32_t *p = parg; + + *p = 0; +} + +static void +dtnfsclient_load(void *dummy) +{ + + if (dtrace_register("nfsclient", &dtnfsclient_attr, + DTRACE_PRIV_USER, NULL, &dtnfsclient_pops, NULL, + &dtnfsclient_id) != 0) + return; + + dtrace_nfsclient_nfs23_start_probe = + (dtrace_nfsclient_nfs23_start_probe_func_t)dtrace_probe; + dtrace_nfsclient_nfs23_done_probe = + (dtrace_nfsclient_nfs23_done_probe_func_t)dtrace_probe; +} + + +static int +dtnfsclient_unload() +{ + int error = 0; + + dtrace_nfsclient_nfs23_start_probe = NULL; + dtrace_nfsclient_nfs23_done_probe = NULL; + + if ((error = dtrace_unregister(dtnfsclient_id)) != 0) + return (error); + + return (error); +} + +static int +dtnfsclient_modevent(module_t mod __unused, int type, void *data __unused) +{ + int error = 0; + + switch (type) { + case MOD_LOAD: + break; + + case MOD_UNLOAD: + break; + + case MOD_SHUTDOWN: + break; + + default: + error = EOPNOTSUPP; + break; + } + + return (error); +} + +SYSINIT(dtnfsclient_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, + dtnfsclient_load, NULL); +SYSUNINIT(dtnfsclient_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, + dtnfsclient_unload, NULL); + +DEV_MODULE(dtnfsclient, dtnfsclient_modevent, NULL); +MODULE_VERSION(dtnfsclient, 1); +MODULE_DEPEND(dtnfsclient, dtrace, 1, 1, 1); +MODULE_DEPEND(dtnfsclient, opensolaris, 1, 1, 1); Modified: head/sys/modules/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/Makefile Sun Mar 22 22:05:22 2009 (r190292) +++ head/sys/modules/dtrace/Makefile Sun Mar 22 22:07:52 2009 (r190293) @@ -4,6 +4,7 @@ .include "Makefile.inc" SUBDIR= dtmalloc \ + dtnfsclient \ dtrace \ dtraceall \ dtrace_test \ Added: head/sys/modules/dtrace/dtnfsclient/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/dtrace/dtnfsclient/Makefile Sun Mar 22 22:07:52 2009 (r190293) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../cddl/dev/dtnfsclient + +KMOD= dtnfsclient +SRCS= dtnfsclient.c +SRCS+= vnode_if.h + +CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \ + -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \ + -I${.CURDIR}/../../.. + +.include Modified: head/sys/modules/dtrace/dtraceall/dtraceall.c ============================================================================== --- head/sys/modules/dtrace/dtraceall/dtraceall.c Sun Mar 22 22:05:22 2009 (r190292) +++ head/sys/modules/dtrace/dtraceall/dtraceall.c Sun Mar 22 22:07:52 2009 (r190293) @@ -65,6 +65,7 @@ MODULE_DEPEND(dtraceall, cyclic, 1, 1, 1 MODULE_DEPEND(dtraceall, opensolaris, 1, 1, 1); MODULE_DEPEND(dtraceall, dtrace, 1, 1, 1); MODULE_DEPEND(dtraceall, dtmalloc, 1, 1, 1); +MODULE_DEPEND(dtraceall, dtnfsclient, 1, 1, 1); #if defined(__amd64__) || defined(__i386__) MODULE_DEPEND(dtraceall, fbt, 1, 1, 1); #endif Modified: head/sys/nfsclient/nfs_krpc.c ============================================================================== --- head/sys/nfsclient/nfs_krpc.c Sun Mar 22 22:05:22 2009 (r190292) +++ head/sys/nfsclient/nfs_krpc.c Sun Mar 22 22:07:52 2009 (r190293) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); */ #include "opt_inet6.h" +#include "opt_kdtrace.h" #include "opt_kgssapi.h" #include @@ -73,6 +74,25 @@ __FBSDID("$FreeBSD$"); #ifndef NFS_LEGACYRPC +#ifdef KDTRACE_HOOKS +#include + +dtrace_nfsclient_nfs23_start_probe_func_t + dtrace_nfsclient_nfs23_start_probe; + +dtrace_nfsclient_nfs23_done_probe_func_t + dtrace_nfsclient_nfs23_done_probe; + +/* + * Registered probes by RPC type. + */ +uint32_t nfsclient_nfs2_start_probes[NFS_NPROCS]; +uint32_t nfsclient_nfs2_done_probes[NFS_NPROCS]; + +uint32_t nfsclient_nfs3_start_probes[NFS_NPROCS]; +uint32_t nfsclient_nfs3_done_probes[NFS_NPROCS]; +#endif + static int nfs_realign_test; static int nfs_realign_count; static int nfs_bufpackets = 4; @@ -468,6 +488,25 @@ nfs_request(struct vnode *vp, struct mbu ext.rc_timers = NULL; } +#ifdef KDTRACE_HOOKS + if (dtrace_nfsclient_nfs23_start_probe != NULL) { + uint32_t probe_id; + int probe_procnum; + + if (nmp->nm_flag & NFSMNT_NFSV3) { + probe_id = nfsclient_nfs3_start_probes[procnum]; + probe_procnum = procnum; + } else { + probe_id = nfsclient_nfs2_start_probes[procnum]; + probe_procnum = (nmp->nm_flag & NFSMNT_NFSV3) ? + procnum : nfsv2_procid[procnum]; + } + if (probe_id != 0) + (dtrace_nfsclient_nfs23_start_probe)(probe_id, vp, + mreq, cred, probe_procnum); + } +#endif + nfsstats.rpcrequests++; tryagain: timo.tv_sec = nmp->nm_timeo / NFS_HZ; @@ -535,6 +574,24 @@ tryagain: goto nfsmout; } +#ifdef KDTRACE_HOOKS + if (dtrace_nfsclient_nfs23_done_probe != NULL) { + uint32_t probe_id; + int probe_procnum; + + if (nmp->nm_flag & NFSMNT_NFSV3) { + probe_id = nfsclient_nfs3_done_probes[procnum]; + probe_procnum = procnum; + } else { + probe_id = nfsclient_nfs2_done_probes[procnum]; + probe_procnum = (nmp->nm_flag & NFSMNT_NFSV3) ? + procnum : nfsv2_procid[procnum]; + } + if (probe_id != 0) + (dtrace_nfsclient_nfs23_done_probe)(probe_id, vp, + mreq, cred, probe_procnum, 0); + } +#endif m_freem(mreq); *mrp = mrep; *mdp = md; @@ -543,6 +600,24 @@ tryagain: return (0); nfsmout: +#ifdef KDTRACE_HOOKS + if (dtrace_nfsclient_nfs23_done_probe != NULL) { + uint32_t probe_id; + int probe_procnum; + + if (nmp->nm_flag & NFSMNT_NFSV3) { + probe_id = nfsclient_nfs3_done_probes[procnum]; + probe_procnum = procnum; + } else { + probe_id = nfsclient_nfs2_done_probes[procnum]; + probe_procnum = (nmp->nm_flag & NFSMNT_NFSV3) ? + procnum : nfsv2_procid[procnum]; + } + if (probe_id != 0) + (dtrace_nfsclient_nfs23_done_probe)(probe_id, vp, + mreq, cred, probe_procnum, error); + } +#endif m_freem(mreq); if (auth) AUTH_DESTROY(auth); Modified: head/sys/sys/dtrace_bsd.h ============================================================================== --- head/sys/sys/dtrace_bsd.h Sun Mar 22 22:05:22 2009 (r190292) +++ head/sys/sys/dtrace_bsd.h Sun Mar 22 22:07:52 2009 (r190293) @@ -32,6 +32,7 @@ #define _SYS_DTRACE_BSD_H /* Forward definitions: */ +struct mbuf; struct trapframe; struct thread; @@ -93,6 +94,17 @@ typedef void (*dtrace_malloc_probe_func_ extern dtrace_malloc_probe_func_t dtrace_malloc_probe; +/* The dtnfsclient provider hooks into the NFS[23] client. */ +typedef void (*dtrace_nfsclient_nfs23_start_probe_func_t)(u_int32_t, + struct vnode *, struct mbuf *, struct ucred *, int); +typedef void (*dtrace_nfsclient_nfs23_done_probe_func_t)(u_int32_t, + struct vnode *, struct mbuf *, struct ucred *, int, int); + +extern dtrace_nfsclient_nfs23_start_probe_func_t + dtrace_nfsclient_nfs23_start_probe; +extern dtrace_nfsclient_nfs23_done_probe_func_t + dtrace_nfsclient_nfs23_done_probe; + /* * Functions which allow the dtrace module to check that the kernel * hooks have been compiled with sufficient space for it's private From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 22:09:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37A81106566C; Sun, 22 Mar 2009 22:09:13 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0CCF58FC25; Sun, 22 Mar 2009 22:09:13 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2MM9C6r085476; Sun, 22 Mar 2009 22:09:12 GMT (envelope-from stefanf@svn.freebsd.org) Received: (from stefanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MM9Cuk085475; Sun, 22 Mar 2009 22:09:12 GMT (envelope-from stefanf@svn.freebsd.org) Message-Id: <200903222209.n2MM9Cuk085475@svn.freebsd.org> From: Stefan Farfeleder Date: Sun, 22 Mar 2009 22:09:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190295 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 22:09:14 -0000 Author: stefanf Date: Sun Mar 22 22:09:12 2009 New Revision: 190295 URL: http://svn.freebsd.org/changeset/base/190295 Log: Improve the IFS handling of the read built-in. Obtained from: NetBSD Submitted by: Jilles Tjoelker Modified: head/bin/sh/miscbltin.c Modified: head/bin/sh/miscbltin.c ============================================================================== --- head/bin/sh/miscbltin.c Sun Mar 22 22:08:30 2009 (r190294) +++ head/bin/sh/miscbltin.c Sun Mar 22 22:09:12 2009 (r190295) @@ -73,6 +73,16 @@ int ulimitcmd(int, char **); * ordinary characters. * * This uses unbuffered input, which may be avoidable in some cases. + * + * Note that if IFS=' :' then read x y should work so that: + * 'a b' x='a', y='b' + * ' a b ' x='a', y='b' + * ':b' x='', y='b' + * ':' x='', y='' + * '::' x='', y='' + * ': :' x='', y='' + * ':::' x='', y='::' + * ':b c:' x='', y='b c:' */ int @@ -88,6 +98,8 @@ readcmd(int argc __unused, char **argv _ int startword; int status; int i; + int is_ifs; + int saveall = 0; struct timeval tv; char *tvptr; fd_set ifds; @@ -167,7 +179,7 @@ readcmd(int argc __unused, char **argv _ } status = 0; - startword = 1; + startword = 2; backslash = 0; STARTSTACKSTR(p); for (;;) { @@ -189,22 +201,68 @@ readcmd(int argc __unused, char **argv _ } if (c == '\n') break; - if (startword && *ifs == ' ' && strchr(ifs, c)) { + if (strchr(ifs, c)) + is_ifs = strchr(" \t\n", c) ? 1 : 2; + else + is_ifs = 0; + + if (startword != 0) { + if (is_ifs == 1) { + /* Ignore leading IFS whitespace */ + if (saveall) + STPUTC(c, p); + continue; + } + if (is_ifs == 2 && startword == 1) { + /* Only one non-whitespace IFS per word */ + startword = 2; + if (saveall) + STPUTC(c, p); + continue; + } + } + + if (is_ifs == 0) { + /* append this character to the current variable */ + startword = 0; + if (saveall) + /* Not just a spare terminator */ + saveall++; + STPUTC(c, p); continue; } - startword = 0; - if (ap[1] != NULL && strchr(ifs, c) != NULL) { - STACKSTRNUL(p); - setvar(*ap, stackblock(), 0); - ap++; - startword = 1; - STARTSTACKSTR(p); - } else { + + /* end of variable... */ + startword = is_ifs; + + if (ap[1] == NULL) { + /* Last variable needs all IFS chars */ + saveall++; STPUTC(c, p); + continue; } + + STACKSTRNUL(p); + setvar(*ap, stackblock(), 0); + ap++; + STARTSTACKSTR(p); } STACKSTRNUL(p); + + /* Remove trailing IFS chars */ + for (; stackblock() <= --p; *p = 0) { + if (!strchr(ifs, *p)) + break; + if (strchr(" \t\n", *p)) + /* Always remove whitespace */ + continue; + if (saveall > 1) + /* Don't remove non-whitespace unless it was naked */ + break; + } setvar(*ap, stackblock(), 0); + + /* Set any remaining args to "" */ while (*++ap != NULL) setvar(*ap, nullstr, 0); return status; From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 22:14:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFF091065672; Sun, 22 Mar 2009 22:14:46 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A40E58FC19; Sun, 22 Mar 2009 22:14:46 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2MMEkll085728; Sun, 22 Mar 2009 22:14:46 GMT (envelope-from stefanf@svn.freebsd.org) Received: (from stefanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MMEkfW085726; Sun, 22 Mar 2009 22:14:46 GMT (envelope-from stefanf@svn.freebsd.org) Message-Id: <200903222214.n2MMEkfW085726@svn.freebsd.org> From: Stefan Farfeleder Date: Sun, 22 Mar 2009 22:14:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190296 - head/tools/regression/bin/sh/builtins X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 22:14:47 -0000 Author: stefanf Date: Sun Mar 22 22:14:46 2009 New Revision: 190296 URL: http://svn.freebsd.org/changeset/base/190296 Log: Add a few tests for the read built-in. Added: head/tools/regression/bin/sh/builtins/read1.0 (contents, props changed) head/tools/regression/bin/sh/builtins/read1.0.stdout (contents, props changed) Added: head/tools/regression/bin/sh/builtins/read1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/read1.0 Sun Mar 22 22:14:46 2009 (r190296) @@ -0,0 +1,25 @@ +# $FreeBSD$ +set -e + +echo "1 2 3" | { read a; echo "x${a}x"; } +echo "1 2 3" | { read a b; echo "x${a}x${b}x"; } +echo "1 2 3" | { read a b c; echo "x${a}x${b}x${c}x"; } +echo "1 2 3" | { read a b c d; echo "x${a}x${b}x${c}x${d}x"; } + +echo " 1 2 3 " | { read a b c; echo "x${a}x${b}x${c}x"; } +echo " 1 2 3 " | { IFS=$(printf ' \t\n') read a b c; echo "x${a}x${b}x${c}x"; } +echo " 1 2 3 " | { IFS= read a b; echo "x${a}x${b}x"; } + +echo " 1,2 3 " | { IFS=' ,' read a b c; echo "x${a}x${b}x${c}x"; } +echo ", 2 ,3" | { IFS=' ,' read a b c; echo "x${a}x${b}x${c}x"; } +echo " 1 ,,3" | { IFS=' ,' read a b c; echo "x${a}x${b}x${c}x"; } +echo " 1 , , 3" | { IFS=' ,' read a b c; echo "x${a}x${b}x${c}x"; } +echo " 1 ,2 3," | { IFS=' ,' read a b c; echo "x${a}x${b}x${c}x"; } +echo " 1 ,2 3,," | { IFS=' ,' read a b c; echo "x${a}x${b}x${c}x"; } + +echo " 1,2 3 " | { IFS=', ' read a b c; echo "x${a}x${b}x${c}x"; } +echo ", 2 ,3" | { IFS=', ' read a b c; echo "x${a}x${b}x${c}x"; } +echo " 1 ,,3" | { IFS=', ' read a b c; echo "x${a}x${b}x${c}x"; } +echo " 1 , , 3" | { IFS=', ' read a b c; echo "x${a}x${b}x${c}x"; } +echo " 1 ,2 3," | { IFS=', ' read a b c; echo "x${a}x${b}x${c}x"; } +echo " 1 ,2 3,," | { IFS=', ' read a b c; echo "x${a}x${b}x${c}x"; } Added: head/tools/regression/bin/sh/builtins/read1.0.stdout ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/read1.0.stdout Sun Mar 22 22:14:46 2009 (r190296) @@ -0,0 +1,19 @@ +x1 2 3x +x1x2 3x +x1x2x3x +x1x2x3xx +x1x2x3x +x1x2x3x +x 1 2 3 xx +x1x2x3x +xx2x3x +x1xx3x +x1xx3x +x1x2x3x +x1x2x3,,x +x1x2x3x +xx2x3x +x1xx3x +x1xx3x +x1x2x3x +x1x2x3,,x From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 22:15:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E2621065674; Sun, 22 Mar 2009 22:15:48 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 692448FC16; Sun, 22 Mar 2009 22:15:48 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 2241E46B6C; Sun, 22 Mar 2009 18:15:48 -0400 (EDT) Date: Sun, 22 Mar 2009 22:15:48 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <200903222207.n2MM7qK3085361@svn.freebsd.org> Message-ID: References: <200903222207.n2MM7qK3085361@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Subject: Re: svn commit: r190293 - in head/sys: cddl/dev/dtnfsclient modules/dtrace modules/dtrace/dtnfsclient modules/dtrace/dtraceall nfsclient sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 22:15:49 -0000 On Sun, 22 Mar 2009, Robert Watson wrote: > Add dtnfsclient, a first cut at an NFSv2/v3 client reuest DTrace > provider. The NFS client exposes 'start' and 'done' probes for NFSv2 > and NFSv3 RPCs when using the new RPC implementation, passing in the > vnode, mbuf chain, credential, and NFSv2 or NFSv3 procedure number. > For 'done' probes, the error number is also available. > > Probes are named in the following way: > > ... > nfsclient:nfs2:write:start > nfsclient:nfs2:write:done > ... > nfsclient:nfs3:access:start > nfsclient:nfs3:access:done > ... > An example script to profile time spent waiting on NFS RPCs in NFSv3 by system call: syscall:::entry { self->count = 0; } nfsclient:nfs3::start { self->timestamp = timestamp; } nfsclient:nfs3::done { self->count += (timestamp - self->timestamp); } syscall:::return /self->count != 0/ { @syscalls[probefunc] = quantize(self->count); } The script could easily be expanded to look at RPC delays associated with page faults, etc. Something Solaris does in their prototype DTrace server probes is summarize network information for the remote host (local + remote address) and provide a pathname for the vnode being accessed (if available). It would be easy to do something along those lines here, although when I glanced at a recent opensolaris tree it looked like their server probes hadn't made it back into hg yet. However, it would be easy to imagine one or both of these behaviors here being very useful (summarize I/O by pathname, latency by server, etc), which would currently require DTrace scripts to grub around a lot. Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 22:57:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F7FA1065674; Sun, 22 Mar 2009 22:57:54 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F21E98FC0C; Sun, 22 Mar 2009 22:57:53 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2MMvr22086693; Sun, 22 Mar 2009 22:57:53 GMT (envelope-from stefanf@svn.freebsd.org) Received: (from stefanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MMvreF086692; Sun, 22 Mar 2009 22:57:53 GMT (envelope-from stefanf@svn.freebsd.org) Message-Id: <200903222257.n2MMvreF086692@svn.freebsd.org> From: Stefan Farfeleder Date: Sun, 22 Mar 2009 22:57:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190298 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 22:57:54 -0000 Author: stefanf Date: Sun Mar 22 22:57:53 2009 New Revision: 190298 URL: http://svn.freebsd.org/changeset/base/190298 Log: Fix the behaviour of the read built-in when IFS is unset. Obtained from: NetBSD Modified: head/bin/sh/miscbltin.c Modified: head/bin/sh/miscbltin.c ============================================================================== --- head/bin/sh/miscbltin.c Sun Mar 22 22:19:54 2009 (r190297) +++ head/bin/sh/miscbltin.c Sun Mar 22 22:57:53 2009 (r190298) @@ -147,7 +147,7 @@ readcmd(int argc __unused, char **argv _ if (*(ap = argptr) == NULL) error("arg count"); if ((ifs = bltinlookup("IFS", 1)) == NULL) - ifs = nullstr; + ifs = " \t\n"; if (tv.tv_sec >= 0) { /* From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 23:00:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26523106566C; Sun, 22 Mar 2009 23:00:53 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 148548FC16; Sun, 22 Mar 2009 23:00:53 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2MN0qbU086850; Sun, 22 Mar 2009 23:00:52 GMT (envelope-from stefanf@svn.freebsd.org) Received: (from stefanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MN0qlW086848; Sun, 22 Mar 2009 23:00:52 GMT (envelope-from stefanf@svn.freebsd.org) Message-Id: <200903222300.n2MN0qlW086848@svn.freebsd.org> From: Stefan Farfeleder Date: Sun, 22 Mar 2009 23:00:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190300 - head/tools/regression/bin/sh/builtins X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 23:00:53 -0000 Author: stefanf Date: Sun Mar 22 23:00:52 2009 New Revision: 190300 URL: http://svn.freebsd.org/changeset/base/190300 Log: Test the r190298 change. Modified: head/tools/regression/bin/sh/builtins/read1.0 head/tools/regression/bin/sh/builtins/read1.0.stdout Modified: head/tools/regression/bin/sh/builtins/read1.0 ============================================================================== --- head/tools/regression/bin/sh/builtins/read1.0 Sun Mar 22 23:00:00 2009 (r190299) +++ head/tools/regression/bin/sh/builtins/read1.0 Sun Mar 22 23:00:52 2009 (r190300) @@ -7,6 +7,7 @@ echo "1 2 3" | { read a b c; echo "x${a echo "1 2 3" | { read a b c d; echo "x${a}x${b}x${c}x${d}x"; } echo " 1 2 3 " | { read a b c; echo "x${a}x${b}x${c}x"; } +echo " 1 2 3 " | { unset IFS; read a b c; echo "x${a}x${b}x${c}x"; } echo " 1 2 3 " | { IFS=$(printf ' \t\n') read a b c; echo "x${a}x${b}x${c}x"; } echo " 1 2 3 " | { IFS= read a b; echo "x${a}x${b}x"; } Modified: head/tools/regression/bin/sh/builtins/read1.0.stdout ============================================================================== --- head/tools/regression/bin/sh/builtins/read1.0.stdout Sun Mar 22 23:00:00 2009 (r190299) +++ head/tools/regression/bin/sh/builtins/read1.0.stdout Sun Mar 22 23:00:52 2009 (r190300) @@ -4,6 +4,7 @@ x1x2x3x x1x2x3xx x1x2x3x x1x2x3x +x1x2x3x x 1 2 3 xx x1x2x3x xx2x3x From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 00:00:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BF45106566C; Mon, 23 Mar 2009 00:00:51 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ACC5A8FC0A; Mon, 23 Mar 2009 00:00:50 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2N00oaS088178; Mon, 23 Mar 2009 00:00:50 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2N00o2w088176; Mon, 23 Mar 2009 00:00:50 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200903230000.n2N00o2w088176@svn.freebsd.org> From: Colin Percival Date: Mon, 23 Mar 2009 00:00:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190301 - head/sys/kern releng/7.0 releng/7.0/sys/conf releng/7.0/sys/kern releng/7.1 releng/7.1/sys/conf releng/7.1/sys/kern stable/7/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 00:00:51 -0000 Author: cperciva Date: Mon Mar 23 00:00:50 2009 New Revision: 190301 URL: http://svn.freebsd.org/changeset/base/190301 Log: Correctly sanity-check timer IDs. [SA-09:06] Limit the size of malloced buffer when dumping environment variables. [EN-09:01] Approved by: so (cperciva) Approved by: re (kensmith) Security: FreeBSD-SA-09:06.ktimer Errata: FreeBSD-EN-09:01.kenv Modified: head/sys/kern/kern_environment.c head/sys/kern/kern_time.c Changes in other areas also in this revision: Modified: releng/7.0/UPDATING releng/7.0/sys/conf/newvers.sh releng/7.0/sys/kern/kern_environment.c releng/7.0/sys/kern/kern_time.c releng/7.1/UPDATING releng/7.1/sys/conf/newvers.sh releng/7.1/sys/kern/kern_environment.c releng/7.1/sys/kern/kern_time.c stable/7/sys/kern/kern_environment.c stable/7/sys/kern/kern_time.c Modified: head/sys/kern/kern_environment.c ============================================================================== --- head/sys/kern/kern_environment.c Sun Mar 22 23:00:52 2009 (r190300) +++ head/sys/kern/kern_environment.c Mon Mar 23 00:00:50 2009 (r190301) @@ -87,7 +87,7 @@ kenv(td, uap) } */ *uap; { char *name, *value, *buffer = NULL; - size_t len, done, needed; + size_t len, done, needed, buflen; int error, i; KASSERT(dynamic_kenv, ("kenv: dynamic_kenv = 0")); @@ -100,13 +100,17 @@ kenv(td, uap) return (error); #endif done = needed = 0; + buflen = uap->len; + if (buflen > KENV_SIZE * (KENV_MNAMELEN + KENV_MVALLEN + 2)) + buflen = KENV_SIZE * (KENV_MNAMELEN + + KENV_MVALLEN + 2); if (uap->len > 0 && uap->value != NULL) - buffer = malloc(uap->len, M_TEMP, M_WAITOK|M_ZERO); + buffer = malloc(buflen, M_TEMP, M_WAITOK|M_ZERO); mtx_lock(&kenv_lock); for (i = 0; kenvp[i] != NULL; i++) { len = strlen(kenvp[i]) + 1; needed += len; - len = min(len, uap->len - done); + len = min(len, buflen - done); /* * If called with a NULL or insufficiently large * buffer, just keep computing the required size. Modified: head/sys/kern/kern_time.c ============================================================================== --- head/sys/kern/kern_time.c Sun Mar 22 23:00:52 2009 (r190300) +++ head/sys/kern/kern_time.c Mon Mar 23 00:00:50 2009 (r190301) @@ -1085,7 +1085,8 @@ itimer_find(struct proc *p, int timerid) struct itimer *it; PROC_LOCK_ASSERT(p, MA_OWNED); - if ((p->p_itimers == NULL) || (timerid >= TIMER_MAX) || + if ((p->p_itimers == NULL) || + (timerid < 0) || (timerid >= TIMER_MAX) || (it = p->p_itimers->its_timers[timerid]) == NULL) { return (NULL); } From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 00:27:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B12F10657F4; Mon, 23 Mar 2009 00:27:47 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27FE68FC0C; Mon, 23 Mar 2009 00:27:47 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2N0RlRq088808; Mon, 23 Mar 2009 00:27:47 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2N0Rlbs088807; Mon, 23 Mar 2009 00:27:47 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903230027.n2N0Rlbs088807@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 23 Mar 2009 00:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190303 - head/sys/dev/age X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 00:27:49 -0000 Author: yongari Date: Mon Mar 23 00:27:46 2009 New Revision: 190303 URL: http://svn.freebsd.org/changeset/base/190303 Log: Fix inversed logic. pci_find_extcap() returns 0 when it finds specified capability. Modified: head/sys/dev/age/if_age.c Modified: head/sys/dev/age/if_age.c ============================================================================== --- head/sys/dev/age/if_age.c Mon Mar 23 00:15:38 2009 (r190302) +++ head/sys/dev/age/if_age.c Mon Mar 23 00:27:46 2009 (r190303) @@ -1369,7 +1369,7 @@ age_setwol(struct age_softc *sc) AGE_LOCK_ASSERT(sc); - if (pci_find_extcap(sc->age_dev, PCIY_PMG, &pmc) == 0) { + if (pci_find_extcap(sc->age_dev, PCIY_PMG, &pmc) != 0) { CSR_WRITE_4(sc, AGE_WOL_CFG, 0); /* * No PME capability, PHY power down. From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 00:40:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22FCE106573A; Mon, 23 Mar 2009 00:40:08 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 957298FC1A; Mon, 23 Mar 2009 00:40:07 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2N0e7Es089074; Mon, 23 Mar 2009 00:40:07 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2N0e7t7089073; Mon, 23 Mar 2009 00:40:07 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <200903230040.n2N0e7t7089073@svn.freebsd.org> From: Gregory Neil Shapiro Date: Mon, 23 Mar 2009 00:40:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190304 - head/etc/mail X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 00:40:11 -0000 Author: gshapiro Date: Mon Mar 23 00:40:07 2009 New Revision: 190304 URL: http://svn.freebsd.org/changeset/base/190304 Log: Add the URL for RFC2142 PR: conf/127510 Modified: head/etc/mail/aliases Modified: head/etc/mail/aliases ============================================================================== --- head/etc/mail/aliases Mon Mar 23 00:27:46 2009 (r190303) +++ head/etc/mail/aliases Mon Mar 23 00:40:07 2009 (r190304) @@ -11,6 +11,7 @@ # # See also RFC 2142, `MAILBOX NAMES FOR COMMON SERVICES, ROLES # AND FUNCTIONS', May 1997 +# http://tools.ietf.org/html/rfc2142 # Pretty much everything else in this file points to "root", so # you would do well in either reading root's mailbox or forwarding From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 01:13:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44487106566B; Mon, 23 Mar 2009 01:13:35 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 329648FC12; Mon, 23 Mar 2009 01:13:35 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2N1DY2N089920; Mon, 23 Mar 2009 01:13:34 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2N1DYaR089919; Mon, 23 Mar 2009 01:13:34 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <200903230113.n2N1DYaR089919@svn.freebsd.org> From: Alexander Kabaev Date: Mon, 23 Mar 2009 01:13:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190305 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 01:13:35 -0000 Author: kan Date: Mon Mar 23 01:13:34 2009 New Revision: 190305 URL: http://svn.freebsd.org/changeset/base/190305 Log: Add safety check that does not allow empty strings to be queued to the devctl notification queue. Empty strings cause devctl read call to return 0 and result in devd exiting prematurely. The actual offender (ugen notes for root hubs) will be fixed by separate commit. Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Mon Mar 23 00:40:07 2009 (r190304) +++ head/sys/kern/subr_bus.c Mon Mar 23 01:13:34 2009 (r190305) @@ -532,6 +532,12 @@ devctl_queue_data(char *data) struct dev_event_info *n1 = NULL; struct proc *p; + /* + * Do not allow empty strings to be queued, as they + * cause devd to exit prematurely. + */ + if (strlen(data) == 0) + return; n1 = malloc(sizeof(*n1), M_BUS, M_NOWAIT); if (n1 == NULL) return; From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 01:24:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76A751065672; Mon, 23 Mar 2009 01:24:17 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 646BE8FC16; Mon, 23 Mar 2009 01:24:17 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2N1OHX7090146; Mon, 23 Mar 2009 01:24:17 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2N1OHpo090145; Mon, 23 Mar 2009 01:24:17 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <200903230124.n2N1OHpo090145@svn.freebsd.org> From: Alexander Kabaev Date: Mon, 23 Mar 2009 01:24:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190306 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 01:24:18 -0000 Author: kan Date: Mon Mar 23 01:24:17 2009 New Revision: 190306 URL: http://svn.freebsd.org/changeset/base/190306 Log: Do not pass uninitialized data buffer to devctl_queue_data function. This was botched in revision 190191. Modified: head/sys/dev/usb/usb_device.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Mon Mar 23 01:13:34 2009 (r190305) +++ head/sys/dev/usb/usb_device.c Mon Mar 23 01:24:17 2009 (r190306) @@ -2265,35 +2265,34 @@ usb2_notify_addq(const char *type, struc return; /* String it all together. */ - if (udev->parent_hub) { - snprintf(data, 1024, - "%s" - "%s " - "vendor=0x%04x " - "product=0x%04x " - "devclass=0x%02x " - "devsubclass=0x%02x " - "sernum=\"%s\" " - "at " - "port=%u " - "on " - "%s\n", - type, - udev->ugen_name, - UGETW(udev->ddesc.idVendor), - UGETW(udev->ddesc.idProduct), - udev->ddesc.bDeviceClass, - udev->ddesc.bDeviceSubClass, + snprintf(data, 1024, + "%s" + "%s " + "vendor=0x%04x " + "product=0x%04x " + "devclass=0x%02x " + "devsubclass=0x%02x " + "sernum=\"%s\" " + "at " + "port=%u " + "on " + "%s\n", + type, + udev->ugen_name, + UGETW(udev->ddesc.idVendor), + UGETW(udev->ddesc.idProduct), + udev->ddesc.bDeviceClass, + udev->ddesc.bDeviceSubClass, #if USB_HAVE_STRINGS - udev->serial, + udev->serial, #else - "", + "", #endif - udev->port_no, - udev->parent_hub != NULL ? - udev->parent_hub->ugen_name : - device_get_nameunit(device_get_parent(udev->bus->bdev))); - } + udev->port_no, + udev->parent_hub != NULL ? + udev->parent_hub->ugen_name : + device_get_nameunit(device_get_parent(udev->bus->bdev))); + devctl_queue_data(data); } From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 05:46:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19C3F1065672; Mon, 23 Mar 2009 05:46:29 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 078E48FC12; Mon, 23 Mar 2009 05:46:29 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2N5kSnL095844; Mon, 23 Mar 2009 05:46:28 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2N5kSJM095843; Mon, 23 Mar 2009 05:46:28 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903230546.n2N5kSJM095843@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 23 Mar 2009 05:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190314 - head/sys/dev/msk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 05:46:29 -0000 Author: yongari Date: Mon Mar 23 05:46:28 2009 New Revision: 190314 URL: http://svn.freebsd.org/changeset/base/190314 Log: Togging ALLMULTI does not require controller reset so have Rx filtering handle this. Introduce a new function msk_rxfilter that handles Rx filter configuration and multicast setup as well as promiscuous mode. This simplifies code a lot. Promiscuous mode always have preference to any other Rx filtering so don't disable the mode when ALLMULTI is set. Modified: head/sys/dev/msk/if_msk.c Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Mon Mar 23 04:56:33 2009 (r190313) +++ head/sys/dev/msk/if_msk.c Mon Mar 23 05:46:28 2009 (r190314) @@ -287,9 +287,8 @@ static int msk_miibus_writereg(device_t, static void msk_miibus_statchg(device_t); static void msk_link_task(void *, int); -static void msk_setmulti(struct msk_if_softc *); +static void msk_rxfilter(struct msk_if_softc *); static void msk_setvlan(struct msk_if_softc *, struct ifnet *); -static void msk_setpromisc(struct msk_if_softc *); static void msk_stats_clear(struct msk_if_softc *); static void msk_stats_update(struct msk_if_softc *); @@ -560,7 +559,7 @@ msk_link_task(void *arg, int pending) } static void -msk_setmulti(struct msk_if_softc *sc_if) +msk_rxfilter(struct msk_if_softc *sc_if) { struct msk_softc *sc; struct ifnet *ifp; @@ -577,15 +576,14 @@ msk_setmulti(struct msk_if_softc *sc_if) bzero(mchash, sizeof(mchash)); mode = GMAC_READ_2(sc, sc_if->msk_port, GM_RX_CTRL); - mode |= GM_RXCR_UCF_ENA; - if ((ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) != 0) { - if ((ifp->if_flags & IFF_PROMISC) != 0) - mode &= ~(GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA); - else if ((ifp->if_flags & IFF_ALLMULTI) != 0) { - mchash[0] = 0xffff; - mchash[1] = 0xffff; - } + if ((ifp->if_flags & IFF_PROMISC) != 0) + mode &= ~(GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA); + else if ((ifp->if_flags & IFF_ALLMULTI) != 0) { + mode |= GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA; + mchash[0] = 0xffff; + mchash[1] = 0xffff; } else { + mode |= GM_RXCR_UCF_ENA; IF_ADDR_LOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -598,7 +596,8 @@ msk_setmulti(struct msk_if_softc *sc_if) mchash[crc >> 5] |= 1 << (crc & 0x1f); } IF_ADDR_UNLOCK(ifp); - mode |= GM_RXCR_MCF_ENA; + if (mchash[0] != 0 || mchash[1] != 0) + mode |= GM_RXCR_MCF_ENA; } GMAC_WRITE_2(sc, sc_if->msk_port, GM_MC_ADDR_H1, @@ -631,26 +630,6 @@ msk_setvlan(struct msk_if_softc *sc_if, } } -static void -msk_setpromisc(struct msk_if_softc *sc_if) -{ - struct msk_softc *sc; - struct ifnet *ifp; - uint16_t mode; - - MSK_IF_LOCK_ASSERT(sc_if); - - sc = sc_if->msk_softc; - ifp = sc_if->msk_ifp; - - mode = GMAC_READ_2(sc, sc_if->msk_port, GM_RX_CTRL); - if (ifp->if_flags & IFF_PROMISC) - mode &= ~(GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA); - else - mode |= (GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA); - GMAC_WRITE_2(sc, sc_if->msk_port, GM_RX_CTRL, mode); -} - static int msk_init_rx_ring(struct msk_if_softc *sc_if) { @@ -954,10 +933,8 @@ msk_ioctl(struct ifnet *ifp, u_long comm if ((ifp->if_flags & IFF_UP) != 0) { if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { if (((ifp->if_flags ^ sc_if->msk_if_flags) - & IFF_PROMISC) != 0) { - msk_setpromisc(sc_if); - msk_setmulti(sc_if); - } + & (IFF_PROMISC | IFF_ALLMULTI)) != 0) + msk_rxfilter(sc_if); } else { if (sc_if->msk_detach == 0) msk_init_locked(sc_if); @@ -973,7 +950,7 @@ msk_ioctl(struct ifnet *ifp, u_long comm case SIOCDELMULTI: MSK_IF_LOCK(sc_if); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) - msk_setmulti(sc_if); + msk_rxfilter(sc_if); MSK_IF_UNLOCK(sc_if); break; case SIOCGIFMEDIA: @@ -3594,11 +3571,8 @@ msk_init_locked(struct msk_if_softc *sc_ CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_CTRL_T), GMF_OPER_ON | GMF_RX_F_FL_ON); - /* Set promiscuous mode. */ - msk_setpromisc(sc_if); - - /* Set multicast filter. */ - msk_setmulti(sc_if); + /* Set receive filter. */ + msk_rxfilter(sc_if); /* Flush Rx MAC FIFO on any flow control or error. */ CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_FL_MSK), From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 11:07:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 803BD1065670; Mon, 23 Mar 2009 11:07:34 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61FA68FC08; Mon, 23 Mar 2009 11:07:34 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2NB7Yns007568; Mon, 23 Mar 2009 11:07:34 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NB7YAx007567; Mon, 23 Mar 2009 11:07:34 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200903231107.n2NB7YAx007567@svn.freebsd.org> From: Poul-Henning Kamp Date: Mon, 23 Mar 2009 11:07:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190317 - head/sbin/recoverdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 11:07:37 -0000 Author: phk Date: Mon Mar 23 11:07:34 2009 New Revision: 190317 URL: http://svn.freebsd.org/changeset/base/190317 Log: Save (empty) worklist at successful completion Modified: head/sbin/recoverdisk/recoverdisk.c Modified: head/sbin/recoverdisk/recoverdisk.c ============================================================================== --- head/sbin/recoverdisk/recoverdisk.c Mon Mar 23 09:00:33 2009 (r190316) +++ head/sbin/recoverdisk/recoverdisk.c Mon Mar 23 11:07:34 2009 (r190317) @@ -306,6 +306,7 @@ main(int argc, char * const argv[]) free(lp); } PRINT_STATUS(start, i, len, state, d, t); + save_worklist(); printf("\nCompleted\n"); return (0); } From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 14:36:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23C83106567A; Mon, 23 Mar 2009 14:36:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 118F18FC16; Mon, 23 Mar 2009 14:36:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2NEao72012047; Mon, 23 Mar 2009 14:36:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NEao58012045; Mon, 23 Mar 2009 14:36:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903231436.n2NEao58012045@svn.freebsd.org> From: Marius Strobl Date: Mon, 23 Mar 2009 14:36:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190319 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 14:36:51 -0000 Author: marius Date: Mon Mar 23 14:36:50 2009 New Revision: 190319 URL: http://svn.freebsd.org/changeset/base/190319 Log: - Ensure that INTx isn't disabled, as these chips apparently have a quirk requiring it to be enabled even when using MSI. This makes the latter work again after r189285. - Remove a comment which no longer applies since r190194. Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Mon Mar 23 12:07:29 2009 (r190318) +++ head/sys/dev/bge/if_bge.c Mon Mar 23 14:36:50 2009 (r190319) @@ -1295,8 +1295,7 @@ bge_stop_fw(sc) } /* - * Do endian, PCI and DMA initialization. Also check the on-board ROM - * self-test results. + * Do endian, PCI and DMA initialization. */ static int bge_chipinit(struct bge_softc *sc) @@ -1404,9 +1403,11 @@ bge_chipinit(struct bge_softc *sc) /* * Disable memory write invalidate. Apparently it is not supported - * properly by these devices. + * properly by these devices. Also ensure that INTx isn't disabled, + * as these chips need it even when using MSI. */ - PCI_CLRBIT(sc->bge_dev, BGE_PCI_CMD, PCIM_CMD_MWIEN, 4); + PCI_CLRBIT(sc->bge_dev, BGE_PCI_CMD, + PCIM_CMD_INTxDIS | PCIM_CMD_MWIEN, 4); /* Set the timer prescaler (always 66Mhz) */ CSR_WRITE_4(sc, BGE_MISC_CFG, BGE_32BITTIME_66MHZ); Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Mon Mar 23 12:07:29 2009 (r190318) +++ head/sys/dev/bge/if_bgereg.h Mon Mar 23 14:36:50 2009 (r190319) @@ -404,6 +404,9 @@ #ifndef PCIM_CMD_MWIEN #define PCIM_CMD_MWIEN 0x0010 #endif +#ifndef PCIM_CMD_INTxDIS +#define PCIM_CMD_INTxDIS 0x0400 +#endif /* * High priority mailbox registers From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 14:42:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB6F7106566C; Mon, 23 Mar 2009 14:42:41 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F4E48FC1E; Mon, 23 Mar 2009 14:42:41 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2NEgfPo012194; Mon, 23 Mar 2009 14:42:41 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NEgfSk012192; Mon, 23 Mar 2009 14:42:41 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200903231442.n2NEgfSk012192@svn.freebsd.org> From: Doug Barton Date: Mon, 23 Mar 2009 14:42:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190320 - head/usr.sbin/mergemaster X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 14:42:42 -0000 Author: dougb Date: Mon Mar 23 14:42:41 2009 New Revision: 190320 URL: http://svn.freebsd.org/changeset/base/190320 Log: Don't tempt svn to expand the example $FreeBSD strings Modified: head/usr.sbin/mergemaster/mergemaster.8 head/usr.sbin/mergemaster/mergemaster.sh Modified: head/usr.sbin/mergemaster/mergemaster.8 ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.8 Mon Mar 23 14:36:50 2009 (r190319) +++ head/usr.sbin/mergemaster/mergemaster.8 Mon Mar 23 14:42:41 2009 (r190320) @@ -82,7 +82,7 @@ merge by hand later. By default it creates the temporary root in .Pa /var/tmp/temproot and compares the -Version Control System (VCS) Id strings ($FreeBSD$) +Version Control System (VCS) Id strings ($FreeBSD) for files that have them, deleting the temporary file if the strings match. If there is @@ -216,7 +216,7 @@ Compares only files known to be essentia including .Pa /etc/make.conf . .It Fl F -If the files differ only by VCS Id ($FreeBSD$) +If the files differ only by VCS Id ($FreeBSD) install the new file. .It Fl C After a standard @@ -338,7 +338,7 @@ with all values commented out: # Type of diff, such as unified, context, etc. #DIFF_FLAG='-u' # -# Install the new file if it differs only by VCS Id ($FreeBSD$) +# Install the new file if it differs only by VCS Id ($FreeBSD) #FREEBSD_ID= # # Verbose mode includes more details and additional checks Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Mon Mar 23 14:36:50 2009 (r190319) +++ head/usr.sbin/mergemaster/mergemaster.sh Mon Mar 23 14:42:41 2009 (r190320) @@ -26,7 +26,7 @@ display_usage () { echo " -h Display more complete help" echo ' -i Automatically install files that do not exist in destination directory' echo ' -p Pre-buildworld mode, only compares crucial files' - echo ' -F Install files that differ only by revision control Id ($FreeBSD$)' + echo ' -F Install files that differ only by revision control Id ($FreeBSD)' echo ' -C Compare local rc.conf variables to the defaults' echo ' -P Preserve files that are overwritten' echo " -U Attempt to auto upgrade files that have not been user modified" From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 16:20:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6876106566C; Mon, 23 Mar 2009 16:20:39 +0000 (UTC) (envelope-from vanhu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92CD38FC0C; Mon, 23 Mar 2009 16:20:39 +0000 (UTC) (envelope-from vanhu@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2NGKddB014397; Mon, 23 Mar 2009 16:20:39 GMT (envelope-from vanhu@svn.freebsd.org) Received: (from vanhu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NGKdfg014396; Mon, 23 Mar 2009 16:20:39 GMT (envelope-from vanhu@svn.freebsd.org) Message-Id: <200903231620.n2NGKdfg014396@svn.freebsd.org> From: VANHULLEBUS Yvan Date: Mon, 23 Mar 2009 16:20:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190323 - head/sys/netipsec X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 16:20:40 -0000 Author: vanhu Date: Mon Mar 23 16:20:39 2009 New Revision: 190323 URL: http://svn.freebsd.org/changeset/base/190323 Log: Fixed comments so it stays in 80 chars by line with hard tabs of 8 chars.... Approved by: gnn(mentor) Modified: head/sys/netipsec/key.c Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Mon Mar 23 14:54:01 2009 (r190322) +++ head/sys/netipsec/key.c Mon Mar 23 16:20:39 2009 (r190323) @@ -4162,11 +4162,15 @@ key_flush_sad(time_t now) now - sav->created > sav->lft_s->addtime) { key_sa_chgstate(sav, SADB_SASTATE_DYING); /* - * Actually, only send expire message if SA has been used, as it - * was done before, but should we always send such message, and let IKE - * daemon decide if it should be renegotiated or not ? - * XXX expire message will actually NOT be sent if SA is only used - * after soft lifetime has been reached, see below (DYING state) + * Actually, only send expire message if + * SA has been used, as it was done before, + * but should we always send such message, + * and let IKE daemon decide if it should be + * renegotiated or not ? + * XXX expire message will actually NOT be + * sent if SA is only used after soft + * lifetime has been reached, see below + * (DYING state) */ if (sav->lft_c->usetime != 0) key_expire(sav); From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 16:49:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FFB4106564A; Mon, 23 Mar 2009 16:49:00 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D6D08FC14; Mon, 23 Mar 2009 16:49:00 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2NGn0D0014997; Mon, 23 Mar 2009 16:49:00 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NGn0fY014995; Mon, 23 Mar 2009 16:49:00 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200903231649.n2NGn0fY014995@svn.freebsd.org> From: Xin LI Date: Mon, 23 Mar 2009 16:49:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190324 - head/libexec/rtld-elf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 16:49:01 -0000 Author: delphij Date: Mon Mar 23 16:49:00 2009 New Revision: 190324 URL: http://svn.freebsd.org/changeset/base/190324 Log: Support for a new environment variable, LD_ELF_HINTS_PATH for overriding the rtld hints file. This environment variable would be unset if the process is considered as tainted with setuid/setgid. This feature gives a convenient way of using a custom set of shared library that is not located in the default location and switch back. Feature requested by: iXsystems Original patch by: John Hixson MFC after: 2 weeks Modified: head/libexec/rtld-elf/rtld.1 head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.1 ============================================================================== --- head/libexec/rtld-elf/rtld.1 Mon Mar 23 16:20:39 2009 (r190323) +++ head/libexec/rtld-elf/rtld.1 Mon Mar 23 16:49:00 2009 (r190324) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 15, 2008 +.Dd March 23, 2009 .Dt RTLD 1 .Os .Sh NAME @@ -116,6 +116,11 @@ If set, disables the use of and .Ev LD_LIBMAP . This variable is unset for set-user-ID and set-group-ID programs. +.It Ev LD_ELF_HINTS_PATH +This variable will override the default location of +.Dq hints +file. +This variable is unset for set-user-ID and set-group-ID programs. .It Ev LD_LIBRARY_PATH A colon separated list of directories, overriding the default search path for shared libraries. Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Mon Mar 23 16:20:39 2009 (r190323) +++ head/libexec/rtld-elf/rtld.c Mon Mar 23 16:49:00 2009 (r190324) @@ -162,6 +162,7 @@ static char *ld_debug; /* Environment v static char *ld_library_path; /* Environment variable for search path */ static char *ld_preload; /* Environment variable for libraries to load first */ +static char *ld_elf_hints_path; /* Environment variable for alternative hints path */ static char *ld_tracing; /* Called from ldd to print libs */ static char *ld_utrace; /* Use utrace() to log events. */ static Obj_Entry *obj_list; /* Head of linked list of shared objects */ @@ -370,17 +371,23 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ unsetenv(LD_ "LIBRARY_PATH"); unsetenv(LD_ "LIBMAP_DISABLE"); unsetenv(LD_ "DEBUG"); + unsetenv(LD_ "ELF_HINTS_PATH"); } ld_debug = getenv(LD_ "DEBUG"); libmap_disable = getenv(LD_ "LIBMAP_DISABLE") != NULL; libmap_override = getenv(LD_ "LIBMAP"); ld_library_path = getenv(LD_ "LIBRARY_PATH"); ld_preload = getenv(LD_ "PRELOAD"); + ld_elf_hints_path = getenv(LD_ "ELF_HINTS_PATH"); dangerous_ld_env = libmap_disable || (libmap_override != NULL) || - (ld_library_path != NULL) || (ld_preload != NULL); + (ld_library_path != NULL) || (ld_preload != NULL) || + (ld_elf_hints_path != NULL); ld_tracing = getenv(LD_ "TRACE_LOADED_OBJECTS"); ld_utrace = getenv(LD_ "UTRACE"); + if ((ld_elf_hints_path == NULL) || strlen(ld_elf_hints_path) == 0) + ld_elf_hints_path = _PATH_ELF_HINTS; + if (ld_debug != NULL && *ld_debug != '\0') debug = 1; dbg("%s is initialized, base address = %p", __progname, @@ -1240,7 +1247,7 @@ gethints(void) /* Keep from trying again in case the hints file is bad. */ hints = ""; - if ((fd = open(_PATH_ELF_HINTS, O_RDONLY)) == -1) + if ((fd = open(ld_elf_hints_path, O_RDONLY)) == -1) return NULL; if (read(fd, &hdr, sizeof hdr) != sizeof hdr || hdr.magic != ELFHINTS_MAGIC || From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 17:51:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B5EC1065679; Mon, 23 Mar 2009 17:51:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A06A8FC1E; Mon, 23 Mar 2009 17:51:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2NHp7Li016278; Mon, 23 Mar 2009 17:51:07 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NHp79F016277; Mon, 23 Mar 2009 17:51:07 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903231751.n2NHp79F016277@svn.freebsd.org> From: John Baldwin Date: Mon, 23 Mar 2009 17:51:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190325 - head/sys/dev/my X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 17:51:08 -0000 Author: jhb Date: Mon Mar 23 17:51:07 2009 New Revision: 190325 URL: http://svn.freebsd.org/changeset/base/190325 Log: Release driver lock at the end of the watchdog routine instead of trying to acquire it again. Submitted by: bland MFC after: 3 days Modified: head/sys/dev/my/if_my.c Modified: head/sys/dev/my/if_my.c ============================================================================== --- head/sys/dev/my/if_my.c Mon Mar 23 16:49:00 2009 (r190324) +++ head/sys/dev/my/if_my.c Mon Mar 23 17:51:07 2009 (r190325) @@ -1700,7 +1700,7 @@ my_watchdog(struct ifnet * ifp) my_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) my_start_locked(ifp); - MY_LOCK(sc); + MY_UNLOCK(sc); return; } From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 19:10:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A48AE106566B; Mon, 23 Mar 2009 19:10:38 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92EB38FC13; Mon, 23 Mar 2009 19:10:38 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2NJAci4018111; Mon, 23 Mar 2009 19:10:38 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NJAcv6018110; Mon, 23 Mar 2009 19:10:38 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200903231910.n2NJAcv6018110@svn.freebsd.org> From: Andrew Thompson Date: Mon, 23 Mar 2009 19:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190328 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 19:10:40 -0000 Author: thompsa Date: Mon Mar 23 19:10:38 2009 New Revision: 190328 URL: http://svn.freebsd.org/changeset/base/190328 Log: Fix order of debug printf items, addr and config# were swapped. Modified: head/sys/dev/usb/usb_device.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Mon Mar 23 18:13:18 2009 (r190327) +++ head/sys/dev/usb/usb_device.c Mon Mar 23 19:10:38 2009 (r190328) @@ -628,7 +628,7 @@ usb2_set_config_index(struct usb2_device DPRINTF("udev=%p cdesc=%p (addr %d) cno=%d attr=0x%02x, " "selfpowered=%d, power=%d\n", udev, cdp, - cdp->bConfigurationValue, udev->address, cdp->bmAttributes, + udev->address, cdp->bConfigurationValue, cdp->bmAttributes, selfpowered, cdp->bMaxPower * 2); /* Check if we have enough power. */ From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 19:27:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E0F71065673; Mon, 23 Mar 2009 19:27:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F12968FC12; Mon, 23 Mar 2009 19:27:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2NJRNAx018465; Mon, 23 Mar 2009 19:27:23 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NJRN3x018462; Mon, 23 Mar 2009 19:27:23 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903231927.n2NJRN3x018462@svn.freebsd.org> From: John Baldwin Date: Mon, 23 Mar 2009 19:27:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190329 - head/sys/dev/twa X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 19:27:24 -0000 Author: jhb Date: Mon Mar 23 19:27:23 2009 New Revision: 190329 URL: http://svn.freebsd.org/changeset/base/190329 Log: Reenable 64-bit DMA for twa(4) controllers, but use a boundary of 4GB to prevent individual transactions from crossing a 4GB address boundary. Due to bus_size_t type limitations, the driver uses a 2GB boundary in PAE kernels. Reviewed by: scottl MFC after: 1 week Modified: head/sys/dev/twa/tw_cl_init.c head/sys/dev/twa/tw_osl.h head/sys/dev/twa/tw_osl_freebsd.c Modified: head/sys/dev/twa/tw_cl_init.c ============================================================================== --- head/sys/dev/twa/tw_cl_init.c Mon Mar 23 19:10:38 2009 (r190328) +++ head/sys/dev/twa/tw_cl_init.c Mon Mar 23 19:27:23 2009 (r190329) @@ -692,7 +692,7 @@ tw_cli_init_connection(struct tw_cli_ctl init_connect->message_credits = TW_CL_SWAP16(message_credits); init_connect->features = TW_CL_SWAP32(set_features); if (ctlr->flags & TW_CL_64BIT_ADDRESSES) - init_connect->features |= TWA_64BIT_SG_ADDRESSES; + init_connect->features |= TW_CL_SWAP32(TWA_64BIT_SG_ADDRESSES); if (set_features & TWA_EXTENDED_INIT_CONNECT) { /* * Fill in the extra fields needed for an extended Modified: head/sys/dev/twa/tw_osl.h ============================================================================== --- head/sys/dev/twa/tw_osl.h Mon Mar 23 19:10:38 2009 (r190328) +++ head/sys/dev/twa/tw_osl.h Mon Mar 23 19:27:23 2009 (r190329) @@ -57,6 +57,12 @@ #define TW_OSLI_DEFERRED_INTR_USED */ +#ifdef PAE +#define TW_OSLI_DMA_BOUNDARY (1u << 31) +#else +#define TW_OSLI_DMA_BOUNDARY ((bus_size_t)((uint64_t)1 << 32)) +#endif + /* Possible values of req->state. */ #define TW_OSLI_REQ_STATE_INIT 0x0 /* being initialized */ #define TW_OSLI_REQ_STATE_BUSY 0x1 /* submitted to CL */ Modified: head/sys/dev/twa/tw_osl_freebsd.c ============================================================================== --- head/sys/dev/twa/tw_osl_freebsd.c Mon Mar 23 19:10:38 2009 (r190328) +++ head/sys/dev/twa/tw_osl_freebsd.c Mon Mar 23 19:27:23 2009 (r190329) @@ -491,8 +491,8 @@ tw_osli_alloc_mem(struct twa_softc *sc) /* Create the parent dma tag. */ if (bus_dma_tag_create(NULL, /* parent */ sc->alignment, /* alignment */ - 0, /* boundary */ - BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ + TW_OSLI_DMA_BOUNDARY, /* boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ TW_CL_MAX_IO_SIZE, /* maxsize */ @@ -515,7 +515,7 @@ tw_osli_alloc_mem(struct twa_softc *sc) if (bus_dma_tag_create(sc->parent_tag, /* parent */ sc->alignment, /* alignment */ 0, /* boundary */ - BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ + BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ dma_mem_size, /* maxsize */ @@ -562,7 +562,7 @@ tw_osli_alloc_mem(struct twa_softc *sc) if (bus_dma_tag_create(sc->parent_tag, /* parent */ sc->alignment, /* alignment */ 0, /* boundary */ - BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ + BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ TW_CL_MAX_IO_SIZE, /* maxsize */ @@ -588,7 +588,7 @@ tw_osli_alloc_mem(struct twa_softc *sc) if (bus_dma_tag_create(sc->parent_tag, /* parent */ sc->alignment, /* alignment */ 0, /* boundary */ - BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ + BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ TW_CL_MAX_IO_SIZE, /* maxsize */ @@ -1347,7 +1347,7 @@ static TW_VOID twa_map_load_callback(TW_VOID *arg, bus_dma_segment_t *segs, TW_INT32 nsegments, TW_INT32 error) { - *((bus_addr_t *)arg) = segs[0].ds_addr; + *((TW_UINT64 *)arg) = segs[0].ds_addr; } From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 19:58:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35BE2106566B; Mon, 23 Mar 2009 19:58:27 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19F008FC0C; Mon, 23 Mar 2009 19:58:27 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2NJwRbl019690; Mon, 23 Mar 2009 19:58:27 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NJwQdX019688; Mon, 23 Mar 2009 19:58:26 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <200903231958.n2NJwQdX019688@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 23 Mar 2009 19:58:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190330 - head/sys/dev/cxgb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 19:58:27 -0000 Author: gnn Date: Mon Mar 23 19:58:26 2009 New Revision: 190330 URL: http://svn.freebsd.org/changeset/base/190330 Log: Minor updates to the Chelsio driver, including removing an LOR. Submitted by: Navdeep Parhar at Chelsio Reviewed by: gnn MFC after: 3 weeks Modified: head/sys/dev/cxgb/cxgb_main.c head/sys/dev/cxgb/cxgb_offload.c Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Mon Mar 23 19:27:23 2009 (r190329) +++ head/sys/dev/cxgb/cxgb_main.c Mon Mar 23 19:58:26 2009 (r190330) @@ -365,8 +365,8 @@ cxgb_controller_probe(device_t dev) } #define FW_FNAME "cxgb_t3fw" -#define TPEEPROM_NAME "t3%c_tp_eeprom" -#define TPSRAM_NAME "t3%c_protocol_sram" +#define TPEEPROM_NAME "cxgb_t3%c_tp_eeprom" +#define TPSRAM_NAME "cxgb_t3%c_protocol_sram" static int upgrade_fw(adapter_t *sc) @@ -1292,10 +1292,8 @@ void t3_os_link_fault_handler(struct ada { struct port_info *pi = &sc->port[port_id]; - ADAPTER_LOCK(sc); pi->link_fault = 1; taskqueue_enqueue(sc->tq, &pi->link_fault_task); - ADAPTER_UNLOCK(sc); } void @@ -1595,8 +1593,9 @@ update_tpeeprom(struct adapter *adap) tpeeprom = firmware_get(name); if (tpeeprom == NULL) { - device_printf(adap->dev, "could not load TP EEPROM: unable to load %s\n", - TPEEPROM_NAME); + device_printf(adap->dev, + "could not load TP EEPROM: unable to load %s\n", + name); return; } @@ -1607,7 +1606,9 @@ update_tpeeprom(struct adapter *adap) goto release_tpeeprom; if (len != TP_SRAM_LEN) { - device_printf(adap->dev, "%s length is wrong len=%d expected=%d\n", TPEEPROM_NAME, len, TP_SRAM_LEN); + device_printf(adap->dev, + "%s length is wrong len=%d expected=%d\n", name, + len, TP_SRAM_LEN); return; } @@ -1619,7 +1620,8 @@ update_tpeeprom(struct adapter *adap) "Protocol SRAM image updated in EEPROM to %d.%d.%d\n", TP_VERSION_MAJOR, TP_VERSION_MINOR, TP_VERSION_MICRO); } else - device_printf(adap->dev, "Protocol SRAM image update in EEPROM failed\n"); + device_printf(adap->dev, + "Protocol SRAM image update in EEPROM failed\n"); release_tpeeprom: firmware_put(tpeeprom, FIRMWARE_UNLOAD); @@ -2571,7 +2573,7 @@ cxgb_extension_ioctl(struct cdev *dev, u mmd = mid->phy_id >> 8; if (!mmd) mmd = MDIO_DEV_PCS; - else if (mmd > MDIO_DEV_XGXS) + else if (mmd > MDIO_DEV_VEND2) return (EINVAL); error = phy->mdio_read(sc, mid->phy_id & 0x1f, mmd, @@ -2593,7 +2595,7 @@ cxgb_extension_ioctl(struct cdev *dev, u mmd = mid->phy_id >> 8; if (!mmd) mmd = MDIO_DEV_PCS; - else if (mmd > MDIO_DEV_XGXS) + else if (mmd > MDIO_DEV_VEND2) return (EINVAL); error = phy->mdio_write(sc, mid->phy_id & 0x1f, Modified: head/sys/dev/cxgb/cxgb_offload.c ============================================================================== --- head/sys/dev/cxgb/cxgb_offload.c Mon Mar 23 19:27:23 2009 (r190329) +++ head/sys/dev/cxgb/cxgb_offload.c Mon Mar 23 19:58:26 2009 (r190330) @@ -94,6 +94,9 @@ register_tdev(struct t3cdev *tdev) static inline void unregister_tdev(struct t3cdev *tdev) { + if (!inited) + return; + mtx_lock(&cxgb_db_lock); TAILQ_REMOVE(&ofld_dev_list, tdev, entry); mtx_unlock(&cxgb_db_lock); From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 20:18:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D1441065670; Mon, 23 Mar 2009 20:18:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 005D08FC18; Mon, 23 Mar 2009 20:18:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2NKI6Bu020512; Mon, 23 Mar 2009 20:18:06 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NKI6Ua020510; Mon, 23 Mar 2009 20:18:06 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903232018.n2NKI6Ua020510@svn.freebsd.org> From: John Baldwin Date: Mon, 23 Mar 2009 20:18:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190331 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 20:18:08 -0000 Author: jhb Date: Mon Mar 23 20:18:06 2009 New Revision: 190331 URL: http://svn.freebsd.org/changeset/base/190331 Log: Improve the description of a few sysctls. Submitted by: bde (partially) MFC after: 3 days Modified: head/sys/kern/subr_param.c head/sys/kern/vfs_bio.c Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Mon Mar 23 19:58:26 2009 (r190330) +++ head/sys/kern/subr_param.c Mon Mar 23 20:18:06 2009 (r190331) @@ -100,29 +100,30 @@ u_long dflssiz; /* initial stack size u_long maxssiz; /* max stack size */ u_long sgrowsiz; /* amount to grow stack */ -SYSCTL_INT(_kern, OID_AUTO, hz, CTLFLAG_RDTUN, &hz, 0, "ticks/second"); +SYSCTL_INT(_kern, OID_AUTO, hz, CTLFLAG_RDTUN, &hz, 0, + "Number of clock ticks per second"); SYSCTL_INT(_kern, OID_AUTO, ncallout, CTLFLAG_RDTUN, &ncallout, 0, "Number of pre-allocated timer events"); SYSCTL_INT(_kern, OID_AUTO, nbuf, CTLFLAG_RDTUN, &nbuf, 0, - "Number of buffer-cache I/O buffers"); + "Number of buffers in the buffer cache"); SYSCTL_INT(_kern, OID_AUTO, nswbuf, CTLFLAG_RDTUN, &nswbuf, 0, "Number of swap buffers"); SYSCTL_LONG(_kern, OID_AUTO, maxswzone, CTLFLAG_RDTUN, &maxswzone, 0, - "max swmeta KVA storage"); + "Maximum memory for swap metadata"); SYSCTL_LONG(_kern, OID_AUTO, maxbcache, CTLFLAG_RDTUN, &maxbcache, 0, - "max buffer cache KVA storage"); + "Maximum value of vfs.maxbufspace"); SYSCTL_ULONG(_kern, OID_AUTO, maxtsiz, CTLFLAG_RDTUN, &maxtsiz, 0, - "max text size"); + "Maximum text size"); SYSCTL_ULONG(_kern, OID_AUTO, dfldsiz, CTLFLAG_RDTUN, &dfldsiz, 0, - "initial data size limit"); + "Initial data size limit"); SYSCTL_ULONG(_kern, OID_AUTO, maxdsiz, CTLFLAG_RDTUN, &maxdsiz, 0, - "max data size"); + "Maximum data size"); SYSCTL_ULONG(_kern, OID_AUTO, dflssiz, CTLFLAG_RDTUN, &dflssiz, 0, - "initial stack size limit"); + "Initial stack size limit"); SYSCTL_ULONG(_kern, OID_AUTO, maxssiz, CTLFLAG_RDTUN, &maxssiz, 0, - "max stack size"); + "Maximum stack size"); SYSCTL_ULONG(_kern, OID_AUTO, sgrowsiz, CTLFLAG_RDTUN, &sgrowsiz, 0, - "amount to grow stack"); + "Amount to grow stack on a stack fault"); SYSCTL_PROC(_kern, OID_AUTO, vm_guest, CTLFLAG_RD | CTLTYPE_STRING, NULL, 0, sysctl_kern_vm_guest, "A", "Virtual machine detected? (none|generic|xen)"); Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Mon Mar 23 19:58:26 2009 (r190330) +++ head/sys/kern/vfs_bio.c Mon Mar 23 20:18:06 2009 (r190331) @@ -125,10 +125,10 @@ static long bufspace; #if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \ defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) SYSCTL_PROC(_vfs, OID_AUTO, bufspace, CTLTYPE_LONG|CTLFLAG_MPSAFE|CTLFLAG_RD, - &bufspace, 0, sysctl_bufspace, "L", "KVA memory used for bufs"); + &bufspace, 0, sysctl_bufspace, "L", "Virtual memory used for buffers"); #else SYSCTL_LONG(_vfs, OID_AUTO, bufspace, CTLFLAG_RD, &bufspace, 0, - "KVA memory used for bufs"); + "Virtual memory used for buffers"); #endif static long maxbufspace; SYSCTL_LONG(_vfs, OID_AUTO, maxbufspace, CTLFLAG_RD, &maxbufspace, 0, From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 21:16:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B62510656EB; Mon, 23 Mar 2009 21:16:22 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BF268FC0C; Mon, 23 Mar 2009 21:16:22 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2NLGMK5021875; Mon, 23 Mar 2009 21:16:22 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NLGMAx021874; Mon, 23 Mar 2009 21:16:22 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200903232116.n2NLGMAx021874@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 23 Mar 2009 21:16:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190337 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 21:16:27 -0000 Author: jkim Date: Mon Mar 23 21:16:21 2009 New Revision: 190337 URL: http://svn.freebsd.org/changeset/base/190337 Log: Clean up MI inittodr(9) and kill noop code. It was derived from i386 version long ago but never resync'ed again. Originally, i386 version compared the current time from realtime clock with time_second (which was just `time' in the old days). When this MI version was written, it was wrongly compared against `base' AND never used because of a bug (typo?) in the code. This check was killed in i386 version when home-rolled calendaric calculation was removed. Now, we just remove the code here as well to make the code simpler. Modified: head/sys/kern/subr_rtc.c Modified: head/sys/kern/subr_rtc.c ============================================================================== --- head/sys/kern/subr_rtc.c Mon Mar 23 20:53:50 2009 (r190336) +++ head/sys/kern/subr_rtc.c Mon Mar 23 21:16:21 2009 (r190337) @@ -109,44 +109,36 @@ clock_register(device_t dev, long res) / void inittodr(time_t base) { - struct timespec diff, ref, ts; + struct timespec ref, ts; int error; - if (base) { - ref.tv_sec = base; - ref.tv_nsec = 0; - tc_setclock(&ref); - } - if (clock_dev == NULL) { printf("warning: no time-of-day clock registered, system time " "will not be set accurately\n"); - return; + goto wrong_time; } /* XXX: We should poll all registered RTCs in case of failure */ error = CLOCK_GETTIME(clock_dev, &ts); if (error != 0 && error != EINVAL) { printf("warning: clock_gettime failed (%d), the system time " "will not be set accurately\n", error); - return; + goto wrong_time; } if (error == EINVAL || ts.tv_sec < 0) { - printf("Invalid time in real time clock.\n"); - printf("Check and reset the date immediately!\n"); + printf("Invalid time in real time clock.\n" + "Check and reset the date immediately!\n"); + goto wrong_time; } ts.tv_sec += utc_offset(); + tc_setclock(&ts); + return; - if (timespeccmp(&ref, &ts, >)) { - diff = ref; - timespecsub(&ref, &ts); - } else { - diff = ts; - timespecsub(&diff, &ref); - } - if (ts.tv_sec >= 2) { - /* badly off, adjust it */ - tc_setclock(&ts); +wrong_time: + if (base > 0) { + ref.tv_sec = base; + ref.tv_nsec = 0; + tc_setclock(&ref); } } From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 22:06:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A606106568C; Mon, 23 Mar 2009 22:06:10 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38DEF8FC29; Mon, 23 Mar 2009 22:06:10 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2NM6AJs022947; Mon, 23 Mar 2009 22:06:10 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NM6Agr022946; Mon, 23 Mar 2009 22:06:10 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200903232206.n2NM6Agr022946@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 23 Mar 2009 22:06:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190339 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 22:06:11 -0000 Author: jkim Date: Mon Mar 23 22:06:09 2009 New Revision: 190339 URL: http://svn.freebsd.org/changeset/base/190339 Log: Check whether devd is running before calling resume notifier and reshuffle code to reduce unnecessary locking coverage. Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Mon Mar 23 21:32:03 2009 (r190338) +++ head/sys/dev/acpica/acpi.c Mon Mar 23 22:06:09 2009 (r190339) @@ -2336,7 +2336,7 @@ acpi_ReqSleepState(struct acpi_softc *sc #endif /* If devd(8) is not running, immediately enter the sleep state. */ - if (devctl_process_running() == FALSE) { + if (!devctl_process_running()) { ACPI_UNLOCK(acpi); if (ACPI_SUCCESS(acpi_EnterSleepState(sc, sc->acpi_next_sstate))) { return (0); @@ -2345,9 +2345,6 @@ acpi_ReqSleepState(struct acpi_softc *sc } } - /* Now notify devd(8) also. */ - acpi_UserNotify("Suspend", ACPI_ROOT_OBJECT, state); - /* * Set a timeout to fire if userland doesn't ack the suspend request * in time. This way we still eventually go to sleep if we were @@ -2357,6 +2354,10 @@ acpi_ReqSleepState(struct acpi_softc *sc */ callout_reset(&sc->susp_force_to, 10 * hz, acpi_sleep_force, sc); ACPI_UNLOCK(acpi); + + /* Now notify devd(8) also. */ + acpi_UserNotify("Suspend", ACPI_ROOT_OBJECT, state); + return (0); #else /* This platform does not support acpi suspend/resume. */ @@ -2432,8 +2433,24 @@ acpi_AckSleepState(struct apm_clone_data static void acpi_sleep_enable(void *arg) { + struct acpi_softc *sc = (struct acpi_softc *)arg; - ((struct acpi_softc *)arg)->acpi_sleep_disabled = 0; + ACPI_LOCK(acpi); + sc->acpi_sleep_disabled = 0; + ACPI_UNLOCK(acpi); +} + +static ACPI_STATUS +acpi_sleep_disable(struct acpi_softc *sc) +{ + ACPI_STATUS status; + + ACPI_LOCK(acpi); + status = sc->acpi_sleep_disabled ? AE_ERROR : AE_OK; + sc->acpi_sleep_disabled = 1; + ACPI_UNLOCK(acpi); + + return (status); } enum acpi_sleep_state { @@ -2460,15 +2477,11 @@ acpi_EnterSleepState(struct acpi_softc * ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, state); /* Re-entry once we're suspending is not allowed. */ - status = AE_OK; - ACPI_LOCK(acpi); - if (sc->acpi_sleep_disabled) { - ACPI_UNLOCK(acpi); + status = acpi_sleep_disable(sc); + if (ACPI_FAILURE(status)) { printf("acpi: suspend request ignored (not ready yet)\n"); - return (AE_ERROR); + return (status); } - sc->acpi_sleep_disabled = 1; - ACPI_UNLOCK(acpi); #ifdef SMP thread_lock(curthread); @@ -2557,6 +2570,7 @@ acpi_EnterSleepState(struct acpi_softc * * shutdown handlers. */ shutdown_nice(RB_POWEROFF); + status = AE_OK; break; case ACPI_STATE_S0: default: @@ -2580,13 +2594,6 @@ acpi_EnterSleepState(struct acpi_softc * if (slp_state >= ACPI_SS_SLEPT) acpi_enable_fixed_events(sc); - /* Allow another sleep request after a while. */ - if (state != ACPI_STATE_S5) - timeout(acpi_sleep_enable, sc, hz * ACPI_MINIMUM_AWAKETIME); - - /* Run /etc/rc.resume after we are back. */ - acpi_UserNotify("Resume", ACPI_ROOT_OBJECT, state); - mtx_unlock(&Giant); /* Warm up timecounter again */ @@ -2599,6 +2606,14 @@ acpi_EnterSleepState(struct acpi_softc * thread_unlock(curthread); #endif + /* Allow another sleep request after a while. */ + if (state != ACPI_STATE_S5) + timeout(acpi_sleep_enable, sc, hz * ACPI_MINIMUM_AWAKETIME); + + /* Run /etc/rc.resume after we are back. */ + if (devctl_process_running()) + acpi_UserNotify("Resume", ACPI_ROOT_OBJECT, state); + return_ACPI_STATUS (status); } From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 22:12:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D784106564A; Mon, 23 Mar 2009 22:12:34 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11A2F8FC1C; Mon, 23 Mar 2009 22:12:34 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2NMCXjN023116; Mon, 23 Mar 2009 22:12:33 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NMCXWK023114; Mon, 23 Mar 2009 22:12:33 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200903232212.n2NMCXWK023114@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 23 Mar 2009 22:12:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190340 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 22:12:35 -0000 Author: jkim Date: Mon Mar 23 22:12:33 2009 New Revision: 190340 URL: http://svn.freebsd.org/changeset/base/190340 Log: Add a function to reset system time after resuming, which will be used by amd64 shortly. It can be turned off by setting "debug.acpi.reset_clock" tunable to zero. Modified: head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpivar.h Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Mon Mar 23 22:06:09 2009 (r190339) +++ head/sys/dev/acpica/acpi.c Mon Mar 23 22:12:33 2009 (r190340) @@ -254,6 +254,12 @@ TUNABLE_INT("debug.acpi.do_powerstate", SYSCTL_INT(_debug_acpi, OID_AUTO, do_powerstate, CTLFLAG_RW, &acpi_do_powerstate, 1, "Turn off devices when suspending."); +/* Reset system clock while resuming. XXX Remove once tested. */ +static int acpi_reset_clock = 1; +TUNABLE_INT("debug.acpi.reset_clock", &acpi_reset_clock); +SYSCTL_INT(_debug_acpi, OID_AUTO, reset_clock, CTLFLAG_RW, + &acpi_reset_clock, 1, "Reset system clock while resuming."); + /* Allow users to override quirks. */ TUNABLE_INT("debug.acpi.quirks", &acpi_quirks); @@ -2596,10 +2602,6 @@ acpi_EnterSleepState(struct acpi_softc * mtx_unlock(&Giant); - /* Warm up timecounter again */ - (void)timecounter->tc_get_timecount(timecounter); - (void)timecounter->tc_get_timecount(timecounter); - #ifdef SMP thread_lock(curthread); sched_unbind(curthread); @@ -2617,6 +2619,21 @@ acpi_EnterSleepState(struct acpi_softc * return_ACPI_STATUS (status); } +void +acpi_resync_clock(struct acpi_softc *sc) +{ + + if (!acpi_reset_clock) + return; + + /* + * Warm up timecounter again and reset system clock. + */ + (void)timecounter->tc_get_timecount(timecounter); + (void)timecounter->tc_get_timecount(timecounter); + inittodr(time_second + sc->acpi_sleep_delay); +} + /* Initialize a device's wake GPE. */ int acpi_wake_init(device_t dev, int type) Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Mon Mar 23 22:06:09 2009 (r190339) +++ head/sys/dev/acpica/acpivar.h Mon Mar 23 22:12:33 2009 (r190340) @@ -330,6 +330,7 @@ ACPI_STATUS acpi_SetIntrModel(int model) int acpi_ReqSleepState(struct acpi_softc *sc, int state); int acpi_AckSleepState(struct apm_clone_data *clone, int error); ACPI_STATUS acpi_SetSleepState(struct acpi_softc *sc, int state); +void acpi_resync_clock(struct acpi_softc *sc); int acpi_wake_init(device_t dev, int type); int acpi_wake_set_enable(device_t dev, int enable); int acpi_parse_prw(ACPI_HANDLE h, struct acpi_prw_data *prw); From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 22:35:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27676106566B; Mon, 23 Mar 2009 22:35:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15EBB8FC1E; Mon, 23 Mar 2009 22:35:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2NMZUvj023651; Mon, 23 Mar 2009 22:35:30 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NMZUYe023647; Mon, 23 Mar 2009 22:35:30 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200903232235.n2NMZUYe023647@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 23 Mar 2009 22:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190341 - head/sys/amd64/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 22:35:32 -0000 Author: jkim Date: Mon Mar 23 22:35:30 2009 New Revision: 190341 URL: http://svn.freebsd.org/changeset/base/190341 Log: - Clean up suspend/resume code for amd64. - Call acpi_resync_clock() to reset system time before hardclock is ready to tick. Note we assume the current timecounter hardware and RTC are already available for read operation. Tested by: mav Modified: head/sys/amd64/acpica/acpi_machdep.c head/sys/amd64/acpica/acpi_wakecode.S head/sys/amd64/acpica/acpi_wakeup.c head/sys/amd64/acpica/genwakecode.sh Modified: head/sys/amd64/acpica/acpi_machdep.c ============================================================================== --- head/sys/amd64/acpica/acpi_machdep.c Mon Mar 23 22:12:33 2009 (r190340) +++ head/sys/amd64/acpica/acpi_machdep.c Mon Mar 23 22:35:30 2009 (r190341) @@ -40,11 +40,12 @@ __FBSDID("$FreeBSD$"); SYSCTL_DECL(_debug_acpi); -uint32_t acpi_resume_beep; +int acpi_resume_beep; TUNABLE_INT("debug.acpi.resume_beep", &acpi_resume_beep); -SYSCTL_UINT(_debug_acpi, OID_AUTO, resume_beep, CTLFLAG_RW, &acpi_resume_beep, +SYSCTL_INT(_debug_acpi, OID_AUTO, resume_beep, CTLFLAG_RW, &acpi_resume_beep, 0, "Beep the PC speaker when resuming"); -uint32_t acpi_reset_video; + +int acpi_reset_video; TUNABLE_INT("hw.acpi.reset_video", &acpi_reset_video); static int intr_model = ACPI_INTR_PIC; Modified: head/sys/amd64/acpica/acpi_wakecode.S ============================================================================== --- head/sys/amd64/acpica/acpi_wakecode.S Mon Mar 23 22:12:33 2009 (r190340) +++ head/sys/amd64/acpica/acpi_wakecode.S Mon Mar 23 22:35:30 2009 (r190341) @@ -2,7 +2,7 @@ * Copyright (c) 2001 Takanori Watanabe * Copyright (c) 2001 Mitsuru IWASAKI * Copyright (c) 2003 Peter Wemm - * Copyright (c) 2008 Jung-uk Kim + * Copyright (c) 2008-2009 Jung-uk Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -66,12 +66,14 @@ wakeup_start: mov %ax, %ds /* are offsets rather than selectors */ mov %ax, %ss movw $PAGE_SIZE - 8, %sp - pushw $0 + xorw %ax, %ax + pushw %ax popfw /* To debug resume hangs, beep the speaker if the user requested. */ - cmpw $0, resume_beep - wakeup_start - je 1f + testb $~0, resume_beep - wakeup_start + jz 1f + movb $0, resume_beep - wakeup_start movb $0xc0, %al outb %al, $0x42 movb $0x04, %al @@ -79,22 +81,16 @@ wakeup_start: inb $0x61, %al orb $0x3, %al outb %al, $0x61 - movw $0, resume_beep - wakeup_start 1: /* Re-initialize video BIOS if the reset_video tunable is set. */ - cmpw $0, reset_video - wakeup_start - je 1f + testb $~0, reset_video - wakeup_start + jz 1f + movb $0, reset_video - wakeup_start lcall $0xc000, $3 - movw $0, reset_video - wakeup_start - /* - * Set up segment registers for real mode again in case the - * previous BIOS call clobbers them. - */ - mov %cs, %ax - mov %ax, %ds - mov %ax, %ss + /* Re-start in case the previous BIOS call clobbers them. */ + jmp wakeup_start 1: /* @@ -204,6 +200,7 @@ wakeup_sw64: * space. Remember that jmp is relative and that we've been relocated, * so use an indirect jump. */ + ALIGN_TEXT .code64 wakeup_64: mov $bootdata64 - bootgdt, %eax @@ -215,6 +212,13 @@ wakeup_64: movq wakeup_retaddr - wakeup_start(%rbx), %rax jmp *%rax + .data + +resume_beep: + .byte 0 +reset_video: + .byte 0 + ALIGN_DATA bootgdt: .long 0x00000000 @@ -245,10 +249,6 @@ bootgdtdesc: .long bootgdt - wakeup_start /* Offset plus %ds << 4 */ ALIGN_DATA -resume_beep: - .long 0 -reset_video: - .long 0 wakeup_retaddr: .quad 0 wakeup_kpml4: Modified: head/sys/amd64/acpica/acpi_wakeup.c ============================================================================== --- head/sys/amd64/acpica/acpi_wakeup.c Mon Mar 23 22:12:33 2009 (r190340) +++ head/sys/amd64/acpica/acpi_wakeup.c Mon Mar 23 22:35:30 2009 (r190341) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -67,8 +66,8 @@ CTASSERT(sizeof(wakecode) < PAGE_SIZE - #error this file needs sys/cdefs.h as a prerequisite #endif -extern uint32_t acpi_resume_beep; -extern uint32_t acpi_reset_video; +extern int acpi_resume_beep; +extern int acpi_reset_video; #ifdef SMP extern struct xpcb *stopxpcbs; @@ -280,8 +279,8 @@ acpi_sleep_machdep(struct acpi_softc *sc } #endif - WAKECODE_FIXUP(resume_beep, uint32_t, acpi_resume_beep); - WAKECODE_FIXUP(reset_video, uint32_t, acpi_reset_video); + WAKECODE_FIXUP(resume_beep, uint8_t, (acpi_resume_beep != 0)); + WAKECODE_FIXUP(reset_video, uint8_t, (acpi_reset_video != 0)); WAKECODE_FIXUP(wakeup_xpcb, struct xpcb *, &stopxpcbs[0]); WAKECODE_FIXUP(wakeup_gdt, uint16_t, @@ -309,13 +308,11 @@ acpi_sleep_machdep(struct acpi_softc *sc ia32_pause(); } else { fpusetregs(curthread, stopfpu); - - WAKECODE_FIXUP(resume_beep, uint32_t, 0); - WAKECODE_FIXUP(reset_video, uint32_t, 0); #ifdef SMP if (wakeup_cpus != 0) acpi_wakeup_cpus(sc, wakeup_cpus); #endif + acpi_resync_clock(sc); ret = 0; } Modified: head/sys/amd64/acpica/genwakecode.sh ============================================================================== --- head/sys/amd64/acpica/genwakecode.sh Mon Mar 23 22:12:33 2009 (r190340) +++ head/sys/amd64/acpica/genwakecode.sh Mon Mar 23 22:35:30 2009 (r190341) @@ -1,6 +1,6 @@ #!/bin/sh # $FreeBSD$ # -file2c 'static char wakecode[] = {' '};' Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23AC71065672; Mon, 23 Mar 2009 23:22:10 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 114CF8FC14; Mon, 23 Mar 2009 23:22:10 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2NNM9Y6024563; Mon, 23 Mar 2009 23:22:09 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NNM9s0024561; Mon, 23 Mar 2009 23:22:09 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200903232322.n2NNM9s0024561@svn.freebsd.org> From: Xin LI Date: Mon, 23 Mar 2009 23:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190342 - in head/lib/libc/db: btree mpool X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 23:22:10 -0000 Author: delphij Date: Mon Mar 23 23:22:09 2009 New Revision: 190342 URL: http://svn.freebsd.org/changeset/base/190342 Log: use more proper format string. Obtained from: NetBSD via OpenBSD Modified: head/lib/libc/db/btree/bt_debug.c head/lib/libc/db/mpool/mpool.c Modified: head/lib/libc/db/btree/bt_debug.c ============================================================================== --- head/lib/libc/db/btree/bt_debug.c Mon Mar 23 22:35:30 2009 (r190341) +++ head/lib/libc/db/btree/bt_debug.c Mon Mar 23 23:22:09 2009 (r190342) @@ -61,7 +61,7 @@ __bt_dump(DB *dbp) char *sep; t = dbp->internal; - (void)fprintf(stderr, "%s: pgsz %d", + (void)fprintf(stderr, "%s: pgsz %u", F_ISSET(t, B_INMEM) ? "memory" : "disk", t->bt_psize); if (F_ISSET(t, R_RECNO)) (void)fprintf(stderr, " keys %u", t->bt_nrecs); @@ -157,7 +157,7 @@ __bt_dpage(PAGE *h) indx_t cur, top; char *sep; - (void)fprintf(stderr, " page %d: (", h->pgno); + (void)fprintf(stderr, " page %u: (", h->pgno); #undef X #define X(flag, name) \ if (h->flags & flag) { \ @@ -174,7 +174,7 @@ __bt_dpage(PAGE *h) (void)fprintf(stderr, ")\n"); #undef X - (void)fprintf(stderr, "\tprev %2d next %2d", h->prevpg, h->nextpg); + (void)fprintf(stderr, "\tprev %2u next %2u", h->prevpg, h->nextpg); if (h->flags & P_OVERFLOW) return; @@ -292,27 +292,27 @@ __bt_stat(DB *dbp) (void)mpool_put(t->bt_mp, h, 0); } - (void)fprintf(stderr, "%d level%s with %ld keys", + (void)fprintf(stderr, "%d level%s with %lu keys", levels, levels == 1 ? "" : "s", nkeys); if (F_ISSET(t, R_RECNO)) - (void)fprintf(stderr, " (%d header count)", t->bt_nrecs); + (void)fprintf(stderr, " (%u header count)", t->bt_nrecs); (void)fprintf(stderr, - "\n%u pages (leaf %d, internal %d, overflow %d)\n", + "\n%u pages (leaf %u, internal %u, overflow %u)\n", pinternal + pleaf + pcont, pleaf, pinternal, pcont); - (void)fprintf(stderr, "%ld cache hits, %ld cache misses\n", + (void)fprintf(stderr, "%lu cache hits, %lu cache misses\n", bt_cache_hit, bt_cache_miss); (void)fprintf(stderr, "%lu splits (%lu root splits, %lu sort splits)\n", bt_split, bt_rootsplit, bt_sortsplit); pleaf *= t->bt_psize - BTDATAOFF; if (pleaf) (void)fprintf(stderr, - "%.0f%% leaf fill (%ld bytes used, %ld bytes free)\n", + "%.0f%% leaf fill (%lu bytes used, %lu bytes free)\n", ((double)(pleaf - lfree) / pleaf) * 100, pleaf - lfree, lfree); pinternal *= t->bt_psize - BTDATAOFF; if (pinternal) (void)fprintf(stderr, - "%.0f%% internal fill (%ld bytes used, %ld bytes free\n", + "%.0f%% internal fill (%lu bytes used, %lu bytes free\n", ((double)(pinternal - ifree) / pinternal) * 100, pinternal - ifree, ifree); if (bt_pfxsaved) Modified: head/lib/libc/db/mpool/mpool.c ============================================================================== --- head/lib/libc/db/mpool/mpool.c Mon Mar 23 22:35:30 2009 (r190341) +++ head/lib/libc/db/mpool/mpool.c Mon Mar 23 23:22:09 2009 (r190342) @@ -406,9 +406,9 @@ mpool_stat(MPOOL *mp) int cnt; char *sep; - (void)fprintf(stderr, "%u pages in the file\n", mp->npages); + (void)fprintf(stderr, "%lu pages in the file\n", mp->npages); (void)fprintf(stderr, - "page size %lu, cacheing %u pages of %u page max cache\n", + "page size %lu, cacheing %lu pages of %lu page max cache\n", mp->pagesize, mp->curcache, mp->maxcache); (void)fprintf(stderr, "%lu page puts, %lu page gets, %lu page new\n", mp->pageput, mp->pageget, mp->pagenew); From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 23:43:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2988A1065673; Mon, 23 Mar 2009 23:43:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 17ECE8FC12; Mon, 23 Mar 2009 23:43:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2NNh7Wx025077; Mon, 23 Mar 2009 23:43:08 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NNh7LE025076; Mon, 23 Mar 2009 23:43:07 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200903232343.n2NNh7LE025076@svn.freebsd.org> From: Xin LI Date: Mon, 23 Mar 2009 23:43:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190344 - head/lib/libc/db/btree X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 23:43:09 -0000 Author: delphij Date: Mon Mar 23 23:43:07 2009 New Revision: 190344 URL: http://svn.freebsd.org/changeset/base/190344 Log: Save errno before calling _close(), which may clear it. Obtained from: OpenBSD Modified: head/lib/libc/db/btree/bt_open.c Modified: head/lib/libc/db/btree/bt_open.c ============================================================================== --- head/lib/libc/db/btree/bt_open.c Mon Mar 23 23:32:20 2009 (r190343) +++ head/lib/libc/db/btree/bt_open.c Mon Mar 23 23:43:07 2009 (r190344) @@ -96,7 +96,7 @@ __bt_open(const char *fname, int flags, DB *dbp; pgno_t ncache; ssize_t nr; - int machine_lorder; + int machine_lorder, saved_errno; t = NULL; @@ -327,13 +327,15 @@ einval: errno = EINVAL; eftype: errno = EFTYPE; goto err; -err: if (t) { +err: saved_errno = errno; + if (t) { if (t->bt_dbp) free(t->bt_dbp); if (t->bt_fd != -1) (void)_close(t->bt_fd); free(t); } + errno = saved_errno; return (NULL); } From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 00:09:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 030B61065673; Tue, 24 Mar 2009 00:09:00 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E57BF8FC14; Tue, 24 Mar 2009 00:08:59 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2O08x6x025670; Tue, 24 Mar 2009 00:08:59 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2O08xwh025669; Tue, 24 Mar 2009 00:08:59 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <200903240008.n2O08xwh025669@svn.freebsd.org> From: Juli Mallett Date: Tue, 24 Mar 2009 00:08:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190346 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Mar 2009 00:09:00 -0000 Author: jmallett Date: Tue Mar 24 00:08:58 2009 New Revision: 190346 URL: http://svn.freebsd.org/changeset/base/190346 Log: Remove gratuitous unlock in error case. Reviewed by: sam Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Tue Mar 24 00:07:17 2009 (r190345) +++ head/sys/dev/iwn/if_iwn.c Tue Mar 24 00:08:58 2009 (r190346) @@ -2134,7 +2134,6 @@ iwn_start_locked(struct ifnet *ifp) if (iwn_tx_data(sc, m, ni, txq) != 0) { ifp->if_oerrors++; ieee80211_free_node(ni); - IWN_UNLOCK(sc); break; } } From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 00:09:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CD971065674; Tue, 24 Mar 2009 00:09:35 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5AF8F8FC12; Tue, 24 Mar 2009 00:09:35 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2O09ZTK025719; Tue, 24 Mar 2009 00:09:35 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2O09ZfT025718; Tue, 24 Mar 2009 00:09:35 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200903240009.n2O09ZfT025718@svn.freebsd.org> From: Sam Leffler Date: Tue, 24 Mar 2009 00:09:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190347 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Mar 2009 00:09:36 -0000 Author: sam Date: Tue Mar 24 00:09:35 2009 New Revision: 190347 URL: http://svn.freebsd.org/changeset/base/190347 Log: fix build w/ AH_DEBUG Modified: head/sys/dev/ath/ah_osdep.c Modified: head/sys/dev/ath/ah_osdep.c ============================================================================== --- head/sys/dev/ath/ah_osdep.c Tue Mar 24 00:08:58 2009 (r190346) +++ head/sys/dev/ath/ah_osdep.c Tue Mar 24 00:09:35 2009 (r190347) @@ -71,12 +71,7 @@ extern void ath_hal_assert_failed(const int lineno, const char* msg); #endif #ifdef AH_DEBUG -#if HAL_ABI_VERSION >= 0x08090101 extern void HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...); -#else -extern void HALDEBUG(struct ath_hal *ah, const char* fmt, ...); -extern void HALDEBUGn(struct ath_hal *ah, u_int level, const char* fmt, ...); -#endif #endif /* AH_DEBUG */ /* NB: put this here instead of the driver to avoid circular references */ @@ -140,7 +135,6 @@ ath_hal_ether_sprintf(const u_int8_t *ma } #ifdef AH_DEBUG -#if HAL_ABI_VERSION >= 0x08090101 void HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...) { @@ -151,29 +145,6 @@ HALDEBUG(struct ath_hal *ah, u_int mask, va_end(ap); } } -#else -void -HALDEBUG(struct ath_hal *ah, const char* fmt, ...) -{ - if (ath_hal_debug) { - __va_list ap; - va_start(ap, fmt); - ath_hal_vprintf(ah, fmt, ap); - va_end(ap); - } -} - -void -HALDEBUGn(struct ath_hal *ah, u_int level, const char* fmt, ...) -{ - if (ath_hal_debug >= level) { - __va_list ap; - va_start(ap, fmt); - ath_hal_vprintf(ah, fmt, ap); - va_end(ap); - } -} -#endif #endif /* AH_DEBUG */ #ifdef AH_DEBUG_ALQ From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 01:22:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCB5E1065670; Tue, 24 Mar 2009 01:22:12 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB38E8FC0C; Tue, 24 Mar 2009 01:22:12 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2O1MCBg027543; Tue, 24 Mar 2009 01:22:12 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2O1MCts027541; Tue, 24 Mar 2009 01:22:12 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200903240122.n2O1MCts027541@svn.freebsd.org> From: Bruce M Simpson Date: Tue, 24 Mar 2009 01:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190354 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Mar 2009 01:22:13 -0000 Author: bms Date: Tue Mar 24 01:22:12 2009 New Revision: 190354 URL: http://svn.freebsd.org/changeset/base/190354 Log: Don't call m_freem() after ip_output(), as it always consumes the mbuf chain provided to it. Found by: Pierre Guinoiseau Modified: head/sys/netinet/igmp.c Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Tue Mar 24 01:18:35 2009 (r190353) +++ head/sys/netinet/igmp.c Tue Mar 24 01:22:12 2009 (r190354) @@ -3451,7 +3451,6 @@ igmp_intr(struct mbuf *m) error = ip_output(m0, ipopts, NULL, 0, &imo, NULL); if (error) { CTR3(KTR_IGMPV3, "%s: ip_output(%p) = %d", __func__, m0, error); - m_freem(m0); goto out; } From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 01:32:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA0611065674; Tue, 24 Mar 2009 01:32:32 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 1C0048FC1E; Tue, 24 Mar 2009 01:32:32 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.3/8.14.3) with ESMTP id n2O1Fp3G032043; Mon, 23 Mar 2009 18:15:51 -0700 (PDT) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.3/8.14.2/Submit) id n2O1Fp0p032042; Mon, 23 Mar 2009 18:15:51 -0700 (PDT) (envelope-from obrien) Date: Mon, 23 Mar 2009 18:15:50 -0700 From: "David O'Brien" To: Christoph Mallon Message-ID: <20090324011550.GB31497@dragon.NUXI.org> References: <49C4C974.5050209@gmx.de> <20090321130332.GD67783@alchemy.franken.de> <49C5737F.1050902@gmx.de> <20090321.175756.-434257642.imp@bsdimp.com> <49C5F88C.3070600@freebsd.org> <49C5FCCA.5010509@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49C5FCCA.5010509@gmx.de> X-Operating-System: FreeBSD 8.0-CURRENT User-Agent: Mutt/1.5.16 (2007-06-09) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190098 - in head/sys/sparc64: fhc sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@freebsd.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Mar 2009 01:32:33 -0000 On Sun, Mar 22, 2009 at 09:54:34AM +0100, Christoph Mallon wrote: > I'm ok with 80 columns. But at the same time having tab stops every 8 > spaces - I consider this silly. You may be missing the beauty of KNF's statement continuations. e.g.: if (foo || bar || baz || other_really_long_variable || quix) { panic("blah"); } From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 01:50:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8F3D1065673; Tue, 24 Mar 2009 01:50:34 +0000 (UTC) (envelope-from ganbold@micom.mng.net) Received: from publicd.ub.mng.net (publicd.ub.mng.net [202.179.0.88]) by mx1.freebsd.org (Postfix) with ESMTP id 571FB8FC27; Tue, 24 Mar 2009 01:50:34 +0000 (UTC) (envelope-from ganbold@micom.mng.net) Received: from [202.179.0.164] (helo=daemon.micom.mng.net) by publicd.ub.mng.net with esmtpa (Exim 4.69 (FreeBSD)) (envelope-from ) id 1Llvlq-000IvZ-Q0; Tue, 24 Mar 2009 09:49:38 +0800 Message-ID: <49C83C66.5060500@micom.mng.net> Date: Tue, 24 Mar 2009 09:50:30 +0800 From: Ganbold User-Agent: Thunderbird 2.0.0.12 (X11/20080415) MIME-Version: 1.0 To: Jung-uk Kim References: <200903170048.n2H0mCw4076588@svn.freebsd.org> In-Reply-To: <200903170048.n2H0mCw4076588@svn.freebsd.org> X-Enigmail-Version: 0.95.6 OpenPGP: id=78F6425E Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r189903 - in head/sys: amd64/acpica amd64/amd64 amd64/include conf dev/acpica i386/i386 kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Mar 2009 01:50:36 -0000 Jung-uk Kim wrote: > Author: jkim > Date: Tue Mar 17 00:48:11 2009 > New Revision: 189903 > URL: http://svn.freebsd.org/changeset/base/189903 > > Log: > Initial suspend/resume support for amd64. > > This code is heavily inspired by Takanori Watanabe's experimental SMP patch > for i386 and large portion was shamelessly cut and pasted from Peter Wemm's > AP boot code. > Sorry for responding late, but is there any chance that similar support can be committed for i386? thanks, Ganbold From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 04:20:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96ED81065670; Tue, 24 Mar 2009 04:20:18 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30E628FC24; Tue, 24 Mar 2009 04:20:18 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2O4KIsA032589; Tue, 24 Mar 2009 04:20:18 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2O4KIwS032588; Tue, 24 Mar 2009 04:20:18 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200903240420.n2O4KIwS032588@svn.freebsd.org> From: Weongyo Jeong Date: Tue, 24 Mar 2009 04:20:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190367 - head/sys/dev/if_ndis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Mar 2009 04:20:19 -0000 Author: weongyo Date: Tue Mar 24 04:20:17 2009 New Revision: 190367 URL: http://svn.freebsd.org/changeset/base/190367 Log: set NULL after free to avoid duplicate free. Tested by: Ganbold Modified: head/sys/dev/if_ndis/if_ndis.c Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Tue Mar 24 03:08:09 2009 (r190366) +++ head/sys/dev/if_ndis/if_ndis.c Tue Mar 24 04:20:17 2009 (r190367) @@ -3250,8 +3250,10 @@ ndis_stop(sc) NDIS_LOCK(sc); for (i = 0; i < NDIS_EVENTS; i++) { - if (sc->ndis_evt[i].ne_sts && sc->ndis_evt[i].ne_buf != NULL) + if (sc->ndis_evt[i].ne_sts && sc->ndis_evt[i].ne_buf != NULL) { free(sc->ndis_evt[i].ne_buf, M_TEMP); + sc->ndis_evt[i].ne_buf = NULL; + } sc->ndis_evt[i].ne_sts = 0; sc->ndis_evt[i].ne_len = 0; } From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 10:50:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAC64106566B; Tue, 24 Mar 2009 10:50:30 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D67CF8FC1C; Tue, 24 Mar 2009 10:50:30 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2OAoUiq043970; Tue, 24 Mar 2009 10:50:30 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2OAoU8N043967; Tue, 24 Mar 2009 10:50:30 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200903241050.n2OAoU8N043967@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 24 Mar 2009 10:50:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190372 - head/share/zoneinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Mar 2009 10:50:32 -0000 Author: edwin Date: Tue Mar 24 10:50:30 2009 New Revision: 190372 URL: http://svn.freebsd.org/changeset/base/190372 Log: MFV of tzdata2009d: - Morocco will observe DST from 2009-06-01 00:00 to 2009-08-21 00:00 - Tunisia will not observe DST this year. - Syria will start DST on 2009-03-27 00:00 this year - the Province of San Luis will go to utc-04:00 MFC after: 1 week Modified: head/share/zoneinfo/ (props changed) head/share/zoneinfo/africa head/share/zoneinfo/asia head/share/zoneinfo/southamerica Modified: head/share/zoneinfo/africa ============================================================================== --- head/share/zoneinfo/africa Tue Mar 24 10:48:32 2009 (r190371) +++ head/share/zoneinfo/africa Tue Mar 24 10:50:30 2009 (r190372) @@ -1,4 +1,4 @@ -# @(#)africa 8.17 +# @(#)africa 8.18 #
 
 # This data is by no means authoritative; if you think you know better,
@@ -564,6 +564,40 @@ Zone	Indian/Mayotte	3:00:56 -	LMT	1911 J
 # 
 # http://www.timeanddate.com/news/time/morocco-ends-dst-early-2008.html
 # 
+
+# From Steffen Thorsen (2009-03-17):
+# Morocco will observe DST from 2009-06-01 00:00 to 2009-08-21 00:00 according
+# to many sources, such as
+# 
+# http://news.marweb.com/morocco/entertainment/morocco-daylight-saving.html
+# 
+# 
+# http://www.medi1sat.ma/fr/depeche.aspx?idp=2312
+# 
+# (French)
+#
+# Our summary:
+# 
+# http://www.timeanddate.com/news/time/morocco-starts-dst-2009.html
+# 
+
+# From Alexander Krivenyshev (2009-03-17):
+# Here is a link to official document from Royaume du Maroc Premier Ministre,
+# Ministere de la Modernisation des Secteurs Publics
+#
+# Under Article 1 of Royal Decree No. 455-67 of Act 23 safar 1387 (2 june 1967)
+# concerning the amendment of the legal time, the Ministry of Modernization of
+# Public Sectors announced that the official time in the Kingdom will be
+# advanced 60 minutes from Sunday 31 May 2009 at midnight.
+#
+# 
+# http://www.mmsp.gov.ma/francais/Actualites_fr/PDF_Actualites_Fr/HeureEte_FR.pdf
+# 
+#
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_morocco03.html
+# 
+
 # RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 
 Rule	Morocco	1939	only	-	Sep	12	 0:00	1:00	S
@@ -583,6 +617,8 @@ Rule	Morocco	1978	only	-	Jun	 1	 0:00	1:
 Rule	Morocco	1978	only	-	Aug	 4	 0:00	0	-
 Rule	Morocco	2008	only	-	Jun	 1	 0:00	1:00	S
 Rule	Morocco	2008	only	-	Sep	 1	 0:00	0	-
+Rule	Morocco	2009	only	-	Jun	 1	 0:00	1:00	S
+Rule	Morocco	2009	only	-	Aug	 21	 0:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Africa/Casablanca	-0:30:20 -	LMT	1913 Oct 26
 			 0:00	Morocco	WE%sT	1984 Mar 16
@@ -787,6 +823,43 @@ Zone	Africa/Lome	0:04:52 -	LMT	1893
 # Ending         : the last Sunday of October at 03:00 ...
 # http://www.tap.info.tn/en/index.php?option=com_content&task=view&id=1188&Itemid=50
 
+# From Steffen Thorsen (2009-03-16):
+# According to several news sources, Tunisia will not observe DST this year.
+# (Arabic)
+# 
+# http://www.elbashayer.com/?page=viewn&nid=42546
+# 
+# 
+# http://www.babnet.net/kiwidetail-15295.asp
+# 
+#
+# We have also confirmed this with the US embassy in Tunisia.
+# We have a wrap-up about this on the following page:
+# 
+# http://www.timeanddate.com/news/time/tunisia-cancels-dst-2009.html
+# 
+
+# From Alexander Krivenyshev (2009-03-17):
+# Here is a link to Tunis Afrique Presse News Agency
+#
+# Standard time to be kept the whole year long (tap.info.tn):
+#
+# (in English)
+# 
+# http://www.tap.info.tn/en/index.php?option=com_content&task=view&id=26813&Itemid=157
+# 
+#
+# (in Arabic)
+# 
+# http://www.tap.info.tn/ar/index.php?option=com_content&task=view&id=61240&Itemid=1
+# 
+
+# From Arthur David Olson (2009--3-18):
+# The Tunis Afrique Presse News Agency notice contains this: "This measure is due to the fact
+# that the fasting month of ramadan coincides with the period concerned by summer time.
+# Therefore, the standard time will be kept unchanged the whole year long."
+# So foregoing DST seems to be an exception (albeit one that may be repeated in the  future).
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Tunisia	1939	only	-	Apr	15	23:00s	1:00	S
 Rule	Tunisia	1939	only	-	Nov	18	23:00s	0	-
@@ -811,8 +884,10 @@ Rule	Tunisia	1989	only	-	Mar	26	 0:00s	1
 Rule	Tunisia	1990	only	-	May	 1	 0:00s	1:00	S
 Rule	Tunisia	2005	only	-	May	 1	 0:00s	1:00	S
 Rule	Tunisia	2005	only	-	Sep	30	 1:00s	0	-
-Rule	Tunisia	2006	max	-	Mar	lastSun	 2:00s	1:00	S
-Rule	Tunisia	2006	max	-	Oct	lastSun	 2:00s	0	-
+Rule	Tunisia	2006	2008	-	Mar	lastSun	 2:00s	1:00	S
+Rule	Tunisia	2006	2008	-	Oct	lastSun	 2:00s	0	-
+Rule	Tunisia	2010	max	-	Mar	lastSun	 2:00s	1:00	S
+Rule	Tunisia	2010	max	-	Oct	lastSun	 2:00s	0	-
 # Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
 # more precise 0:09:21.
 # Shanks & Pottenger say the 1911 switch was on Mar 9; go with Howse's Mar 11.

Modified: head/share/zoneinfo/asia
==============================================================================
--- head/share/zoneinfo/asia	Tue Mar 24 10:48:32 2009	(r190371)
+++ head/share/zoneinfo/asia	Tue Mar 24 10:50:30 2009	(r190372)
@@ -1,4 +1,4 @@
-# @(#)asia	8.25
+# @(#)asia	8.26
 # 
 
 # This data is by no means authoritative; if you think you know better,
@@ -1969,8 +1969,29 @@ Rule	Syria	2007	only	-	Nov	 Fri>=1	0:00	
 # http://sana.sy/ara/2/2008/10/07/195459.htm
 # 
 
-Rule	Syria	2008	max	-	Apr	Fri>=1	0:00	1:00	S
+# From Steffen Thorsen (2009-03-19):
+# Syria will start DST on 2009-03-27 00:00 this year according to many sources,
+# two examples:
+#
+# 
+# http://www.sana.sy/eng/21/2009/03/17/217563.htm
+# 
+# (English, Syrian Arab News # Agency)
+# 
+# http://thawra.alwehda.gov.sy/_View_news2.asp?FileName=94459258720090318012209
+# 
+# (Arabic, gov-site)
+#
+# We have not found any sources saying anything about when DST ends this year.
+#
+# Our summary
+# 
+# http://www.timeanddate.com/news/time/syria-dst-starts-march-27-2009.html
+# 
+
+Rule	Syria	2008	only	-	Apr	Fri>=1	0:00	1:00	S
 Rule	Syria	2008	max	-	Nov	1	0:00	0	-
+Rule	Syria	2009	max	-	Mar	lastFri	0:00	1:00	S
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Damascus	2:25:12 -	LMT	1920	# Dimashq

Modified: head/share/zoneinfo/southamerica
==============================================================================
--- head/share/zoneinfo/southamerica	Tue Mar 24 10:48:32 2009	(r190371)
+++ head/share/zoneinfo/southamerica	Tue Mar 24 10:50:30 2009	(r190372)
@@ -1,4 +1,4 @@
-# @(#)southamerica	8.33
+# @(#)southamerica	8.34
 # 
 
 # This data is by no means authoritative; if you think you know better,
@@ -351,6 +351,50 @@ Rule	Arg	2008	max	-	Oct	Sun>=15	0:00	1:0
 # keep America/Cordoba a single region rather than splitting it into the
 # other 5 subregions.
 
+# From Mariano Absatz (2009-03-13):
+# Yesterday (with our usual 2-day notice) the Province of San Luis
+# decided that next Sunday instead of "staying" @utc-03:00 they will go
+# to utc-04:00 until the second Saturday in October...
+#
+# The press release is at
+# 
+# http://www.sanluis.gov.ar/SL/Paginas/NoticiaDetalle.asp?TemaId=1&InfoPrensaId=3102
+# 
+# (I couldn't find the decree, but
+# 
+# www.sanluis.gov.ar
+# 
+# is the official page for the Province Government).
+#
+# There's also a note in only one of the major national papers (La Nación) at
+# 
+# http://www.lanacion.com.ar/nota.asp?nota_id=1107912
+# 
+# 
+# The press release says:
+#  (...) anunció que el próximo domingo a las 00:00 los puntanos deberán
+# atrasar una hora sus relojes.
+#
+# A partir de entonces, San Luis establecerá el huso horario propio de
+# la Provincia. De esta manera, durante el periodo del calendario anual
+# 2009, el cambio horario quedará comprendido entre las 00:00 del tercer
+# domingo de marzo y las 24:00 del segundo sábado de octubre.
+# Quick&dirty translation
+# (...) announced that next Sunday, at 00:00, Puntanos (the San Luis
+# inhabitants) will have to turn back one hour their clocks
+#
+# Since then, San Luis will establish its own Province timezone. Thus,
+# during 2009, this timezone change will run from 00:00 the third Sunday
+# in March until 24:00 of the second Saturday in October.
+
+# From Arthur David Olson (2009-03-16):
+# The unofficial claim at
+# 
+# http://www.timeanddate.com/news/time/san-luis-new-time-zone.html
+# 
+# is that "The province will most likely follow the next daylight saving schedule,
+# which is planned for the second Sunday in October."
+
 #
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 #
@@ -498,7 +542,8 @@ Zone America/Argentina/San_Luis -4:25:24
 			-3:00	-	ART	2004 May 31
 			-4:00	-	WART	2004 Jul 25
 			-3:00	Arg	AR%sT	2008 Jan 21
-			-3:00	-	ART
+			-3:00	-	ART	2009 Mar 15
+			-4:00	Arg	WAR%sT
 #
 # Santa Cruz (SC)
 Zone America/Argentina/Rio_Gallegos -4:36:52 - LMT 1894 Oct 31

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 24 13:11:16 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A8C211065675;
	Tue, 24 Mar 2009 13:11:16 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 967108FC15;
	Tue, 24 Mar 2009 13:11:16 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2ODBGki046716;
	Tue, 24 Mar 2009 13:11:16 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2ODBGPl046715;
	Tue, 24 Mar 2009 13:11:16 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200903241311.n2ODBGPl046715@svn.freebsd.org>
From: Rui Paulo 
Date: Tue, 24 Mar 2009 13:11:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190373 - head/sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 13:11:17 -0000

Author: rpaulo
Date: Tue Mar 24 13:11:16 2009
New Revision: 190373
URL: http://svn.freebsd.org/changeset/base/190373

Log:
  Bump __FreeBSD_version to reflect tcpdump 4.0.0 and libpcap 1.0.0
  import.

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==============================================================================
--- head/sys/sys/param.h	Tue Mar 24 10:50:30 2009	(r190372)
+++ head/sys/sys/param.h	Tue Mar 24 13:11:16 2009	(r190373)
@@ -57,7 +57,7 @@
  *		is created, otherwise 1.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 800073	/* Master, propagated to newvers */
+#define __FreeBSD_version 800074	/* Master, propagated to newvers */
 
 #ifndef LOCORE
 #include 

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 24 15:48:35 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A9AC01065670;
	Tue, 24 Mar 2009 15:48:35 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 96A028FC0C;
	Tue, 24 Mar 2009 15:48:35 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2OFmZPx049843;
	Tue, 24 Mar 2009 15:48:35 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2OFmZ3w049842;
	Tue, 24 Mar 2009 15:48:35 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903241548.n2OFmZ3w049842@svn.freebsd.org>
From: Marius Strobl 
Date: Tue, 24 Mar 2009 15:48:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190374 - head/sys/modules/opensolaris
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 15:48:36 -0000

Author: marius
Date: Tue Mar 24 15:48:35 2009
New Revision: 190374
URL: http://svn.freebsd.org/changeset/base/190374

Log:
  As with ZFS use real atomic operations for sparc64.

Modified:
  head/sys/modules/opensolaris/Makefile

Modified: head/sys/modules/opensolaris/Makefile
==============================================================================
--- head/sys/modules/opensolaris/Makefile	Tue Mar 24 13:11:16 2009	(r190373)
+++ head/sys/modules/opensolaris/Makefile	Tue Mar 24 15:48:35 2009	(r190374)
@@ -7,7 +7,7 @@ SRCS=		opensolaris.c		\
 		opensolaris_cmn_err.c	\
 		opensolaris_kmem.c
 
-.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64"
+.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" || ${MACHINE_ARCH} == "sparc64"
 .PATH:	${.CURDIR}/../../cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}
 SRCS+=		atomic.S
 .else

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 24 15:52:46 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0A9C4106566B;
	Tue, 24 Mar 2009 15:52:46 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EC4788FC24;
	Tue, 24 Mar 2009 15:52:45 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2OFqjpX049968;
	Tue, 24 Mar 2009 15:52:45 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2OFqjWA049967;
	Tue, 24 Mar 2009 15:52:45 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903241552.n2OFqjWA049967@svn.freebsd.org>
From: Marius Strobl 
Date: Tue, 24 Mar 2009 15:52:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190375 - head/sys/modules
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 15:52:47 -0000

Author: marius
Date: Tue Mar 24 15:52:45 2009
New Revision: 190375
URL: http://svn.freebsd.org/changeset/base/190375

Log:
  Given that zfs.ko depends on opensolaris.ko also build the latter by
  default on sparc64.

Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==============================================================================
--- head/sys/modules/Makefile	Tue Mar 24 15:48:35 2009	(r190374)
+++ head/sys/modules/Makefile	Tue Mar 24 15:52:45 2009	(r190375)
@@ -76,6 +76,7 @@ SUBDIR=	${_3dfx} \
 	${_em} \
 	en \
 	${_ep} \
+	esp \
 	${_et} \
 	${_ex} \
 	${_exca} \
@@ -581,6 +582,9 @@ _auxio=		auxio
 _em=		em
 _i2c=		i2c
 _igb=		igb
+.if ${MK_CDDL} != "no" || defined(ALL_MODULES)
+_opensolaris=	opensolaris
+.endif
 _sound=		sound
 .if ${MK_ZFS} != "no" || defined(ALL_MODULES)
 _zfs=		zfs

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 24 15:56:15 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A32291065670;
	Tue, 24 Mar 2009 15:56:15 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 76B588FC21;
	Tue, 24 Mar 2009 15:56:15 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2OFuFvm050078;
	Tue, 24 Mar 2009 15:56:15 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2OFuFV1050077;
	Tue, 24 Mar 2009 15:56:15 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903241556.n2OFuFV1050077@svn.freebsd.org>
From: Marius Strobl 
Date: Tue, 24 Mar 2009 15:56:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190376 - head/sys/modules
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 15:56:17 -0000

Author: marius
Date: Tue Mar 24 15:56:15 2009
New Revision: 190376
URL: http://svn.freebsd.org/changeset/base/190376

Log:
  Revert unintended part of r190375.

Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==============================================================================
--- head/sys/modules/Makefile	Tue Mar 24 15:52:45 2009	(r190375)
+++ head/sys/modules/Makefile	Tue Mar 24 15:56:15 2009	(r190376)
@@ -76,7 +76,6 @@ SUBDIR=	${_3dfx} \
 	${_em} \
 	en \
 	${_ep} \
-	esp \
 	${_et} \
 	${_ex} \
 	${_exca} \

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 24 15:57:35 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CC10B1065709;
	Tue, 24 Mar 2009 15:57:35 +0000 (UTC)
	(envelope-from vanhu@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B6C768FC19;
	Tue, 24 Mar 2009 15:57:35 +0000 (UTC)
	(envelope-from vanhu@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2OFvZmE050135;
	Tue, 24 Mar 2009 15:57:35 GMT (envelope-from vanhu@svn.freebsd.org)
Received: (from vanhu@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2OFvZ3w050134;
	Tue, 24 Mar 2009 15:57:35 GMT (envelope-from vanhu@svn.freebsd.org)
Message-Id: <200903241557.n2OFvZ3w050134@svn.freebsd.org>
From: VANHULLEBUS Yvan 
Date: Tue, 24 Mar 2009 15:57:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190377 - head/contrib/libpcap
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 15:57:38 -0000

Author: vanhu
Date: Tue Mar 24 15:57:35 2009
New Revision: 190377
URL: http://svn.freebsd.org/changeset/base/190377

Log:
  Fixed indentation for LINKTYPE_ENC
  
  Approved by:	gnn(mentor)

Modified:
  head/contrib/libpcap/savefile.c

Modified: head/contrib/libpcap/savefile.c
==============================================================================
--- head/contrib/libpcap/savefile.c	Tue Mar 24 15:56:15 2009	(r190376)
+++ head/contrib/libpcap/savefile.c	Tue Mar 24 15:57:35 2009	(r190377)
@@ -908,7 +908,7 @@ static struct linktype_map {
 	{ DLT_IPMB,		LINKTYPE_IPMB },
 
 	/* enc0 device */
-	{ DLT_ENC, LINKTYPE_ENC },
+	{ DLT_ENC,		LINKTYPE_ENC },
 
         /* Juniper Secure Tunnel */
         { DLT_JUNIPER_ST,       LINKTYPE_JUNIPER_ST },

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 24 16:03:47 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2244410656C2;
	Tue, 24 Mar 2009 16:03:47 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0D8318FC17;
	Tue, 24 Mar 2009 16:03:47 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2OG3k9u050295;
	Tue, 24 Mar 2009 16:03:46 GMT (envelope-from luigi@svn.freebsd.org)
Received: (from luigi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2OG3kxw050294;
	Tue, 24 Mar 2009 16:03:46 GMT (envelope-from luigi@svn.freebsd.org)
Message-Id: <200903241603.n2OG3kxw050294@svn.freebsd.org>
From: Luigi Rizzo 
Date: Tue, 24 Mar 2009 16:03:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190378 - head/release/picobsd/build
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 16:03:50 -0000

Author: luigi
Date: Tue Mar 24 16:03:46 2009
New Revision: 190378
URL: http://svn.freebsd.org/changeset/base/190378

Log:
  remove unused "package" entry.
  default to use devfs (we do that anyways)
  
  Many small changes in comments

Modified:
  head/release/picobsd/build/picobsd

Modified: head/release/picobsd/build/picobsd
==============================================================================
--- head/release/picobsd/build/picobsd	Tue Mar 24 15:57:35 2009	(r190377)
+++ head/release/picobsd/build/picobsd	Tue Mar 24 16:03:46 2009	(r190378)
@@ -3,17 +3,17 @@
 # $FreeBSD$
 # This file requires sysutils/makefs to run
 #
-# The new PicoBSD build script. Invoked as
+# The PicoBSD build script. Invoked as
 #
-# picobsd [options] floppy_type site_name
+#	picobsd [options] image_type [site_name]
 #
-# Where floppy_type is a directory where the picobsd config info
-# is held, and ${floppy_type}/floppy.tree.${site_name} contains
+# Where image_type is a directory with the picobsd config info,
+# and ${image_type}/floppy.tree.${site_name} contains
 # optional site-specific configuration.
 #
 # For Options, see the bottom of the file where the processing is
 # done. The picobsd(8) manpage might be of some help, but code and docs
-# tend to lose sync over time...
+# tend to lose sync over time.
 #
 # This script depends on the following files:
 #
@@ -33,36 +33,42 @@
 #   floppy.tree/	local additions to ${PICO_TREE}/mfs_free
 #   floppy.tree.${site}/ same as above, site specific.
 #   mfs_tree/		local additions to the mfs_free
-#   buildtree.mk	optional makefile to build an extension for floppy tree
+#   buildtree.mk	optional Makefile to build an extension for floppy tree
 #			(generated in buildtree/ )
 
 #
 #--- The main entry point is at the end.
 #
 
-# There are two set of initialization. The first one (set_defaults)
-# is done on entry to the script, and is used to set default values
-# for all variables which do not depend on floppy type and source tree.
+# There are two initialization functions:
 #
-# The second set is done after command line parsing, e.g.
-# to resolve dependencies on the source tree.
+# + set_defaults
+#   is run on entry to the script, and is used to set default values
+#   for all variables that do not depend on image type and source tree.
 #
-# Naming:
+# + set_build_parameters
+#   is run after command line parsing
+#
+# VARIABLE NAMES:
 # + variables that control operation (e.g. verbosity) and are generally
 #   set from the command line have o_ ("option") as a name prefix
 #
-# + variables which contain pathnames and values that should not change
+# + variables that contain pathnames and values that should not change
 #   have c_ ("constant") as a name prefix
 #
 # + variables exported to Makefiles and subshells are CAPITAL
 #
 # + variables local to the script are lowercase, possibly with
-#   an l_ ("local") prefix
+#   an l_ ("local") prefix.
+#
+# There are unfortunately exceptions:
+# name, l_usrtree, l_objtree
 
 # SRC points to your FreeBSD source tree.
 # l_usrtree points to the /usr subdir for the source tree.
 #     Normally /usr or ${SRC}/../usr
 # l_objtree points to the obj tree. Normally ${l_usrtree}/obj-pico
+# c_label is either bsdlabel or disklabel
 # PICO_TREE is where standard picobsd stuff resides.
 #     Normally ${SRC}/release/picobsd
 # You can set SRC with --src 
@@ -71,28 +77,27 @@
 # MY_TREE (set later) is where this floppy type resides.
 # BUILDDIR is the build directory
 
-# set some default values for variables.
-# needs to be done as the first thing in the script.
-
 # log something on stdout if verbose.
 o_verbose=0	# this needs to be here!
-log() {
+log() {	#	message
     local foo
     [ ${o_verbose} -gt 0 ] && printf "\n*** %s\n" "$*"
     [ ${o_verbose}  -gt 1 ] && read -p "=== Press enter to continue" foo
     return 0
 }
 
-logverbose() {
+# unconditionally log and wait for input
+logverbose() {	# message
     local foo
     printf "\n*** %s\n" "$*"
     read -p "=== Press enter to continue" foo
     return 0
 }
 
-set_defaults() {
-    # no way to use logging in this function, variable not set yet.
+# set some default values for variables.
+# needs to be done as the first thing in the script.
 
+set_defaults() {	# no arguments
     # EDITOR is the editor you use
     # fd_size  floppy size in KB (default to 1440). You can use 1480,
     #	1720, 2880, etc. but beware that only 1440 and 1480 will boot
@@ -101,15 +106,20 @@ set_defaults() {
     fd_size=${fd_size:-1440}
 
     o_use_loader="yes"		# use /boot/loader
-    o_all_in_mfs="yes"		# put all files in mfs so you can boot and run
-				# the image via diskless boot.
-    o_clean=""			# do not clean
+	# You should not change it unless you are really short
+	# of space, and your kernel is small enough that the
+	# bootblocks manage to load it.
+
+    o_all_in_mfs="yes"		# put all files in mfs so you can boot
+				# and run the image via diskless boot.
+    o_clean=""			# set if you want to clean prev.builds.
     o_interactive=""		# default is interactive
     o_verbose=0			# verbose level, 0 is silent
     o_tarv=""			# tar verbose flag, "" or "v"
-    o_init_src=""		# non "" if we need to init libs and includes.
+    o_init_src=""		# set to build libs and includes.
     o_makeopts=${MAKEOPTS:--s}	# make options, be silent by default
-    o_no_devfs=yes		# we do not want devfs
+    o_no_devfs=			# default is use devfs.
+	# You should only set it when building 4.x images
     o_do_modules=""		# do not build modules
 
     SRC="/usr/src"		# default location for sources
@@ -132,13 +142,13 @@ set_defaults() {
     c_img=picobsd.bin		# filename used for the picobsd image
     generate_iso="NO"		# don't generate the iso image
 
-    # select the right memory disk name
+    # select the right disklabel program
     case `uname -r` in
-	7.*|6.*|5.*)
-	    l_label="bsdlabel"
+	4.*)
+	    c_label="disklabel"
 	    ;;
 	*)
-	    l_label="disklabel"
+	    c_label="bsdlabel"
 	    ;;
     esac
 
@@ -173,7 +183,7 @@ create_includes_and_libraries() {
 
     log "create_includes_and_libraries() for ${SRC}"
     # Optionally creates include directory and libraries.
-    mkdir -p ${l_usrtree}/include		# the include directory...
+    mkdir -p ${l_usrtree}/include	# the include directory...
     mkdir -p ${l_usrtree}/share/misc	# a few things go here
     mkdir -p ${l_usrtree}/lib		# libraries
     mkdir -p ${l_usrtree}/sbin		# some binaries
@@ -210,11 +220,12 @@ create_includes_and_libraries() {
     log "Libraries done"
 }
 
-# set_type  looks in user or system directories for the floppy type
-# specified as first argument, and sets variables according to the config.
-# file. Also sets MY_TREE and BUILDDIR and SITE
+# set_type  [the_site] looks in user or system directories
+# for the directory named as the first argument, reads the configuration
+# files and sets variables according to the config.
+# Also sets MY_TREE and BUILDDIR and SITE
 
-set_type() {
+set_type() {	# the_type the_site
     local a i
 
     log "set_type() : Type '$1' site '$2'"
@@ -312,27 +323,6 @@ build_image() {
     fill_floppy_image # copies everything into the floppy
 }
 
-build_package() {
-    local z msg
-
-    log "build_package()"
-    rm -rf build.status
-    echo "##############################################" >>build.status
-    echo "## `date` ">>build.status
-    echo "##############################################" >>build.status
-    for z in bridge dial router net isp ; do
-	set_type ${z}
-	echo "---------------------------------------------">>build.status
-	echo "Building TYPE=${z}, SIZE=${MFS_SIZE}" >>build.status
-	msg="(ok)"	# error message
-	build_image || msg="** FAILED! **"
-        echo "	${msg}">>build.status
-	# where do i put things ?
-	# clean_tree
-    done
-    exit 0
-}
-
 # Set build parameters interactively
 
 main_dialog() {
@@ -664,6 +654,7 @@ populate_mfs_tree() {
     if [ -n "${copy_files}" ] ; then
 	do_copyfiles ${dst} copy_files
     fi
+    do_copyfiles_user ${dst} || true
 
     # The 'import_files' mechanism is deprecated, as it requires
     # root permissions to follow the symlinks, and also does
@@ -829,22 +820,22 @@ fill_floppy_image() {
     (cd ${BUILDDIR}
     makefs -t ffs -o bsize=4096 -o fsize=512 \
 	-s ${blocks}k -f 50 ${c_img} ${dst}
-    # ${l_label} -f `pwd`/${c_img}
-    ${l_label} -w -f `pwd`/${c_img} auto # write in a label
+
+    ${c_label} -w -f `pwd`/${c_img} auto # write in a label
     # copy partition c: into a: with some sed magic
-    ${l_label} -f `pwd`/${c_img} | sed -e '/  c:/{p;s/c:/a:/;}' | \
-	${l_label} -R -f `pwd`/${c_img} /dev/stdin
-    ${l_label} -f `pwd`/${c_img}
+    ${c_label} -f `pwd`/${c_img} | sed -e '/  c:/{p;s/c:/a:/;}' | \
+	${c_label} -R -f `pwd`/${c_img} /dev/stdin
+    ${c_label} -f `pwd`/${c_img}
 
     ls -l ${c_img}
-    ${l_label} -f `pwd`/${c_img}
+    ${c_label} -f `pwd`/${c_img}
     logverbose "after disklabel"
     )
 
     echo "BUILDDIR ${BUILDDIR}"
     if [ "${generate_iso}" = "YES" ]; then
 	echo "generate_iso ${generate_iso}"
-	#build_iso_image()
+	# build_iso_image	# XXX not implemented yet
 	exit 1
     fi
 
@@ -968,12 +959,10 @@ while [ true ]; do
     esac
     shift
 done
+
 set_build_parameters	# things that depend on ${SRC}
 set_type $1 $2		# type and site, respectively
 
-# If $1="package", it creates a neat set of floppies
-[ "$1" = "package" ] && build_package
-
 [ "${o_interactive}" != "NO" ] && main_dialog
 
 if [ "${o_clean}" = "YES" ] ; then

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 24 16:44:02 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BE342106579A;
	Tue, 24 Mar 2009 16:44:02 +0000 (UTC)
	(envelope-from vanhu@zeninc.net)
Received: from smtp.zeninc.net (smtp.zeninc.net [80.67.176.25])
	by mx1.freebsd.org (Postfix) with ESMTP id 70EC38FC21;
	Tue, 24 Mar 2009 16:44:02 +0000 (UTC)
	(envelope-from vanhu@zeninc.net)
Received: from astro.zen.inc (astro.zen.inc [192.168.1.239])
	by smtp.zeninc.net (smtpd) with ESMTP id 7547C2798B8;
	Tue, 24 Mar 2009 17:28:13 +0100 (CET)
Received: by astro.zen.inc (Postfix, from userid 1000)
	id 9B4E61704C; Tue, 24 Mar 2009 17:31:00 +0100 (CET)
Date: Tue, 24 Mar 2009 17:31:00 +0100
From: VANHULLEBUS Yvan 
To: "Bjoern A. Zeeb" 
Message-ID: <20090324163100.GA59404@zeninc.net>
References: <200903161509.n2GF9lT6063773@svn.freebsd.org>
	<20090316163648.Q96785@maildrop.int.zabbadoz.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20090316163648.Q96785@maildrop.int.zabbadoz.net>
User-Agent: All mail clients suck. This one just sucks less.
Cc: svn-src-head@freebsd.org, "George V. Neville-Neil" ,
	svn-src-all@freebsd.org, src-committers@freebsd.org
Subject: Re:  svn commit: r189877 - head/contrib/libpcap
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 16:44:07 -0000

On Mon, Mar 16, 2009 at 04:38:56PM +0000, Bjoern A. Zeeb wrote:
[...]
> If you haven't you should also submit this upstream as OpenBSD can
> make use of that as well. (www.tcpdump.org)

Done.


> All entries (that aren't overlong) are tab separated in in the
> linktype_map map[]. It would be nice, to keep the style of the vendor.

I noticed the tab at the beginning of the line, but not that one,
fixed.


Yvan.

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 24 17:10:42 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D58311065B13;
	Tue, 24 Mar 2009 17:10:42 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A2D5C8FC16;
	Tue, 24 Mar 2009 17:10:42 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2OHAgXw051674;
	Tue, 24 Mar 2009 17:10:42 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2OHAgSF051673;
	Tue, 24 Mar 2009 17:10:42 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200903241710.n2OHAgSF051673@svn.freebsd.org>
From: Sam Leffler 
Date: Tue, 24 Mar 2009 17:10:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190379 - head/sys/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 17:10:47 -0000

Author: sam
Date: Tue Mar 24 17:10:42 2009
New Revision: 190379
URL: http://svn.freebsd.org/changeset/base/190379

Log:
  require wlan for ancillary modules; they are required to link

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Tue Mar 24 16:03:46 2009	(r190378)
+++ head/sys/conf/files	Tue Mar 24 17:10:42 2009	(r190379)
@@ -2189,14 +2189,14 @@ net/zlib.c			optional crypto | geom_uzip
 					 mxge | netgraph_deflate | \
 					 ddb_ctf
 net80211/ieee80211.c		optional wlan
-net80211/ieee80211_acl.c	optional wlan_acl
+net80211/ieee80211_acl.c	optional wlan wlan_acl
 net80211/ieee80211_adhoc.c	optional wlan
-net80211/ieee80211_amrr.c	optional wlan_amrr
+net80211/ieee80211_amrr.c	optional wlan wlan_amrr
 net80211/ieee80211_crypto.c	optional wlan
-net80211/ieee80211_crypto_ccmp.c optional wlan_ccmp
+net80211/ieee80211_crypto_ccmp.c optional wlan wlan_ccmp
 net80211/ieee80211_crypto_none.c optional wlan
-net80211/ieee80211_crypto_tkip.c optional wlan_tkip
-net80211/ieee80211_crypto_wep.c	optional wlan_wep
+net80211/ieee80211_crypto_tkip.c optional wlan wlan_tkip
+net80211/ieee80211_crypto_wep.c	optional wlan wlan_wep
 net80211/ieee80211_ddb.c	optional wlan ddb
 net80211/ieee80211_dfs.c	optional wlan
 net80211/ieee80211_freebsd.c	optional wlan
@@ -2211,13 +2211,13 @@ net80211/ieee80211_phy.c	optional wlan
 net80211/ieee80211_power.c	optional wlan
 net80211/ieee80211_proto.c	optional wlan
 net80211/ieee80211_regdomain.c	optional wlan
-net80211/ieee80211_rssadapt.c	optional wlan_rssadapt
+net80211/ieee80211_rssadapt.c	optional wlan wlan_rssadapt
 net80211/ieee80211_scan.c	optional wlan
 net80211/ieee80211_scan_sta.c	optional wlan
 net80211/ieee80211_sta.c	optional wlan
 net80211/ieee80211_tdma.c	optional wlan
 net80211/ieee80211_wds.c	optional wlan
-net80211/ieee80211_xauth.c	optional wlan_xauth
+net80211/ieee80211_xauth.c	optional wlan wlan_xauth
 netatalk/aarp.c			optional netatalk
 netatalk/at_control.c		optional netatalk
 netatalk/at_proto.c		optional netatalk

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 24 17:13:36 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28])
	by hub.freebsd.org (Postfix) with ESMTP id 9212B1065A6C;
	Tue, 24 Mar 2009 17:13:36 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
From: Jung-uk Kim 
To: Ganbold 
Date: Tue, 24 Mar 2009 13:13:26 -0400
User-Agent: KMail/1.6.2
References: <200903170048.n2H0mCw4076588@svn.freebsd.org>
	<49C83C66.5060500@micom.mng.net>
In-Reply-To: <49C83C66.5060500@micom.mng.net>
MIME-Version: 1.0
Content-Disposition: inline
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <200903241313.28897.jkim@FreeBSD.org>
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r189903 - in head/sys: amd64/acpica
 amd64/amd64	amd64/include conf dev/acpica i386/i386 kern sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 17:13:38 -0000

On Monday 23 March 2009 09:50 pm, Ganbold wrote:
> Jung-uk Kim wrote:
> > Author: jkim
> > Date: Tue Mar 17 00:48:11 2009
> > New Revision: 189903
> > URL: http://svn.freebsd.org/changeset/base/189903
> >
> > Log:
> >   Initial suspend/resume support for amd64.
> >
> >   This code is heavily inspired by Takanori Watanabe's
> > experimental SMP patch for i386 and large portion was shamelessly
> > cut and pasted from Peter Wemm's AP boot code.
>
> Sorry for responding late, but is there any chance that
> similar support can be committed for i386?

Sorry, I don't have much free time lately and my development 
environment is totally 64-bit ATM.  If anyone submit a patch, I am 
willing to review, though.

Jung-uk Kim

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 24 17:14:34 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9ECE71065B09;
	Tue, 24 Mar 2009 17:14:34 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 88E298FC13;
	Tue, 24 Mar 2009 17:14:34 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2OHEYpB051787;
	Tue, 24 Mar 2009 17:14:34 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2OHEYnX051781;
	Tue, 24 Mar 2009 17:14:34 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200903241714.n2OHEYnX051781@svn.freebsd.org>
From: Robert Watson 
Date: Tue, 24 Mar 2009 17:14:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190380 - in head/sys: cddl/dev/dtnfsclient nfsclient
	sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 17:14:37 -0000

Author: rwatson
Date: Tue Mar 24 17:14:34 2009
New Revision: 190380
URL: http://svn.freebsd.org/changeset/base/190380

Log:
  Add DTrace probes to the NFS access and attribute caches.  Access cache
  events are:
  
    nfsclient:accesscache:flush:done
    nfsclient:accesscache:get:hit
    nfsclient:accesscache:get:miss
    nfsclient:accesscache:load:done
  
  They pass the vnode, uid, and requested or loaded access mode (if any);
  the load event may also report a load error if the RPC fails.
  
  The attribute cache events are:
  
    nfsclient:attrcache:flush:done
    nfsclient:attrcache:get:hit
    nfsclient:attrcache:get:miss
    nfsclient:attrcache:load:done
  
  They pass the vnode, optionally the vattr if one is present (hit or load),
  and in the case of a load event, also a possible RPC error.
  
  MFC after:	1 month
  Sponsored by:	Google, Inc.

Added:
  head/sys/nfsclient/nfs_kdtrace.h   (contents, props changed)
Modified:
  head/sys/cddl/dev/dtnfsclient/dtnfsclient.c
  head/sys/nfsclient/nfs_bio.c
  head/sys/nfsclient/nfs_subs.c
  head/sys/nfsclient/nfs_vnops.c
  head/sys/sys/dtrace_bsd.h

Modified: head/sys/cddl/dev/dtnfsclient/dtnfsclient.c
==============================================================================
--- head/sys/cddl/dev/dtnfsclient/dtnfsclient.c	Tue Mar 24 17:10:42 2009	(r190379)
+++ head/sys/cddl/dev/dtnfsclient/dtnfsclient.c	Tue Mar 24 17:14:34 2009	(r190380)
@@ -44,11 +44,13 @@ __FBSDID("$FreeBSD$");
 
 /*
  * dtnfsclient is a DTrace provider that tracks the intent to perform RPCs
- * in the NFS client.  This is not quite the same as RPCs, because NFS may
+ * in the NFS client, as well as acess to and maintenance of the access and
+ * attribute caches.  This is not quite the same as RPCs, because NFS may
  * issue multiple RPC transactions in the event that authentication fails,
- * there's a jukebox error, etc.  However, it cleanly represents the logical
- * layer between RPC transmission and vnode/vfs operations, providing access
- * to state linking the two.
+ * there's a jukebox error, or none at all if the access or attribute cache
+ * hits.  However, it cleanly represents the logical layer between RPC
+ * transmission and vnode/vfs operations, providing access to state linking
+ * the two.
  */
 
 static int	dtnfsclient_unload(void);
@@ -68,6 +70,9 @@ static dtrace_pattr_t dtnfsclient_attr =
 { DTRACE_STABILITY_STABLE, DTRACE_STABILITY_STABLE, DTRACE_CLASS_COMMON },
 };
 
+/*
+ * Descrition of NFSv3 and (optional) NFSv2 probes for a procedure.
+ */
 struct dtnfsclient_rpc {
 	char		*nr_v3_name;
 	char		*nr_v2_name;	/* Or NULL if none. */
@@ -109,11 +114,28 @@ static struct dtnfsclient_rpc	dtnfsclien
 	{ "noop" },
 };
 
-static char	*dtnfsclient_v2modulename = "nfs2";
-static char	*dtnfsclient_v3modulename = "nfs3";
+/*
+ * Module name strings.
+ */
+static char	*dtnfsclient_accesscache_str = "accesscache";
+static char	*dtnfsclient_attrcache_str = "attrcache";
+static char	*dtnfsclient_nfs2_str = "nfs2";
+static char	*dtnfsclient_nfs3_str = "nfs3";
+
+/*
+ * Function name strings.
+ */
+static char	*dtnfsclient_flush_str = "flush";
+static char	*dtnfsclient_load_str = "load";
+static char	*dtnfsclient_get_str = "get";
 
-static char	*dtnfsclient_start = "start";
-static char	*dtnfsclient_done = "done";
+/*
+ * Name strings.
+ */
+static char	*dtnfsclient_done_str = "done";
+static char	*dtnfsclient_hit_str = "hit";
+static char	*dtnfsclient_miss_str = "miss";
+static char	*dtnfsclient_start_str = "start";
 
 static dtrace_pops_t dtnfsclient_pops = {
 	dtnfsclient_provide,
@@ -131,7 +153,22 @@ static dtrace_pops_t dtnfsclient_pops = 
 static dtrace_provider_id_t	dtnfsclient_id;
 
 /*
- * When tracing on a procedure is enabled, the DTrace ID for the event is
+ * Most probes are generated from the above RPC table, but for access and
+ * attribute caches, we have specific IDs we recognize and handle specially
+ * in various spots.
+ */
+extern uint32_t	nfsclient_accesscache_flush_done_id;
+extern uint32_t	nfsclient_accesscache_get_hit_id;
+extern uint32_t	nfsclient_accesscache_get_miss_id;
+extern uint32_t	nfsclient_accesscache_load_done_id;
+
+extern uint32_t	nfsclient_attrcache_flush_done_id;
+extern uint32_t	nfsclient_attrcache_get_hit_id;
+extern uint32_t	nfsclient_attrcache_get_miss_id;
+extern uint32_t	nfsclient_attrcache_load_done_id;
+
+/*
+ * When tracing on a procedure is enabled, the DTrace ID for an RPC event is
  * stored in one of these two NFS client-allocated arrays; 0 indicates that
  * the event is not being traced so probes should not be called.
  *
@@ -167,28 +204,102 @@ dtnfsclient_getargdesc(void *arg, dtrace
 {
 	const char *p = NULL;
 
-	switch (desc->dtargd_ndx) {
-	case 0:
-		p = "struct vnode *";
-		break;
-	case 1:
-		p = "struct mbuf *";
-		break;
-	case 2:
-		p = "struct ucred *";
-		break;
-	case 3:
-		p = "int";
-		break;
-	case 4:
-		if (dtnfs23_isdoneprobe(id)) {
+	if (id == nfsclient_accesscache_flush_done_id ||
+	    id == nfsclient_attrcache_flush_done_id ||
+	    id == nfsclient_attrcache_get_miss_id) {
+		switch (desc->dtargd_ndx) {
+		case 0:
+			p = "struct vnode *";
+			break;
+		default:
+			desc->dtargd_ndx = DTRACE_ARGNONE;
+			break;
+		}
+	} else if (id == nfsclient_accesscache_get_hit_id ||
+	    id == nfsclient_accesscache_get_miss_id) {
+		switch (desc->dtargd_ndx) {
+		case 0:
+			p = "struct vnode *";
+			break;
+		case 1:
+			p = "uid_t";
+			break;
+		case 2:
+			p = "uint32_t";
+			break;
+		default:
+			desc->dtargd_ndx = DTRACE_ARGNONE;
+			break;
+		}
+	} else if (id == nfsclient_accesscache_load_done_id) {
+		switch (desc->dtargd_ndx) {
+		case 0:
+			p = "struct vnode *";
+			break;
+		case 1:
+			p = "uid_t";
+			break;
+		case 2:
+			p = "uint32_t";
+			break;
+		case 3:
 			p = "int";
 			break;
+		default:
+			desc->dtargd_ndx = DTRACE_ARGNONE;
+			break;
+		}
+	} else if (id == nfsclient_attrcache_get_hit_id) {
+		switch (desc->dtargd_ndx) {
+		case 0:
+			p = "struct vnode *";
+			break;
+		case 1:
+			p = "struct vattr *";
+			break;
+		default:
+			desc->dtargd_ndx = DTRACE_ARGNONE;
+			break;
+		}
+	} else if (id == nfsclient_attrcache_load_done_id) {
+		switch (desc->dtargd_ndx) {
+		case 0:
+			p = "struct vnode *";
+			break;
+		case 1:
+			p = "struct vattr *";
+			break;
+		case 2:
+			p = "int";
+			break;
+		default:
+			desc->dtargd_ndx = DTRACE_ARGNONE;
+			break;
+		}
+	} else {
+		switch (desc->dtargd_ndx) {
+		case 0:
+			p = "struct vnode *";
+			break;
+		case 1:
+			p = "struct mbuf *";
+			break;
+		case 2:
+			p = "struct ucred *";
+			break;
+		case 3:
+			p = "int";
+			break;
+		case 4:
+			if (dtnfs23_isdoneprobe(id)) {
+				p = "int";
+				break;
+			}
+			/* FALLSTHROUGH */
+		default:
+			desc->dtargd_ndx = DTRACE_ARGNONE;
+			break;
 		}
-		/* FALLSTHROUGH */
-	default:
-		desc->dtargd_ndx = DTRACE_ARGNONE;
-		break;
 	}
 	if (p != NULL)
 		strlcpy(desc->dtargd_native, p, sizeof(desc->dtargd_native));
@@ -203,56 +314,112 @@ dtnfsclient_provide(void *arg, dtrace_pr
 		return;
 
 	/*
-	 * First, register NFSv2 RPC procedures; note sparseness check for
-	 * each slot in the NFSv3 procnum-indexed array.
+	 * Register access cache probes.
+	 */
+	if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_accesscache_str,
+	    dtnfsclient_flush_str, dtnfsclient_done_str) == 0) {
+		nfsclient_accesscache_flush_done_id = dtrace_probe_create(
+		    dtnfsclient_id, dtnfsclient_accesscache_str,
+		    dtnfsclient_flush_str, dtnfsclient_done_str, 0, NULL);
+	}
+	if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_accesscache_str,
+	    dtnfsclient_get_str, dtnfsclient_hit_str) == 0) {
+		nfsclient_accesscache_get_hit_id = dtrace_probe_create(
+		    dtnfsclient_id, dtnfsclient_accesscache_str,
+		    dtnfsclient_get_str, dtnfsclient_hit_str, 0, NULL);
+	}
+	if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_accesscache_str,
+	    dtnfsclient_get_str, dtnfsclient_miss_str) == 0) {
+		nfsclient_accesscache_get_miss_id = dtrace_probe_create(
+		    dtnfsclient_id, dtnfsclient_accesscache_str,
+		    dtnfsclient_get_str, dtnfsclient_miss_str, 0, NULL);
+	}
+	if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_accesscache_str,
+	    dtnfsclient_load_str, dtnfsclient_done_str) == 0) {
+		nfsclient_accesscache_load_done_id = dtrace_probe_create(
+		    dtnfsclient_id, dtnfsclient_accesscache_str,
+		    dtnfsclient_load_str, dtnfsclient_done_str, 0, NULL);
+	}
+
+	/*
+	 * Register attribute cache probes.
+	 */
+	if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_attrcache_str,
+	    dtnfsclient_flush_str, dtnfsclient_done_str) == 0) {
+		nfsclient_attrcache_flush_done_id = dtrace_probe_create(
+		    dtnfsclient_id, dtnfsclient_attrcache_str,
+		    dtnfsclient_flush_str, dtnfsclient_done_str, 0, NULL);
+	}
+	if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_attrcache_str,
+	    dtnfsclient_get_str, dtnfsclient_hit_str) == 0) {
+		nfsclient_attrcache_get_hit_id = dtrace_probe_create(
+		    dtnfsclient_id, dtnfsclient_attrcache_str,
+		    dtnfsclient_get_str, dtnfsclient_hit_str, 0, NULL);
+	}
+	if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_attrcache_str,
+	    dtnfsclient_get_str, dtnfsclient_miss_str) == 0) {
+		nfsclient_attrcache_get_miss_id = dtrace_probe_create(
+		    dtnfsclient_id, dtnfsclient_attrcache_str,
+		    dtnfsclient_get_str, dtnfsclient_miss_str, 0, NULL);
+	}
+	if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_attrcache_str,
+	    dtnfsclient_load_str, dtnfsclient_done_str) == 0) {
+		nfsclient_attrcache_load_done_id = dtrace_probe_create(
+		    dtnfsclient_id, dtnfsclient_attrcache_str,
+		    dtnfsclient_load_str, dtnfsclient_done_str, 0, NULL);
+	}
+
+	/*
+	 * Register NFSv2 RPC procedures; note sparseness check for each slot
+	 * in the NFSv3 procnum-indexed array.
 	 */
 	for (i = 0; i < NFS_NPROCS; i++) {
 		if (dtnfsclient_rpcs[i].nr_v2_name != NULL &&
-		    dtrace_probe_lookup(dtnfsclient_id,
-		    dtnfsclient_v2modulename, dtnfsclient_rpcs[i].nr_v2_name,
-		    dtnfsclient_start) == 0) {
+		    dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_nfs2_str,
+		    dtnfsclient_rpcs[i].nr_v2_name, dtnfsclient_start_str) ==
+		    0) {
 			dtnfsclient_rpcs[i].nr_v2_id_start =
 			    dtrace_probe_create(dtnfsclient_id,
-			    dtnfsclient_v2modulename,
+			    dtnfsclient_nfs2_str,
 			    dtnfsclient_rpcs[i].nr_v2_name,
-			    dtnfsclient_start, 0,
+			    dtnfsclient_start_str, 0,
 			    &nfsclient_nfs2_start_probes[i]);
 		}
 		if (dtnfsclient_rpcs[i].nr_v2_name != NULL &&
-		    dtrace_probe_lookup(dtnfsclient_id,
-		    dtnfsclient_v2modulename, dtnfsclient_rpcs[i].nr_v2_name,
-		    dtnfsclient_done) == 0) {
+		    dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_nfs2_str,
+		    dtnfsclient_rpcs[i].nr_v2_name, dtnfsclient_done_str) ==
+		    0) {
 			dtnfsclient_rpcs[i].nr_v2_id_done = 
 			    dtrace_probe_create(dtnfsclient_id,
-			    dtnfsclient_v2modulename,
+			    dtnfsclient_nfs2_str,
 			    dtnfsclient_rpcs[i].nr_v2_name,
-			    dtnfsclient_done, 0,
+			    dtnfsclient_done_str, 0,
 			    &nfsclient_nfs2_done_probes[i]);
 		}
 	}
 
 	/*
-	 * Now, register NFSv3 RPC procedures.
+	 * Register NFSv3 RPC procedures.
 	 */
 	for (i = 0; i < NFS_NPROCS; i++) {
-		if (dtrace_probe_lookup(dtnfsclient_id,
-		    dtnfsclient_v3modulename, dtnfsclient_rpcs[i].nr_v3_name,
-		    dtnfsclient_start) == 0) {
+		if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_nfs3_str,
+		    dtnfsclient_rpcs[i].nr_v3_name, dtnfsclient_start_str) ==
+		    0) {
 			dtnfsclient_rpcs[i].nr_v3_id_start =
 			    dtrace_probe_create(dtnfsclient_id,
-			    dtnfsclient_v3modulename,
+			    dtnfsclient_nfs3_str,
 			    dtnfsclient_rpcs[i].nr_v3_name,
-			    dtnfsclient_start, 0,
+			    dtnfsclient_start_str, 0,
 			    &nfsclient_nfs3_start_probes[i]);
 		}
-		if (dtrace_probe_lookup(dtnfsclient_id,
-		    dtnfsclient_v3modulename, dtnfsclient_rpcs[i].nr_v3_name,
-		    dtnfsclient_done) == 0) {
+		if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_nfs3_str,
+		    dtnfsclient_rpcs[i].nr_v3_name, dtnfsclient_done_str) ==
+		    0) {
 			dtnfsclient_rpcs[i].nr_v3_id_done = 
 			    dtrace_probe_create(dtnfsclient_id,
-			    dtnfsclient_v3modulename,
+			    dtnfsclient_nfs3_str,
 			    dtnfsclient_rpcs[i].nr_v3_name,
-			    dtnfsclient_done, 0,
+			    dtnfsclient_done_str, 0,
 			    &nfsclient_nfs3_done_probes[i]);
 		}
 	}
@@ -267,8 +434,26 @@ static void
 dtnfsclient_enable(void *arg, dtrace_id_t id, void *parg)
 {
 	uint32_t *p = parg;
+	void *f = dtrace_probe;
 
-	*p = id;
+	if (id == nfsclient_accesscache_flush_done_id)
+		dtrace_nfsclient_accesscache_flush_done_probe = f;
+	else if (id == nfsclient_accesscache_get_hit_id)
+		dtrace_nfsclient_accesscache_get_hit_probe = f;
+	else if (id == nfsclient_accesscache_get_miss_id)
+		dtrace_nfsclient_accesscache_get_miss_probe = f;
+	else if (id == nfsclient_accesscache_load_done_id)
+		dtrace_nfsclient_accesscache_load_done_probe = f;
+	else if (id == nfsclient_attrcache_flush_done_id)
+		dtrace_nfsclient_attrcache_flush_done_probe = f;
+	else if (id == nfsclient_attrcache_get_hit_id)
+		dtrace_nfsclient_attrcache_get_hit_probe = f;
+	else if (id == nfsclient_attrcache_get_miss_id)
+		dtrace_nfsclient_attrcache_get_miss_probe = f;
+	else if (id == nfsclient_attrcache_load_done_id)
+		dtrace_nfsclient_attrcache_load_done_probe = f;
+	else
+		*p = id;
 }
 
 static void
@@ -276,7 +461,24 @@ dtnfsclient_disable(void *arg, dtrace_id
 {
 	uint32_t *p = parg;
 
-	*p = 0;
+	if (id == nfsclient_accesscache_flush_done_id)
+		dtrace_nfsclient_accesscache_flush_done_probe = NULL;
+	else if (id == nfsclient_accesscache_get_hit_id)
+		dtrace_nfsclient_accesscache_get_hit_probe = NULL;
+	else if (id == nfsclient_accesscache_get_miss_id)
+		dtrace_nfsclient_accesscache_get_miss_probe = NULL;
+	else if (id == nfsclient_accesscache_load_done_id)
+		dtrace_nfsclient_accesscache_load_done_probe = NULL;
+	else if (id == nfsclient_attrcache_flush_done_id)
+		dtrace_nfsclient_attrcache_flush_done_probe = NULL;
+	else if (id == nfsclient_attrcache_get_hit_id)
+		dtrace_nfsclient_attrcache_get_hit_probe = NULL;
+	else if (id == nfsclient_attrcache_get_miss_id)
+		dtrace_nfsclient_attrcache_get_miss_probe = NULL;
+	else if (id == nfsclient_attrcache_load_done_id)
+		dtrace_nfsclient_attrcache_load_done_probe = NULL;
+	else
+		*p = 0;
 }
 
 static void

Modified: head/sys/nfsclient/nfs_bio.c
==============================================================================
--- head/sys/nfsclient/nfs_bio.c	Tue Mar 24 17:10:42 2009	(r190379)
+++ head/sys/nfsclient/nfs_bio.c	Tue Mar 24 17:14:34 2009	(r190380)
@@ -35,6 +35,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_kdtrace.h"
+
 #include 
 #include 
 #include 
@@ -61,6 +63,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -403,6 +406,7 @@ nfs_bioread_check_cons(struct vnode *vp,
 				goto out;
 		}
 		np->n_attrstamp = 0;
+		KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
 		error = VOP_GETATTR(vp, &vattr, cred);
 		if (error)
 			goto out;
@@ -915,6 +919,7 @@ nfs_write(struct vop_write_args *ap)
 #endif
 flush_and_restart:
 			np->n_attrstamp = 0;
+			KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
 			error = nfs_vinvalbuf(vp, V_SAVE, td, 1);
 			if (error)
 				return (error);
@@ -928,6 +933,7 @@ flush_and_restart:
 	 */
 	if (ioflag & IO_APPEND) {
 		np->n_attrstamp = 0;
+		KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
 		error = VOP_GETATTR(vp, &vattr, cred);
 		if (error)
 			return (error);
@@ -1756,6 +1762,7 @@ nfs_doio(struct vnode *vp, struct buf *b
 			mtx_lock(&np->n_mtx);
 			np->n_flag |= NWRITEERR;
 			np->n_attrstamp = 0;
+			KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
 			mtx_unlock(&np->n_mtx);
 		    }
 		    bp->b_dirtyoff = bp->b_dirtyend = 0;

Added: head/sys/nfsclient/nfs_kdtrace.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/nfsclient/nfs_kdtrace.h	Tue Mar 24 17:14:34 2009	(r190380)
@@ -0,0 +1,121 @@
+/*-
+ * Copyright (c) 2009 Robert N. M. Watson
+ * All rights reserved.
+ *
+ * This software was developed at the University of Cambridge Computer
+ * Laboratory with support from a grant from Google, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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$
+ */
+
+#ifndef _NFSCLIENT_NFS_KDTRACE_H_
+#define	_NFSCLIENT_NFS_KDTRACE_H_
+
+#ifdef KDTRACE_HOOKS
+#include 
+
+/*
+ * Definitions for NFS access cache probes.
+ */
+extern uint32_t nfsclient_accesscache_flush_done_id;
+extern uint32_t nfsclient_accesscache_get_hit_id;
+extern uint32_t nfsclient_accesscache_get_miss_id;
+extern uint32_t nfsclient_accesscache_load_done_id;
+
+#define	KDTRACE_NFS_ACCESSCACHE_FLUSH_DONE(vp)	do {			\
+	if (dtrace_nfsclient_accesscache_flush_done_probe != NULL)	\
+		(dtrace_nfsclient_accesscache_flush_done_probe)(	\
+		    nfsclient_accesscache_flush_done_id, (vp));		\
+} while (0)
+
+#define	KDTRACE_NFS_ACCESSCACHE_GET_HIT(vp, uid, mode)	do {		\
+	if (dtrace_nfsclient_accesscache_get_hit_probe != NULL)		\
+		(dtrace_nfsclient_accesscache_get_hit_probe)(		\
+		    nfsclient_accesscache_get_hit_id, (vp), (uid),	\
+		    (mode));						\
+} while (0)
+	
+#define	KDTRACE_NFS_ACCESSCACHE_GET_MISS(vp, uid, mode)	do {		\
+	if (dtrace_nfsclient_accesscache_get_miss_probe != NULL)	\
+		(dtrace_nfsclient_accesscache_get_miss_probe)(		\
+		    nfsclient_accesscache_get_miss_id, (vp), (uid),	\
+		    (mode));						\
+} while (0)
+
+#define	KDTRACE_NFS_ACCESSCACHE_LOAD_DONE(vp, uid, rmode, error) do {	\
+	if (error && dtrace_nfsclient_accesscache_load_done_probe !=	\
+	    NULL)							\
+		(dtrace_nfsclient_accesscache_load_done_probe)(		\
+		    nfsclient_accesscache_load_done_id, (vp), (uid),	\
+		    (rmode), (error));					\
+} while (0)
+
+/*
+ * Definitions for NFS attribute cache probes.
+ */
+extern uint32_t nfsclient_attrcache_flush_done_id;
+extern uint32_t nfsclient_attrcache_get_hit_id;
+extern uint32_t nfsclient_attrcache_get_miss_id;
+extern uint32_t nfsclient_attrcache_load_done_id;
+
+#define	KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp)	do {			\
+	if (dtrace_nfsclient_attrcache_flush_done_probe != NULL)	\
+		(dtrace_nfsclient_attrcache_flush_done_probe)(		\
+		    nfsclient_attrcache_flush_done_id, (vp));		\
+} while (0)
+
+#define	KDTRACE_NFS_ATTRCACHE_GET_HIT(vp, vap)	do {			\
+	if (dtrace_nfsclient_attrcache_get_hit_probe != NULL)		\
+		(dtrace_nfsclient_attrcache_get_hit_probe)(		\
+		    nfsclient_attrcache_get_hit_id, (vp), (vap));	\
+} while (0)
+
+#define	KDTRACE_NFS_ATTRCACHE_GET_MISS(vp)	do {			\
+	if (dtrace_nfsclient_attrcache_get_miss_probe != NULL)		\
+		(dtrace_nfsclient_attrcache_get_miss_probe)(		\
+			    nfsclient_attrcache_get_miss_id, (vp));	\
+} while (0)
+
+#define	KDTRACE_NFS_ATTRCACHE_LOAD_DONE(vp, vap, error)	do {		\
+	if (dtrace_nfsclient_attrcache_load_done_probe != NULL)		\
+		(dtrace_nfsclient_attrcache_load_done_probe)(		\
+		    nfsclient_attrcache_load_done_id, (vp), (vap),	\
+		    (error));						\
+} while (0)
+
+#else /* !KDTRACE_HOOKS */
+
+#define	KDTRACE_NFS_ACCESSCACHE_FLUSH_DONE(vp)
+#define	KDTRACE_NFS_ACCESSCACHE_GET_HIT(vp, uid, mode)
+#define	KDTRACE_NFS_ACCESSCACHE_GET_MISS(vp, uid, mode)
+#define	KDTRACE_NFS_ACCESSCACHE_LOAD_DONE(vp, uid, rmode, error)
+
+#define	KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp)
+#define	KDTRACE_NFS_ATTRCACHE_GET_HIT(vp, vap)
+#define	KDTRACE_NFS_ATTRCACHE_GET_MISS(vp)
+#define	KDTRACE_NFS_ATTRCACHE_LOAD_DONE(vp, vap, error)
+
+#endif /* KDTRACE_HOOKS */
+
+#endif /* !_NFSCLIENT_NFS_KDTRACE_H_ */

Modified: head/sys/nfsclient/nfs_subs.c
==============================================================================
--- head/sys/nfsclient/nfs_subs.c	Tue Mar 24 17:10:42 2009	(r190379)
+++ head/sys/nfsclient/nfs_subs.c	Tue Mar 24 17:14:34 2009	(r190380)
@@ -41,6 +41,8 @@ __FBSDID("$FreeBSD$");
  * copy data between mbuf chains and uio lists.
  */
 
+#include "opt_kdtrace.h"
+
 #include 
 #include 
 #include 
@@ -69,6 +71,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -81,6 +84,24 @@ __FBSDID("$FreeBSD$");
  */
 #include 
 
+#ifdef KDTRACE_HOOKS
+dtrace_nfsclient_attrcache_flush_probe_func_t
+    dtrace_nfsclient_attrcache_flush_done_probe;
+uint32_t nfsclient_attrcache_flush_done_id;
+
+dtrace_nfsclient_attrcache_get_hit_probe_func_t
+    dtrace_nfsclient_attrcache_get_hit_probe;
+uint32_t nfsclient_attrcache_get_hit_id;
+
+dtrace_nfsclient_attrcache_get_miss_probe_func_t
+    dtrace_nfsclient_attrcache_get_miss_probe;
+uint32_t nfsclient_attrcache_get_miss_id;
+
+dtrace_nfsclient_attrcache_load_probe_func_t
+    dtrace_nfsclient_attrcache_load_done_probe;
+uint32_t nfsclient_attrcache_load_done_id;
+#endif /* !KDTRACE_HOOKS */
+
 /*
  * Data items converted to xdr at startup, since they are constant
  * This is kinda hokey, but may save a little time doing byte swaps
@@ -556,7 +577,7 @@ nfs_loadattrcache(struct vnode **vpp, st
 	struct vnode *vp = *vpp;
 	struct vattr *vap;
 	struct nfs_fattr *fp;
-	struct nfsnode *np;
+	struct nfsnode *np = NULL;
 	int32_t t1;
 	caddr_t cp2;
 	int rdev;
@@ -566,12 +587,15 @@ nfs_loadattrcache(struct vnode **vpp, st
 	struct timespec mtime, mtime_save;
 	int v3 = NFS_ISV3(vp);
 	struct thread *td = curthread;
+	int error = 0;
 
 	md = *mdp;
 	t1 = (mtod(md, caddr_t) + md->m_len) - *dposp;
 	cp2 = nfsm_disct(mdp, dposp, NFSX_FATTR(v3), t1, M_WAIT);
-	if (cp2 == NULL)
-		return EBADRPC;
+	if (cp2 == NULL) {
+		error = EBADRPC;
+		goto out;
+	}
 	fp = (struct nfs_fattr *)cp2;
 	if (v3) {
 		vtyp = nfsv3tov_type(fp->fa_type);
@@ -684,6 +708,7 @@ nfs_loadattrcache(struct vnode **vpp, st
 				 */
 				vap->va_size = np->n_size;
 				np->n_attrstamp = 0;
+				KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
 			} else if (np->n_flag & NMODIFIED) {
 				/*
 				 * We've modified the file: Use the larger
@@ -716,9 +741,11 @@ nfs_loadattrcache(struct vnode **vpp, st
 	 * We detect this by for the mtime moving back. We invalidate the 
 	 * attrcache when this happens.
 	 */
-	if (timespeccmp(&mtime_save, &vap->va_mtime, >))
+	if (timespeccmp(&mtime_save, &vap->va_mtime, >)) {
 		/* Size changed or mtime went backwards */
 		np->n_attrstamp = 0;
+		KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
+	}
 	if (vaper != NULL) {
 		bcopy((caddr_t)vap, (caddr_t)vaper, sizeof(*vap));
 		if (np->n_flag & NCHG) {
@@ -729,7 +756,13 @@ nfs_loadattrcache(struct vnode **vpp, st
 		}
 	}
 	mtx_unlock(&np->n_mtx);
-	return (0);
+out:
+#ifdef KDRACE_HOOKS
+	if (np != NULL)
+		KDTRACE_NFS_ATTRCACHE_LOAD_DONE(vp, error == 0 ? &np->n_vattr
+		    : NULL, error);
+#endif
+	return (error);
 }
 
 #ifdef NFS_ACDEBUG
@@ -794,7 +827,8 @@ nfs_getattrcache(struct vnode *vp, struc
 	if ((time_second - np->n_attrstamp) >= timeo) {
 		nfsstats.attrcache_misses++;
 		mtx_unlock(&np->n_mtx);
-		return( ENOENT);
+		KDTRACE_NFS_ATTRCACHE_GET_MISS(vp);
+		return (ENOENT);
 	}
 	nfsstats.attrcache_hits++;
 	if (vap->va_size != np->n_size) {
@@ -823,6 +857,7 @@ nfs_getattrcache(struct vnode *vp, struc
 #ifdef NFS_ACDEBUG
 	mtx_unlock(&Giant);	/* nfs_printf() */
 #endif
+	KDTRACE_NFS_ATTRCACHE_GET_HIT(vp, vap);
 	return (0);
 }
 

Modified: head/sys/nfsclient/nfs_vnops.c
==============================================================================
--- head/sys/nfsclient/nfs_vnops.c	Tue Mar 24 17:10:42 2009	(r190379)
+++ head/sys/nfsclient/nfs_vnops.c	Tue Mar 24 17:14:34 2009	(r190380)
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
  */
 
 #include "opt_inet.h"
+#include "opt_kdtrace.h"
 
 #include 
 #include 
@@ -76,6 +77,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -85,6 +87,26 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+
+#ifdef KDTRACE_HOOKS
+#include 
+
+dtrace_nfsclient_accesscache_flush_probe_func_t
+    dtrace_nfsclient_accesscache_flush_done_probe;
+uint32_t nfsclient_accesscache_flush_done_id;
+
+dtrace_nfsclient_accesscache_get_probe_func_t
+    dtrace_nfsclient_accesscache_get_hit_probe,
+    dtrace_nfsclient_accesscache_get_miss_probe;
+uint32_t nfsclient_accesscache_get_hit_id;
+uint32_t nfsclient_accesscache_get_miss_id;
+
+dtrace_nfsclient_accesscache_load_probe_func_t
+    dtrace_nfsclient_accesscache_load_done_probe;
+uint32_t nfsclient_accesscache_load_done_id;
+#endif /* !KDTRACE_HOOKS */
+
 /* Defs */
 #define	TRUE	1
 #define	FALSE	0
@@ -313,9 +335,11 @@ nfs3_access_otw(struct vnode *vp, int wm
 		mtx_unlock(&np->n_mtx);
 		if (retmode != NULL)
 			*retmode = rmode;
+		KDTRACE_NFS_ACCESSCACHE_LOAD_DONE(vp, cred->cr_uid, rmode, 0);
 	}
 	m_freem(mrep);
 nfsmout:
+	KDTRACE_NFS_ACCESSCACHE_LOAD_DONE(vp, cred->cr_uid, 0, error);
 	return (error);
 }
 
@@ -401,6 +425,14 @@ nfs_access(struct vop_access_args *ap)
 			}
 		}
 		mtx_unlock(&np->n_mtx);
+#ifdef KDTRACE_HOOKS
+		if (gotahit)
+			KDTRACE_NFS_ACCESSCACHE_GET_HIT(vp,
+			    ap->a_cred->cr_uid, mode);
+		else
+			KDTRACE_NFS_ACCESSCACHE_GET_MISS(vp,
+			    ap->a_cred->cr_uid, mode);
+#endif
 		if (gotahit == 0) {
 			/*
 			 * Either a no, or a don't know.  Go to the wire.
@@ -494,6 +526,7 @@ nfs_open(struct vop_open_args *ap)
 		if (error == EINTR || error == EIO)
 			return (error);
 		np->n_attrstamp = 0;
+		KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
 		if (vp->v_type == VDIR)
 			np->n_direofoffset = 0;
 		error = VOP_GETATTR(vp, &vattr, ap->a_cred);
@@ -510,6 +543,7 @@ nfs_open(struct vop_open_args *ap)
 		    td->td_proc == NULL ||
 		    np->n_ac_ts_pid != td->td_proc->p_pid) {
 			np->n_attrstamp = 0;
+			KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
 		}
 		mtx_unlock(&np->n_mtx);						
 		error = VOP_GETATTR(vp, &vattr, ap->a_cred);
@@ -868,6 +902,7 @@ nfs_setattrrpc(struct vnode *vp, struct 
 		for (i = 0; i < NFS_ACCESSCACHESIZE; i++)
 			np->n_accesscache[i].stamp = 0;
 		mtx_unlock(&np->n_mtx);
+		KDTRACE_NFS_ACCESSCACHE_FLUSH_DONE(vp);
 		nfsm_wcc_data(vp, wccflag);
 	} else
 		nfsm_loadattr(vp, NULL);
@@ -1421,8 +1456,10 @@ nfsmout:
 	}
 	mtx_lock(&(VTONFS(dvp))->n_mtx);
 	VTONFS(dvp)->n_flag |= NMODIFIED;
-	if (!wccflag)
+	if (!wccflag) {
 		VTONFS(dvp)->n_attrstamp = 0;
+		KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp);
+	}
 	mtx_unlock(&(VTONFS(dvp))->n_mtx);
 	return (error);
 }
@@ -1553,8 +1590,10 @@ nfsmout:
 	}
 	mtx_lock(&(VTONFS(dvp))->n_mtx);
 	VTONFS(dvp)->n_flag |= NMODIFIED;
-	if (!wccflag)
+	if (!wccflag) {
 		VTONFS(dvp)->n_attrstamp = 0;
+		KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp);
+	}
 	mtx_unlock(&(VTONFS(dvp))->n_mtx);
 	return (error);
 }
@@ -1618,6 +1657,7 @@ nfs_remove(struct vop_remove_args *ap)
 	} else if (!np->n_sillyrename)
 		error = nfs_sillyrename(dvp, vp, cnp);
 	np->n_attrstamp = 0;
+	KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
 	return (error);
 }
 
@@ -1663,8 +1703,10 @@ nfs_removerpc(struct vnode *dvp, const c
 nfsmout:
 	mtx_lock(&(VTONFS(dvp))->n_mtx);
 	VTONFS(dvp)->n_flag |= NMODIFIED;
-	if (!wccflag)
+	if (!wccflag) {
 		VTONFS(dvp)->n_attrstamp = 0;
+		KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp);
+	}
 	mtx_unlock(&(VTONFS(dvp))->n_mtx);
 	return (error);
 }
@@ -1809,10 +1851,14 @@ nfsmout:
 	mtx_lock(&(VTONFS(tdvp))->n_mtx);
 	VTONFS(tdvp)->n_flag |= NMODIFIED;
 	mtx_unlock(&(VTONFS(tdvp))->n_mtx);
-	if (!fwccflag)
+	if (!fwccflag) {
 		VTONFS(fdvp)->n_attrstamp = 0;
-	if (!twccflag)
+		KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(fdvp);
+	}
+	if (!twccflag) {
 		VTONFS(tdvp)->n_attrstamp = 0;
+		KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(tdvp);
+	}
 	return (error);
 }
 
@@ -1860,10 +1906,14 @@ nfsmout:
 	mtx_lock(&(VTONFS(tdvp))->n_mtx);
 	VTONFS(tdvp)->n_flag |= NMODIFIED;
 	mtx_unlock(&(VTONFS(tdvp))->n_mtx);
-	if (!attrflag)
+	if (!attrflag) {
 		VTONFS(vp)->n_attrstamp = 0;
-	if (!wccflag)
+		KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
+	}
+	if (!wccflag) {
 		VTONFS(tdvp)->n_attrstamp = 0;
+		KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(tdvp);
+	}
 	return (error);
 }
 
@@ -1948,8 +1998,10 @@ nfsmout:
 	mtx_lock(&(VTONFS(dvp))->n_mtx);
 	VTONFS(dvp)->n_flag |= NMODIFIED;
 	mtx_unlock(&(VTONFS(dvp))->n_mtx);
-	if (!wccflag)
+	if (!wccflag) {
 		VTONFS(dvp)->n_attrstamp = 0;
+		KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp);
+	}
 	return (error);
 }
 
@@ -2004,8 +2056,10 @@ nfsmout:
 	mtx_lock(&(VTONFS(dvp))->n_mtx);
 	VTONFS(dvp)->n_flag |= NMODIFIED;
 	mtx_unlock(&(VTONFS(dvp))->n_mtx);
-	if (!wccflag)
+	if (!wccflag) {
 		VTONFS(dvp)->n_attrstamp = 0;
+		KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp);
+	}
 	if (error == 0 && newvp == NULL) {
 		error = nfs_lookitup(dvp, cnp->cn_nameptr, len, cnp->cn_cred,
 			cnp->cn_thread, &np);
@@ -2054,8 +2108,10 @@ nfsmout:
 	mtx_lock(&(VTONFS(dvp))->n_mtx);
 	VTONFS(dvp)->n_flag |= NMODIFIED;
 	mtx_unlock(&(VTONFS(dvp))->n_mtx);
-	if (!wccflag)
+	if (!wccflag) {
 		VTONFS(dvp)->n_attrstamp = 0;
+		KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp);
+	}
 	cache_purge(dvp);
 	cache_purge(vp);
 	/*

Modified: head/sys/sys/dtrace_bsd.h
==============================================================================
--- head/sys/sys/dtrace_bsd.h	Tue Mar 24 17:10:42 2009	(r190379)
+++ head/sys/sys/dtrace_bsd.h	Tue Mar 24 17:14:34 2009	(r190380)
@@ -35,6 +35,8 @@
 struct mbuf;
 struct trapframe;
 struct thread;
+struct vattr;
+struct vnode;
 
 /*
  * Cyclic clock function type definition used to hook the cyclic
@@ -94,14 +96,52 @@ typedef	void (*dtrace_malloc_probe_func_
 
 extern dtrace_malloc_probe_func_t   dtrace_malloc_probe;
 
-/* The dtnfsclient provider hooks into the NFS[23] client. */
-typedef void (*dtrace_nfsclient_nfs23_start_probe_func_t)(u_int32_t,
-    struct vnode *, struct mbuf *, struct ucred *, int);
-typedef void (*dtrace_nfsclient_nfs23_done_probe_func_t)(u_int32_t,
-    struct vnode *, struct mbuf *, struct ucred *, int, int);
+/* dtnfsclient NFSv3 access cache provider hooks. */
+typedef void (*dtrace_nfsclient_accesscache_flush_probe_func_t)(uint32_t,
+    struct vnode *);
+extern dtrace_nfsclient_accesscache_flush_probe_func_t
+    dtrace_nfsclient_accesscache_flush_done_probe;
+
+typedef void (*dtrace_nfsclient_accesscache_get_probe_func_t)(uint32_t,
+    struct vnode *, uid_t, uint32_t);
+extern dtrace_nfsclient_accesscache_get_probe_func_t
+    dtrace_nfsclient_accesscache_get_hit_probe,
+    dtrace_nfsclient_accesscache_get_miss_probe;
+
+typedef void (*dtrace_nfsclient_accesscache_load_probe_func_t)(uint32_t,
+    struct vnode *, uid_t, uint32_t, int);
+extern dtrace_nfsclient_accesscache_load_probe_func_t
+    dtrace_nfsclient_accesscache_load_done_probe;
+
+/* dtnfsclient NFSv[23] attribute cache provider hooks. */
+typedef void (*dtrace_nfsclient_attrcache_flush_probe_func_t)(uint32_t,
+    struct vnode *);
+extern dtrace_nfsclient_attrcache_flush_probe_func_t
+    dtrace_nfsclient_attrcache_flush_done_probe;
+
+typedef void (*dtrace_nfsclient_attrcache_get_hit_probe_func_t)(uint32_t,
+    struct vnode *, struct vattr *);
+extern dtrace_nfsclient_attrcache_get_hit_probe_func_t
+    dtrace_nfsclient_attrcache_get_hit_probe;
+
+typedef void (*dtrace_nfsclient_attrcache_get_miss_probe_func_t)(uint32_t,
+    struct vnode *);
+extern dtrace_nfsclient_attrcache_get_miss_probe_func_t
+    dtrace_nfsclient_attrcache_get_miss_probe;
+
+typedef void (*dtrace_nfsclient_attrcache_load_probe_func_t)(uint32_t,
+    struct vnode *, struct vattr *, int);
+extern dtrace_nfsclient_attrcache_load_probe_func_t
+    dtrace_nfsclient_attrcache_load_done_probe;
 
+/* dtnfsclient NFSv[23] RPC provider hooks. */
+typedef void (*dtrace_nfsclient_nfs23_start_probe_func_t)(uint32_t,
+    struct vnode *, struct mbuf *, struct ucred *, int);
 extern dtrace_nfsclient_nfs23_start_probe_func_t
     dtrace_nfsclient_nfs23_start_probe;
+
+typedef void (*dtrace_nfsclient_nfs23_done_probe_func_t)(uint32_t,
+    struct vnode *, struct mbuf *, struct ucred *, int, int);
 extern dtrace_nfsclient_nfs23_done_probe_func_t
     dtrace_nfsclient_nfs23_done_probe;
 

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 24 17:22:11 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0350010658ED;
	Tue, 24 Mar 2009 17:22:11 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E401C8FC21;
	Tue, 24 Mar 2009 17:22:10 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2OHMA7V051984;
	Tue, 24 Mar 2009 17:22:10 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2OHMAxT051982;
	Tue, 24 Mar 2009 17:22:10 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200903241722.n2OHMAxT051982@svn.freebsd.org>
From: Sam Leffler 
Date: Tue, 24 Mar 2009 17:22:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190381 - in head/sys: conf net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 17:22:13 -0000

Author: sam
Date: Tue Mar 24 17:22:10 2009
New Revision: 190381
URL: http://svn.freebsd.org/changeset/base/190381

Log:
  use IEEE80211_SUPPORT_TDMA option to control whether code is
  configured; this allows us to remove an #ifdef

Modified:
  head/sys/conf/files
  head/sys/net80211/ieee80211_tdma.c

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Tue Mar 24 17:14:34 2009	(r190380)
+++ head/sys/conf/files	Tue Mar 24 17:22:10 2009	(r190381)
@@ -2215,7 +2215,7 @@ net80211/ieee80211_rssadapt.c	optional w
 net80211/ieee80211_scan.c	optional wlan
 net80211/ieee80211_scan_sta.c	optional wlan
 net80211/ieee80211_sta.c	optional wlan
-net80211/ieee80211_tdma.c	optional wlan
+net80211/ieee80211_tdma.c	optional wlan ieee80211_support_tdma
 net80211/ieee80211_wds.c	optional wlan
 net80211/ieee80211_xauth.c	optional wlan wlan_xauth
 netatalk/aarp.c			optional netatalk

Modified: head/sys/net80211/ieee80211_tdma.c
==============================================================================
--- head/sys/net80211/ieee80211_tdma.c	Tue Mar 24 17:14:34 2009	(r190380)
+++ head/sys/net80211/ieee80211_tdma.c	Tue Mar 24 17:22:10 2009	(r190381)
@@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$");
 #include "opt_inet.h"
 #include "opt_wlan.h"
 
-#ifdef IEEE80211_SUPPORT_TDMA
 #include 
 #include  
 #include    
@@ -787,4 +786,3 @@ ieee80211_tdma_ioctl_set80211(struct iee
 	}
 	return 0;
 }
-#endif /* IEEE80211_SUPPORT_TDMA */

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 24 17:39:08 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 563EB10657B5;
	Tue, 24 Mar 2009 17:39:08 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 30BE18FC17;
	Tue, 24 Mar 2009 17:39:08 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id D73CC46B52;
	Tue, 24 Mar 2009 13:39:07 -0400 (EDT)
Date: Tue, 24 Mar 2009 17:39:07 +0000 (GMT)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: src-committers@freebsd.org, svn-src-all@freebsd.org, 
	svn-src-head@freebsd.org
In-Reply-To: <200903241714.n2OHEYnX051781@svn.freebsd.org>
Message-ID: 
References: <200903241714.n2OHEYnX051781@svn.freebsd.org>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: 
Subject: Re: svn commit: r190380 - in head/sys: cddl/dev/dtnfsclient
 nfsclient sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 17:39:09 -0000


On Tue, 24 Mar 2009, Robert Watson wrote:

>  Add DTrace probes to the NFS access and attribute caches.  Access cache
>  events are:
>
>    nfsclient:accesscache:flush:done
>    nfsclient:accesscache:get:hit
>    nfsclient:accesscache:get:miss
>    nfsclient:accesscache:load:done
>
>  They pass the vnode, uid, and requested or loaded access mode (if any);
>  the load event may also report a load error if the RPC fails.
>
>  The attribute cache events are:
>
>    nfsclient:attrcache:flush:done
>    nfsclient:attrcache:get:hit
>    nfsclient:attrcache:get:miss
>    nfsclient:attrcache:load:done
>
>  They pass the vnode, optionally the vattr if one is present (hit or load),
>  and in the case of a load event, also a possible RPC error.

This will probably want to be changed in a few ways before we consider it 
done, but I've found it quite useful already in understanding our NFS client 
and how the various caches interact.  Typical trace output might look like 
this, combining the previously committed NFSv3 RPC tracing with cache tracing:

bin  syscall       module      probe         vnode *
---- ------------- ----------- ------------- ----------
ls   lstat         attrcache   get:hit       3282019108
ls   stat          attrcache   get:hit       3282019108
ls   open          accesscache get:hit       3282019108
ls   open          attrcache   flush:done    3282019108
ls   open          attrcache   get:miss      3282019108
ls   open          nfs3        getattr:start 3282019108
ls   open          nfs3        getattr:done  3282019108
ls   fstat         attrcache   get:hit       3282019108
ls   fstatfs       nfs3        fsstat:start  3282019108
ls   fstatfs       nfs3        fsstat:done   3282019108
ls   fstat         attrcache   get:hit       3282019108
ls   fchdir        accesscache get:hit       3282019108
ls   getdirentries attrcache   get:hit       3282019108
ls   lstat         accesscache get:hit       3282019108
ls   lstat         attrcache   get:hit       3281944576
ls   lstat         attrcache   get:hit       3281944576
ls   getdirentries attrcache   get:hit       3282019108
ls   pathconf      accesscache get:hit       3282019108
ls   pathconf      attrcache   get:hit       3281944576

If you're using this on a multi-CPU box, make sure your probes trace 
timestamps and that you sort by them, if you require ordering, since NFS tends 
to bounce around a bit, especially for loopback NFS testing. :-)

Robert N M Watson
Computer Laboratory
University of Cambridge

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 24 17:47:25 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 141AD106575F;
	Tue, 24 Mar 2009 17:47:25 +0000 (UTC) (envelope-from ume@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 020448FC1E;
	Tue, 24 Mar 2009 17:47:25 +0000 (UTC) (envelope-from ume@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2OHlO8x052494;
	Tue, 24 Mar 2009 17:47:24 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2OHlOdZ052493;
	Tue, 24 Mar 2009 17:47:24 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <200903241747.n2OHlOdZ052493@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Tue, 24 Mar 2009 17:47:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190382 - head/lib/libc/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 17:47:27 -0000

Author: ume
Date: Tue Mar 24 17:47:24 2009
New Revision: 190382
URL: http://svn.freebsd.org/changeset/base/190382

Log:
  getaddrinfo(3) should accept numeric when ai_socktype is not
  specified in hint or hints is NULL.
  
  PR:		bin/51827
  Submitted by:	Mark Andrews 
  MFC after:	1 week

Modified:
  head/lib/libc/net/getaddrinfo.c

Modified: head/lib/libc/net/getaddrinfo.c
==============================================================================
--- head/lib/libc/net/getaddrinfo.c	Tue Mar 24 17:22:10 2009	(r190381)
+++ head/lib/libc/net/getaddrinfo.c	Tue Mar 24 17:47:24 2009	(r190382)
@@ -1347,7 +1347,17 @@ get_port(struct addrinfo *ai, const char
 		allownumeric = 1;
 		break;
 	case ANY:
-		allownumeric = 0;
+		switch (ai->ai_family) {
+		case AF_INET:
+#ifdef AF_INET6
+		case AF_INET6:
+#endif
+			allownumeric = 1;
+			break;
+		default:
+			allownumeric = 0;
+			break;
+		}
 		break;
 	default:
 		return EAI_SOCKTYPE;

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 24 17:47:50 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D13C61065837;
	Tue, 24 Mar 2009 17:47:50 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BCB788FC29;
	Tue, 24 Mar 2009 17:47:50 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2OHloFq052541;
	Tue, 24 Mar 2009 17:47:50 GMT (envelope-from luigi@svn.freebsd.org)
Received: (from luigi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2OHloFV052540;
	Tue, 24 Mar 2009 17:47:50 GMT (envelope-from luigi@svn.freebsd.org)
Message-Id: <200903241747.n2OHloFV052540@svn.freebsd.org>
From: Luigi Rizzo 
Date: Tue, 24 Mar 2009 17:47:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190383 - head/release/picobsd/build
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 17:47:53 -0000

Author: luigi
Date: Tue Mar 24 17:47:50 2009
New Revision: 190383
URL: http://svn.freebsd.org/changeset/base/190383

Log:
  add a function to help copying shared binaries from the output
  of a buildworld.

Modified:
  head/release/picobsd/build/picobsd

Modified: head/release/picobsd/build/picobsd
==============================================================================
--- head/release/picobsd/build/picobsd	Tue Mar 24 17:47:24 2009	(r190382)
+++ head/release/picobsd/build/picobsd	Tue Mar 24 17:47:50 2009	(r190383)
@@ -548,6 +548,52 @@ do_copyfiles() {	# rootdir varname
         done
 }
 
+# find_progs is a helper function to locate the named programs
+# or libraries in ${o_objdir} and return the full pathnames.
+# Sets ${u_progs} to the list of programs, and ${u_libs}
+# to the list of shared libraries used.
+# If the first argument is - does not set u_libs
+#
+# You can use it e.g. in a local configuration file by writing
+#
+#  do_copyfiles_user() {
+#	local dst=$1
+#	find_progs nvi sed less grep
+#	cp -p ${u_progs} ${dst}/bin
+#	cp -p ${u_libs} ${dst}/lib
+#	mkdir -p ${dst}/libexec
+#	find_progs ld-elf.so.1
+#	cp -p ${u_progs} ${dst}/libexec
+#  }
+
+find_progs() {	# programs
+	local i
+	u_progs="`find_progs_helper $*`"
+	[ -z "${u_progs}" ] && return 1	# not found, error
+	i="`ldd ${u_progs} | grep -v '^/' | awk '{print $1}' | sort | uniq`"
+	u_libs="`find_progs_helper $i`"
+	return 0
+}
+
+find_progs_helper() {	# programs
+	local progs="$*"
+	local i o places names
+	local subdirs="bin sbin usr.bin usr.sbin libexec lib \
+		gnu/usr.bin gnu/lib \
+		secure/usr.bin secure/usr.sbin secure/libexec secure/lib"
+	names=""	# files to search
+	o=""
+	for i in $progs ; do
+		names="${names} ${o} -name $i"
+		o="-o"
+	done
+	places=""				# places to search
+	for i in $subdirs ; do
+		places="${places} ${o_objdir}/${i}"
+	done
+	find ${places} -type f \( ${names} \)
+}
+		
 # Populate the memory filesystem with binaries and non-variable
 # configuration files.
 # First do an mtree pass, then create directory links and device entries,
@@ -863,7 +909,6 @@ fill_floppy_image() {
 # needs to be done once).
 
 set_build_parameters() {
-    log "set_build_parameters() SRC is ${SRC}"
     if [ "${SRC}" = "/usr/src" ] ; then
 	l_usrtree=${USR:-/usr}
     else
@@ -890,6 +935,19 @@ set_build_parameters() {
 	CONFIG=${l_usrtree}/sbin/config
 	export CONFIG
     fi
+
+    # if we have o_objdir, find where bin/ is
+    if [ ! -z "${o_objdir}" ] ; then
+	if [ -d ${o_objdir}/bin ] ; then
+	    # fine
+	elif [ -d "${o_objdir}${SRC}/bin" ] ; then
+	    o_objdir="${o_objdir}${SRC}"
+	    log "Changing objdir to ${o_objdir}"
+	else
+	    log "Cannot find objdir in ${o_objdir}, sorry"
+	    o_objdir=""
+	fi
+    fi
 }
 
 #-------------------------------------------------------------------
@@ -898,9 +956,10 @@ set_build_parameters() {
 
 set_defaults
 while [ true ]; do
+    log "Parsing $1"
     case $1 in
     --src)	# set the source path instead of /usr/src
-	SRC=`(cd $2; pwd)`
+	SRC=`realpath $2`
 	shift
 	;;
     --init)
@@ -952,6 +1011,12 @@ while [ true ]; do
 	shift
 	;;
 
+    --objdir)	# Place with results of a previous buildworld
+		# useful if you want to copy shared binaries and libs
+	o_objdir=`realpath $2`
+	shift
+	;;
+
     *)
 	break
 	;;

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 24 17:57:49 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C4238106567D;
	Tue, 24 Mar 2009 17:57:49 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A45328FC1D;
	Tue, 24 Mar 2009 17:57:49 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2OHvnLl052815;
	Tue, 24 Mar 2009 17:57:49 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2OHvnle052811;
	Tue, 24 Mar 2009 17:57:49 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200903241757.n2OHvnle052811@svn.freebsd.org>
From: Sam Leffler 
Date: Tue, 24 Mar 2009 17:57:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190384 - head/sys/net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 17:57:53 -0000

Author: sam
Date: Tue Mar 24 17:57:48 2009
New Revision: 190384
URL: http://svn.freebsd.org/changeset/base/190384

Log:
  add linker sets for get/set ioctl handlers so optional net80211
  code is isolated

Modified:
  head/sys/net80211/ieee80211_freebsd.h
  head/sys/net80211/ieee80211_ioctl.c
  head/sys/net80211/ieee80211_tdma.c
  head/sys/net80211/ieee80211_tdma.h

Modified: head/sys/net80211/ieee80211_freebsd.h
==============================================================================
--- head/sys/net80211/ieee80211_freebsd.h	Tue Mar 24 17:47:50 2009	(r190383)
+++ head/sys/net80211/ieee80211_freebsd.h	Tue Mar 24 17:57:48 2009	(r190384)
@@ -393,6 +393,17 @@ alg##_modevent(int type)						\
 TEXT_SET(rate##_set, alg##_modevent)
 #endif /* _KERNEL */
 
+struct ieee80211req;
+typedef int ieee80211_ioctl_getfunc(struct ieee80211vap *,
+    struct ieee80211req *);
+SET_DECLARE(ieee80211_ioctl_getset, ieee80211_ioctl_getfunc);
+#define	IEEE80211_IOCTL_GET(_name, _get) TEXT_SET(ieee80211_ioctl_getset, _get)
+
+typedef int ieee80211_ioctl_setfunc(struct ieee80211vap *,
+    struct ieee80211req *);
+SET_DECLARE(ieee80211_ioctl_setset, ieee80211_ioctl_setfunc);
+#define	IEEE80211_IOCTL_SET(_name, _set) TEXT_SET(ieee80211_ioctl_setset, _set)
+
 /* XXX this stuff belongs elsewhere */
 /*
  * Message formats for messages from the net80211 layer to user

Modified: head/sys/net80211/ieee80211_ioctl.c
==============================================================================
--- head/sys/net80211/ieee80211_ioctl.c	Tue Mar 24 17:47:50 2009	(r190383)
+++ head/sys/net80211/ieee80211_ioctl.c	Tue Mar 24 17:57:48 2009	(r190384)
@@ -63,9 +63,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#ifdef IEEE80211_SUPPORT_TDMA
-#include 
-#endif
 
 #define	IS_UP_AUTO(_vap) \
 	(IFNET_IS_UP_RUNNING(vap->iv_ifp) && \
@@ -752,6 +749,30 @@ ieee80211_ioctl_getstavlan(struct ieee80
 }
 
 /*
+ * Dummy ioctl get handler so the linker set is defined.
+ */
+static int
+dummy_ioctl_get(struct ieee80211vap *vap, struct ieee80211req *ireq)
+{
+	return ENOSYS;
+}
+IEEE80211_IOCTL_GET(dummy, dummy_ioctl_get);
+
+static int
+ieee80211_ioctl_getdefault(struct ieee80211vap *vap, struct ieee80211req *ireq)
+{
+	ieee80211_ioctl_getfunc * const *get;
+	int error;
+
+	SET_FOREACH(get, ieee80211_ioctl_getset) {
+		error = (*get)(vap, ireq);
+		if (error != ENOSYS)
+			return error;
+	}
+	return EINVAL;
+}
+
+/*
  * When building the kernel with -O2 on the i386 architecture, gcc
  * seems to want to inline this function into ieee80211_ioctl()
  * (which is the only routine that calls it). When this happens,
@@ -1104,16 +1125,8 @@ ieee80211_ioctl_get80211(struct ieee8021
 			ireq->i_val =
 			    (vap->iv_flags_ext & IEEE80211_FEXT_RIFS) != 0;
 		break;
-#ifdef IEEE80211_SUPPORT_TDMA
-	case IEEE80211_IOC_TDMA_SLOT:
-	case IEEE80211_IOC_TDMA_SLOTCNT:
-	case IEEE80211_IOC_TDMA_SLOTLEN:
-	case IEEE80211_IOC_TDMA_BINTERVAL:
-		error = ieee80211_tdma_ioctl_get80211(vap, ireq);
-		break;
-#endif
 	default:
-		error = EINVAL;
+		error = ieee80211_ioctl_getdefault(vap, ireq);
 		break;
 	}
 	return error;
@@ -2476,6 +2489,30 @@ isvapht(const struct ieee80211vap *vap)
 	    IEEE80211_IS_CHAN_HT(bss->ni_chan);
 }
 
+/*
+ * Dummy ioctl set handler so the linker set is defined.
+ */
+static int
+dummy_ioctl_set(struct ieee80211vap *vap, struct ieee80211req *ireq)
+{
+	return ENOSYS;
+}
+IEEE80211_IOCTL_SET(dummy, dummy_ioctl_set);
+
+static int
+ieee80211_ioctl_setdefault(struct ieee80211vap *vap, struct ieee80211req *ireq)
+{
+	ieee80211_ioctl_setfunc * const *set;
+	int error;
+
+	SET_FOREACH(set, ieee80211_ioctl_setset) {
+		error = (*set)(vap, ireq);
+		if (error != ENOSYS)
+			return error;
+	}
+	return EINVAL;
+}
+
 static __noinline int
 ieee80211_ioctl_set80211(struct ieee80211vap *vap, u_long cmd, struct ieee80211req *ireq)
 {
@@ -3131,16 +3168,8 @@ ieee80211_ioctl_set80211(struct ieee8021
 		if (isvapht(vap))
 			error = ERESTART;
 		break;
-#ifdef IEEE80211_SUPPORT_TDMA
-	case IEEE80211_IOC_TDMA_SLOT:
-	case IEEE80211_IOC_TDMA_SLOTCNT:
-	case IEEE80211_IOC_TDMA_SLOTLEN:
-	case IEEE80211_IOC_TDMA_BINTERVAL:
-		error = ieee80211_tdma_ioctl_set80211(vap, ireq);
-		break;
-#endif
 	default:
-		error = EINVAL;
+		error = ieee80211_ioctl_setdefault(vap, ireq);
 		break;
 	}
 	/*

Modified: head/sys/net80211/ieee80211_tdma.c
==============================================================================
--- head/sys/net80211/ieee80211_tdma.c	Tue Mar 24 17:47:50 2009	(r190383)
+++ head/sys/net80211/ieee80211_tdma.c	Tue Mar 24 17:57:48 2009	(r190384)
@@ -705,9 +705,8 @@ ieee80211_tdma_update_beacon(struct ieee
 		ts->tdma_count--;
 }
 
-int
-ieee80211_tdma_ioctl_get80211(struct ieee80211vap *vap,
-	struct ieee80211req *ireq)
+static int
+tdma_ioctl_get80211(struct ieee80211vap *vap, struct ieee80211req *ireq)
 {
 	struct ieee80211_tdma_state *ts = vap->iv_tdma;
 
@@ -728,14 +727,14 @@ ieee80211_tdma_ioctl_get80211(struct iee
 		ireq->i_val = ts->tdma_bintval;
 		break;
 	default:
-		return EINVAL;
+		return ENOSYS;
 	}
 	return 0;
 }
+IEEE80211_IOCTL_GET(tdma, tdma_ioctl_get80211);
 
-int
-ieee80211_tdma_ioctl_set80211(struct ieee80211vap *vap,
-	struct ieee80211req *ireq)
+static int
+tdma_ioctl_set80211(struct ieee80211vap *vap, struct ieee80211req *ireq)
 {
 	struct ieee80211_tdma_state *ts = vap->iv_tdma;
 
@@ -782,7 +781,8 @@ ieee80211_tdma_ioctl_set80211(struct iee
 		}
 		break;
 	default:
-		return EINVAL;
+		return ENOSYS;
 	}
 	return 0;
 }
+IEEE80211_IOCTL_SET(tdma, tdma_ioctl_set80211);

Modified: head/sys/net80211/ieee80211_tdma.h
==============================================================================
--- head/sys/net80211/ieee80211_tdma.h	Tue Mar 24 17:47:50 2009	(r190383)
+++ head/sys/net80211/ieee80211_tdma.h	Tue Mar 24 17:57:48 2009	(r190384)
@@ -65,9 +65,4 @@ uint8_t *ieee80211_add_tdma(uint8_t *frm
 struct ieee80211_beacon_offsets;
 void	ieee80211_tdma_update_beacon(struct ieee80211vap *vap,
 	    struct ieee80211_beacon_offsets *bo);
-struct ieee80211req;
-int	ieee80211_tdma_ioctl_get80211(struct ieee80211vap *vap,
-	    struct ieee80211req *ireq);
-int	ieee80211_tdma_ioctl_set80211(struct ieee80211vap *vap,
-	    struct ieee80211req *ireq);
 #endif /* !_NET80211_IEEE80211_TDMA_H_ */

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 24 18:02:35 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9E5E21065680;
	Tue, 24 Mar 2009 18:02:35 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8C77A8FC14;
	Tue, 24 Mar 2009 18:02:35 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2OI2ZOj052973;
	Tue, 24 Mar 2009 18:02:35 GMT (envelope-from luigi@svn.freebsd.org)
Received: (from luigi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2OI2Zt1052972;
	Tue, 24 Mar 2009 18:02:35 GMT (envelope-from luigi@svn.freebsd.org)
Message-Id: <200903241802.n2OI2Zt1052972@svn.freebsd.org>
From: Luigi Rizzo 
Date: Tue, 24 Mar 2009 18:02:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190385 - head/release/picobsd/bridge
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 18:02:36 -0000

Author: luigi
Date: Tue Mar 24 18:02:35 2009
New Revision: 190385
URL: http://svn.freebsd.org/changeset/base/190385

Log:
  remove stale comments on the size of objects, they are more
  than 10 years old and do not reflect reality anymore.
  
  Also remove some commented out entries that have no hope to
  be useful anymore.

Modified:
  head/release/picobsd/bridge/crunch.conf

Modified: head/release/picobsd/bridge/crunch.conf
==============================================================================
--- head/release/picobsd/bridge/crunch.conf	Tue Mar 24 17:57:48 2009	(r190384)
+++ head/release/picobsd/bridge/crunch.conf	Tue Mar 24 18:02:35 2009	(r190385)
@@ -48,13 +48,13 @@ srcdirs /usr/src/libexec
 # variables contain the list of sources and objects, and so on.
 
 # init is almost always necessary.
-progs init # 4KB.
+progs init
 # fsck is almost always necessary, unless you have everything on the
 # image and use 'tar' or something similar to read/write raw blocks
 # from the floppy.
-progs fsck # 24KB.
+progs fsck
 # ifconfig is needed if you want to configure interfaces...
-progs ifconfig # 4KB.
+progs ifconfig
 #
 # You will also need a shell and a bunch of utilities.
 # The standard shell is not that large, but you need many
@@ -64,114 +64,94 @@ progs ifconfig # 4KB.
 # no additional memory.
 # There are a few exceptions such as 'less', which in 4.x is
 # rather large.
-progs sh # 36KB.
+progs sh
 ln sh -sh
-progs echo # 0KB.
+progs echo
 progs pwd
 progs mkdir rmdir
 progs chmod chown
-progs mv ln # 0KB.
+progs mv ln
 progs mount
-progs minigzip # 0KB.
+progs minigzip
 ln minigzip gzip
-progs cp # 0KB.
+progs cp
 progs rm
 progs ls
 progs kill
-progs df # 0KB.
-progs ps # 4KB.
-progs ns # 4KB.
+progs df
+progs ps
+progs ns
 ln ns netstat
-progs vm # 0KB.
-progs cat # 0KB.
-progs test # 0KB.
+progs vm
+progs cat
+progs test
 ln test [
-progs hostname # 0KB.
-progs login # 4KB.
-progs getty # 4KB.
-progs stty # 4KB.
-progs w # 0KB.
-progs msg # 0KB.
+progs hostname
+progs login
+progs getty
+progs stty
+progs w
+progs msg
 ln msg dmesg
-progs reboot # 0KB.
-progs less # 36KB
+progs reboot
+progs less
 #ln less more
-#progs more # 12KB
+#progs more
 special more srcdir /usr/ports/misc/44bsd-more/work
 
 progs sysctl
-progs swapon # 0KB.
-progs pwd_mkdb # 0KB.
+progs swapon
+progs pwd_mkdb
 progs umount
-progs du # 0KB.
-progs tail # 0KB.
-progs tee # 0KB.
-progs passwd # 0KB.
+progs du
+progs tail
+progs tee
+progs passwd
 
-progs route # 8KB
+progs route
 # progs mount_msdosfs
 # progs comcontrol
 #
 # If you want to run natd, remember the alias library
-#progs natd # 20KB
+#progs natd
 #libs -lalias	# natd
 #
 # ppp is rather large. Note that as of Jan.01, RELEASE_CRUNCH
 # makes ppp not use libalias, so you cannot have aliasing.
-#progs ppp # 112KB
+#progs ppp
 
 # You need an editor. ee is relatively small, though there are
 # smaller ones. vi is much larger.
 # The editor also usually need a curses library.
-progs ee # 32KB.
+progs ee
 libs -lncurses
-# progs vi # ??
+# progs vi
 # libs -lcurses # for vi
 
-#progs tcpdump # 100KB.
+#progs tcpdump
 special tcpdump srcdir /usr/src/usr.sbin/tcpdump/tcpdump
 
-progs arp # 0KB.
+progs arp
 
-progs bsdlabel # 4KB.
-progs fdisk # 4KB.
-progs vnconfig # 0KB.
-
-#progs grep # 16KB.
-progs date # 4KB.
-#progs mount_nfs # 0KB.
+progs bsdlabel
+progs fdisk
+progs mdconfig
+
+#progs grep
+progs date
+#progs mount_nfs
 ln mount_nfs nfs
-progs ping # 4KB.
-#progs routed # 32KB.
-progs ipfw # 12KB.
-progs traceroute # 0KB.
-# progs mount_cd9660 # 4KB.
+progs ping
+#progs routed
+progs ipfw
+progs traceroute
+# progs mount_cd9660
 # ln mount_cd9660 cd9660
-# progs newfs # 12KB.
+# progs newfs
 #ln newfs mount_mfs
 ln chown chgrp
 # ln mount_msdosfs msdos
 
-# If you need to access the box remotely, and maybe copy files
-# from/to it, you can use telnet, rsh or ssh.
-# inetd is only needed for telnet and rshd
-#progs inetd # 12KB.
-#progs telnet # 20KB.
-#progs telnetd # 12KB.
-#progs ftp # 28KB.
-#progs tar # 32KB.
-
-# Check the ssh license! If you want to use this,
-# go to /usr/ports/security/ssh-picobsd, do a make extract configure
-# You also need to install /usr/ports/math/libgmp-freebsd
-#progs sshd	# includes ssh and scp
-special sshd objvar SSHD_OBJS
-special sshd srcdir /usr/ports/picobsd/ssh-picobsd/work/ssh-1.2.27
-special sshd objdir /usr/ports/picobsd/ssh-picobsd/work/ssh-1.2.27
-ln sshd ssh
-ln sshd ssh1
-ln sshd scp
-#libs /usr/local/lib/libgmp.a
 
 libs -ll       # used by sh
 libs -lufs     # used by mount

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 24 18:10:23 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 66C5F1065710;
	Tue, 24 Mar 2009 18:10:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 37D0E8FC17;
	Tue, 24 Mar 2009 18:10:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2OIAMOc053164;
	Tue, 24 Mar 2009 18:10:22 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2OIAM9t053162;
	Tue, 24 Mar 2009 18:10:22 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200903241810.n2OIAM9t053162@svn.freebsd.org>
From: John Baldwin 
Date: Tue, 24 Mar 2009 18:10:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190386 - in head/sys: amd64/pci i386/pci
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 18:10:27 -0000

Author: jhb
Date: Tue Mar 24 18:10:22 2009
New Revision: 190386
URL: http://svn.freebsd.org/changeset/base/190386

Log:
  Fall back to using configuration type 1 accesses for PCI config requests if
  the requested PCI bus falls outside of the bus range given in the ACPI
  MCFG table.  Several BIOSes seem to not include all of the PCI busses in
  systems in their MCFG tables.  It maybe that the BIOS is simply buggy and
  does support all the busses, but it is more conservative to just fall back
  to the old method unless it is certain that memory accesses will work.

Modified:
  head/sys/amd64/pci/pci_cfgreg.c
  head/sys/i386/pci/pci_cfgreg.c

Modified: head/sys/amd64/pci/pci_cfgreg.c
==============================================================================
--- head/sys/amd64/pci/pci_cfgreg.c	Tue Mar 24 18:02:35 2009	(r190385)
+++ head/sys/amd64/pci/pci_cfgreg.c	Tue Mar 24 18:10:22 2009	(r190386)
@@ -119,6 +119,7 @@ pci_docfgregread(int bus, int slot, int 
 {
 
 	if (cfgmech == CFGMECH_PCIE &&
+	    (bus >= pcie_minbus && bus <= pcie_maxbus) &&
 	    (bus != 0 || !(1 << slot & pcie_badslots)))
 		return (pciereg_cfgread(bus, slot, func, reg, bytes));
 	else
@@ -158,6 +159,7 @@ pci_cfgregwrite(int bus, int slot, int f
 {
 
 	if (cfgmech == CFGMECH_PCIE &&
+	    (bus >= pcie_minbus && bus <= pcie_maxbus) &&
 	    (bus != 0 || !(1 << slot & pcie_badslots)))
 		pciereg_cfgwrite(bus, slot, func, reg, data, bytes);
 	else

Modified: head/sys/i386/pci/pci_cfgreg.c
==============================================================================
--- head/sys/i386/pci/pci_cfgreg.c	Tue Mar 24 18:02:35 2009	(r190385)
+++ head/sys/i386/pci/pci_cfgreg.c	Tue Mar 24 18:10:22 2009	(r190386)
@@ -206,6 +206,7 @@ pci_docfgregread(int bus, int slot, int 
 {
 
 	if (cfgmech == CFGMECH_PCIE &&
+	    (bus >= pcie_minbus && bus <= pcie_maxbus) &&
 	    (bus != 0 || !(1 << slot & pcie_badslots)))
 		return (pciereg_cfgread(bus, slot, func, reg, bytes));
 	else
@@ -240,6 +241,7 @@ pci_cfgregwrite(int bus, int slot, int f
 {
 
 	if (cfgmech == CFGMECH_PCIE &&
+	    (bus >= pcie_minbus && bus <= pcie_maxbus) &&
 	    (bus != 0 || !(1 << slot & pcie_badslots)))
 		pciereg_cfgwrite(bus, slot, func, reg, data, bytes);
 	else

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 24 18:16:43 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 75C411065725;
	Tue, 24 Mar 2009 18:16:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 499DA8FC1F;
	Tue, 24 Mar 2009 18:16:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2OIGhIl053314;
	Tue, 24 Mar 2009 18:16:43 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2OIGhHj053312;
	Tue, 24 Mar 2009 18:16:43 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200903241816.n2OIGhHj053312@svn.freebsd.org>
From: John Baldwin 
Date: Tue, 24 Mar 2009 18:16:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190387 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 18:16:45 -0000

Author: jhb
Date: Tue Mar 24 18:16:42 2009
New Revision: 190387
URL: http://svn.freebsd.org/changeset/base/190387

Log:
  When a file lookup fails due to encountering a doomed vnode from a forced
  unmount, consistently return ENOENT rather than EBADF.
  
  Reviewed by:	kib
  MFC after:	1 month

Modified:
  head/sys/kern/vfs_cache.c
  head/sys/kern/vfs_lookup.c

Modified: head/sys/kern/vfs_cache.c
==============================================================================
--- head/sys/kern/vfs_cache.c	Tue Mar 24 18:10:22 2009	(r190386)
+++ head/sys/kern/vfs_cache.c	Tue Mar 24 18:16:42 2009	(r190387)
@@ -320,7 +320,7 @@ cache_zap(ncp)
  * (negative cacheing), a status of ENOENT is returned. If the lookup
  * fails, a status of zero is returned.  If the directory vnode is
  * recycled out from under us due to a forced unmount, a status of
- * EBADF is returned.
+ * ENOENT is returned.
  *
  * vpp is locked and ref'd on return.  If we're looking up DOTDOT, dvp is
  * unlocked.  If we're looking up . an extra ref is taken, but the lock is
@@ -472,7 +472,7 @@ success:
 					/* forced unmount */
 					vrele(*vpp);
 					*vpp = NULL;
-					return (EBADF);
+					return (ENOENT);
 				}
 			} else
 				vn_lock(*vpp, LK_DOWNGRADE | LK_RETRY);
@@ -983,7 +983,7 @@ vn_fullpath1(struct thread *td, struct v
 		if (vp->v_vflag & VV_ROOT) {
 			if (vp->v_iflag & VI_DOOMED) {	/* forced unmount */
 				CACHE_RUNLOCK();
-				error = EBADF;
+				error = ENOENT;
 				break;
 			}
 			vp = vp->v_mount->mnt_vnodecovered;

Modified: head/sys/kern/vfs_lookup.c
==============================================================================
--- head/sys/kern/vfs_lookup.c	Tue Mar 24 18:10:22 2009	(r190386)
+++ head/sys/kern/vfs_lookup.c	Tue Mar 24 18:16:42 2009	(r190387)
@@ -602,7 +602,7 @@ dirloop:
 			if ((dp->v_vflag & VV_ROOT) == 0)
 				break;
 			if (dp->v_iflag & VI_DOOMED) {	/* forced unmount */
-				error = EBADF;
+				error = ENOENT;
 				goto bad;
 			}
 			tdp = dp;
@@ -764,9 +764,11 @@ unionlookup:
 	     *ndp->ni_next == '/')) {
 		cnp->cn_flags |= ISSYMLINK;
 		if (dp->v_iflag & VI_DOOMED) {
-			/* We can't know whether the directory was mounted with
-			 * NOSYMFOLLOW, so we can't follow safely. */
-			error = EBADF;
+			/*
+			 * We can't know whether the directory was mounted with
+			 * NOSYMFOLLOW, so we can't follow safely.
+			 */
+			error = ENOENT;
 			goto bad2;
 		}
 		if (dp->v_mount->mnt_flag & MNT_NOSYMFOLLOW) {

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 24 20:00:28 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B69741065781;
	Tue, 24 Mar 2009 20:00:28 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A0D2D8FC17;
	Tue, 24 Mar 2009 20:00:28 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2OK0Sff055436;
	Tue, 24 Mar 2009 20:00:28 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2OK0S5Z055435;
	Tue, 24 Mar 2009 20:00:28 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903242000.n2OK0S5Z055435@svn.freebsd.org>
From: Marius Strobl 
Date: Tue, 24 Mar 2009 20:00:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190390 - head/release/sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 20:00:29 -0000

Author: marius
Date: Tue Mar 24 20:00:28 2009
New Revision: 190390
URL: http://svn.freebsd.org/changeset/base/190390

Log:
  Change yet another script to use /dev/mdX instead of /dev/mdXc (see
  also r188438).

Modified:
  head/release/sparc64/mkisoimages.sh

Modified: head/release/sparc64/mkisoimages.sh
==============================================================================
--- head/release/sparc64/mkisoimages.sh	Tue Mar 24 18:35:01 2009	(r190389)
+++ head/release/sparc64/mkisoimages.sh	Tue Mar 24 20:00:28 2009	(r190390)
@@ -31,8 +31,8 @@ if [ "x$1" = "x-b" ]; then
 	dd if=/dev/zero of=${IMG} bs=512 count=1024
 	MD=`mdconfig -a -t vnode -f ${IMG}`
 	sunlabel -w -B -b $4/boot/boot1 ${MD} auto
-	newfs -O1 -o space -m 0 /dev/${MD}c
-	mount /dev/${MD}c ${MNT}
+	newfs -O1 -o space -m 0 /dev/${MD}
+	mount /dev/${MD} ${MNT}
 	mkdir ${MNT}/boot
 	cp $4/boot/loader ${MNT}/boot
 	umount ${MNT}

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 24 20:39:09 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 279AE10657C3;
	Tue, 24 Mar 2009 20:39:09 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 142838FC16;
	Tue, 24 Mar 2009 20:39:09 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2OKd9tU056192;
	Tue, 24 Mar 2009 20:39:09 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2OKd8LC056178;
	Tue, 24 Mar 2009 20:39:08 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200903242039.n2OKd8LC056178@svn.freebsd.org>
From: Sam Leffler 
Date: Tue, 24 Mar 2009 20:39:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190391 - in head/sys: conf net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 20:39:09 -0000

Author: sam
Date: Tue Mar 24 20:39:08 2009
New Revision: 190391
URL: http://svn.freebsd.org/changeset/base/190391

Log:
  split Atheros SuperG support out into it's own file that's included only
  with a new IEEE80211_SUPPORT_SUPERG option

Added:
  head/sys/net80211/ieee80211_superg.c   (contents, props changed)
  head/sys/net80211/ieee80211_superg.h   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/conf/options
  head/sys/net80211/ieee80211.c
  head/sys/net80211/ieee80211_adhoc.c
  head/sys/net80211/ieee80211_hostap.c
  head/sys/net80211/ieee80211_input.c
  head/sys/net80211/ieee80211_input.h
  head/sys/net80211/ieee80211_ioctl.c
  head/sys/net80211/ieee80211_node.c
  head/sys/net80211/ieee80211_output.c
  head/sys/net80211/ieee80211_proto.c
  head/sys/net80211/ieee80211_proto.h
  head/sys/net80211/ieee80211_sta.c
  head/sys/net80211/ieee80211_wds.c

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Tue Mar 24 20:00:28 2009	(r190390)
+++ head/sys/conf/files	Tue Mar 24 20:39:08 2009	(r190391)
@@ -2215,6 +2215,7 @@ net80211/ieee80211_rssadapt.c	optional w
 net80211/ieee80211_scan.c	optional wlan
 net80211/ieee80211_scan_sta.c	optional wlan
 net80211/ieee80211_sta.c	optional wlan
+net80211/ieee80211_superg.c	optional wlan ieee80211_support_superg
 net80211/ieee80211_tdma.c	optional wlan ieee80211_support_tdma
 net80211/ieee80211_wds.c	optional wlan
 net80211/ieee80211_xauth.c	optional wlan wlan_xauth

Modified: head/sys/conf/options
==============================================================================
--- head/sys/conf/options	Tue Mar 24 20:00:28 2009	(r190390)
+++ head/sys/conf/options	Tue Mar 24 20:39:08 2009	(r190391)
@@ -789,6 +789,7 @@ INTR_FILTER
 IEEE80211_DEBUG		opt_wlan.h
 IEEE80211_DEBUG_REFCNT	opt_wlan.h
 IEEE80211_AMPDU_AGE	opt_wlan.h
+IEEE80211_SUPPORT_SUPERG	opt_wlan.h
 IEEE80211_SUPPORT_TDMA	opt_wlan.h
 
 # 802.11 TDMA support

Modified: head/sys/net80211/ieee80211.c
==============================================================================
--- head/sys/net80211/ieee80211.c	Tue Mar 24 20:00:28 2009	(r190390)
+++ head/sys/net80211/ieee80211.c	Tue Mar 24 20:39:08 2009	(r190391)
@@ -46,6 +46,9 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#ifdef IEEE80211_SUPPORT_SUPERG
+#include 
+#endif
 
 #include 
 
@@ -264,6 +267,9 @@ ieee80211_ifattach(struct ieee80211com *
 	ieee80211_node_attach(ic);
 	ieee80211_power_attach(ic);
 	ieee80211_proto_attach(ic);
+#ifdef IEEE80211_SUPPORT_SUPERG
+	ieee80211_superg_attach(ic);
+#endif
 	ieee80211_ht_attach(ic);
 	ieee80211_scan_attach(ic);
 	ieee80211_regdomain_attach(ic);
@@ -306,6 +312,9 @@ ieee80211_ifdetach(struct ieee80211com *
 	ieee80211_sysctl_detach(ic);
 	ieee80211_regdomain_detach(ic);
 	ieee80211_scan_detach(ic);
+#ifdef IEEE80211_SUPPORT_SUPERG
+	ieee80211_superg_detach(ic);
+#endif
 	ieee80211_ht_detach(ic);
 	/* NB: must be called before ieee80211_node_detach */
 	ieee80211_proto_detach(ic);
@@ -415,10 +424,6 @@ ieee80211_vap_setup(struct ieee80211com 
 		vap->iv_flags |= IEEE80211_F_WME;
 	if (vap->iv_caps & IEEE80211_C_BURST)
 		vap->iv_flags |= IEEE80211_F_BURST;
-	if (vap->iv_caps & IEEE80211_C_FF)
-		vap->iv_flags |= IEEE80211_F_FF;
-	if (vap->iv_caps & IEEE80211_C_TURBOP)
-		vap->iv_flags |= IEEE80211_F_TURBOP;
 	/* NB: bg scanning only makes sense for station mode right now */
 	if (vap->iv_opmode == IEEE80211_M_STA &&
 	    (vap->iv_caps & IEEE80211_C_BGSCAN))
@@ -445,6 +450,9 @@ ieee80211_vap_setup(struct ieee80211com 
 	ieee80211_node_vattach(vap);
 	ieee80211_power_vattach(vap);
 	ieee80211_proto_vattach(vap);
+#ifdef IEEE80211_SUPPORT_SUPERG
+	ieee80211_superg_vattach(vap);
+#endif
 	ieee80211_ht_vattach(vap);
 	ieee80211_scan_vattach(vap);
 	ieee80211_regdomain_vattach(vap);
@@ -497,7 +505,9 @@ ieee80211_vap_attach(struct ieee80211vap
 	IEEE80211_LOCK(ic);
 	TAILQ_INSERT_TAIL(&ic->ic_vaps, vap, iv_next);
 	ieee80211_syncflag_locked(ic, IEEE80211_F_WME);
+#ifdef IEEE80211_SUPPORT_SUPERG
 	ieee80211_syncflag_locked(ic, IEEE80211_F_TURBOP);
+#endif
 	ieee80211_syncflag_locked(ic, IEEE80211_F_PCF);
 	ieee80211_syncflag_locked(ic, IEEE80211_F_BURST);
 	ieee80211_syncflag_ext_locked(ic, IEEE80211_FEXT_HT);
@@ -545,7 +555,9 @@ ieee80211_vap_detach(struct ieee80211vap
 
 	TAILQ_REMOVE(&ic->ic_vaps, vap, iv_next);
 	ieee80211_syncflag_locked(ic, IEEE80211_F_WME);
+#ifdef IEEE80211_SUPPORT_SUPERG
 	ieee80211_syncflag_locked(ic, IEEE80211_F_TURBOP);
+#endif
 	ieee80211_syncflag_locked(ic, IEEE80211_F_PCF);
 	ieee80211_syncflag_locked(ic, IEEE80211_F_BURST);
 	ieee80211_syncflag_ext_locked(ic, IEEE80211_FEXT_HT);
@@ -562,6 +574,9 @@ ieee80211_vap_detach(struct ieee80211vap
 
 	ieee80211_regdomain_vdetach(vap);
 	ieee80211_scan_vdetach(vap);
+#ifdef IEEE80211_SUPPORT_SUPERG
+	ieee80211_superg_vdetach(vap);
+#endif
 	ieee80211_ht_vdetach(vap);
 	/* NB: must be before ieee80211_node_vdetach */
 	ieee80211_proto_vdetach(vap);

Modified: head/sys/net80211/ieee80211_adhoc.c
==============================================================================
--- head/sys/net80211/ieee80211_adhoc.c	Tue Mar 24 20:00:28 2009	(r190390)
+++ head/sys/net80211/ieee80211_adhoc.c	Tue Mar 24 20:39:08 2009	(r190391)
@@ -57,6 +57,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef IEEE80211_SUPPORT_SUPERG
+#include 
+#endif
 #ifdef IEEE80211_SUPPORT_TDMA
 #include 
 #endif
@@ -590,32 +593,13 @@ adhoc_input(struct ieee80211_node *ni, s
 			m = ieee80211_decap_amsdu(ni, m);
 			if (m == NULL)
 				return IEEE80211_FC0_TYPE_DATA;
-		} else if (IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_FF) &&
-#define	FF_LLC_SIZE	(sizeof(struct ether_header) + sizeof(struct llc))
-		    m->m_pkthdr.len >= 3*FF_LLC_SIZE) {
-			struct llc *llc;
-
-			/*
-			 * Check for fast-frame tunnel encapsulation.
-			 */
-			if (m->m_len < FF_LLC_SIZE &&
-			    (m = m_pullup(m, FF_LLC_SIZE)) == NULL) {
-				IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY,
-				    ni->ni_macaddr, "fast-frame",
-				    "%s", "m_pullup(llc) failed");
-				vap->iv_stats.is_rx_tooshort++;
+		} else {
+#ifdef IEEE80211_SUPPORT_SUPERG
+			m = ieee80211_decap_fastframe(vap, ni, m);
+			if (m == NULL)
 				return IEEE80211_FC0_TYPE_DATA;
-			}
-			llc = (struct llc *)(mtod(m, uint8_t *) + 
-				sizeof(struct ether_header));
-			if (llc->llc_snap.ether_type == htons(ATH_FF_ETH_TYPE)) {
-				m_adj(m, FF_LLC_SIZE);
-				m = ieee80211_decap_fastframe(ni, m);
-				if (m == NULL)
-					return IEEE80211_FC0_TYPE_DATA;
-			}
+#endif
 		}
-#undef FF_LLC_SIZE
 		if (dir == IEEE80211_FC1_DIR_DSTODS && ni->ni_wdsvap != NULL)
 			ieee80211_deliver_data(ni->ni_wdsvap, ni, m);
 		else

Modified: head/sys/net80211/ieee80211_hostap.c
==============================================================================
--- head/sys/net80211/ieee80211_hostap.c	Tue Mar 24 20:00:28 2009	(r190390)
+++ head/sys/net80211/ieee80211_hostap.c	Tue Mar 24 20:39:08 2009	(r190391)
@@ -57,6 +57,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef IEEE80211_SUPPORT_SUPERG
+#include 
+#endif
 #include 
 
 #define	IEEE80211_RATE2MBS(r)	(((r) & IEEE80211_RATE_VAL) / 2)
@@ -752,32 +755,13 @@ hostap_input(struct ieee80211_node *ni, 
 			m = ieee80211_decap_amsdu(ni, m);
 			if (m == NULL)
 				return IEEE80211_FC0_TYPE_DATA;
-		} else if (IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_FF) &&
-#define	FF_LLC_SIZE	(sizeof(struct ether_header) + sizeof(struct llc))
-		    m->m_pkthdr.len >= 3*FF_LLC_SIZE) {
-			struct llc *llc;
-
-			/*
-			 * Check for fast-frame tunnel encapsulation.
-			 */
-			if (m->m_len < FF_LLC_SIZE &&
-			    (m = m_pullup(m, FF_LLC_SIZE)) == NULL) {
-				IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY,
-				    ni->ni_macaddr, "fast-frame",
-				    "%s", "m_pullup(llc) failed");
-				vap->iv_stats.is_rx_tooshort++;
+		} else {
+#ifdef IEEE80211_SUPPORT_SUPERG
+			m = ieee80211_decap_fastframe(vap, ni, m);
+			if (m == NULL)
 				return IEEE80211_FC0_TYPE_DATA;
-			}
-			llc = (struct llc *)(mtod(m, uint8_t *) + 
-				sizeof(struct ether_header));
-			if (llc->llc_snap.ether_type == htons(ATH_FF_ETH_TYPE)) {
-				m_adj(m, FF_LLC_SIZE);
-				m = ieee80211_decap_fastframe(ni, m);
-				if (m == NULL)
-					return IEEE80211_FC0_TYPE_DATA;
-			}
+#endif
 		}
-#undef FF_LLC_SIZE
 		if (dir == IEEE80211_FC1_DIR_DSTODS && ni->ni_wdsvap != NULL)
 			ieee80211_deliver_data(ni->ni_wdsvap, ni, m);
 		else
@@ -1967,8 +1951,10 @@ hostap_recv_mgmt(struct ieee80211_node *
 					wpa = frm;
 				else if (iswmeinfo(frm))
 					wme = frm;
+#ifdef IEEE80211_SUPPORT_SUPERG
 				else if (isatherosoui(frm))
 					ath = frm;
+#endif
 				else if (vap->iv_flags_ext & IEEE80211_FEXT_HTCOMPAT) {
 					if (ishtcapoui(frm) && htcap == NULL)
 						htcap = frm;
@@ -2106,6 +2092,7 @@ hostap_recv_mgmt(struct ieee80211_node *
 				ni->ni_flags |= IEEE80211_NODE_QOS;
 			} else
 				ni->ni_flags &= ~IEEE80211_NODE_QOS;
+#ifdef IEEE80211_SUPPORT_SUPERG
 			if (ath != NULL) {
 				setie(ath_ie, ath - sfrm);
 				/* 
@@ -2113,6 +2100,7 @@ hostap_recv_mgmt(struct ieee80211_node *
 				 */
 				ieee80211_parse_ath(ni, ni->ni_ies.ath_ie);
 			} else
+#endif
 				ni->ni_ath_flags = 0;
 #undef setie
 		} else {

Modified: head/sys/net80211/ieee80211_input.c
==============================================================================
--- head/sys/net80211/ieee80211_input.c	Tue Mar 24 20:00:28 2009	(r190390)
+++ head/sys/net80211/ieee80211_input.c	Tue Mar 24 20:39:08 2009	(r190391)
@@ -358,73 +358,6 @@ ieee80211_decap1(struct mbuf *m, int *fr
 }
 
 /*
- * Decap the encapsulated frame pair and dispatch the first
- * for delivery.  The second frame is returned for delivery
- * via the normal path.
- */
-struct mbuf *
-ieee80211_decap_fastframe(struct ieee80211_node *ni, struct mbuf *m)
-{
-#define	MS(x,f)	(((x) & f) >> f##_S)
-	struct ieee80211vap *vap = ni->ni_vap;
-	uint32_t ath;
-	struct mbuf *n;
-	int framelen;
-
-	m_copydata(m, 0, sizeof(uint32_t), (caddr_t) &ath);
-	if (MS(ath, ATH_FF_PROTO) != ATH_FF_PROTO_L2TUNNEL) {
-		IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY,
-		    ni->ni_macaddr, "fast-frame",
-		    "unsupport tunnel protocol, header 0x%x", ath);
-		vap->iv_stats.is_ff_badhdr++;
-		m_freem(m);
-		return NULL;
-	}
-	/* NB: skip header and alignment padding */
-	m_adj(m, roundup(sizeof(uint32_t) - 2, 4) + 2);
-
-	vap->iv_stats.is_ff_decap++;
-
-	/*
-	 * Decap the first frame, bust it apart from the
-	 * second and deliver; then decap the second frame
-	 * and return it to the caller for normal delivery.
-	 */
-	m = ieee80211_decap1(m, &framelen);
-	if (m == NULL) {
-		IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY,
-		    ni->ni_macaddr, "fast-frame", "%s", "first decap failed");
-		vap->iv_stats.is_ff_tooshort++;
-		return NULL;
-	}
-	n = m_split(m, framelen, M_NOWAIT);
-	if (n == NULL) {
-		IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY,
-		    ni->ni_macaddr, "fast-frame",
-		    "%s", "unable to split encapsulated frames");
-		vap->iv_stats.is_ff_split++;
-		m_freem(m);			/* NB: must reclaim */
-		return NULL;
-	}
-	/* XXX not right for WDS */
-	vap->iv_deliver_data(vap, ni, m);	/* 1st of pair */
-
-	/*
-	 * Decap second frame.
-	 */
-	m_adj(n, roundup2(framelen, 4) - framelen);	/* padding */
-	n = ieee80211_decap1(n, &framelen);
-	if (n == NULL) {
-		IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY,
-		    ni->ni_macaddr, "fast-frame", "%s", "second decap failed");
-		vap->iv_stats.is_ff_tooshort++;
-	}
-	/* XXX verify framelen against mbuf contents */
-	return n;				/* 2nd delivered by caller */
-#undef MS
-}
-
-/*
  * Install received rate set information in the node's state block.
  */
 int
@@ -510,16 +443,6 @@ ieee80211_alloc_challenge(struct ieee802
 	return (ni->ni_challenge != NULL);
 }
 
-void
-ieee80211_parse_ath(struct ieee80211_node *ni, uint8_t *ie)
-{
-	const struct ieee80211_ath_ie *ath =
-		(const struct ieee80211_ath_ie *) ie;
-
-	ni->ni_ath_flags = ath->ath_capability;
-	ni->ni_ath_defkeyix = LE_READ_2(&ath->ath_defkeyix);
-}
-
 /*
  * Parse a Beacon or ProbeResponse frame and return the
  * useful information in an ieee80211_scanparams structure.
@@ -633,8 +556,10 @@ ieee80211_parse_beacon(struct ieee80211_
 				scan->wpa = frm;
 			else if (iswmeparam(frm) || iswmeinfo(frm))
 				scan->wme = frm;
+#ifdef IEEE80211_SUPPORT_SUPERG
 			else if (isatherosoui(frm))
 				scan->ath = frm;
+#endif
 #ifdef IEEE80211_SUPPORT_TDMA
 			else if (istdmaoui(frm))
 				scan->tdma = frm;

Modified: head/sys/net80211/ieee80211_input.h
==============================================================================
--- head/sys/net80211/ieee80211_input.h	Tue Mar 24 20:00:28 2009	(r190390)
+++ head/sys/net80211/ieee80211_input.h	Tue Mar 24 20:39:08 2009	(r190391)
@@ -148,14 +148,11 @@ struct mbuf *ieee80211_defrag(struct iee
 		struct mbuf *, int);
 struct mbuf *ieee80211_decap(struct ieee80211vap *, struct mbuf *, int);
 struct mbuf *ieee80211_decap1(struct mbuf *, int *);
-struct mbuf *ieee80211_decap_fastframe(struct ieee80211_node *,
-		struct mbuf *);
 int	ieee80211_setup_rates(struct ieee80211_node *ni,
 		const uint8_t *rates, const uint8_t *xrates, int flags);
 void ieee80211_send_error(struct ieee80211_node *,
 		const uint8_t mac[IEEE80211_ADDR_LEN], int subtype, int arg);
 int	ieee80211_alloc_challenge(struct ieee80211_node *);
-void	ieee80211_parse_ath(struct ieee80211_node *, uint8_t *);
 int	ieee80211_parse_beacon(struct ieee80211_node *, struct mbuf *,
 		struct ieee80211_scanparams *);
 int	ieee80211_parse_action(struct ieee80211_node *, struct mbuf *);

Modified: head/sys/net80211/ieee80211_ioctl.c
==============================================================================
--- head/sys/net80211/ieee80211_ioctl.c	Tue Mar 24 20:00:28 2009	(r190390)
+++ head/sys/net80211/ieee80211_ioctl.c	Tue Mar 24 20:39:08 2009	(r190391)
@@ -584,21 +584,6 @@ ieee80211_ioctl_getmaccmd(struct ieee802
 	return (acl == NULL ? EINVAL : acl->iac_getioctl(vap, ireq));
 }
 
-/*
- * Return the current ``state'' of an Atheros capbility.
- * If associated in station mode report the negotiated
- * setting. Otherwise report the current setting.
- */
-static int
-getathcap(struct ieee80211vap *vap, int cap)
-{
-	if (vap->iv_opmode == IEEE80211_M_STA &&
-	    vap->iv_state == IEEE80211_S_RUN)
-		return IEEE80211_ATH_CAP(vap, vap->iv_bss, cap) != 0;
-	else
-		return (vap->iv_flags & cap) != 0;
-}
-
 static __noinline int
 ieee80211_ioctl_getcurchan(struct ieee80211vap *vap, struct ieee80211req *ireq)
 {
@@ -974,12 +959,6 @@ ieee80211_ioctl_get80211(struct ieee8021
 	case IEEE80211_IOC_PUREG:
 		ireq->i_val = (vap->iv_flags & IEEE80211_F_PUREG) != 0;
 		break;
-	case IEEE80211_IOC_FF:
-		ireq->i_val = getathcap(vap, IEEE80211_F_FF);
-		break;
-	case IEEE80211_IOC_TURBOP:
-		ireq->i_val = getathcap(vap, IEEE80211_F_TURBOP);
-		break;
 	case IEEE80211_IOC_BGSCAN:
 		ireq->i_val = (vap->iv_flags & IEEE80211_F_BGSCAN) != 0;
 		break;
@@ -2889,24 +2868,6 @@ ieee80211_ioctl_set80211(struct ieee8021
 		if (isvap11g(vap))
 			error = ENETRESET;
 		break;
-	case IEEE80211_IOC_FF:
-		if (ireq->i_val) {
-			if ((vap->iv_caps & IEEE80211_C_FF) == 0)
-				return EOPNOTSUPP;
-			vap->iv_flags |= IEEE80211_F_FF;
-		} else
-			vap->iv_flags &= ~IEEE80211_F_FF;
-		error = ERESTART;
-		break;
-	case IEEE80211_IOC_TURBOP:
-		if (ireq->i_val) {
-			if ((vap->iv_caps & IEEE80211_C_TURBOP) == 0)
-				return EOPNOTSUPP;
-			vap->iv_flags |= IEEE80211_F_TURBOP;
-		} else
-			vap->iv_flags &= ~IEEE80211_F_TURBOP;
-		error = ENETRESET;
-		break;
 	case IEEE80211_IOC_BGSCAN:
 		if (ireq->i_val) {
 			if ((vap->iv_caps & IEEE80211_C_BGSCAN) == 0)

Modified: head/sys/net80211/ieee80211_node.c
==============================================================================
--- head/sys/net80211/ieee80211_node.c	Tue Mar 24 20:00:28 2009	(r190390)
+++ head/sys/net80211/ieee80211_node.c	Tue Mar 24 20:39:08 2009	(r190391)
@@ -43,6 +43,9 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#ifdef IEEE80211_SUPPORT_SUPERG
+#include 
+#endif
 #ifdef IEEE80211_SUPPORT_TDMA
 #include 
 #endif
@@ -754,8 +757,10 @@ ieee80211_sta_join(struct ieee80211vap *
 
 	if (ieee80211_ies_init(&ni->ni_ies, se->se_ies.data, se->se_ies.len)) {
 		ieee80211_ies_expand(&ni->ni_ies);
+#ifdef IEEE80211_SUPPORT_SUPERG
 		if (ni->ni_ies.ath_ie != NULL)
 			ieee80211_parse_ath(ni, ni->ni_ies.ath_ie);
+#endif
 		if (ni->ni_ies.htcap_ie != NULL)
 			ieee80211_parse_htcap(ni, ni->ni_ies.htcap_ie);
 		if (ni->ni_ies.htinfo_ie != NULL)
@@ -875,8 +880,10 @@ ieee80211_ies_expand(struct ieee80211_ie
 				ies->wpa_ie = ie;
 			else if (iswmeoui(ie))
 				ies->wme_ie = ie;
+#ifdef IEEE80211_SUPPORT_SUPERG
 			else if (isatherosoui(ie))
 				ies->ath_ie = ie;
+#endif
 #ifdef IEEE80211_SUPPORT_TDMA
 			else if (istdmaoui(ie))
 				ies->tdma_ie = ie;
@@ -1173,8 +1180,10 @@ ieee80211_node_create_wds(struct ieee802
 		 */
 		if (vap->iv_flags & IEEE80211_F_WME)
 			ni->ni_flags |= IEEE80211_NODE_QOS;
+#ifdef IEEE80211_SUPPORT_SUPERG
 		if (vap->iv_flags & IEEE80211_F_FF)
 			ni->ni_flags |= IEEE80211_NODE_FF;
+#endif
 		if ((ic->ic_htcaps & IEEE80211_HTC_HT) &&
 		    (vap->iv_flags_ext & IEEE80211_FEXT_HT)) {
 			/*
@@ -1331,8 +1340,10 @@ ieee80211_fakeup_adhoc_node(struct ieee8
 			 */
 			if (vap->iv_flags & IEEE80211_F_WME)
 				ni->ni_flags |= IEEE80211_NODE_QOS;
+#ifdef IEEE80211_SUPPORT_SUPERG
 			if (vap->iv_flags & IEEE80211_F_FF)
 				ni->ni_flags |= IEEE80211_NODE_FF;
+#endif
 		}
 		node_setuptxparms(ni);
 		if (ic->ic_newassoc != NULL)
@@ -1366,8 +1377,10 @@ ieee80211_init_neighbor(struct ieee80211
 			ni->ni_flags |= IEEE80211_NODE_QOS;
 		else
 			ni->ni_flags &= ~IEEE80211_NODE_QOS;
+#ifdef IEEE80211_SUPPORT_SUPERG
 		if (ni->ni_ies.ath_ie != NULL)
 			ieee80211_parse_ath(ni, ni->ni_ies.ath_ie);
+#endif
 	}
 
 	/* NB: must be after ni_chan is setup */

Modified: head/sys/net80211/ieee80211_output.c
==============================================================================
--- head/sys/net80211/ieee80211_output.c	Tue Mar 24 20:00:28 2009	(r190390)
+++ head/sys/net80211/ieee80211_output.c	Tue Mar 24 20:39:08 2009	(r190391)
@@ -47,6 +47,9 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#ifdef IEEE80211_SUPPORT_SUPERG
+#include 
+#endif
 #ifdef IEEE80211_SUPPORT_TDMA
 #include 
 #endif
@@ -62,9 +65,6 @@ __FBSDID("$FreeBSD$");
 #define	ETHER_HEADER_COPY(dst, src) \
 	memcpy(dst, src, sizeof(struct ether_header))
 
-static struct mbuf *ieee80211_encap_fastframe(struct ieee80211vap *,
-	struct mbuf *m1, const struct ether_header *eh1,
-	struct mbuf *m2, const struct ether_header *eh2);
 static int ieee80211_fragment(struct ieee80211vap *, struct mbuf *,
 	u_int hdrsize, u_int ciphdrsize, u_int mtu);
 static	void ieee80211_tx_mgt_cb(struct ieee80211_node *, void *, int);
@@ -731,7 +731,7 @@ done:
  * Drivers and cipher modules assume we have done the necessary work
  * and fail rudely if they don't find the space they need.
  */
-static struct mbuf *
+struct mbuf *
 ieee80211_mbuf_adjust(struct ieee80211vap *vap, int hdrsize,
 	struct ieee80211_key *key, struct mbuf *m)
 {
@@ -861,7 +861,7 @@ ieee80211_encap(struct ieee80211_node *n
 	struct ieee80211_frame *wh;
 	struct ieee80211_key *key;
 	struct llc *llc;
-	int hdrsize, hdrspace, datalen, addqos, txfrag, isff, is4addr;
+	int hdrsize, hdrspace, datalen, addqos, txfrag, is4addr;
 
 	/*
 	 * Copy existing Ethernet header to a safe place.  The
@@ -935,56 +935,7 @@ ieee80211_encap(struct ieee80211_node *n
 	else
 		hdrspace = hdrsize;
 
-	if ((isff = m->m_flags & M_FF) != 0) {
-		struct mbuf *m2;
-		struct ether_header eh2;
-
-		/*
-		 * Fast frame encapsulation.  There must be two packets
-		 * chained with m_nextpkt.  We do header adjustment for
-		 * each, add the tunnel encapsulation, and then concatenate
-		 * the mbuf chains to form a single frame for transmission.
-		 */
-		m2 = m->m_nextpkt;
-		if (m2 == NULL) {
-			IEEE80211_DPRINTF(vap, IEEE80211_MSG_SUPERG,
-				"%s: only one frame\n", __func__);
-			goto bad;
-		}
-		m->m_nextpkt = NULL;
-		/*
-		 * Include fast frame headers in adjusting header
-		 * layout; this allocates space according to what
-		 * ieee80211_encap_fastframe will do.
-		 */
-		m = ieee80211_mbuf_adjust(vap,
-			hdrspace + sizeof(struct llc) + sizeof(uint32_t) + 2 +
-			    sizeof(struct ether_header),
-			key, m);
-		if (m == NULL) {
-			/* NB: ieee80211_mbuf_adjust handles msgs+statistics */
-			m_freem(m2);
-			goto bad;
-		}
-		/*
-		 * Copy second frame's Ethernet header out of line
-		 * and adjust for encapsulation headers.  Note that
-		 * we make room for padding in case there isn't room
-		 * at the end of first frame.
-		 */
-		KASSERT(m2->m_len >= sizeof(eh2), ("no ethernet header!"));
-		ETHER_HEADER_COPY(&eh2, mtod(m2, caddr_t));
-		m2 = ieee80211_mbuf_adjust(vap,
-			ATH_FF_MAX_HDR_PAD + sizeof(struct ether_header),
-			NULL, m2);
-		if (m2 == NULL) {
-			/* NB: ieee80211_mbuf_adjust handles msgs+statistics */
-			goto bad;
-		}
-		m = ieee80211_encap_fastframe(vap, m, &eh, m2, &eh2);
-		if (m == NULL)
-			goto bad;
-	} else {
+	if (__predict_true((m->m_flags & M_FF) == 0)) {
 		/*
 		 * Normal frame.
 		 */
@@ -1002,6 +953,12 @@ ieee80211_encap(struct ieee80211_node *n
 		llc->llc_snap.org_code[1] = 0;
 		llc->llc_snap.org_code[2] = 0;
 		llc->llc_snap.ether_type = eh.ether_type;
+	} else {
+#ifdef IEEE80211_SUPPORT_SUPERG
+		m = ieee80211_ff_encap(vap, m, hdrspace, key);
+		if (m == NULL)
+#endif
+			goto bad;
 	}
 	datalen = m->m_pkthdr.len;		/* NB: w/o 802.11 header */
 
@@ -1047,7 +1004,7 @@ ieee80211_encap(struct ieee80211_node *n
 	case IEEE80211_M_WDS:		/* NB: is4addr should always be true */
 		goto bad;
 	}
-	if (m->m_flags & M_MORE_DATA)
+		if (m->m_flags & M_MORE_DATA)
 		wh->i_fc[1] |= IEEE80211_FC1_MORE_DATA;
 	if (addqos) {
 		uint8_t *qos;
@@ -1128,7 +1085,7 @@ ieee80211_encap(struct ieee80211_node *n
 	txfrag = (m->m_pkthdr.len > vap->iv_fragthreshold &&
 	    !IEEE80211_IS_MULTICAST(wh->i_addr1) &&
 	    (vap->iv_caps & IEEE80211_C_TXFRAG) &&
-	    !isff);		/* NB: don't fragment ff's */
+	    (m->m_flags & M_FF) == 0);		/* NB: don't fragment ff's */
 	if (key != NULL) {
 		/*
 		 * IEEE 802.1X: send EAPOL frames always in the clear.
@@ -1175,135 +1132,6 @@ bad:
 }
 
 /*
- * Do Ethernet-LLC encapsulation for each payload in a fast frame
- * tunnel encapsulation.  The frame is assumed to have an Ethernet
- * header at the front that must be stripped before prepending the
- * LLC followed by the Ethernet header passed in (with an Ethernet
- * type that specifies the payload size).
- */
-static struct mbuf *
-ieee80211_encap1(struct ieee80211vap *vap, struct mbuf *m,
-	const struct ether_header *eh)
-{
-	struct llc *llc;
-	uint16_t payload;
-
-	/* XXX optimize by combining m_adj+M_PREPEND */
-	m_adj(m, sizeof(struct ether_header) - sizeof(struct llc));
-	llc = mtod(m, struct llc *);
-	llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP;
-	llc->llc_control = LLC_UI;
-	llc->llc_snap.org_code[0] = 0;
-	llc->llc_snap.org_code[1] = 0;
-	llc->llc_snap.org_code[2] = 0;
-	llc->llc_snap.ether_type = eh->ether_type;
-	payload = m->m_pkthdr.len;		/* NB: w/o Ethernet header */
-
-	M_PREPEND(m, sizeof(struct ether_header), M_DONTWAIT);
-	if (m == NULL) {		/* XXX cannot happen */
-		IEEE80211_DPRINTF(vap, IEEE80211_MSG_SUPERG,
-			"%s: no space for ether_header\n", __func__);
-		vap->iv_stats.is_tx_nobuf++;
-		return NULL;
-	}
-	ETHER_HEADER_COPY(mtod(m, void *), eh);
-	mtod(m, struct ether_header *)->ether_type = htons(payload);
-	return m;
-}
-
-/*
- * Do fast frame tunnel encapsulation.  The two frames and
- * Ethernet headers are supplied.  The caller is assumed to
- * have arrange for space in the mbuf chains for encapsulating
- * headers (to avoid major mbuf fragmentation).
- *
- * The encapsulated frame is returned or NULL if there is a
- * problem (should not happen).
- */
-static struct mbuf *
-ieee80211_encap_fastframe(struct ieee80211vap *vap,
-	struct mbuf *m1, const struct ether_header *eh1,
-	struct mbuf *m2, const struct ether_header *eh2)
-{
-	struct llc *llc;
-	struct mbuf *m;
-	int pad;
-
-	/*
-	 * First, each frame gets a standard encapsulation.
-	 */
-	m1 = ieee80211_encap1(vap, m1, eh1);
-	if (m1 == NULL) {
-		m_freem(m2);
-		return NULL;
-	}
-	m2 = ieee80211_encap1(vap, m2, eh2);
-	if (m2 == NULL) {
-		m_freem(m1);
-		return NULL;
-	}
-
-	/*
-	 * Pad leading frame to a 4-byte boundary.  If there
-	 * is space at the end of the first frame, put it
-	 * there; otherwise prepend to the front of the second
-	 * frame.  We know doing the second will always work
-	 * because we reserve space above.  We prefer appending
-	 * as this typically has better DMA alignment properties.
-	 */
-	for (m = m1; m->m_next != NULL; m = m->m_next)
-		;
-	pad = roundup2(m1->m_pkthdr.len, 4) - m1->m_pkthdr.len;
-	if (pad) {
-		if (M_TRAILINGSPACE(m) < pad) {		/* prepend to second */
-			m2->m_data -= pad;
-			m2->m_len += pad;
-			m2->m_pkthdr.len += pad;
-		} else {				/* append to first */
-			m->m_len += pad;
-			m1->m_pkthdr.len += pad;
-		}
-	}
-
-	/*
-	 * Now, stick 'em together and prepend the tunnel headers;
-	 * first the Atheros tunnel header (all zero for now) and
-	 * then a special fast frame LLC.
-	 *
-	 * XXX optimize by prepending together
-	 */
-	m->m_next = m2;			/* NB: last mbuf from above */
-	m1->m_pkthdr.len += m2->m_pkthdr.len;
-	M_PREPEND(m1, sizeof(uint32_t)+2, M_DONTWAIT);
-	if (m1 == NULL) {		/* XXX cannot happen */
-		IEEE80211_DPRINTF(vap, IEEE80211_MSG_SUPERG,
-			"%s: no space for tunnel header\n", __func__);
-		vap->iv_stats.is_tx_nobuf++;
-		return NULL;
-	}
-	memset(mtod(m1, void *), 0, sizeof(uint32_t)+2);
-
-	M_PREPEND(m1, sizeof(struct llc), M_DONTWAIT);
-	if (m1 == NULL) {		/* XXX cannot happen */
-		IEEE80211_DPRINTF(vap, IEEE80211_MSG_SUPERG,
-			"%s: no space for llc header\n", __func__);
-		vap->iv_stats.is_tx_nobuf++;
-		return NULL;
-	}
-	llc = mtod(m1, struct llc *);
-	llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP;
-	llc->llc_control = LLC_UI;
-	llc->llc_snap.org_code[0] = ATH_FF_SNAP_ORGCODE_0;
-	llc->llc_snap.org_code[1] = ATH_FF_SNAP_ORGCODE_1;
-	llc->llc_snap.org_code[2] = ATH_FF_SNAP_ORGCODE_2;
-	llc->llc_snap.ether_type = htons(ATH_FF_ETH_TYPE);
-
-	vap->iv_stats.is_ff_encap++;
-
-	return m1;
-}
-
-/*
  * Fragment the frame according to the specified mtu.
  * The size of the 802.11 header (w/o padding) is provided
  * so we don't need to recalculate it.  We create a new
@@ -1568,31 +1396,6 @@ ieee80211_add_wme_param(uint8_t *frm, st
 }
 #undef WME_OUI_BYTES
 
-#define	ATH_OUI_BYTES		0x00, 0x03, 0x7f
-/*
- * Add a WME information element to a frame.
- */
-static uint8_t *
-ieee80211_add_ath(uint8_t *frm, uint8_t caps, uint16_t defkeyix)
-{
-	static const struct ieee80211_ath_ie info = {
-		.ath_id		= IEEE80211_ELEMID_VENDOR,
-		.ath_len	= sizeof(struct ieee80211_ath_ie) - 2,
-		.ath_oui	= { ATH_OUI_BYTES },
-		.ath_oui_type	= ATH_OUI_TYPE,
-		.ath_oui_subtype= ATH_OUI_SUBTYPE,
-		.ath_version	= ATH_OUI_VERSION,
-	};
-	struct ieee80211_ath_ie *ath = (struct ieee80211_ath_ie *) frm;
-
-	memcpy(frm, &info, sizeof(info));
-	ath->ath_capability = caps;
-	ath->ath_defkeyix[0] = (defkeyix & 0xff);
-	ath->ath_defkeyix[1] = ((defkeyix >> 8) & 0xff);
-	return frm + sizeof(info); 
-}
-#undef ATH_OUI_BYTES
-
 /*
  * Add an 11h Power Constraint element to a frame.
  */
@@ -1977,7 +1780,9 @@ ieee80211_send_mgmt(struct ieee80211_nod
 		       + sizeof(struct ieee80211_wme_info)
 		       + sizeof(struct ieee80211_ie_htcap)
 		       + 4 + sizeof(struct ieee80211_ie_htcap)
+#ifdef IEEE80211_SUPPORT_SUPERG
 		       + sizeof(struct ieee80211_ath_ie)
+#endif
 		       + (vap->iv_appie_wpa != NULL ?
 				vap->iv_appie_wpa->ie_len : 0)
 		       + (vap->iv_appie_assocreq != NULL ?
@@ -2046,6 +1851,7 @@ ieee80211_send_mgmt(struct ieee80211_nod
 		    ni->ni_ies.htcap_ie != NULL &&
 		    ni->ni_ies.htcap_ie[0] == IEEE80211_ELEMID_VENDOR)
 			frm = ieee80211_add_htcap_vendor(frm, ni);
+#ifdef IEEE80211_SUPPORT_SUPERG
 		if (IEEE80211_ATH_CAP(vap, ni, IEEE80211_F_ATHEROS))
 			frm = ieee80211_add_ath(frm,
 				IEEE80211_ATH_CAP(vap, ni, IEEE80211_F_ATHEROS),
@@ -2053,6 +1859,7 @@ ieee80211_send_mgmt(struct ieee80211_nod
 				ni->ni_authmode != IEEE80211_AUTH_8021X &&
 				vap->iv_def_txkey != IEEE80211_KEYIX_NONE ?
 				vap->iv_def_txkey : 0x7fff);
+#endif /* IEEE80211_SUPPORT_SUPERG */
 		if (vap->iv_appie_assocreq != NULL)
 			frm = add_appie(frm, vap->iv_appie_assocreq);
 		m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *);
@@ -2088,7 +1895,9 @@ ieee80211_send_mgmt(struct ieee80211_nod
 		       + sizeof(struct ieee80211_ie_htcap) + 4
 		       + sizeof(struct ieee80211_ie_htinfo) + 4
 		       + sizeof(struct ieee80211_wme_param)
+#ifdef IEEE80211_SUPPORT_SUPERG
 		       + sizeof(struct ieee80211_ath_ie)
+#endif
 		       + (vap->iv_appie_assocresp != NULL ?
 				vap->iv_appie_assocresp->ie_len : 0)
 		);
@@ -2123,10 +1932,12 @@ ieee80211_send_mgmt(struct ieee80211_nod
 			frm = ieee80211_add_htcap_vendor(frm, ni);
 			frm = ieee80211_add_htinfo_vendor(frm, ni);
 		}
+#ifdef IEEE80211_SUPPORT_SUPERG
 		if (IEEE80211_ATH_CAP(vap, ni, IEEE80211_F_ATHEROS))
 			frm = ieee80211_add_ath(frm,
 				IEEE80211_ATH_CAP(vap, ni, IEEE80211_F_ATHEROS),
 				ni->ni_ath_defkeyix);
+#endif /* IEEE80211_SUPPORT_SUPERG */
 		if (vap->iv_appie_assocresp != NULL)
 			frm = add_appie(frm, vap->iv_appie_assocresp);
 		m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *);
@@ -2227,7 +2038,9 @@ ieee80211_alloc_proberesp(struct ieee802
 	       + sizeof(struct ieee80211_wme_param)
 	       + 4 + sizeof(struct ieee80211_ie_htcap)
 	       + 4 + sizeof(struct ieee80211_ie_htinfo)
+#ifdef IEEE80211_SUPPORT_SUPERG
 	       + sizeof(struct ieee80211_ath_ie)
+#endif
 	       + (vap->iv_appie_proberesp != NULL ?
 			vap->iv_appie_proberesp->ie_len : 0)
 	);
@@ -2310,9 +2123,11 @@ ieee80211_alloc_proberesp(struct ieee802
 		frm = ieee80211_add_htcap_vendor(frm, bss);
 		frm = ieee80211_add_htinfo_vendor(frm, bss);
 	}
+#ifdef IEEE80211_SUPPORT_SUPERG
 	if (bss->ni_ies.ath_ie != NULL && legacy != IEEE80211_SEND_LEGACY_11B)
 		frm = ieee80211_add_ath(frm, bss->ni_ath_flags,
 			bss->ni_ath_defkeyix);
+#endif
 	if (vap->iv_appie_proberesp != NULL)
 		frm = add_appie(frm, vap->iv_appie_proberesp);
 	m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *);

Modified: head/sys/net80211/ieee80211_proto.c
==============================================================================
--- head/sys/net80211/ieee80211_proto.c	Tue Mar 24 20:00:28 2009	(r190390)
+++ head/sys/net80211/ieee80211_proto.c	Tue Mar 24 20:39:08 2009	(r190391)
@@ -1316,39 +1316,6 @@ ieee80211_resume_all(struct ieee80211com
 	IEEE80211_UNLOCK(ic);
 }
 
-/*
- * Switch between turbo and non-turbo operating modes.
- * Use the specified channel flags to locate the new
- * channel, update 802.11 state, and then call back into
- * the driver to effect the change.
- */
-void
-ieee80211_dturbo_switch(struct ieee80211vap *vap, int newflags)
-{
-	struct ieee80211com *ic = vap->iv_ic;
-	struct ieee80211_channel *chan;
-
-	chan = ieee80211_find_channel(ic, ic->ic_bsschan->ic_freq, newflags);
-	if (chan == NULL) {		/* XXX should not happen */
-		IEEE80211_DPRINTF(vap, IEEE80211_MSG_SUPERG,
-		    "%s: no channel with freq %u flags 0x%x\n",
-		    __func__, ic->ic_bsschan->ic_freq, newflags);
-		return;
-	}
-
-	IEEE80211_DPRINTF(vap, IEEE80211_MSG_SUPERG,
-	    "%s: %s -> %s (freq %u flags 0x%x)\n", __func__,
-	    ieee80211_phymode_name[ieee80211_chan2mode(ic->ic_bsschan)],
-	    ieee80211_phymode_name[ieee80211_chan2mode(chan)],
-	    chan->ic_freq, chan->ic_flags);
-
-	ic->ic_bsschan = chan;
-	ic->ic_prevchan = ic->ic_curchan;
-	ic->ic_curchan = chan;
-	ic->ic_set_channel(ic);
-	/* NB: do not need to reset ERP state 'cuz we're in sta mode */
-}
-
 void
 ieee80211_beacon_miss(struct ieee80211com *ic)
 {

Modified: head/sys/net80211/ieee80211_proto.h
==============================================================================
--- head/sys/net80211/ieee80211_proto.h	Tue Mar 24 20:00:28 2009	(r190390)
+++ head/sys/net80211/ieee80211_proto.h	Tue Mar 24 20:39:08 2009	(r190391)
@@ -74,6 +74,8 @@ int	ieee80211_output(struct ifnet *, str
 void	ieee80211_start(struct ifnet *);
 int	ieee80211_send_nulldata(struct ieee80211_node *);
 int	ieee80211_classify(struct ieee80211_node *, struct mbuf *m);
+struct mbuf *ieee80211_mbuf_adjust(struct ieee80211vap *, int,
+	struct ieee80211_key *, struct mbuf *);
 struct mbuf *ieee80211_encap(struct ieee80211_node *, struct mbuf *);
 int	ieee80211_send_mgmt(struct ieee80211_node *, int, int);
 struct ieee80211_appie;

Modified: head/sys/net80211/ieee80211_sta.c
==============================================================================
--- head/sys/net80211/ieee80211_sta.c	Tue Mar 24 20:00:28 2009	(r190390)
+++ head/sys/net80211/ieee80211_sta.c	Tue Mar 24 20:39:08 2009	(r190391)
@@ -57,6 +57,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef IEEE80211_SUPPORT_SUPERG
+#include 
+#endif
 
 #define	IEEE80211_RATE2MBS(r)	(((r) & IEEE80211_RATE_VAL) / 2)
 
@@ -129,6 +132,7 @@ sta_beacon_miss(struct ieee80211vap *vap
 	vap->iv_bmiss_count = 0;
 	vap->iv_stats.is_beacon_miss++;
 	if (vap->iv_roaming == IEEE80211_ROAMING_AUTO) {
+#ifdef IEEE80211_SUPPORT_SUPERG
 		/*
 		 * If we receive a beacon miss interrupt when using
 		 * dynamic turbo, attempt to switch modes before
@@ -137,6 +141,7 @@ sta_beacon_miss(struct ieee80211vap *vap
 		if (IEEE80211_ATH_CAP(vap, vap->iv_bss, IEEE80211_NODE_TURBOP))
 			ieee80211_dturbo_switch(vap,
 			    ic->ic_bsschan->ic_flags ^ IEEE80211_CHAN_TURBO);
+#endif
 		/*
 		 * Try to reassociate before scanning for a new ap.
 		 */
@@ -795,32 +800,13 @@ sta_input(struct ieee80211_node *ni, str
 			m = ieee80211_decap_amsdu(ni, m);
 			if (m == NULL)
 				return IEEE80211_FC0_TYPE_DATA;
-		} else if (IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_FF) &&
-#define	FF_LLC_SIZE	(sizeof(struct ether_header) + sizeof(struct llc))
-		    m->m_pkthdr.len >= 3*FF_LLC_SIZE) {
-			struct llc *llc;
-
-			/*
-			 * Check for fast-frame tunnel encapsulation.
-			 */
-			if (m->m_len < FF_LLC_SIZE &&
-			    (m = m_pullup(m, FF_LLC_SIZE)) == NULL) {
-				IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY,
-				    ni->ni_macaddr, "fast-frame",
-				    "%s", "m_pullup(llc) failed");
-				vap->iv_stats.is_rx_tooshort++;
+		} else {
+#ifdef IEEE80211_SUPPORT_SUPERG
+			m = ieee80211_decap_fastframe(vap, ni, m);
+			if (m == NULL)
 				return IEEE80211_FC0_TYPE_DATA;
-			}
-			llc = (struct llc *)(mtod(m, uint8_t *) + 
-				sizeof(struct ether_header));
-			if (llc->llc_snap.ether_type == htons(ATH_FF_ETH_TYPE)) {
-				m_adj(m, FF_LLC_SIZE);
-				m = ieee80211_decap_fastframe(ni, m);
-				if (m == NULL)
-					return IEEE80211_FC0_TYPE_DATA;
-			}
+#endif
 		}
-#undef FF_LLC_SIZE
 		ieee80211_deliver_data(vap, ni, m);
 		return IEEE80211_FC0_TYPE_DATA;
 
@@ -1094,51 +1080,6 @@ ieee80211_parse_wmeparams(struct ieee802
 #undef MS
 }
 
-static int
-ieee80211_parse_athparams(struct ieee80211_node *ni, uint8_t *frm,
-	const struct ieee80211_frame *wh)
-{
-	struct ieee80211vap *vap = ni->ni_vap;
-	const struct ieee80211_ath_ie *ath;
-	u_int len = frm[1];
-	int capschanged;
-	uint16_t defkeyix;
-
-	if (len < sizeof(struct ieee80211_ath_ie)-2) {
-		IEEE80211_DISCARD_IE(vap,
-		    IEEE80211_MSG_ELEMID | IEEE80211_MSG_SUPERG,
-		    wh, "Atheros", "too short, len %u", len);
-		return -1;
-	}
-	ath = (const struct ieee80211_ath_ie *)frm;
-	capschanged = (ni->ni_ath_flags != ath->ath_capability);
-	defkeyix = LE_READ_2(ath->ath_defkeyix);
-	if (capschanged || defkeyix != ni->ni_ath_defkeyix) {
-		ni->ni_ath_flags = ath->ath_capability;
-		ni->ni_ath_defkeyix = defkeyix;
-		IEEE80211_NOTE(vap, IEEE80211_MSG_SUPERG, ni,
-		    "ath ie change: new caps 0x%x defkeyix 0x%x",
-		    ni->ni_ath_flags, ni->ni_ath_defkeyix);
-	}
-	if (IEEE80211_ATH_CAP(vap, ni, ATHEROS_CAP_TURBO_PRIME)) {
-		uint16_t curflags, newflags;
-

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 24 21:02:19 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8381E106564A;
	Tue, 24 Mar 2009 21:02:19 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7273F8FC17;
	Tue, 24 Mar 2009 21:02:19 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2OL2JTZ056863;
	Tue, 24 Mar 2009 21:02:19 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2OL2Jj9056862;
	Tue, 24 Mar 2009 21:02:19 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200903242102.n2OL2Jj9056862@svn.freebsd.org>
From: Sam Leffler 
Date: Tue, 24 Mar 2009 21:02:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190394 - head/sys/net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 21:02:20 -0000

Author: sam
Date: Tue Mar 24 21:02:19 2009
New Revision: 190394
URL: http://svn.freebsd.org/changeset/base/190394

Log:
  hide linker set stuff from user space

Modified:
  head/sys/net80211/ieee80211_freebsd.h

Modified: head/sys/net80211/ieee80211_freebsd.h
==============================================================================
--- head/sys/net80211/ieee80211_freebsd.h	Tue Mar 24 20:57:10 2009	(r190393)
+++ head/sys/net80211/ieee80211_freebsd.h	Tue Mar 24 21:02:19 2009	(r190394)
@@ -391,7 +391,6 @@ alg##_modevent(int type)						\
 	/* XXX nothing to do until the rate control framework arrives */\
 }									\
 TEXT_SET(rate##_set, alg##_modevent)
-#endif /* _KERNEL */
 
 struct ieee80211req;
 typedef int ieee80211_ioctl_getfunc(struct ieee80211vap *,
@@ -403,6 +402,7 @@ typedef int ieee80211_ioctl_setfunc(stru
     struct ieee80211req *);
 SET_DECLARE(ieee80211_ioctl_setset, ieee80211_ioctl_setfunc);
 #define	IEEE80211_IOCTL_SET(_name, _set) TEXT_SET(ieee80211_ioctl_setset, _set)
+#endif /* _KERNEL */
 
 /* XXX this stuff belongs elsewhere */
 /*

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 24 22:35:05 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 76511106566B;
	Tue, 24 Mar 2009 22:35:05 +0000 (UTC)
	(envelope-from fabient@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 64A6C8FC19;
	Tue, 24 Mar 2009 22:35:05 +0000 (UTC)
	(envelope-from fabient@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2OMZ5YY058650;
	Tue, 24 Mar 2009 22:35:05 GMT (envelope-from fabient@svn.freebsd.org)
Received: (from fabient@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2OMZ5a3058648;
	Tue, 24 Mar 2009 22:35:05 GMT (envelope-from fabient@svn.freebsd.org)
Message-Id: <200903242235.n2OMZ5a3058648@svn.freebsd.org>
From: Fabien Thomas 
Date: Tue, 24 Mar 2009 22:35:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190395 - head/lib/libpmc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 22:35:05 -0000

Author: fabient
Date: Tue Mar 24 22:35:05 2009
New Revision: 190395
URL: http://svn.freebsd.org/changeset/base/190395

Log:
  Allow compile from c++ for libpmc
  
  Approved by:	jkoshy (mentor)
  MFC after:	3 days

Modified:
  head/lib/libpmc/pmc.h
  head/lib/libpmc/pmclog.h

Modified: head/lib/libpmc/pmc.h
==============================================================================
--- head/lib/libpmc/pmc.h	Tue Mar 24 21:02:19 2009	(r190394)
+++ head/lib/libpmc/pmc.h	Tue Mar 24 22:35:05 2009	(r190395)
@@ -29,6 +29,7 @@
 #ifndef _PMC_H_
 #define _PMC_H_
 
+#include 
 #include 
 
 /*
@@ -68,6 +69,7 @@ struct pmc_pmcinfo {
  * Prototypes
  */
 
+__BEGIN_DECLS
 int	pmc_allocate(const char *_ctrspec, enum pmc_mode _mode, uint32_t _flags,
     int _cpu, pmc_id_t *_pmcid);
 int	pmc_attach(pmc_id_t _pmcid, pid_t _pid);
@@ -105,5 +107,6 @@ const char	*pmc_name_of_state(enum pmc_s
 
 int	pmc_event_names_of_class(enum pmc_class _cl, const char ***_eventnames,
     int *_nevents);
+__END_DECLS
 
 #endif

Modified: head/lib/libpmc/pmclog.h
==============================================================================
--- head/lib/libpmc/pmclog.h	Tue Mar 24 21:02:19 2009	(r190394)
+++ head/lib/libpmc/pmclog.h	Tue Mar 24 22:35:05 2009	(r190395)
@@ -33,6 +33,7 @@
 #ifndef	_PMCLOG_H_
 #define	_PMCLOG_H_
 
+#include 
 #include 
 
 enum pmclog_state {
@@ -158,10 +159,12 @@ struct pmclog_ev {
 
 #define	PMCLOG_FD_NONE				(-1)
 
+__BEGIN_DECLS
 void	*pmclog_open(int _fd);
 int	pmclog_feed(void *_cookie, char *_data, int _len);
 int	pmclog_read(void *_cookie, struct pmclog_ev *_ev);
 void	pmclog_close(void *_cookie);
+__END_DECLS
 
 #endif
 

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 24 23:16:48 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8DA1A1065672;
	Tue, 24 Mar 2009 23:16:48 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 606768FC22;
	Tue, 24 Mar 2009 23:16:48 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2ONGmrh059439;
	Tue, 24 Mar 2009 23:16:48 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2ONGmdb059436;
	Tue, 24 Mar 2009 23:16:48 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200903242316.n2ONGmdb059436@svn.freebsd.org>
From: Robert Watson 
Date: Tue, 24 Mar 2009 23:16:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190396 - head/sys/nfsclient
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 23:16:50 -0000

Author: rwatson
Date: Tue Mar 24 23:16:48 2009
New Revision: 190396
URL: http://svn.freebsd.org/changeset/base/190396

Log:
  Fix two bugs in DTrace tracing of accesscache and attrcache load events:
  
  - Trace non-error loads into the access cache once, not zero times or
    twice.
  - Sometimes attr cache loads fail due to a race, in which case they are
    aborted leading to an invalidation; in this case, trace only the flush,
    not a load.
  
  MFC after:	1 month
  Sponsored by:	Google, Inc.

Modified:
  head/sys/nfsclient/nfs_kdtrace.h
  head/sys/nfsclient/nfs_subs.c
  head/sys/nfsclient/nfs_vnops.c

Modified: head/sys/nfsclient/nfs_kdtrace.h
==============================================================================
--- head/sys/nfsclient/nfs_kdtrace.h	Tue Mar 24 22:35:05 2009	(r190395)
+++ head/sys/nfsclient/nfs_kdtrace.h	Tue Mar 24 23:16:48 2009	(r190396)
@@ -64,8 +64,7 @@ extern uint32_t nfsclient_accesscache_lo
 } while (0)
 
 #define	KDTRACE_NFS_ACCESSCACHE_LOAD_DONE(vp, uid, rmode, error) do {	\
-	if (error && dtrace_nfsclient_accesscache_load_done_probe !=	\
-	    NULL)							\
+	if (dtrace_nfsclient_accesscache_load_done_probe != NULL)	\
 		(dtrace_nfsclient_accesscache_load_done_probe)(		\
 		    nfsclient_accesscache_load_done_id, (vp), (uid),	\
 		    (rmode), (error));					\

Modified: head/sys/nfsclient/nfs_subs.c
==============================================================================
--- head/sys/nfsclient/nfs_subs.c	Tue Mar 24 22:35:05 2009	(r190395)
+++ head/sys/nfsclient/nfs_subs.c	Tue Mar 24 23:16:48 2009	(r190396)
@@ -755,12 +755,16 @@ nfs_loadattrcache(struct vnode **vpp, st
 				vaper->va_mtime = np->n_mtim;
 		}
 	}
+
+#ifdef KDTRACE_HOOKS
+	if (np->n_attrstamp != 0)
+		KDTRACE_NFS_ATTRCACHE_LOAD_DONE(vp, &np->n_vattr, 0);
+#endif
 	mtx_unlock(&np->n_mtx);
 out:
-#ifdef KDRACE_HOOKS
-	if (np != NULL)
-		KDTRACE_NFS_ATTRCACHE_LOAD_DONE(vp, error == 0 ? &np->n_vattr
-		    : NULL, error);
+#ifdef KDTRACE_HOOKS
+	if (error)
+		KDTRACE_NFS_ATTRCACHE_LOAD_DONE(vp, NULL, error);
 #endif
 	return (error);
 }

Modified: head/sys/nfsclient/nfs_vnops.c
==============================================================================
--- head/sys/nfsclient/nfs_vnops.c	Tue Mar 24 22:35:05 2009	(r190395)
+++ head/sys/nfsclient/nfs_vnops.c	Tue Mar 24 23:16:48 2009	(r190396)
@@ -339,7 +339,12 @@ nfs3_access_otw(struct vnode *vp, int wm
 	}
 	m_freem(mrep);
 nfsmout:
-	KDTRACE_NFS_ACCESSCACHE_LOAD_DONE(vp, cred->cr_uid, 0, error);
+#ifdef KDTRACE_HOOKS
+	if (error) {
+		KDTRACE_NFS_ACCESSCACHE_LOAD_DONE(vp, cred->cr_uid, 0,
+		    error);
+	}
+#endif
 	return (error);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 24 23:31:41 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C81151065687;
	Tue, 24 Mar 2009 23:31:41 +0000 (UTC)
	(envelope-from gabor@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B56788FC1C;
	Tue, 24 Mar 2009 23:31:41 +0000 (UTC)
	(envelope-from gabor@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2ONVf9Q059721;
	Tue, 24 Mar 2009 23:31:41 GMT (envelope-from gabor@svn.freebsd.org)
Received: (from gabor@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2ONVfO6059720;
	Tue, 24 Mar 2009 23:31:41 GMT (envelope-from gabor@svn.freebsd.org)
Message-Id: <200903242331.n2ONVfO6059720@svn.freebsd.org>
From: Gabor Kovesdan 
Date: Tue, 24 Mar 2009 23:31:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190397 - head/lib/libc/nls
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 23:31:42 -0000

Author: gabor (doc,ports committer)
Date: Tue Mar 24 23:31:41 2009
New Revision: 190397
URL: http://svn.freebsd.org/changeset/base/190397

Log:
  - Add Belarusian catalog
  
  PR:		conf/133004
  Submitted by:	Tatsiana Elavaya 

Added:
  head/lib/libc/nls/be_BY.UTF-8.msg   (contents, props changed)
Modified:
  head/lib/libc/nls/Makefile.inc

Modified: head/lib/libc/nls/Makefile.inc
==============================================================================
--- head/lib/libc/nls/Makefile.inc	Tue Mar 24 23:16:48 2009	(r190396)
+++ head/lib/libc/nls/Makefile.inc	Tue Mar 24 23:31:41 2009	(r190397)
@@ -13,6 +13,7 @@ MAN+=	catclose.3 catgets.3 catopen.3
 #       for translators.
 
 NLSNAME=	libc
+NLS+=	be_BY.UTF-8
 NLS+=	ca_ES.ISO8859-1
 NLS+=	de_DE.ISO8859-1
 NLS+=	el_GR.ISO8859-7

Added: head/lib/libc/nls/be_BY.UTF-8.msg
==============================================================================
Binary file. No diff available.

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 00:57:10 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 309D7106564A;
	Wed, 25 Mar 2009 00:57:10 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1F3608FC16;
	Wed, 25 Mar 2009 00:57:10 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2P0v93O061299;
	Wed, 25 Mar 2009 00:57:09 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2P0v9P8061298;
	Wed, 25 Mar 2009 00:57:09 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200903250057.n2P0v9P8061298@svn.freebsd.org>
From: Xin LI 
Date: Wed, 25 Mar 2009 00:57:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190398 - head/sys/dev/hptiop
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 00:57:10 -0000

Author: delphij
Date: Wed Mar 25 00:57:09 2009
New Revision: 190398
URL: http://svn.freebsd.org/changeset/base/190398

Log:
  Use __attribute__((packed)) for the structure so that hptiop management
  utility would work.
  
  Submitted by:	Shaowei WANG 
  MFC after:	2 weeks

Modified:
  head/sys/dev/hptiop/hptiop.h

Modified: head/sys/dev/hptiop/hptiop.h
==============================================================================
--- head/sys/dev/hptiop/hptiop.h	Tue Mar 24 23:31:41 2009	(r190397)
+++ head/sys/dev/hptiop/hptiop.h	Wed Mar 25 00:57:09 2009	(r190398)
@@ -260,7 +260,7 @@ struct hpt_iop_ioctl_param {
 	unsigned long    lpOutBuffer;           /* output data buffer */
 	u_int32_t        nOutBufferSize;        /* size of output data buffer */
 	unsigned long    lpBytesReturned;       /* count of HPT_U8s returned */
-};
+} __attribute__((packed));
 
 #define HPT_IOCTL_FLAG_OPEN 1
 #define HPT_CTL_CODE_BSD_TO_IOP(x) ((x)-0xff00)

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 01:41:57 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A63E6106564A;
	Wed, 25 Mar 2009 01:41:57 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 946478FC08;
	Wed, 25 Mar 2009 01:41:57 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2P1fvHM062142;
	Wed, 25 Mar 2009 01:41:57 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2P1fvRJ062139;
	Wed, 25 Mar 2009 01:41:57 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200903250141.n2P1fvRJ062139@svn.freebsd.org>
From: Robert Noland 
Date: Wed, 25 Mar 2009 01:41:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190399 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 01:41:58 -0000

Author: rnoland
Date: Wed Mar 25 01:41:56 2009
New Revision: 190399
URL: http://svn.freebsd.org/changeset/base/190399

Log:
  The GART allocations are a propery of the gart, not of scatter-gather
  memory.  Track them in the appropriate structure.
  
  MFC after:	3 days

Modified:
  head/sys/dev/drm/ati_pcigart.c
  head/sys/dev/drm/drmP.h
  head/sys/dev/drm/drm_scatter.c

Modified: head/sys/dev/drm/ati_pcigart.c
==============================================================================
--- head/sys/dev/drm/ati_pcigart.c	Wed Mar 25 00:57:09 2009	(r190398)
+++ head/sys/dev/drm/ati_pcigart.c	Wed Mar 25 01:41:56 2009	(r190399)
@@ -104,7 +104,7 @@ drm_ati_alloc_pcigart_table(struct drm_d
 		return ENOMEM;
 	}
 
-	dev->sg->dmah = dmah;
+	gart_info->dmah = dmah;
 
 	return 0;
 }
@@ -113,12 +113,12 @@ static void
 drm_ati_free_pcigart_table(struct drm_device *dev,
 			   struct drm_ati_pcigart_info *gart_info)
 {
-	struct drm_dma_handle *dmah = dev->sg->dmah;
+	struct drm_dma_handle *dmah = gart_info->dmah;
 
 	bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map);
 	bus_dma_tag_destroy(dmah->tag);
 	free(dmah, DRM_MEM_DMA);
-	dev->sg->dmah = NULL;
+	gart_info->dmah = NULL;
 }
 
 int
@@ -134,7 +134,7 @@ drm_ati_pcigart_cleanup(struct drm_devic
 	if (gart_info->bus_addr) {
 		if (gart_info->gart_table_location == DRM_ATI_GART_MAIN) {
 			gart_info->bus_addr = 0;
-			if (dev->sg->dmah)
+			if (gart_info->dmah)
 				drm_ati_free_pcigart_table(dev, gart_info);
 		}
 	}
@@ -169,8 +169,8 @@ drm_ati_pcigart_init(struct drm_device *
 			goto done;
 		}
 
-		address = (void *)dev->sg->dmah->vaddr;
-		bus_address = dev->sg->dmah->busaddr;
+		address = (void *)gart_info->dmah->vaddr;
+		bus_address = gart_info->dmah->busaddr;
 	} else {
 		address = gart_info->addr;
 		bus_address = gart_info->bus_addr;

Modified: head/sys/dev/drm/drmP.h
==============================================================================
--- head/sys/dev/drm/drmP.h	Wed Mar 25 00:57:09 2009	(r190398)
+++ head/sys/dev/drm/drmP.h	Wed Mar 25 01:41:56 2009	(r190399)
@@ -480,9 +480,7 @@ typedef struct drm_sg_mem {
 	void			 *virtual;
 	int			  pages;
 	dma_addr_t		 *busaddr;
-	struct drm_dma_handle	 *sg_dmah;	/* Handle for sg_pages   */
 	struct drm_dma_handle	 *dmah;		/* Handle to PCI memory  */
-						/* for ATI PCIGART table */
 } drm_sg_mem_t;
 
 typedef TAILQ_HEAD(drm_map_list, drm_local_map) drm_map_list_t;
@@ -543,6 +541,7 @@ struct drm_ati_pcigart_info {
 	struct drm_dma_handle *table_handle;
 	drm_local_map_t mapping;
 	int table_size;
+	struct drm_dma_handle *dmah; /* handle for ATI PCIGART table */
 };
 
 #ifndef DMA_BIT_MASK

Modified: head/sys/dev/drm/drm_scatter.c
==============================================================================
--- head/sys/dev/drm/drm_scatter.c	Wed Mar 25 00:57:09 2009	(r190398)
+++ head/sys/dev/drm/drm_scatter.c	Wed Mar 25 01:41:56 2009	(r190399)
@@ -112,7 +112,7 @@ drm_sg_alloc(struct drm_device *dev, str
 		return ENOMEM;
 	}
 
-	entry->sg_dmah = dmah;
+	entry->dmah = dmah;
 	entry->handle = (unsigned long)dmah->vaddr;
 	
 	DRM_DEBUG("sg alloc handle  = %08lx\n", entry->handle);
@@ -160,7 +160,7 @@ drm_sg_alloc_ioctl(struct drm_device *de
 void
 drm_sg_cleanup(struct drm_sg_mem *entry)
 {
-	struct drm_dma_handle *dmah = entry->sg_dmah;
+	struct drm_dma_handle *dmah = entry->dmah;
 
 	bus_dmamap_unload(dmah->tag, dmah->map);
 	bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map);

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 01:44:17 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1FC821065670;
	Wed, 25 Mar 2009 01:44:17 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E80338FC15;
	Wed, 25 Mar 2009 01:44:16 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2P1iG9G062226;
	Wed, 25 Mar 2009 01:44:16 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2P1iGFg062224;
	Wed, 25 Mar 2009 01:44:16 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200903250144.n2P1iGFg062224@svn.freebsd.org>
From: Robert Noland 
Date: Wed, 25 Mar 2009 01:44:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190400 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 01:44:17 -0000

Author: rnoland
Date: Wed Mar 25 01:44:16 2009
New Revision: 190400
URL: http://svn.freebsd.org/changeset/base/190400

Log:
  Intel handled the management of the breadcrumb counter inconsistently.
  Make sure that we always handle it the same way.
  
  MFC after:	3 days

Modified:
  head/sys/dev/drm/i915_dma.c
  head/sys/dev/drm/i915_irq.c

Modified: head/sys/dev/drm/i915_dma.c
==============================================================================
--- head/sys/dev/drm/i915_dma.c	Wed Mar 25 01:41:56 2009	(r190399)
+++ head/sys/dev/drm/i915_dma.c	Wed Mar 25 01:44:16 2009	(r190400)
@@ -439,8 +439,7 @@ static void i915_emit_breadcrumb(struct 
 	drm_i915_private_t *dev_priv = dev->dev_private;
 	RING_LOCALS;
 
-	dev_priv->counter++;
-	if (dev_priv->counter > 0x7FFFFFFFUL)
+	if (++dev_priv->counter > 0x7FFFFFFFUL)
 		dev_priv->counter = 0;
 	if (dev_priv->sarea_priv)
 		dev_priv->sarea_priv->last_enqueue = dev_priv->counter;
@@ -574,7 +573,10 @@ static int i915_dispatch_flip(struct drm
 	OUT_RING(0);
 	ADVANCE_LP_RING();
 
-	dev_priv->sarea_priv->last_enqueue = dev_priv->counter++;
+	if (++dev_priv->counter > 0x7FFFFFFFUL)
+		dev_priv->counter = 0;
+	if (dev_priv->sarea_priv)
+		dev_priv->sarea_priv->last_enqueue = dev_priv->counter;
 
 	BEGIN_LP_RING(4);
 	OUT_RING(MI_STORE_DWORD_INDEX);

Modified: head/sys/dev/drm/i915_irq.c
==============================================================================
--- head/sys/dev/drm/i915_irq.c	Wed Mar 25 01:41:56 2009	(r190399)
+++ head/sys/dev/drm/i915_irq.c	Wed Mar 25 01:44:16 2009	(r190400)
@@ -284,14 +284,13 @@ static int i915_emit_irq(struct drm_devi
 
 	i915_kernel_lost_context(dev);
 
-	DRM_DEBUG("\n");
-
-	dev_priv->counter++;
-	if (dev_priv->counter > 0x7FFFFFFFUL)
-		dev_priv->counter = 1;
+	if (++dev_priv->counter > 0x7FFFFFFFUL)
+		dev_priv->counter = 0;
 	if (dev_priv->sarea_priv)
 		dev_priv->sarea_priv->last_enqueue = dev_priv->counter;
 
+	DRM_DEBUG("emitting: %d\n", dev_priv->counter);
+
 	BEGIN_LP_RING(4);
 	OUT_RING(MI_STORE_DWORD_INDEX);
 	OUT_RING(I915_BREADCRUMB_INDEX << MI_STORE_DWORD_INDEX_SHIFT);
@@ -331,9 +330,6 @@ static int i915_wait_irq(struct drm_devi
 	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
 	int ret = 0;
 
-	DRM_DEBUG("irq_nr=%d breadcrumb=%d\n", irq_nr,
-		  READ_BREADCRUMB(dev_priv));
-
 	if (READ_BREADCRUMB(dev_priv) >= irq_nr) {
 		if (dev_priv->sarea_priv) {
 			dev_priv->sarea_priv->last_dispatch =
@@ -345,6 +341,9 @@ static int i915_wait_irq(struct drm_devi
 	if (dev_priv->sarea_priv)
 		dev_priv->sarea_priv->perf_boxes |= I915_BOX_WAIT;
 
+	DRM_DEBUG("irq_nr=%d breadcrumb=%d\n", irq_nr,
+		  READ_BREADCRUMB(dev_priv));
+
 	i915_user_irq_get(dev);
 	DRM_WAIT_ON(ret, dev_priv->irq_queue, 3 * DRM_HZ,
 		    READ_BREADCRUMB(dev_priv) >= irq_nr);

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 01:50:56 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5AE841065670;
	Wed, 25 Mar 2009 01:50:56 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 48C8F8FC16;
	Wed, 25 Mar 2009 01:50:56 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2P1ouvH062377;
	Wed, 25 Mar 2009 01:50:56 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2P1ou4g062376;
	Wed, 25 Mar 2009 01:50:56 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200903250150.n2P1ou4g062376@svn.freebsd.org>
From: Robert Noland 
Date: Wed, 25 Mar 2009 01:50:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190401 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 01:50:56 -0000

Author: rnoland
Date: Wed Mar 25 01:50:56 2009
New Revision: 190401
URL: http://svn.freebsd.org/changeset/base/190401

Log:
  Rework the management of vblank interrupts a bit.
  
  When a vt switch occurs the irq handler is uninstalled.  Interrupts
  and the state tracking of what was enabled/disabled wasn't working
  properly.  This should resolve the reports of "slow windows" after a
  vt switch, among other things.  The radeon 2d driver seems to work a
  bit more correctly than the Intel driver.  With the Intel driver,
  vblank interrupts will be enabled at system startup and will only
  be disabled after an additional modeset (vt switch, dpms, randr event).
  
  With this patch, I am able to run glxgears synced to vblank and
  vt switch while it is running without ill effects.
  
  MFC after:	3 days

Modified:
  head/sys/dev/drm/drm_irq.c

Modified: head/sys/dev/drm/drm_irq.c
==============================================================================
--- head/sys/dev/drm/drm_irq.c	Wed Mar 25 01:44:16 2009	(r190400)
+++ head/sys/dev/drm/drm_irq.c	Wed Mar 25 01:50:56 2009	(r190401)
@@ -80,13 +80,14 @@ static void vblank_disable_fn(void *arg)
 	}
 	callout_deactivate(&dev->vblank_disable_timer);
 
-	DRM_DEBUG("vblank_disable_allowed=%d\n", dev->vblank_disable_allowed);
+	DRM_DEBUG("vblank_disable: %s\n", dev->vblank_disable_allowed ?
+		"allowed" : "denied");
 	if (!dev->vblank_disable_allowed)
 		return;
 
 	for (i = 0; i < dev->num_crtcs; i++) {
 		if (atomic_read(&dev->vblank[i].refcount) == 0 &&
-		    dev->vblank[i].enabled) {
+		    dev->vblank[i].enabled && !dev->vblank[i].inmodeset) {
 			DRM_DEBUG("disabling vblank on crtc %d\n", i);
 			dev->vblank[i].last =
 			    dev->driver->get_vblank_counter(dev, i);
@@ -149,7 +150,7 @@ err:
 
 int drm_irq_install(struct drm_device *dev)
 {
-	int retcode;
+	int crtc, retcode;
 
 	if (dev->irq == 0 || dev->dev_private == NULL)
 		return EINVAL;
@@ -186,6 +187,17 @@ int drm_irq_install(struct drm_device *d
 	DRM_LOCK();
 	dev->driver->irq_postinstall(dev);
 	DRM_UNLOCK();
+	if (dev->driver->enable_vblank) {
+		DRM_SPINLOCK(&dev->vbl_lock);
+		for( crtc = 0 ; crtc < dev->num_crtcs ; crtc++) {
+			if (dev->driver->enable_vblank(dev, crtc) == 0) {
+				dev->vblank[crtc].enabled = 1;
+			}
+		}
+		callout_reset(&dev->vblank_disable_timer, 5 * DRM_HZ,
+		    (timeout_t *)vblank_disable_fn, (void *)dev);
+		DRM_SPINUNLOCK(&dev->vbl_lock);
+	}
 
 	return 0;
 err:
@@ -212,9 +224,9 @@ int drm_irq_uninstall(struct drm_device 
 	for (crtc = 0; crtc < dev->num_crtcs; crtc++) {
 		if (dev->vblank[crtc].enabled) {
 			DRM_WAKEUP(&dev->vblank[crtc].queue);
-			dev->vblank[crtc].enabled = 0;
 			dev->vblank[crtc].last =
-		    	    dev->driver->get_vblank_counter(dev, crtc);
+			    dev->driver->get_vblank_counter(dev, crtc);
+			dev->vblank[crtc].enabled = 0;
 		}
 	}
 	DRM_SPINUNLOCK(&dev->vbl_lock);
@@ -320,9 +332,11 @@ void drm_vblank_put(struct drm_device *d
 	/* Last user schedules interrupt disable */
 	atomic_subtract_acq_int(&dev->vblank[crtc].refcount, 1);
 
+	DRM_SPINLOCK(&dev->vbl_lock);
 	if (dev->vblank[crtc].refcount == 0)
 	    callout_reset(&dev->vblank_disable_timer, 5 * DRM_HZ,
 		(timeout_t *)vblank_disable_fn, (void *)dev);
+	DRM_SPINUNLOCK(&dev->vbl_lock);
 }
 
 int drm_modeset_ctl(struct drm_device *dev, void *data,
@@ -449,31 +463,26 @@ int drm_wait_vblank(struct drm_device *d
 	} else {
 		DRM_DEBUG("waiting on vblank count %d, crtc %d\n",
 		    vblwait->request.sequence, crtc);
-		for ( ret = 0 ; !ret && !((drm_vblank_count(dev, crtc) -
-		    vblwait->request.sequence) <= (1 << 23)) ; ) {
-			mtx_lock(&dev->irq_lock);
-			if (!((drm_vblank_count(dev, crtc) -
-			    vblwait->request.sequence) <= (1 << 23)))
-				ret = mtx_sleep(&dev->vblank[crtc].queue,
-				    &dev->irq_lock, PCATCH, "vblwtq",
-				    3 * DRM_HZ);
-			mtx_unlock(&dev->irq_lock);
-		}
-
-		if (ret == ERESTART) {
-			DRM_DEBUG("restarting syscall\n");
-			return ret;
+		mtx_lock(&dev->irq_lock);
+		dev->vblank[crtc].last = vblwait->request.sequence;
+		for ( ret = 0 ; !ret && !(((drm_vblank_count(dev, crtc) -
+		    vblwait->request.sequence) <= (1 << 23)) ||
+		    !dev->irq_enabled) ; ) {
+			ret = mtx_sleep(&dev->vblank[crtc].queue,
+			    &dev->irq_lock, PCATCH, "vblwtq",
+			    3 * DRM_HZ);
 		}
+		mtx_unlock(&dev->irq_lock);
 
-		if (ret != EINTR) {
+		if (ret != EINTR && ret != ERESTART) {
 			struct timeval now;
 
 			microtime(&now);
 			vblwait->reply.tval_sec = now.tv_sec;
 			vblwait->reply.tval_usec = now.tv_usec;
 			vblwait->reply.sequence = drm_vblank_count(dev, crtc);
-			DRM_DEBUG("returning %d to client\n",
-			    vblwait->reply.sequence);
+			DRM_DEBUG("returning %d to client, irq_enabled %d\n",
+			    vblwait->reply.sequence, dev->irq_enabled);
 		} else {
 			DRM_DEBUG("vblank wait interrupted by signal\n");
 		}

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 03:02:03 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C24E1106564A;
	Wed, 25 Mar 2009 03:02:03 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B136A8FC1F;
	Wed, 25 Mar 2009 03:02:03 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2P323xr063879;
	Wed, 25 Mar 2009 03:02:03 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2P323ST063878;
	Wed, 25 Mar 2009 03:02:03 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200903250302.n2P323ST063878@svn.freebsd.org>
From: Sam Leffler 
Date: Wed, 25 Mar 2009 03:02:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190402 - head/sys/net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 03:02:04 -0000

Author: sam
Date: Wed Mar 25 03:02:03 2009
New Revision: 190402
URL: http://svn.freebsd.org/changeset/base/190402

Log:
  shuffle code so things build w/o INVARIANTS or IEEE80211_SUPPORT_SUPERG
  
  Prodded by:	several

Modified:
  head/sys/net80211/ieee80211_sta.c

Modified: head/sys/net80211/ieee80211_sta.c
==============================================================================
--- head/sys/net80211/ieee80211_sta.c	Wed Mar 25 01:50:56 2009	(r190401)
+++ head/sys/net80211/ieee80211_sta.c	Wed Mar 25 03:02:03 2009	(r190402)
@@ -105,9 +105,7 @@ sta_vattach(struct ieee80211vap *vap)
 static void
 sta_beacon_miss(struct ieee80211vap *vap)
 {
-	struct ieee80211com *ic = vap->iv_ic;
-
-	KASSERT((ic->ic_flags & IEEE80211_F_SCAN) == 0, ("scanning"));
+	KASSERT((vap->iv_ic->ic_flags & IEEE80211_F_SCAN) == 0, ("scanning"));
 	KASSERT(vap->iv_state == IEEE80211_S_RUN,
 	    ("wrong state %d", vap->iv_state));
 
@@ -133,6 +131,8 @@ sta_beacon_miss(struct ieee80211vap *vap
 	vap->iv_stats.is_beacon_miss++;
 	if (vap->iv_roaming == IEEE80211_ROAMING_AUTO) {
 #ifdef IEEE80211_SUPPORT_SUPERG
+		struct ieee80211com *ic = vap->iv_ic;
+
 		/*
 		 * If we receive a beacon miss interrupt when using
 		 * dynamic turbo, attempt to switch modes before

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 03:42:49 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7EEA2106568C;
	Wed, 25 Mar 2009 03:42:49 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6D0FA8FC15;
	Wed, 25 Mar 2009 03:42:49 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2P3gnPq064757;
	Wed, 25 Mar 2009 03:42:49 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2P3gnxa064756;
	Wed, 25 Mar 2009 03:42:49 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <200903250342.n2P3gnxa064756@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Wed, 25 Mar 2009 03:42:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190403 - head/sys/powerpc/powermac
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 03:42:50 -0000

Author: nwhitehorn
Date: Wed Mar 25 03:42:49 2009
New Revision: 190403
URL: http://svn.freebsd.org/changeset/base/190403

Log:
  Disable ATA DMA for ATAPI devices for now. Apparently, certain revisions
  of this controller, in combination with certain ATAPI devices and phases
  of the moon, will cause DMA operations for ATAPI to fail.

Modified:
  head/sys/powerpc/powermac/ata_macio.c

Modified: head/sys/powerpc/powermac/ata_macio.c
==============================================================================
--- head/sys/powerpc/powermac/ata_macio.c	Wed Mar 25 03:02:03 2009	(r190402)
+++ head/sys/powerpc/powermac/ata_macio.c	Wed Mar 25 03:42:49 2009	(r190403)
@@ -259,6 +259,10 @@ ata_macio_setmode(device_t parent, devic
 
 	mode = ata_limit_mode(dev, mode, sc->max_mode);
 
+	/* XXX Some controllers don't work correctly with ATAPI DMA */
+	if (atadev->param.config & ATA_PROTO_ATAPI)
+		mode = ata_limit_mode(dev, mode, ATA_PIO_MAX);
+
 	if (ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_SETXFER, 0, mode))
 		return;
 

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 05:10:33 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 48645106566B;
	Wed, 25 Mar 2009 05:10:33 +0000 (UTC) (envelope-from das@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 372C58FC15;
	Wed, 25 Mar 2009 05:10:33 +0000 (UTC) (envelope-from das@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2P5AXHQ066390;
	Wed, 25 Mar 2009 05:10:33 GMT (envelope-from das@svn.freebsd.org)
Received: (from das@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2P5AXgD066389;
	Wed, 25 Mar 2009 05:10:33 GMT (envelope-from das@svn.freebsd.org)
Message-Id: <200903250510.n2P5AXgD066389@svn.freebsd.org>
From: David Schultz 
Date: Wed, 25 Mar 2009 05:10:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190404 - head/contrib/gcc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 05:10:33 -0000

Author: das
Date: Wed Mar 25 05:10:32 2009
New Revision: 190404
URL: http://svn.freebsd.org/changeset/base/190404

Log:
  Merge an important change that I mistakenly left out when merging C99
  inline function support. This should fix instances where gcc
  spuriously reports the following error:
  
      error: nested function 'foo' declared but never defined

Modified:
  head/contrib/gcc/c-decl.c

Modified: head/contrib/gcc/c-decl.c
==============================================================================
--- head/contrib/gcc/c-decl.c	Wed Mar 25 03:42:49 2009	(r190403)
+++ head/contrib/gcc/c-decl.c	Wed Mar 25 05:10:32 2009	(r190404)
@@ -798,7 +798,9 @@ pop_scope (void)
 	      && DECL_ABSTRACT_ORIGIN (p) != p)
 	    TREE_ADDRESSABLE (DECL_ABSTRACT_ORIGIN (p)) = 1;
 	  if (!DECL_EXTERNAL (p)
-	      && DECL_INITIAL (p) == 0)
+	      && DECL_INITIAL (p) == 0
+	      && scope != file_scope
+	      && scope != external_scope)
 	    {
 	      error ("nested function %q+D declared but never defined", p);
 	      undef_nested_function = true;

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 06:27:57 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 15070106566C;
	Wed, 25 Mar 2009 06:27:57 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 037B98FC0A;
	Wed, 25 Mar 2009 06:27:57 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2P6Rufo067831;
	Wed, 25 Mar 2009 06:27:56 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2P6Ruls067830;
	Wed, 25 Mar 2009 06:27:56 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200903250627.n2P6Ruls067830@svn.freebsd.org>
From: Xin LI 
Date: Wed, 25 Mar 2009 06:27:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190405 - head/sys/dev/hptiop
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 06:27:57 -0000

Author: delphij
Date: Wed Mar 25 06:27:56 2009
New Revision: 190405
URL: http://svn.freebsd.org/changeset/base/190405

Log:
  Use __packed from cdefs.h
  
  Submitted by:	pyunyh
  Reviewed by:	Shaowei WANG 
  MFC after:	2 weeks

Modified:
  head/sys/dev/hptiop/hptiop.h

Modified: head/sys/dev/hptiop/hptiop.h
==============================================================================
--- head/sys/dev/hptiop/hptiop.h	Wed Mar 25 05:10:32 2009	(r190404)
+++ head/sys/dev/hptiop/hptiop.h	Wed Mar 25 06:27:56 2009	(r190405)
@@ -260,7 +260,7 @@ struct hpt_iop_ioctl_param {
 	unsigned long    lpOutBuffer;           /* output data buffer */
 	u_int32_t        nOutBufferSize;        /* size of output data buffer */
 	unsigned long    lpBytesReturned;       /* count of HPT_U8s returned */
-} __attribute__((packed));
+} __packed;
 
 #define HPT_IOCTL_FLAG_OPEN 1
 #define HPT_CTL_CODE_BSD_TO_IOP(x) ((x)-0xff00)

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 07:01:46 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2297810656BA;
	Wed, 25 Mar 2009 07:01:46 +0000 (UTC)
	(envelope-from lulf@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 108938FC28;
	Wed, 25 Mar 2009 07:01:46 +0000 (UTC)
	(envelope-from lulf@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2P71jxw068524;
	Wed, 25 Mar 2009 07:01:45 GMT (envelope-from lulf@svn.freebsd.org)
Received: (from lulf@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2P71j1k068523;
	Wed, 25 Mar 2009 07:01:45 GMT (envelope-from lulf@svn.freebsd.org)
Message-Id: <200903250701.n2P71j1k068523@svn.freebsd.org>
From: Ulf Lilleengen 
Date: Wed, 25 Mar 2009 07:01:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190406 - head/contrib/csup
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 07:01:46 -0000

Author: lulf
Date: Wed Mar 25 07:01:45 2009
New Revision: 190406
URL: http://svn.freebsd.org/changeset/base/190406

Log:
  - Remember to set umask before setting attributes of RCS file.
  
  Tested by:	dougb
  MFC after:	2 days

Modified:
  head/contrib/csup/updater.c

Modified: head/contrib/csup/updater.c
==============================================================================
--- head/contrib/csup/updater.c	Wed Mar 25 06:27:56 2009	(r190405)
+++ head/contrib/csup/updater.c	Wed Mar 25 07:01:45 2009	(r190406)
@@ -1661,6 +1661,7 @@ updater_rcsedit(struct updater *up, stru
 		else
 			lprintf(1, " Touch %s", fup->coname);
 		/* Install new attributes. */
+		fattr_umask(sr->sr_serverattr, coll->co_umask);
 		fattr_install(sr->sr_serverattr, fup->destpath, NULL);
 		if (fup->attic)
 			lprintf(1, " -> Attic");

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 07:05:23 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C732E1065688;
	Wed, 25 Mar 2009 07:05:23 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B53318FC1B;
	Wed, 25 Mar 2009 07:05:23 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2P75NRN068633;
	Wed, 25 Mar 2009 07:05:23 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2P75NP1068632;
	Wed, 25 Mar 2009 07:05:23 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <200903250705.n2P75NP1068632@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 25 Mar 2009 07:05:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190407 - head/sys/dev/msk
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 07:05:24 -0000

Author: yongari
Date: Wed Mar 25 07:05:23 2009
New Revision: 190407
URL: http://svn.freebsd.org/changeset/base/190407

Log:
  Fix typo.

Modified:
  head/sys/dev/msk/if_msk.c

Modified: head/sys/dev/msk/if_msk.c
==============================================================================
--- head/sys/dev/msk/if_msk.c	Wed Mar 25 07:01:45 2009	(r190406)
+++ head/sys/dev/msk/if_msk.c	Wed Mar 25 07:05:23 2009	(r190407)
@@ -4170,7 +4170,7 @@ msk_sysctl_node(struct msk_if_softc *sc_
 	    child, rx_pkts_too_long, "frames too long");
 	MSK_SYSCTL_STAT32(sc_if, ctx, "jabbers",
 	    child, rx_pkts_jabbers, "Jabber errors");
-	MSK_SYSCTL_STAT32(sc_if, ctx, "jabbers",
+	MSK_SYSCTL_STAT32(sc_if, ctx, "overflows",
 	    child, rx_fifo_oflows, "FIFO overflows");
 
 	tree = SYSCTL_ADD_NODE(ctx, schild, OID_AUTO, "tx", CTLFLAG_RD,

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 07:26:24 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AEFBB1065672;
	Wed, 25 Mar 2009 07:26:24 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9D51B8FC20;
	Wed, 25 Mar 2009 07:26:24 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2P7QO1e069056;
	Wed, 25 Mar 2009 07:26:24 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2P7QOeW069055;
	Wed, 25 Mar 2009 07:26:24 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200903250726.n2P7QOeW069055@svn.freebsd.org>
From: Warner Losh 
Date: Wed, 25 Mar 2009 07:26:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190408 - head/sys/dev/pccard
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 07:26:25 -0000

Author: imp
Date: Wed Mar 25 07:26:24 2009
New Revision: 190408
URL: http://svn.freebsd.org/changeset/base/190408

Log:
  Another akihabra find: Mitsubishi B8895.

Modified:
  head/sys/dev/pccard/pccarddevs

Modified: head/sys/dev/pccard/pccarddevs
==============================================================================
--- head/sys/dev/pccard/pccarddevs	Wed Mar 25 07:05:23 2009	(r190407)
+++ head/sys/dev/pccard/pccarddevs	Wed Mar 25 07:26:24 2009	(r190408)
@@ -671,6 +671,7 @@ vendor IODATA3			-1	I-O DATA
 vendor LANTECH			-1	Lantech Computer Company
 vendor MELCO2			-1	Melco Corporation
 vendor MICRORESEARCH		-1	Micro Research
+vendor MITSUBISHI		-1	Mitsubishi Electronics Corp
 vendor NDC			-1	NDC
 vendor NEC			-1	NEC
 vendor OEM2			-1	Generic OEM
@@ -745,6 +746,7 @@ product MACNICA MPS100		{ "MACNICA", "MI
 product MEGAHERTZ XJ2288 	{ "MEGAHERTZ", "MODEM&spXJ2288", NULL, NULL } Megahertz XJ2288 Modem
 product MELCO2 LPC2_TX		{ "MELCO", "LPC2-TX", NULL, NULL } Melco LPC2-TX
 product MICRORESEARCH MR10TPC	{ "MICRO-RESEARCH-MR10TPC", "Ethernet", NULL, NULL } Micro Research MR10TPC
+product MITSUBISHI B8895	{ "MITSUBISHI&spELECTRIC&spCORPORATION", "B8895", NULL, NULL } Mitsubishi Electronics Corporation B8895
 product NANOSPEED PRISM2	{ "NANOSPEED", "HFA384x/IEEE", "Version&sp01.02", NULL } NANOSPEED ROOT-RZ2000 WLAN Card
 product NDC ND5100_E		{ "NDC", "Ethernet", "A", NULL } Sohoware ND5100E NE2000 Compatible Card
 product NEC CMZ_RT_WP		{ "NEC", "Wireless&spCard&spCMZ-RT-WP", "Version&sp01.01", NULL } NEC Wireless Card CMZ-RT-WP

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 08:07:53 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1FA9D106564A;
	Wed, 25 Mar 2009 08:07:53 +0000 (UTC) (envelope-from das@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0C9918FC14;
	Wed, 25 Mar 2009 08:07:53 +0000 (UTC) (envelope-from das@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2P87qp9069832;
	Wed, 25 Mar 2009 08:07:52 GMT (envelope-from das@svn.freebsd.org)
Received: (from das@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2P87qko069831;
	Wed, 25 Mar 2009 08:07:52 GMT (envelope-from das@svn.freebsd.org)
Message-Id: <200903250807.n2P87qko069831@svn.freebsd.org>
From: David Schultz 
Date: Wed, 25 Mar 2009 08:07:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190409 - head/include
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 08:07:55 -0000

Author: das
Date: Wed Mar 25 08:07:52 2009
New Revision: 190409
URL: http://svn.freebsd.org/changeset/base/190409

Log:
  Make programs that define a macro called `dprintf' more likely to work.

Modified:
  head/include/stdio.h

Modified: head/include/stdio.h
==============================================================================
--- head/include/stdio.h	Wed Mar 25 07:26:24 2009	(r190408)
+++ head/include/stdio.h	Wed Mar 25 08:07:52 2009	(r190409)
@@ -381,7 +381,7 @@ ssize_t	 getline(char ** __restrict, siz
 #endif
 
 #ifdef _WITH_DPRINTF
-int	 dprintf(int, const char * __restrict, ...);
+int	 (dprintf)(int, const char * __restrict, ...);
 #endif
 
 #endif /* __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 */

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 09:55:48 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 56DE11065672
	for ; Wed, 25 Mar 2009 09:55:48 +0000 (UTC)
	(envelope-from njm@njm.me.uk)
Received: from smtp004.apm-internet.net (smtp004.apm-internet.net
	[85.119.248.54]) by mx1.freebsd.org (Postfix) with SMTP id A89DC8FC19
	for ; Wed, 25 Mar 2009 09:55:47 +0000 (UTC)
	(envelope-from njm@njm.me.uk)
Received: (qmail 1880 invoked from network); 25 Mar 2009 09:29:05 -0000
Received: from unknown (HELO titania.njm.me.uk) (81.155.115.150)
	by smtp004.apm-internet.net with SMTP; 25 Mar 2009 09:29:05 -0000
Received: from titania.njm.me.uk (localhost [127.0.0.1])
	by titania.njm.me.uk (8.14.3/8.14.3) with ESMTP id n2P9T4Wf023554;
	Wed, 25 Mar 2009 09:29:04 GMT (envelope-from njm@njm.me.uk)
Received: (from njm@localhost)
	by titania.njm.me.uk (8.14.3/8.14.3/Submit) id n2P9T4fw023553;
	Wed, 25 Mar 2009 09:29:04 GMT (envelope-from njm@njm.me.uk)
Date: Wed, 25 Mar 2009 09:29:04 +0000
From: "N.J. Mann" 
To: Robert Noland 
Message-ID: <20090325092904.GA2801@titania.njm.me.uk>
References: <200903250150.n2P1ou4g062376@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200903250150.n2P1ou4g062376@svn.freebsd.org>
X-Operating-System: FreeBSD 7.2-PRERELEASE
User-Agent: mutt-NJM (2009-02-20)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r190401 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 09:55:49 -0000

In message <200903250150.n2P1ou4g062376@svn.freebsd.org>,
	Robert Noland (rnoland@FreeBSD.org) wrote:
> Author: rnoland
> Date: Wed Mar 25 01:50:56 2009
> New Revision: 190401
> URL: http://svn.freebsd.org/changeset/base/190401
> 
> Log:
>   Rework the management of vblank interrupts a bit.
>   
>   When a vt switch occurs the irq handler is uninstalled.  Interrupts
>   and the state tracking of what was enabled/disabled wasn't working
>   properly.  This should resolve the reports of "slow windows" after a
>   vt switch, among other things.  The radeon 2d driver seems to work a
>   bit more correctly than the Intel driver.  With the Intel driver,
>   vblank interrupts will be enabled at system startup and will only
>   be disabled after an additional modeset (vt switch, dpms, randr event).
>   
>   With this patch, I am able to run glxgears synced to vblank and
>   vt switch while it is running without ill effects.
>   
>   MFC after:	3 days
> 
> Modified:
>   head/sys/dev/drm/drm_irq.c

Is this a possible cure for the problem I reported here:
http://lists.freebsd.org/pipermail/freebsd-x11/2009-February/007670.html


Cheers,
       Nick.
-- 


From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 12:36:37 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C28EF1065679;
	Wed, 25 Mar 2009 12:36:37 +0000 (UTC)
	(envelope-from netchild@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A7F248FC21;
	Wed, 25 Mar 2009 12:36:37 +0000 (UTC)
	(envelope-from netchild@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2PCabuW076781;
	Wed, 25 Mar 2009 12:36:37 GMT
	(envelope-from netchild@svn.freebsd.org)
Received: (from netchild@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2PCabQx076780;
	Wed, 25 Mar 2009 12:36:37 GMT
	(envelope-from netchild@svn.freebsd.org)
Message-Id: <200903251236.n2PCabQx076780@svn.freebsd.org>
From: Alexander Leidinger 
Date: Wed, 25 Mar 2009 12:36:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190410 - head/lib/libc/nls
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 12:36:40 -0000

Author: netchild
Date: Wed Mar 25 12:36:37 2009
New Revision: 190410
URL: http://svn.freebsd.org/changeset/base/190410

Log:
  Improve the German translation.
  Some parts (ERANGE, ETXTBSY) triggered by Christoph Mallon.
  
  Discussed with:	brueffer, gabor (previous version)

Modified:
  head/lib/libc/nls/de_DE.ISO8859-1.msg

Modified: head/lib/libc/nls/de_DE.ISO8859-1.msg
==============================================================================
--- head/lib/libc/nls/de_DE.ISO8859-1.msg	Wed Mar 25 08:07:52 2009	(r190409)
+++ head/lib/libc/nls/de_DE.ISO8859-1.msg	Wed Mar 25 12:36:37 2009	(r190410)
@@ -14,7 +14,7 @@ $ ESRCH
 $ EINTR
 4 Interrupt innerhalb eines Systemaufrufs
 $ EIO
-5 Ein/Ausgabefehler
+5 Ein-/Ausgabefehler
 $ ENXIO
 6 Gerät ist nicht konfiguriert
 $ E2BIG
@@ -56,7 +56,7 @@ $ EMFILE
 $ ENOTTY
 25 Ungültiger IOCTL für dieses Gerät
 $ ETXTBSY
-26 Text-Datei ist belegt
+26 Datei wird benutzt
 $ EFBIG
 27 Datei zu groß
 $ ENOSPC
@@ -72,11 +72,11 @@ $ EPIPE
 $ EDOM
 33 Numerisches Argument außerhalb des Wertebereichs
 $ ERANGE
-34 Ergebnis zu groß
+34 Ergebnis außerhalb des Wertebereichs
 $ EAGAIN, EWOULDBLOCK
 35 Ressource vorübergehend nicht verfügbar
 $ EINPROGRESS
-36 Operation wird jetzt ausgeführt
+36 Operation wird gerade ausgeführt
 $ EALREADY
 37 Operation wird bereits ausgeführt
 $ ENOTSOCK
@@ -164,7 +164,7 @@ $ ENOSYS
 $ EFTYPE
 79 Ungültiger Dateityp oder Dateiformat
 $ EAUTH
-80 Authentifikationsfehler
+80 Authentifizierungsfehler
 $ ENEEDAUTH
 81 Authentikator benötigt
 $ EIDRM
@@ -208,7 +208,7 @@ $ SIGBUS
 $ SIGSEGV
 11 Illegaler Speicherzugriff
 $ SIGSYS
-12 Ungültiger Speicherzugriff
+12 Ungültiger Systemaufruf
 $ SIGPIPE
 13 Unterbrochene Pipe
 $ SIGALRM

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 12:39:27 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3DF801065A4F;
	Wed, 25 Mar 2009 12:39:27 +0000 (UTC)
	(envelope-from alexander@leidinger.net)
Received: from redbull.bpaserver.net (redbullneu.bpaserver.net
	[213.198.78.217])
	by mx1.freebsd.org (Postfix) with ESMTP id 42D9A8FC18;
	Wed, 25 Mar 2009 12:39:26 +0000 (UTC)
	(envelope-from alexander@leidinger.net)
Received: from outgoing.leidinger.net (pD9E2D310.dip.t-dialin.net
	[217.226.211.16])
	by redbull.bpaserver.net (Postfix) with ESMTP id C9E142E1F6;
	Wed, 25 Mar 2009 13:39:19 +0100 (CET)
Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102])
	by outgoing.leidinger.net (Postfix) with ESMTP id 57963204F15;
	Wed, 25 Mar 2009 13:39:16 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net;
	s=outgoing-alex; t=1237984756; bh=ryqnHx2rSbg13y7QgmgytNqbZOQkb+1p/
	lVApZyQcuA=; h=Message-ID:Date:From:To:Cc:Subject:References:
	In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding;
	b=rmYH8af7Rdb1PBci1E/A5Qd+PZO+mFhbb2BX0rIA8broKhQUxGx/YvIHue/EUaUS/
	kBRzWHHXMUfVvvMzddiBRvz/9oMDL1eCtYE+A+DpGosBr2T/qLioM9y6RSx9DrZFwRS
	AK6fQMHy4dqToJF79cf0nPNv2MUVAWTinDLyap9FIJBU+on7RNNqMUmOeAooksALh0N
	ClJETkgFjo/OxSnPsEsa+K3G7vV814exbX636sjPRY2P5HrBW3OITihQee+8RHY8iux
	Z4ImiQn76sveVWGRn9HxsbPJ+syvt45RA68cCF3zfFgvEAOw+br/ECr9axb0fTdEzdd
	uk0y6M5MQ==
Received: (from www@localhost)
	by webmail.leidinger.net (8.14.3/8.13.8/Submit) id n2PCdF6o043727;
	Wed, 25 Mar 2009 13:39:15 +0100 (CET)
	(envelope-from Alexander@Leidinger.net)
Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by
	webmail.leidinger.net (Horde Framework) with HTTP; Wed, 25 Mar 2009
	13:39:15 +0100
Message-ID: <20090325133915.30120cb1ea7kla0o@webmail.leidinger.net>
X-Priority: 3 (Normal)
Date: Wed, 25 Mar 2009 13:39:15 +0100
From: Alexander Leidinger 
To: Christoph Mallon 
References: <200903161633.n2GGX966065825@svn.freebsd.org>
	<49C4CCC1.6010704@gmx.de>
In-Reply-To: <49C4CCC1.6010704@gmx.de>
MIME-Version: 1.0
Content-Type: text/plain;
	charset=UTF-8;
	DelSp="Yes";
	format="flowed"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
User-Agent: Internet Messaging Program (IMP) H3 (4.3) / FreeBSD-8.0
X-BPAnet-MailScanner-Information: Please contact the ISP for more information
X-MailScanner-ID: C9E142E1F6.11326
X-BPAnet-MailScanner: Found to be clean
X-BPAnet-MailScanner-SpamCheck: not spam, ORDB-RBL, SpamAssassin (not cached, 
	score=-14.823, required 6, BAYES_00 -15.00,
	DKIM_SIGNED 0.00, 
	DKIM_VERIFIED -0.00, RDNS_DYNAMIC 0.10, TW_SV 0.08)
X-BPAnet-MailScanner-From: alexander@leidinger.net
X-Spam-Status: No
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Gabor Kovesdan 
Subject: Re: svn commit: r189883 - head/lib/libc/nls
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 12:39:30 -0000

Quoting Christoph Mallon  (from Sat, 21 Mar  
2009 12:17:21 +0100):

> Gabor Kovesdan schrieb:
[...]
>> Modified: head/lib/libc/nls/de_DE.ISO8859-1.msg

[improvement suggestions]

I just committed an update to it, it should be better now. People  
which still think there's room for improvement are welcome to send a  
PR with a patch.

Bye,
Alexander.

-- 
BOFH excuse #354:

Chewing gum on /dev/sd3c

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 14:02:27 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8EBEC106566B;
	Wed, 25 Mar 2009 14:02:27 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7BDDF8FC1D;
	Wed, 25 Mar 2009 14:02:27 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2PE2R71078422;
	Wed, 25 Mar 2009 14:02:27 GMT (envelope-from luigi@svn.freebsd.org)
Received: (from luigi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2PE2RL9078421;
	Wed, 25 Mar 2009 14:02:27 GMT (envelope-from luigi@svn.freebsd.org)
Message-Id: <200903251402.n2PE2RL9078421@svn.freebsd.org>
From: Luigi Rizzo 
Date: Wed, 25 Mar 2009 14:02:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190411 - head/release/picobsd/build
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 14:02:28 -0000

Author: luigi
Date: Wed Mar 25 14:02:26 2009
New Revision: 190411
URL: http://svn.freebsd.org/changeset/base/190411

Log:
  add support for shared "crunch" binary.

Modified:
  head/release/picobsd/build/picobsd

Modified: head/release/picobsd/build/picobsd
==============================================================================
--- head/release/picobsd/build/picobsd	Wed Mar 25 12:36:37 2009	(r190410)
+++ head/release/picobsd/build/picobsd	Wed Mar 25 14:02:26 2009	(r190411)
@@ -160,8 +160,9 @@ set_defaults() {	# no arguments
     trap fail 15
 }
 
-# use the new build infrastructure
-create_includes_and_libraries2() {
+# use the new build infrastructure to create libraries
+# and also to build a specific target
+create_includes_and_libraries2() { # opt_dir opt_target
     local no
     log "create_includes_and_libraries2() for ${SRC}"
     if [ ${OSVERSION} -ge 600000 ] ; then
@@ -173,7 +174,11 @@ create_includes_and_libraries2() {
     export MAKEOBJDIRPREFIX
     ( cd ${SRC};
     # make -DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R -DPICOBSD buildworld
-    make _+_= $no toolchain _includes _libraries
+    if [ -d "$1" ] ; then
+	cd $1 ; make $2	# specific target, e.g. ld-elf.so
+    else
+	make _+_= $no toolchain _includes _libraries
+    fi
     )
 }
 
@@ -253,7 +258,7 @@ set_type() {	# the_type the_site
 
 clean_tree() {
     log "clean_tree()"
-    if [ "${name}" = "" ] ; then
+    if [ -z "${name}" ] ; then
 	echo "---> Wrong floppy type"
 	exit 3
     fi
@@ -282,7 +287,7 @@ build_iso_image() {
 # Main build procedure.
 build_image() {
     log "build_image() <${name}>"
-    [ "${name}" != "" ] || fail $? bad_type
+    [ -n "${name}" ] || fail $? bad_type
     clear
     set_msgs
     printf "${MSG}---> We'll use the sources living in ${SRC}\n\n"
@@ -292,12 +297,8 @@ build_image() {
     # variables.
     # 
     . ${PICO_TREE}/build/config
-    if [ -f ${MY_TREE}/config ] ; then
-	. ${MY_TREE}/config
-    fi
-    if [ -f ${o_additional_config} ] ; then
-	. ${o_additional_config}
-    fi
+    [ -f "${MY_TREE}/config" ]		&& . ${MY_TREE}/config
+    [ -f "${o_additional_config}" ]	&& . ${o_additional_config}
 
     # location of the object directory
     PICO_OBJ=${l_objtree}/picobsd/${THETYPE}
@@ -329,7 +330,7 @@ main_dialog() {
   local ans i l
 
   log "main_dialog()"
-  while [ true ] ; do
+  while true ; do
     set_msgs
     rm ${c_reply}
     dialog --menu "PicoBSD build menu -- (29 sep 2001)" 19 70 12 \
@@ -537,7 +538,7 @@ do_copyfiles() {	# rootdir varname
 	eval set "\${${2}}"
         srcs=""
 	for dst in $* ; do
-		[ x"$srcs" = x ] && srcs=$dst && continue
+		[ -z "$srcs" ] && srcs=$dst && continue
 		eval srcs="$srcs"	# expand wildcard and vars
 		case x"$dst" in
 		*/ )	mkdir -p ${root}/${dst} ;;
@@ -548,11 +549,34 @@ do_copyfiles() {	# rootdir varname
         done
 }
 
+# do_links is a helper function to create links between programs
+# in stand/
+# This is done reading the names and destination from variable
+# links in a config file, in the format
+#	: dst names
+
+do_links() {	# rootdir varname
+	local root=$1
+	local l i dst
+	eval l="\${${2}}"
+        dst=""
+	log "Create links for ${l}"
+	(cd ${root}/stand
+	for i in $l ; do
+	    if [ "$dst" = ":" -o "$i" = ":" ] ; then
+		dst=$i
+	    elif [ -n "${dst}" ] ; then
+		ln -s ${dst} ${i}
+	    fi
+	done
+	)
+}
+
 # find_progs is a helper function to locate the named programs
-# or libraries in ${o_objdir} and return the full pathnames.
+# or libraries in ${o_objdir} or ${_SHLIBDIRPREFIX},
+# and return the full pathnames.
 # Sets ${u_progs} to the list of programs, and ${u_libs}
 # to the list of shared libraries used.
-# If the first argument is - does not set u_libs
 #
 # You can use it e.g. in a local configuration file by writing
 #
@@ -569,6 +593,7 @@ do_copyfiles() {	# rootdir varname
 find_progs() {	# programs
 	local i
 	u_progs="`find_progs_helper $*`"
+	local o=${o_objdir:-${_SHLIBDIRPREFIX}}
 	[ -z "${u_progs}" ] && return 1	# not found, error
 	i="`ldd ${u_progs} | grep -v '^/' | awk '{print $1}' | sort | uniq`"
 	u_libs="`find_progs_helper $i`"
@@ -584,16 +609,20 @@ find_progs_helper() {	# programs
 	names=""	# files to search
 	o=""
 	for i in $progs ; do
+		# plain programs come out verbatim
+		[ -f "$i" ] && echo $i && continue
 		names="${names} ${o} -name $i"
 		o="-o"
 	done
+	[ -z "${names}" ] && return 0
 	places=""				# places to search
+	o=${o_objdir:-${_SHLIBDIRPREFIX}/..}
 	for i in $subdirs ; do
-		places="${places} ${o_objdir}/${i}"
+		[ -d "${o}/${i}" ] && places="${places} ${o}/${i}"
 	done
 	find ${places} -type f \( ${names} \)
 }
-		
+
 # Populate the memory filesystem with binaries and non-variable
 # configuration files.
 # First do an mtree pass, then create directory links and device entries,
@@ -683,7 +712,7 @@ populate_mfs_tree() {
     fi
 
     # 4.x compatibility - create device nodes
-    if [ "${o_no_devfs}" != "" ] ; then
+    if [ -n "${o_no_devfs}" ] ; then
 	# create device entries using MAKEDEV
 	(cd ${dst}/dev
 	ln -s ${SRC}/etc/MAKEDEV ; chmod 555 MAKEDEV
@@ -697,10 +726,20 @@ populate_mfs_tree() {
 	(cd ${dst}; chown -R root . )
     fi
 
-    if [ -n "${copy_files}" ] ; then
-	do_copyfiles ${dst} copy_files
+    # If we are building a shared 'crunch', take the libraries
+    # and the dynamic loader as well
+    find_progs ${dst}/stand/crunch
+    if [ -n "${u_libs}" ] ; then
+	mkdir -p ${dst}/lib && cp -p ${u_libs} ${dst}/lib
+	mkdir -p ${dst}/libexec
+        create_includes_and_libraries2 libexec/rtld-elf
+        find_progs ld-elf.so.1 && cp -p ${u_progs} ${dst}/libexec
     fi
+
+    [ -n "${copy_files}" ] && do_copyfiles ${dst} copy_files
     do_copyfiles_user ${dst} || true
+    [ -n "${links}" ] && do_links ${dst} links
+    strip ${dst}/libexec/* ${dst}/lib/* ${dst}/stand/* 2> /dev/null || true
 
     # The 'import_files' mechanism is deprecated, as it requires
     # root permissions to follow the symlinks, and also does

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 14:17:08 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C574D106566B;
	Wed, 25 Mar 2009 14:17:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B2E378FC17;
	Wed, 25 Mar 2009 14:17:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2PEH879078769;
	Wed, 25 Mar 2009 14:17:08 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2PEH8iC078767;
	Wed, 25 Mar 2009 14:17:08 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200903251417.n2PEH8iC078767@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 25 Mar 2009 14:17:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190413 - in head/sys: amd64/amd64 i386/isa
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 14:17:09 -0000

Author: jhb
Date: Wed Mar 25 14:17:08 2009
New Revision: 190413
URL: http://svn.freebsd.org/changeset/base/190413

Log:
  Rename (fpu|npx)_cleanstate to (fpu|npx)_initialstate to better reflect
  their purpose.
  
  Inspired by:	bde
  MFC after:	1 month

Modified:
  head/sys/amd64/amd64/fpu.c
  head/sys/i386/isa/npx.c

Modified: head/sys/amd64/amd64/fpu.c
==============================================================================
--- head/sys/amd64/amd64/fpu.c	Wed Mar 25 14:11:29 2009	(r190412)
+++ head/sys/amd64/amd64/fpu.c	Wed Mar 25 14:17:08 2009	(r190413)
@@ -101,7 +101,7 @@ static	void	fpu_clean_state(void);
 SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD,
     NULL, 1, "Floating point instructions executed in hardware");
 
-static	struct savefpu		fpu_cleanstate;
+static	struct savefpu		fpu_initialstate;
 
 /*
  * Initialize the floating point unit.  On the boot CPU we generate a
@@ -123,13 +123,13 @@ fpuinit(void)
 	mxcsr = __INITIAL_MXCSR__;
 	ldmxcsr(mxcsr);
 	if (PCPU_GET(cpuid) == 0) {
-		fxsave(&fpu_cleanstate);
-		if (fpu_cleanstate.sv_env.en_mxcsr_mask)
-			cpu_mxcsr_mask = fpu_cleanstate.sv_env.en_mxcsr_mask;
+		fxsave(&fpu_initialstate);
+		if (fpu_initialstate.sv_env.en_mxcsr_mask)
+			cpu_mxcsr_mask = fpu_initialstate.sv_env.en_mxcsr_mask;
 		else
 			cpu_mxcsr_mask = 0xFFBF;
-		bzero(fpu_cleanstate.sv_fp, sizeof(fpu_cleanstate.sv_fp));
-		bzero(fpu_cleanstate.sv_xmm, sizeof(fpu_cleanstate.sv_xmm));
+		bzero(fpu_initialstate.sv_fp, sizeof(fpu_initialstate.sv_fp));
+		bzero(fpu_initialstate.sv_xmm, sizeof(fpu_initialstate.sv_xmm));
 	}
 	start_emulating();
 	intr_restore(savecrit);
@@ -416,10 +416,11 @@ fpudna(void)
 
 	if ((pcb->pcb_flags & PCB_FPUINITDONE) == 0) {
 		/*
-		 * This is the first time this thread has used the FPU,
-		 * explicitly load sanitized registers.
+		 * This is the first time this thread has used the FPU or
+		 * the PCB doesn't contain a clean FPU state.  Explicitly
+		 * load an initial state.
 		 */
-		fxrstor(&fpu_cleanstate);
+		fxrstor(&fpu_initialstate);
 		if (pcb->pcb_initial_fpucw != __INITIAL_FPUCW__)
 			fldcw(&pcb->pcb_initial_fpucw);
 		pcb->pcb_flags |= PCB_FPUINITDONE;
@@ -453,7 +454,7 @@ fpugetregs(struct thread *td, struct sav
 	register_t s;
 
 	if ((td->td_pcb->pcb_flags & PCB_FPUINITDONE) == 0) {
-		bcopy(&fpu_cleanstate, addr, sizeof(fpu_cleanstate));
+		bcopy(&fpu_initialstate, addr, sizeof(fpu_initialstate));
 		addr->sv_env.en_cw = td->td_pcb->pcb_initial_fpucw;
 		return (_MC_FPOWNED_NONE);
 	}

Modified: head/sys/i386/isa/npx.c
==============================================================================
--- head/sys/i386/isa/npx.c	Wed Mar 25 14:11:29 2009	(r190412)
+++ head/sys/i386/isa/npx.c	Wed Mar 25 14:17:08 2009	(r190413)
@@ -181,7 +181,7 @@ SYSCTL_INT(_hw, HW_FLOATINGPT, floatingp
 static	volatile u_int		npx_intrs_while_probing;
 static	volatile u_int		npx_traps_while_probing;
 
-static	union savefpu		npx_cleanstate;
+static	union savefpu		npx_initialstate;
 static	bool_t			npx_ex16;
 static	bool_t			npx_exists;
 static	bool_t			npx_irq13;
@@ -423,24 +423,24 @@ npx_attach(dev)
 
 	s = intr_disable();
 	stop_emulating();
-	fpusave(&npx_cleanstate);
+	fpusave(&npx_initialstate);
 	start_emulating();
 #ifdef CPU_ENABLE_SSE
 	if (cpu_fxsr) {
-		if (npx_cleanstate.sv_xmm.sv_env.en_mxcsr_mask)
+		if (npx_initialstate.sv_xmm.sv_env.en_mxcsr_mask)
 			cpu_mxcsr_mask = 
-			    npx_cleanstate.sv_xmm.sv_env.en_mxcsr_mask;
+			    npx_initialstate.sv_xmm.sv_env.en_mxcsr_mask;
 		else
 			cpu_mxcsr_mask = 0xFFBF;
-		bzero(npx_cleanstate.sv_xmm.sv_fp,
-		    sizeof(npx_cleanstate.sv_xmm.sv_fp));
-		bzero(npx_cleanstate.sv_xmm.sv_xmm,
-		    sizeof(npx_cleanstate.sv_xmm.sv_xmm));
+		bzero(npx_initialstate.sv_xmm.sv_fp,
+		    sizeof(npx_initialstate.sv_xmm.sv_fp));
+		bzero(npx_initialstate.sv_xmm.sv_xmm,
+		    sizeof(npx_initialstate.sv_xmm.sv_xmm));
 		/* XXX might need even more zeroing. */
 	} else
 #endif
-		bzero(npx_cleanstate.sv_87.sv_ac,
-		    sizeof(npx_cleanstate.sv_87.sv_ac));
+		bzero(npx_initialstate.sv_87.sv_ac,
+		    sizeof(npx_initialstate.sv_87.sv_ac));
 	intr_restore(s);
 #ifdef I586_CPU_XXX
 	if (cpu_class == CPUCLASS_586 && npx_ex16 &&
@@ -798,9 +798,9 @@ npxdna(void)
 		/*
 		 * This is the first time this thread has used the FPU or
 		 * the PCB doesn't contain a clean FPU state.  Explicitly
-		 * load sanitized registers.
+		 * load an initial state.
 		 */
-		fpurstor(&npx_cleanstate);
+		fpurstor(&npx_initialstate);
 		if (pcb->pcb_initial_npxcw != __INITIAL_NPXCW__)
 			fldcw(&pcb->pcb_initial_npxcw);
 		pcb->pcb_flags |= PCB_NPXINITDONE;
@@ -900,7 +900,7 @@ npxgetregs(td, addr)
 		return (_MC_FPOWNED_NONE);
 
 	if ((td->td_pcb->pcb_flags & PCB_NPXINITDONE) == 0) {
-		bcopy(&npx_cleanstate, addr, sizeof(npx_cleanstate));
+		bcopy(&npx_initialstate, addr, sizeof(npx_initialstate));
 		SET_FPU_CW(addr, td->td_pcb->pcb_initial_npxcw);
 		return (_MC_FPOWNED_NONE);
 	}

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 16:23:43 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DAB15106566B;
	Wed, 25 Mar 2009 16:23:43 +0000 (UTC) (envelope-from ume@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C930D8FC08;
	Wed, 25 Mar 2009 16:23:43 +0000 (UTC) (envelope-from ume@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2PGNhBJ081389;
	Wed, 25 Mar 2009 16:23:43 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2PGNhNX081388;
	Wed, 25 Mar 2009 16:23:43 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <200903251623.n2PGNhNX081388@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Wed, 25 Mar 2009 16:23:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190416 - head/lib/libc/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 16:23:44 -0000

Author: ume
Date: Wed Mar 25 16:23:43 2009
New Revision: 190416
URL: http://svn.freebsd.org/changeset/base/190416

Log:
  Add support for SCTP to getaddrinfo(3).
  Now, getaddrinfo(3) returns two SOCK_STREAMs, IPPROTO_TCP and
  IPPROTO_SCTP.  It confuses some programs.  If getaddrinfo(3) returns
  IPPROTO_SCTP when SOCK_STREAM is specified by hints.ai_socktype, at
  least Apache doesn't work.  So, I made getaddrinfo(3) to return
  IPPROTO_SCTP with SOCK_STREAM only when IPPROTO_SCTP is specified
  explicitly by hints.ai_protocol.
  
  PR:		bin/128167
  Submitted by:	Bruce Cran  (partly)
  MFC after:	2 week

Modified:
  head/lib/libc/net/getaddrinfo.c

Modified: head/lib/libc/net/getaddrinfo.c
==============================================================================
--- head/lib/libc/net/getaddrinfo.c	Wed Mar 25 15:42:07 2009	(r190415)
+++ head/lib/libc/net/getaddrinfo.c	Wed Mar 25 16:23:43 2009	(r190416)
@@ -165,18 +165,24 @@ struct explore {
 
 static const struct explore explore[] = {
 #if 0
-	{ PF_LOCAL, 0, ANY, ANY, NULL, 0x01 },
+	{ PF_LOCAL, ANY, ANY, NULL, 0x01 },
 #endif
 #ifdef INET6
 	{ PF_INET6, SOCK_DGRAM, IPPROTO_UDP, "udp", 0x07 },
 	{ PF_INET6, SOCK_STREAM, IPPROTO_TCP, "tcp", 0x07 },
+	{ PF_INET6, SOCK_STREAM, IPPROTO_SCTP, "sctp", 0x03 },
+	{ PF_INET6, SOCK_SEQPACKET, IPPROTO_SCTP, "sctp", 0x07 },
 	{ PF_INET6, SOCK_RAW, ANY, NULL, 0x05 },
 #endif
 	{ PF_INET, SOCK_DGRAM, IPPROTO_UDP, "udp", 0x07 },
 	{ PF_INET, SOCK_STREAM, IPPROTO_TCP, "tcp", 0x07 },
+	{ PF_INET, SOCK_STREAM, IPPROTO_SCTP, "sctp", 0x03 },
+	{ PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP, "sctp", 0x07 },
 	{ PF_INET, SOCK_RAW, ANY, NULL, 0x05 },
 	{ PF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP, "udp", 0x07 },
 	{ PF_UNSPEC, SOCK_STREAM, IPPROTO_TCP, "tcp", 0x07 },
+	{ PF_UNSPEC, SOCK_STREAM, IPPROTO_SCTP, "sctp", 0x03 },
+	{ PF_UNSPEC, SOCK_SEQPACKET, IPPROTO_SCTP, "sctp", 0x07 },
 	{ PF_UNSPEC, SOCK_RAW, ANY, NULL, 0x05 },
 	{ -1, 0, 0, NULL, 0 },
 };
@@ -417,10 +423,12 @@ getaddrinfo(const char *hostname, const 
 				if (ex->e_protocol == ANY)
 					continue;
 				if (pai->ai_socktype == ex->e_socktype &&
-				    pai->ai_protocol != ex->e_protocol) {
-					ERR(EAI_BADHINTS);
-				}
+				    pai->ai_protocol == ex->e_protocol)
+					break;
 			}
+
+			if (ex->e_af < 0)
+				ERR(EAI_BADHINTS);
 		}
 	}
 
@@ -1344,6 +1352,7 @@ get_port(struct addrinfo *ai, const char
 		return EAI_SERVICE;
 	case SOCK_DGRAM:
 	case SOCK_STREAM:
+	case SOCK_SEQPACKET:
 		allownumeric = 1;
 		break;
 	case ANY:
@@ -1373,13 +1382,17 @@ get_port(struct addrinfo *ai, const char
 	} else {
 		if (ai->ai_flags & AI_NUMERICSERV)
 			return EAI_NONAME;
-		switch (ai->ai_socktype) {
-		case SOCK_DGRAM:
+
+		switch (ai->ai_protocol) {
+		case IPPROTO_UDP:
 			proto = "udp";
 			break;
-		case SOCK_STREAM:
+		case IPPROTO_TCP:
 			proto = "tcp";
 			break;
+		case IPPROTO_SCTP:
+			proto = "sctp";
+			break;
 		default:
 			proto = NULL;
 			break;

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 16:42:51 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 55171106566C;
	Wed, 25 Mar 2009 16:42:51 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from gizmo.2hip.net (gizmo.2hip.net [64.74.207.195])
	by mx1.freebsd.org (Postfix) with ESMTP id F32918FC12;
	Wed, 25 Mar 2009 16:42:50 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from [192.168.1.156] (adsl-156-31-142.bna.bellsouth.net
	[70.156.31.142]) (authenticated bits=0)
	by gizmo.2hip.net (8.14.3/8.14.3) with ESMTP id n2PGfTGr029471
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 25 Mar 2009 12:41:29 -0400 (EDT)
	(envelope-from rnoland@FreeBSD.org)
From: Robert Noland 
To: "N.J. Mann" 
In-Reply-To: <20090325092904.GA2801@titania.njm.me.uk>
References: <200903250150.n2P1ou4g062376@svn.freebsd.org>
	<20090325092904.GA2801@titania.njm.me.uk>
Content-Type: multipart/signed; micalg="pgp-sha1";
	protocol="application/pgp-signature";
	boundary="=-lDRLTUaJ5wNgNO6mw/S6"
Organization: FreeBSD
Date: Wed, 25 Mar 2009 11:42:24 -0500
Message-Id: <1237999344.1828.6.camel@balrog.2hip.net>
Mime-Version: 1.0
X-Mailer: Evolution 2.24.5 FreeBSD GNOME Team Port 
X-Spam-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RDNS_DYNAMIC
	autolearn=no version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on gizmo.2hip.net
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r190401 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 16:42:52 -0000


--=-lDRLTUaJ5wNgNO6mw/S6
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Wed, 2009-03-25 at 09:29 +0000, N.J. Mann wrote:
> In message <200903250150.n2P1ou4g062376@svn.freebsd.org>,
> 	Robert Noland (rnoland@FreeBSD.org) wrote:
> > Author: rnoland
> > Date: Wed Mar 25 01:50:56 2009
> > New Revision: 190401
> > URL: http://svn.freebsd.org/changeset/base/190401
> >=20
> > Log:
> >   Rework the management of vblank interrupts a bit.
> >  =20
> >   When a vt switch occurs the irq handler is uninstalled.  Interrupts
> >   and the state tracking of what was enabled/disabled wasn't working
> >   properly.  This should resolve the reports of "slow windows" after a
> >   vt switch, among other things.  The radeon 2d driver seems to work a
> >   bit more correctly than the Intel driver.  With the Intel driver,
> >   vblank interrupts will be enabled at system startup and will only
> >   be disabled after an additional modeset (vt switch, dpms, randr event=
).
> >  =20
> >   With this patch, I am able to run glxgears synced to vblank and
> >   vt switch while it is running without ill effects.
> >  =20
> >   MFC after:	3 days
> >=20
> > Modified:
> >   head/sys/dev/drm/drm_irq.c
>=20
> Is this a possible cure for the problem I reported here:
> http://lists.freebsd.org/pipermail/freebsd-x11/2009-February/007670.html

It could be... interrupts were not working correcty, especially on
Intel.  There is likely still an issue with restarting X that I need to
look into, but I've not seen a problem vt switching or shutting down.

robert.

>=20
> Cheers,
>        Nick.
--=20
Robert Noland 
FreeBSD

--=-lDRLTUaJ5wNgNO6mw/S6
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (FreeBSD)

iEYEABECAAYFAknKXvAACgkQM4TrQ4qfRONnnwCfat4+1ORyvKacgatq5bCgvF6N
RawAnizO08tcZCEm4FJYYQHJ6w405rrd
=Idzw
-----END PGP SIGNATURE-----

--=-lDRLTUaJ5wNgNO6mw/S6--


From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 16:59:33 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 34E36106567D;
	Wed, 25 Mar 2009 16:59:33 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 05A598FC17;
	Wed, 25 Mar 2009 16:59:33 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net
	[98.109.39.197])
	by cyrus.watson.org (Postfix) with ESMTPSA id 6DDB846B45;
	Wed, 25 Mar 2009 12:59:32 -0400 (EDT)
Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0)
	by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n2PGxQv4074311;
	Wed, 25 Mar 2009 12:59:26 -0400 (EDT) (envelope-from jhb@freebsd.org)
From: John Baldwin 
To: Warner Losh 
Date: Wed, 25 Mar 2009 12:59:20 -0400
User-Agent: KMail/1.9.7
References: <200903091320.n29DKNT8027311@svn.freebsd.org>
In-Reply-To: <200903091320.n29DKNT8027311@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200903251259.20921.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by
	milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]);
	Wed, 25 Mar 2009 12:59:26 -0400 (EDT)
X-Virus-Scanned: ClamAV 0.94.2/9165/Wed Mar 25 11:08:41 2009 on
	server.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 
	autolearn=ham version=3.1.3
X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r189574 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 16:59:34 -0000

On Monday 09 March 2009 9:20:23 am Warner Losh wrote:
> Author: imp
> Date: Mon Mar  9 13:20:23 2009
> New Revision: 189574
> URL: http://svn.freebsd.org/changeset/base/189574
> 
> Log:
>   Fix a long-standing bug in newbus.  It was introduced when subclassing
>   was introduced.  If you have a bus, say cardbus, that is derived from
>   a base-bus (say PCI), then ordinarily all PCI drivers would attach to
>   cardbus devices.  However, there had been one exception: kldload
>   wouldn't work.
>   
>   The problem is in devclass_add_driver.  In this routine, all we did
>   was call to the pci device's BUS_DRIVER_ADDED routine.  However, since
>   cardbus bus instances had a different devclass, none of them were
>   called.
>   
> Modified: head/sys/kern/subr_bus.c
> 
==============================================================================
> --- head/sys/kern/subr_bus.c	Mon Mar  9 13:12:48 2009	(r189573)
> +++ head/sys/kern/subr_bus.c	Mon Mar  9 13:20:23 2009	(r189574)
> @@ -82,6 +82,8 @@ struct devclass {
>  	char		*name;
>  	device_t	*devices;	/* array of devices indexed by unit */
>  	int		maxunit;	/* size of devices array */
> +	int		flags;
> +#define DC_HAS_CHILDREN		1
>  
>  	struct sysctl_ctx_list sysctl_ctx;
>  	struct sysctl_oid *sysctl_tree;
> @@ -813,6 +815,7 @@ devclass_find_internal(const char *class
>  	if (parentname && dc && !dc->parent &&
>  	    strcmp(classname, parentname) != 0) {
>  		dc->parent = devclass_find_internal(parentname, NULL, FALSE);
> +		dc->parent->flags |= DC_HAS_CHILDREN;
>  	}
>  
>  	return (dc);

So this is the cause of the recent reports of panics on boot.  The problem is 
that when drivers are registered during boot they are loaded in a "random" 
order (depends on the order the objects are linked actually).  The point, 
though, is that a subclass might register first.  In that case, trying to set 
dc->parent will fail because the parent driver isn't registered yet, so 
dc->parent will be NULL when it tries to set DC_HAS_CHILDREN.  Just not 
setting the flag if dc->parent is NULL will fix the panics, but I think you 
can have baseclasses that won't have DC_HAS_CHILDREN set.  Perhaps the second 
devclass there should always create a devclass (i.e. last param is true)?  
Otherwise dc->parent could be NULL when it shouldn't be, either.  I think 
that is probably the best solution.  I've tested this and it worked.

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 17:02:05 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DDDA410656C5;
	Wed, 25 Mar 2009 17:02:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C8FDD8FC1B;
	Wed, 25 Mar 2009 17:02:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2PH252r082240;
	Wed, 25 Mar 2009 17:02:05 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2PH25o0082239;
	Wed, 25 Mar 2009 17:02:05 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200903251702.n2PH25o0082239@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 25 Mar 2009 17:02:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190417 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 17:02:08 -0000

Author: jhb
Date: Wed Mar 25 17:02:05 2009
New Revision: 190417
URL: http://svn.freebsd.org/changeset/base/190417

Log:
  When looking up the parent devclass of a new devclass, create the parent
  devclass if it doesn't already exist.

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==============================================================================
--- head/sys/kern/subr_bus.c	Wed Mar 25 16:23:43 2009	(r190416)
+++ head/sys/kern/subr_bus.c	Wed Mar 25 17:02:05 2009	(r190417)
@@ -820,7 +820,7 @@ devclass_find_internal(const char *class
 	 */
 	if (parentname && dc && !dc->parent &&
 	    strcmp(classname, parentname) != 0) {
-		dc->parent = devclass_find_internal(parentname, NULL, FALSE);
+		dc->parent = devclass_find_internal(parentname, NULL, TRUE);
 		dc->parent->flags |= DC_HAS_CHILDREN;
 	}
 

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 17:04:58 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2E810106576F;
	Wed, 25 Mar 2009 17:04:57 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 54D5D8FC25;
	Wed, 25 Mar 2009 17:04:56 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n2PH3tEg021100;
	Wed, 25 Mar 2009 11:03:55 -0600 (MDT) (envelope-from imp@bsdimp.com)
Date: Wed, 25 Mar 2009 11:04:31 -0600 (MDT)
Message-Id: <20090325.110431.-165354456.imp@bsdimp.com>
To: jhb@FreeBSD.org
From: "M. Warner Losh" 
In-Reply-To: <200903251259.20921.jhb@freebsd.org>
References: <200903091320.n29DKNT8027311@svn.freebsd.org>
	<200903251259.20921.jhb@freebsd.org>
X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r189574 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 17:05:02 -0000

In message: <200903251259.20921.jhb@freebsd.org>
            John Baldwin  writes:
: On Monday 09 March 2009 9:20:23 am Warner Losh wrote:
: > Author: imp
: > Date: Mon Mar  9 13:20:23 2009
: > New Revision: 189574
: > URL: http://svn.freebsd.org/changeset/base/189574
: > 
: > Log:
: >   Fix a long-standing bug in newbus.  It was introduced when subclassing
: >   was introduced.  If you have a bus, say cardbus, that is derived from
: >   a base-bus (say PCI), then ordinarily all PCI drivers would attach to
: >   cardbus devices.  However, there had been one exception: kldload
: >   wouldn't work.
: >   
: >   The problem is in devclass_add_driver.  In this routine, all we did
: >   was call to the pci device's BUS_DRIVER_ADDED routine.  However, since
: >   cardbus bus instances had a different devclass, none of them were
: >   called.
: >   
: > Modified: head/sys/kern/subr_bus.c
: > 
: ==============================================================================
: > --- head/sys/kern/subr_bus.c	Mon Mar  9 13:12:48 2009	(r189573)
: > +++ head/sys/kern/subr_bus.c	Mon Mar  9 13:20:23 2009	(r189574)
: > @@ -82,6 +82,8 @@ struct devclass {
: >  	char		*name;
: >  	device_t	*devices;	/* array of devices indexed by unit */
: >  	int		maxunit;	/* size of devices array */
: > +	int		flags;
: > +#define DC_HAS_CHILDREN		1
: >  
: >  	struct sysctl_ctx_list sysctl_ctx;
: >  	struct sysctl_oid *sysctl_tree;
: > @@ -813,6 +815,7 @@ devclass_find_internal(const char *class
: >  	if (parentname && dc && !dc->parent &&
: >  	    strcmp(classname, parentname) != 0) {
: >  		dc->parent = devclass_find_internal(parentname, NULL, FALSE);
: > +		dc->parent->flags |= DC_HAS_CHILDREN;
: >  	}
: >  
: >  	return (dc);
: 
: So this is the cause of the recent reports of panics on boot.  The problem is 
: that when drivers are registered during boot they are loaded in a "random" 
: order (depends on the order the objects are linked actually).  The point, 
: though, is that a subclass might register first.  In that case, trying to set 
: dc->parent will fail because the parent driver isn't registered yet, so 
: dc->parent will be NULL when it tries to set DC_HAS_CHILDREN.  Just not 
: setting the flag if dc->parent is NULL will fix the panics, but I think you 
: can have baseclasses that won't have DC_HAS_CHILDREN set.  Perhaps the second 
: devclass there should always create a devclass (i.e. last param is true)?  
: Otherwise dc->parent could be NULL when it shouldn't be, either.  I think 
: that is probably the best solution.  I've tested this and it worked.

I think that's a good fix.  And one that's needed if we want
subclassing to work in the face of these random orderings.  Otherwise,
dc->parent wouldn't get set right anyway, and the function inheritance
wouldn't happen correctly since it is NULL.

Warner

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 17:47:22 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BB8C51065754;
	Wed, 25 Mar 2009 17:47:22 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A5A748FC1B;
	Wed, 25 Mar 2009 17:47:22 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2PHlM6n083164;
	Wed, 25 Mar 2009 17:47:22 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2PHlMl9083162;
	Wed, 25 Mar 2009 17:47:22 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200903251747.n2PHlMl9083162@svn.freebsd.org>
From: Robert Watson 
Date: Wed, 25 Mar 2009 17:47:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190419 - in head/sys: cddl/dev/dtnfsclient
	modules/dtrace/dtnfsclient nfsclient
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 17:47:25 -0000

Author: rwatson
Date: Wed Mar 25 17:47:22 2009
New Revision: 190419
URL: http://svn.freebsd.org/changeset/base/190419

Log:
  Move dtnfsclient.c in the cddl tree to nfs_kdtrace.c in the nfsclient
  directory, since it's under a BSD license, and this keeps NFS internals-
  aware tracing parts close to NFS.
  
  MFC after:	1 month
  Suggested by:	jhb

Added:
  head/sys/nfsclient/nfs_kdtrace.c
     - copied unchanged from r190397, head/sys/cddl/dev/dtnfsclient/dtnfsclient.c
Deleted:
  head/sys/cddl/dev/dtnfsclient/dtnfsclient.c
Modified:
  head/sys/modules/dtrace/dtnfsclient/Makefile

Modified: head/sys/modules/dtrace/dtnfsclient/Makefile
==============================================================================
--- head/sys/modules/dtrace/dtnfsclient/Makefile	Wed Mar 25 17:22:15 2009	(r190418)
+++ head/sys/modules/dtrace/dtnfsclient/Makefile	Wed Mar 25 17:47:22 2009	(r190419)
@@ -1,9 +1,9 @@
 # $FreeBSD$
 
-.PATH: ${.CURDIR}/../../../cddl/dev/dtnfsclient
+.PATH: ${.CURDIR}/../../../nfsclient
 
 KMOD=		dtnfsclient
-SRCS=		dtnfsclient.c
+SRCS=		nfs_kdtrace.c
 SRCS+=		vnode_if.h
 
 CFLAGS+=	-I${.CURDIR}/../../../cddl/compat/opensolaris \

Copied: head/sys/nfsclient/nfs_kdtrace.c (from r190397, head/sys/cddl/dev/dtnfsclient/dtnfsclient.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/nfsclient/nfs_kdtrace.c	Wed Mar 25 17:47:22 2009	(r190419, copy of r190397, head/sys/cddl/dev/dtnfsclient/dtnfsclient.c)
@@ -0,0 +1,545 @@
+/*-
+ * Copyright (c) 2009 Robert N. M. Watson
+ * All rights reserved.
+ *
+ * This software was developed at the University of Cambridge Computer
+ * Laboratory with support from a grant from Google, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+/*
+ * dtnfsclient is a DTrace provider that tracks the intent to perform RPCs
+ * in the NFS client, as well as acess to and maintenance of the access and
+ * attribute caches.  This is not quite the same as RPCs, because NFS may
+ * issue multiple RPC transactions in the event that authentication fails,
+ * there's a jukebox error, or none at all if the access or attribute cache
+ * hits.  However, it cleanly represents the logical layer between RPC
+ * transmission and vnode/vfs operations, providing access to state linking
+ * the two.
+ */
+
+static int	dtnfsclient_unload(void);
+static void	dtnfsclient_getargdesc(void *, dtrace_id_t, void *,
+		    dtrace_argdesc_t *);
+static void	dtnfsclient_provide(void *, dtrace_probedesc_t *);
+static void	dtnfsclient_destroy(void *, dtrace_id_t, void *);
+static void	dtnfsclient_enable(void *, dtrace_id_t, void *);
+static void	dtnfsclient_disable(void *, dtrace_id_t, void *);
+static void	dtnfsclient_load(void *);
+
+static dtrace_pattr_t dtnfsclient_attr = {
+{ DTRACE_STABILITY_STABLE, DTRACE_STABILITY_STABLE, DTRACE_CLASS_COMMON },
+{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN },
+{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN },
+{ DTRACE_STABILITY_STABLE, DTRACE_STABILITY_STABLE, DTRACE_CLASS_COMMON },
+{ DTRACE_STABILITY_STABLE, DTRACE_STABILITY_STABLE, DTRACE_CLASS_COMMON },
+};
+
+/*
+ * Descrition of NFSv3 and (optional) NFSv2 probes for a procedure.
+ */
+struct dtnfsclient_rpc {
+	char		*nr_v3_name;
+	char		*nr_v2_name;	/* Or NULL if none. */
+
+	/*
+	 * IDs for the start and done cases, for both NFSv2 and NFSv3.
+	 */
+	uint32_t	 nr_v2_id_start, nr_v2_id_done;
+	uint32_t	 nr_v3_id_start, nr_v3_id_done;
+};
+
+/*
+ * This table is indexed by NFSv3 procedure number, but also used for NFSv2
+ * procedure names.
+ */
+static struct dtnfsclient_rpc	dtnfsclient_rpcs[NFS_NPROCS] = {
+	{ "null", "null" },
+	{ "getattr", "getattr" },
+	{ "setattr", "setattr" },
+	{ "lookup", "lookup" },
+	{ "access" },
+	{ "readlink", "readlink" },
+	{ "read", "read" },
+	{ "write", "write" },
+	{ "create", "create" },
+	{ "mkdir", "mkdir" },
+	{ "symlink", "symlink" },
+	{ "mknod" },
+	{ "remove", "remove" },
+	{ "rmdir", "rmdir" },
+	{ "rename", "rename" },
+	{ "link", "link" },
+	{ "readdir", "readdir" },
+	{ "readdirplus" },
+	{ "fsstat", "statfs" },
+	{ "fsinfo" },
+	{ "pathconf" },
+	{ "commit" },
+	{ "noop" },
+};
+
+/*
+ * Module name strings.
+ */
+static char	*dtnfsclient_accesscache_str = "accesscache";
+static char	*dtnfsclient_attrcache_str = "attrcache";
+static char	*dtnfsclient_nfs2_str = "nfs2";
+static char	*dtnfsclient_nfs3_str = "nfs3";
+
+/*
+ * Function name strings.
+ */
+static char	*dtnfsclient_flush_str = "flush";
+static char	*dtnfsclient_load_str = "load";
+static char	*dtnfsclient_get_str = "get";
+
+/*
+ * Name strings.
+ */
+static char	*dtnfsclient_done_str = "done";
+static char	*dtnfsclient_hit_str = "hit";
+static char	*dtnfsclient_miss_str = "miss";
+static char	*dtnfsclient_start_str = "start";
+
+static dtrace_pops_t dtnfsclient_pops = {
+	dtnfsclient_provide,
+	NULL,
+	dtnfsclient_enable,
+	dtnfsclient_disable,
+	NULL,
+	NULL,
+	dtnfsclient_getargdesc,
+	NULL,
+	NULL,
+	dtnfsclient_destroy
+};
+
+static dtrace_provider_id_t	dtnfsclient_id;
+
+/*
+ * Most probes are generated from the above RPC table, but for access and
+ * attribute caches, we have specific IDs we recognize and handle specially
+ * in various spots.
+ */
+extern uint32_t	nfsclient_accesscache_flush_done_id;
+extern uint32_t	nfsclient_accesscache_get_hit_id;
+extern uint32_t	nfsclient_accesscache_get_miss_id;
+extern uint32_t	nfsclient_accesscache_load_done_id;
+
+extern uint32_t	nfsclient_attrcache_flush_done_id;
+extern uint32_t	nfsclient_attrcache_get_hit_id;
+extern uint32_t	nfsclient_attrcache_get_miss_id;
+extern uint32_t	nfsclient_attrcache_load_done_id;
+
+/*
+ * When tracing on a procedure is enabled, the DTrace ID for an RPC event is
+ * stored in one of these two NFS client-allocated arrays; 0 indicates that
+ * the event is not being traced so probes should not be called.
+ *
+ * For simplicity, we allocate both v2 and v3 arrays as NFS_NPROCS, and the
+ * v2 array is simply sparse.
+ */
+extern uint32_t			nfsclient_nfs2_start_probes[NFS_NPROCS];
+extern uint32_t			nfsclient_nfs2_done_probes[NFS_NPROCS];
+
+extern uint32_t			nfsclient_nfs3_start_probes[NFS_NPROCS];
+extern uint32_t			nfsclient_nfs3_done_probes[NFS_NPROCS];
+
+/*
+ * Look up a DTrace probe ID to see if it's associated with a "done" event --
+ * if so, we will return a fourth argument type of "int".
+ */
+static int
+dtnfs23_isdoneprobe(dtrace_id_t id)
+{
+	int i;
+
+	for (i = 0; i < NFS_NPROCS; i++) {
+		if (dtnfsclient_rpcs[i].nr_v3_id_done == id ||
+		    dtnfsclient_rpcs[i].nr_v2_id_done == id)
+			return (1);
+	}
+	return (0);
+}
+
+static void
+dtnfsclient_getargdesc(void *arg, dtrace_id_t id, void *parg,
+    dtrace_argdesc_t *desc)
+{
+	const char *p = NULL;
+
+	if (id == nfsclient_accesscache_flush_done_id ||
+	    id == nfsclient_attrcache_flush_done_id ||
+	    id == nfsclient_attrcache_get_miss_id) {
+		switch (desc->dtargd_ndx) {
+		case 0:
+			p = "struct vnode *";
+			break;
+		default:
+			desc->dtargd_ndx = DTRACE_ARGNONE;
+			break;
+		}
+	} else if (id == nfsclient_accesscache_get_hit_id ||
+	    id == nfsclient_accesscache_get_miss_id) {
+		switch (desc->dtargd_ndx) {
+		case 0:
+			p = "struct vnode *";
+			break;
+		case 1:
+			p = "uid_t";
+			break;
+		case 2:
+			p = "uint32_t";
+			break;
+		default:
+			desc->dtargd_ndx = DTRACE_ARGNONE;
+			break;
+		}
+	} else if (id == nfsclient_accesscache_load_done_id) {
+		switch (desc->dtargd_ndx) {
+		case 0:
+			p = "struct vnode *";
+			break;
+		case 1:
+			p = "uid_t";
+			break;
+		case 2:
+			p = "uint32_t";
+			break;
+		case 3:
+			p = "int";
+			break;
+		default:
+			desc->dtargd_ndx = DTRACE_ARGNONE;
+			break;
+		}
+	} else if (id == nfsclient_attrcache_get_hit_id) {
+		switch (desc->dtargd_ndx) {
+		case 0:
+			p = "struct vnode *";
+			break;
+		case 1:
+			p = "struct vattr *";
+			break;
+		default:
+			desc->dtargd_ndx = DTRACE_ARGNONE;
+			break;
+		}
+	} else if (id == nfsclient_attrcache_load_done_id) {
+		switch (desc->dtargd_ndx) {
+		case 0:
+			p = "struct vnode *";
+			break;
+		case 1:
+			p = "struct vattr *";
+			break;
+		case 2:
+			p = "int";
+			break;
+		default:
+			desc->dtargd_ndx = DTRACE_ARGNONE;
+			break;
+		}
+	} else {
+		switch (desc->dtargd_ndx) {
+		case 0:
+			p = "struct vnode *";
+			break;
+		case 1:
+			p = "struct mbuf *";
+			break;
+		case 2:
+			p = "struct ucred *";
+			break;
+		case 3:
+			p = "int";
+			break;
+		case 4:
+			if (dtnfs23_isdoneprobe(id)) {
+				p = "int";
+				break;
+			}
+			/* FALLSTHROUGH */
+		default:
+			desc->dtargd_ndx = DTRACE_ARGNONE;
+			break;
+		}
+	}
+	if (p != NULL)
+		strlcpy(desc->dtargd_native, p, sizeof(desc->dtargd_native));
+}
+
+static void
+dtnfsclient_provide(void *arg, dtrace_probedesc_t *desc)
+{
+	int i;
+
+	if (desc != NULL)
+		return;
+
+	/*
+	 * Register access cache probes.
+	 */
+	if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_accesscache_str,
+	    dtnfsclient_flush_str, dtnfsclient_done_str) == 0) {
+		nfsclient_accesscache_flush_done_id = dtrace_probe_create(
+		    dtnfsclient_id, dtnfsclient_accesscache_str,
+		    dtnfsclient_flush_str, dtnfsclient_done_str, 0, NULL);
+	}
+	if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_accesscache_str,
+	    dtnfsclient_get_str, dtnfsclient_hit_str) == 0) {
+		nfsclient_accesscache_get_hit_id = dtrace_probe_create(
+		    dtnfsclient_id, dtnfsclient_accesscache_str,
+		    dtnfsclient_get_str, dtnfsclient_hit_str, 0, NULL);
+	}
+	if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_accesscache_str,
+	    dtnfsclient_get_str, dtnfsclient_miss_str) == 0) {
+		nfsclient_accesscache_get_miss_id = dtrace_probe_create(
+		    dtnfsclient_id, dtnfsclient_accesscache_str,
+		    dtnfsclient_get_str, dtnfsclient_miss_str, 0, NULL);
+	}
+	if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_accesscache_str,
+	    dtnfsclient_load_str, dtnfsclient_done_str) == 0) {
+		nfsclient_accesscache_load_done_id = dtrace_probe_create(
+		    dtnfsclient_id, dtnfsclient_accesscache_str,
+		    dtnfsclient_load_str, dtnfsclient_done_str, 0, NULL);
+	}
+
+	/*
+	 * Register attribute cache probes.
+	 */
+	if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_attrcache_str,
+	    dtnfsclient_flush_str, dtnfsclient_done_str) == 0) {
+		nfsclient_attrcache_flush_done_id = dtrace_probe_create(
+		    dtnfsclient_id, dtnfsclient_attrcache_str,
+		    dtnfsclient_flush_str, dtnfsclient_done_str, 0, NULL);
+	}
+	if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_attrcache_str,
+	    dtnfsclient_get_str, dtnfsclient_hit_str) == 0) {
+		nfsclient_attrcache_get_hit_id = dtrace_probe_create(
+		    dtnfsclient_id, dtnfsclient_attrcache_str,
+		    dtnfsclient_get_str, dtnfsclient_hit_str, 0, NULL);
+	}
+	if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_attrcache_str,
+	    dtnfsclient_get_str, dtnfsclient_miss_str) == 0) {
+		nfsclient_attrcache_get_miss_id = dtrace_probe_create(
+		    dtnfsclient_id, dtnfsclient_attrcache_str,
+		    dtnfsclient_get_str, dtnfsclient_miss_str, 0, NULL);
+	}
+	if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_attrcache_str,
+	    dtnfsclient_load_str, dtnfsclient_done_str) == 0) {
+		nfsclient_attrcache_load_done_id = dtrace_probe_create(
+		    dtnfsclient_id, dtnfsclient_attrcache_str,
+		    dtnfsclient_load_str, dtnfsclient_done_str, 0, NULL);
+	}
+
+	/*
+	 * Register NFSv2 RPC procedures; note sparseness check for each slot
+	 * in the NFSv3 procnum-indexed array.
+	 */
+	for (i = 0; i < NFS_NPROCS; i++) {
+		if (dtnfsclient_rpcs[i].nr_v2_name != NULL &&
+		    dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_nfs2_str,
+		    dtnfsclient_rpcs[i].nr_v2_name, dtnfsclient_start_str) ==
+		    0) {
+			dtnfsclient_rpcs[i].nr_v2_id_start =
+			    dtrace_probe_create(dtnfsclient_id,
+			    dtnfsclient_nfs2_str,
+			    dtnfsclient_rpcs[i].nr_v2_name,
+			    dtnfsclient_start_str, 0,
+			    &nfsclient_nfs2_start_probes[i]);
+		}
+		if (dtnfsclient_rpcs[i].nr_v2_name != NULL &&
+		    dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_nfs2_str,
+		    dtnfsclient_rpcs[i].nr_v2_name, dtnfsclient_done_str) ==
+		    0) {
+			dtnfsclient_rpcs[i].nr_v2_id_done = 
+			    dtrace_probe_create(dtnfsclient_id,
+			    dtnfsclient_nfs2_str,
+			    dtnfsclient_rpcs[i].nr_v2_name,
+			    dtnfsclient_done_str, 0,
+			    &nfsclient_nfs2_done_probes[i]);
+		}
+	}
+
+	/*
+	 * Register NFSv3 RPC procedures.
+	 */
+	for (i = 0; i < NFS_NPROCS; i++) {
+		if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_nfs3_str,
+		    dtnfsclient_rpcs[i].nr_v3_name, dtnfsclient_start_str) ==
+		    0) {
+			dtnfsclient_rpcs[i].nr_v3_id_start =
+			    dtrace_probe_create(dtnfsclient_id,
+			    dtnfsclient_nfs3_str,
+			    dtnfsclient_rpcs[i].nr_v3_name,
+			    dtnfsclient_start_str, 0,
+			    &nfsclient_nfs3_start_probes[i]);
+		}
+		if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_nfs3_str,
+		    dtnfsclient_rpcs[i].nr_v3_name, dtnfsclient_done_str) ==
+		    0) {
+			dtnfsclient_rpcs[i].nr_v3_id_done = 
+			    dtrace_probe_create(dtnfsclient_id,
+			    dtnfsclient_nfs3_str,
+			    dtnfsclient_rpcs[i].nr_v3_name,
+			    dtnfsclient_done_str, 0,
+			    &nfsclient_nfs3_done_probes[i]);
+		}
+	}
+}
+
+static void
+dtnfsclient_destroy(void *arg, dtrace_id_t id, void *parg)
+{
+}
+
+static void
+dtnfsclient_enable(void *arg, dtrace_id_t id, void *parg)
+{
+	uint32_t *p = parg;
+	void *f = dtrace_probe;
+
+	if (id == nfsclient_accesscache_flush_done_id)
+		dtrace_nfsclient_accesscache_flush_done_probe = f;
+	else if (id == nfsclient_accesscache_get_hit_id)
+		dtrace_nfsclient_accesscache_get_hit_probe = f;
+	else if (id == nfsclient_accesscache_get_miss_id)
+		dtrace_nfsclient_accesscache_get_miss_probe = f;
+	else if (id == nfsclient_accesscache_load_done_id)
+		dtrace_nfsclient_accesscache_load_done_probe = f;
+	else if (id == nfsclient_attrcache_flush_done_id)
+		dtrace_nfsclient_attrcache_flush_done_probe = f;
+	else if (id == nfsclient_attrcache_get_hit_id)
+		dtrace_nfsclient_attrcache_get_hit_probe = f;
+	else if (id == nfsclient_attrcache_get_miss_id)
+		dtrace_nfsclient_attrcache_get_miss_probe = f;
+	else if (id == nfsclient_attrcache_load_done_id)
+		dtrace_nfsclient_attrcache_load_done_probe = f;
+	else
+		*p = id;
+}
+
+static void
+dtnfsclient_disable(void *arg, dtrace_id_t id, void *parg)
+{
+	uint32_t *p = parg;
+
+	if (id == nfsclient_accesscache_flush_done_id)
+		dtrace_nfsclient_accesscache_flush_done_probe = NULL;
+	else if (id == nfsclient_accesscache_get_hit_id)
+		dtrace_nfsclient_accesscache_get_hit_probe = NULL;
+	else if (id == nfsclient_accesscache_get_miss_id)
+		dtrace_nfsclient_accesscache_get_miss_probe = NULL;
+	else if (id == nfsclient_accesscache_load_done_id)
+		dtrace_nfsclient_accesscache_load_done_probe = NULL;
+	else if (id == nfsclient_attrcache_flush_done_id)
+		dtrace_nfsclient_attrcache_flush_done_probe = NULL;
+	else if (id == nfsclient_attrcache_get_hit_id)
+		dtrace_nfsclient_attrcache_get_hit_probe = NULL;
+	else if (id == nfsclient_attrcache_get_miss_id)
+		dtrace_nfsclient_attrcache_get_miss_probe = NULL;
+	else if (id == nfsclient_attrcache_load_done_id)
+		dtrace_nfsclient_attrcache_load_done_probe = NULL;
+	else
+		*p = 0;
+}
+
+static void
+dtnfsclient_load(void *dummy)
+{
+
+	if (dtrace_register("nfsclient", &dtnfsclient_attr,
+	    DTRACE_PRIV_USER, NULL, &dtnfsclient_pops, NULL,
+	    &dtnfsclient_id) != 0)
+		return;
+
+	dtrace_nfsclient_nfs23_start_probe =
+	    (dtrace_nfsclient_nfs23_start_probe_func_t)dtrace_probe;
+	dtrace_nfsclient_nfs23_done_probe =
+	    (dtrace_nfsclient_nfs23_done_probe_func_t)dtrace_probe;
+}
+
+
+static int
+dtnfsclient_unload()
+{
+	int error = 0;
+
+	dtrace_nfsclient_nfs23_start_probe = NULL;
+	dtrace_nfsclient_nfs23_done_probe = NULL;
+
+	if ((error = dtrace_unregister(dtnfsclient_id)) != 0)
+		return (error);
+
+	return (error);
+}
+
+static int
+dtnfsclient_modevent(module_t mod __unused, int type, void *data __unused)
+{
+	int error = 0;
+
+	switch (type) {
+	case MOD_LOAD:
+		break;
+
+	case MOD_UNLOAD:
+		break;
+
+	case MOD_SHUTDOWN:
+		break;
+
+	default:
+		error = EOPNOTSUPP;
+		break;
+	}
+
+	return (error);
+}
+
+SYSINIT(dtnfsclient_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY,
+    dtnfsclient_load, NULL);
+SYSUNINIT(dtnfsclient_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY,
+    dtnfsclient_unload, NULL);
+
+DEV_MODULE(dtnfsclient, dtnfsclient_modevent, NULL);
+MODULE_VERSION(dtnfsclient, 1);
+MODULE_DEPEND(dtnfsclient, dtrace, 1, 1, 1);
+MODULE_DEPEND(dtnfsclient, opensolaris, 1, 1, 1);

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 17:56:28 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B80331065670;
	Wed, 25 Mar 2009 17:56:28 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A6F518FC08;
	Wed, 25 Mar 2009 17:56:28 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2PHuSPi083474;
	Wed, 25 Mar 2009 17:56:28 GMT (envelope-from luigi@svn.freebsd.org)
Received: (from luigi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2PHuSto083473;
	Wed, 25 Mar 2009 17:56:28 GMT (envelope-from luigi@svn.freebsd.org)
Message-Id: <200903251756.n2PHuSto083473@svn.freebsd.org>
From: Luigi Rizzo 
Date: Wed, 25 Mar 2009 17:56:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190420 - head/release/picobsd/bridge
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 17:56:29 -0000

Author: luigi
Date: Wed Mar 25 17:56:28 2009
New Revision: 190420
URL: http://svn.freebsd.org/changeset/base/190420

Log:
  devfs is the standard now

Modified:
  head/release/picobsd/bridge/config

Modified: head/release/picobsd/bridge/config
==============================================================================
--- head/release/picobsd/bridge/config	Wed Mar 25 17:47:22 2009	(r190419)
+++ head/release/picobsd/bridge/config	Wed Mar 25 17:56:28 2009	(r190420)
@@ -3,5 +3,4 @@
 # it should only contain variable definitions -- it is sourced
 # by the shell much like rc.conf* files
 
-o_no_devfs="" # we have devfs.
 fd_size="2880"

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 18:48:46 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8D7C2106564A;
	Wed, 25 Mar 2009 18:48:46 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7AA608FC08;
	Wed, 25 Mar 2009 18:48:46 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2PImkSR084543;
	Wed, 25 Mar 2009 18:48:46 GMT (envelope-from luigi@svn.freebsd.org)
Received: (from luigi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2PImkxk084540;
	Wed, 25 Mar 2009 18:48:46 GMT (envelope-from luigi@svn.freebsd.org)
Message-Id: <200903251848.n2PImkxk084540@svn.freebsd.org>
From: Luigi Rizzo 
Date: Wed, 25 Mar 2009 18:48:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190421 - head/release/picobsd/bridge
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 18:48:47 -0000

Author: luigi
Date: Wed Mar 25 18:48:46 2009
New Revision: 190421
URL: http://svn.freebsd.org/changeset/base/190421

Log:
  This config file uses dynamically linked binaries, which is more
  convenient when you want to import other programs because the
  libraries will not be replicated.
  
  Given that there are no floppies around anymore, I have bumped
  the fd size to 4MB (which is more than reasonable even for
  embedded platforms) and gives some room for other utilities.
  
  MFC after:	3 days

Modified:
  head/release/picobsd/bridge/PICOBSD
  head/release/picobsd/bridge/config
  head/release/picobsd/bridge/crunch.conf

Modified: head/release/picobsd/bridge/PICOBSD
==============================================================================
--- head/release/picobsd/bridge/PICOBSD	Wed Mar 25 17:56:28 2009	(r190420)
+++ head/release/picobsd/bridge/PICOBSD	Wed Mar 25 18:48:46 2009	(r190421)
@@ -3,8 +3,8 @@
 #
 # Line starting with #PicoBSD contains PicoBSD build parameters
 #marker         def_sz  init    MFS_inodes      floppy_inodes
-#PicoBSD	3200	init	8192		32768
-options MD_ROOT_SIZE=3200      # same as def_sz
+#PicoBSD	8000	init	8192		32768
+options MD_ROOT_SIZE=8000      # same as def_sz
 
 hints	"PICOBSD.hints"
 
@@ -45,6 +45,7 @@ options		DUMMYNET
 device		if_bridge
 options		HZ=1000
 
+device		random			# used by ssh
 device		pci
 
 # Floppy drives
@@ -64,7 +65,6 @@ device		atkbd
 device		vga			# VGA screen
 
 # syscons is the default console driver, resembling an SCO console
-
 device		sc
 
 # Serial (COM) ports
@@ -88,14 +88,9 @@ device		uart
 # The following Ethernet NICs are all PCI devices.
 #
 device	miibus 
-#device		de		# DEC/Intel DC21x4x (``Tulip'')
-#device		lnc
 device		fxp		# Intel EtherExpress PRO/100B (82557, 82558)
-#device		xl		# 3Com
 device		rl		# RealTek 8129/8139
 device		sis		# National/SiS
-#device		vx		# 3Com 3c590, 3c595 (``Vortex'')
-#device		wx		# Intel Gigabit Ethernet Card (``Wiseman'')
 device		dc		# DEC/Intel 21143 and various workalikes
 device		ed
 
@@ -109,8 +104,6 @@ device		md		# Memory "disks"
 #device		faith	1	# IPv6-to-IPv4 relaying (translation)
 device		tap
 
-#options		DEVICE_POLLING
-
 # The `bpf' device enables the Berkeley Packet Filter.
 # Be aware of the administrative consequences of enabling this!
 device		bpf		# Berkeley packet filter

Modified: head/release/picobsd/bridge/config
==============================================================================
--- head/release/picobsd/bridge/config	Wed Mar 25 17:56:28 2009	(r190420)
+++ head/release/picobsd/bridge/config	Wed Mar 25 18:48:46 2009	(r190421)
@@ -3,4 +3,4 @@
 # it should only contain variable definitions -- it is sourced
 # by the shell much like rc.conf* files
 
-fd_size="2880"
+fd_size="4096"

Modified: head/release/picobsd/bridge/crunch.conf
==============================================================================
--- head/release/picobsd/bridge/crunch.conf	Wed Mar 25 17:56:28 2009	(r190420)
+++ head/release/picobsd/bridge/crunch.conf	Wed Mar 25 18:48:46 2009	(r190421)
@@ -1,39 +1,55 @@
 #
 # $FreeBSD$
 #
-# configuration file for "bridge" floppy.
-# Depending on your needs, almost surely you will need to
-# modify your configuration to add/remove/change programs used in
-# the floppy image. Remember that some programs also require
-# matching kernel options to enable device drivers etc.
-#
-# Next to most of the programs i have tried to indicate the approximate
-# space consumed, but beware that these values change from release
-# to release, and might depend on the presence of other programs which
-# share the same libraries.
+# Configuration file for "bridge" images..
 #
-# NOTE: the string "/usr/src" will be automatically replaced with the
-# correct value set in 'build' script - you should change it there
+# Depending on your needs, you will almost surely need to
+# add/remove/change programs according to your needs.
+# Remember that some programs require matching kernel options to
+# enable device drivers etc.
+#
+# To figure out how much space is used by each program, do
+#
+#	size build_dir-bridge/crunch/*lo
+#
+# Remember that programs require libraries, which add up to the
+# total size. The final binary is build_dir-bridge/mfs.tree/stand/crunch
+# and you can check which libraries it uses with
+#
+#	ldd build_dir-bridge/mfs.tree/stand/crunch
 
-# Default build options. Basically tell the Makefiles which understand
-# that to use the most compact possible version of the code.
+# crunchgen configuration to build the crunched binary, see "man crunchgen"
+# We need to specify generic build options, the places where to look
+# for sources, and the list of program and libraries we want to put
+# in the crunched binary.
 #
-buildopts -DNO_PAM -DRELEASE_CRUNCH -DPPP_NO_NETGRAPH -DTRACEROUTE_NO_IPSEC -DNO_INET6
+# NOTE: the string "/usr/src" below will be automatically replaced with
+# the path set in the 'build' script.
+
+# Default build options. Basically tell the Makefiles
+# that to use the most compact possible version of the code.
+
+buildopts -DNO_PAM -DRELEASE_CRUNCH -DPPP_NO_NETGRAPH
+buildopts -DTRACEROUTE_NO_IPSEC -DNO_INET6
 buildopts -DWITHOUT_IPX
 
-# directories where to look for sources of various binaries.
+# Directories where to look for sources of various binaries.
 # @__CWD__@ is a magic keyword in the picobsd's (Makefile.conf)
-# which is replaced with the picobsd directory.
+# which is replaced with the directory with the picobsd configuration
+# corresponding to your image. This way you can have custom sources
+# in that directory overriding system programs.
+
 srcdirs @__CWD__@/src
 
-# Some programs are especially written for PicoBSD and reside here
-# Make this first in the list so we can override standard programs
-# with the picobsd-specific ones.
+# Some programs are especially written for PicoBSD and reside in
+# release/picobsd/tinyware.
+# Put this entry near the head of the list to override standard binaries.
+
 srcdirs /usr/src/release/picobsd/tinyware
 
-#
-# standard locations
-#
+# Other standard locations for sources.
+# If a program uses its own source directory, add
+
 srcdirs /usr/src/bin
 srcdirs /usr/src/sbin/i386
 srcdirs /usr/src/sbin
@@ -41,51 +57,56 @@ srcdirs /usr/src/usr.bin
 srcdirs /usr/src/gnu/usr.bin
 srcdirs /usr/src/usr.sbin
 srcdirs /usr/src/libexec
-#
-# And there are others (mostly ports) which reside in their specific
-# directories. For them, we use the "special" commands to tell
-# crunchgen where to look for sources, objects, which Makefile
-# variables contain the list of sources and objects, and so on.
 
-# init is almost always necessary.
+# For programs that reside in different places, the best option
+# is to use the command "special XXX srcdir YYY" where XXX is the
+# program name and YYY is the directory path.
+# "special XXX ..." can be used to specify more options, see again
+# the crunchgen manpage.
+
+#--- Basic configuraton
+# init is always necessary (unless you have a replacement, oinit)
 progs init
+
 # fsck is almost always necessary, unless you have everything on the
 # image and use 'tar' or something similar to read/write raw blocks
 # from the floppy.
+
 progs fsck
-# ifconfig is needed if you want to configure interfaces...
+
+# ifconfig is needed if you want to configure interfaces.
 progs ifconfig
-#
+
 # You will also need a shell and a bunch of utilities.
 # The standard shell is not that large, but you need many
 # external programs. In fact most of them do not take much space
-# as they merely issue a system call, and print the result; the
-# libraries are already needed anyways, so they end up using almost
-# no additional memory.
-# There are a few exceptions such as 'less', which in 4.x is
-# rather large.
+# as they merely issue a system call, and print the result.
+# For a more compact version of shell and utilities, you could
+# try busybox, however most system management commands in busybox
+# will not work as they use linux-specific interfaces.
+
 progs sh
 ln sh -sh
+
+# the small utilities
 progs echo
-progs pwd
-progs mkdir rmdir
+progs pwd mkdir rmdir
 progs chmod chown
-progs mv ln
+ln chown chgrp
+progs mv ln cp rm ls
+progs cat tail tee
+progs test
+ln test [
+
 progs mount
 progs minigzip
 ln minigzip gzip
-progs cp
-progs rm
-progs ls
 progs kill
 progs df
 progs ps
-progs ns
+progs ns	# this is the 
 ln ns netstat
 progs vm
-progs cat
-progs test
-ln test [
 progs hostname
 progs login
 progs getty
@@ -94,28 +115,20 @@ progs w
 progs msg
 ln msg dmesg
 progs reboot
-progs less
-#ln less more
-#progs more
-special more srcdir /usr/ports/misc/44bsd-more/work
 
 progs sysctl
 progs swapon
 progs pwd_mkdb
 progs umount
 progs du
-progs tail
-progs tee
 progs passwd
 
 progs route
-# progs mount_msdosfs
-# progs comcontrol
-#
+
 # If you want to run natd, remember the alias library
 #progs natd
-#libs -lalias	# natd
-#
+#libs_so -lalias	# natd
+
 # ppp is rather large. Note that as of Jan.01, RELEASE_CRUNCH
 # makes ppp not use libalias, so you cannot have aliasing.
 #progs ppp
@@ -124,42 +137,44 @@ progs route
 # smaller ones. vi is much larger.
 # The editor also usually need a curses library.
 progs ee
-libs -lncurses
-# progs vi
-# libs -lcurses # for vi
-
-#progs tcpdump
-special tcpdump srcdir /usr/src/usr.sbin/tcpdump/tcpdump
 
 progs arp
 
-progs bsdlabel
-progs fdisk
-progs mdconfig
+# these require libgeom
+# progs bsdlabel fdisk mdconfig
 
+progs kldload kldunload kldstat
+progs kldxref
 #progs grep
 progs date
-#progs mount_nfs
-ln mount_nfs nfs
 progs ping
 #progs routed
 progs ipfw
 progs traceroute
+progs mdmfs
+ln mdmfs mount_mfs
+# Various filesystem support -- remember to enable the kernel parts
+# progs mount_msdosfs
+progs mount_nfs
 # progs mount_cd9660
-# ln mount_cd9660 cd9660
-# progs newfs
+ln mount_nfs nfs
+ln mount_cd9660 cd9660
+#progs newfs
 #ln newfs mount_mfs
-ln chown chgrp
 # ln mount_msdosfs msdos
 
+# For a small ssh client/server use dropbear
 
-libs -ll       # used by sh
-libs -lufs     # used by mount
-### ee uses ncurses instead of curses
-libs -ledit -lutil -lmd -lcrypt -lmp -lm -lkvm
-# libs -lmytinfo
-libs -lz -lpcap -lwrap
-libs -ltermcap -lgnuregex # -lcurses
-libs -lgeom
-libs -lsbuf
-libs -lbsdxml  # used by ifconfig
+# Now the libraries
+libs_so	-lc		# the C library
+libs_so -ll		# used by sh (really ?)
+libs_so -lufs		# used by mount
+### ee uses ncurses but as a dependency
+#libs_so -lncurses
+libs_so -lm
+libs_so -ledit -lutil
+libs_so -lcrypt
+libs_so -lkvm
+libs_so -lz
+libs_so -lbsdxml
+libs_so -lsbuf

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 19:02:10 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 469FE10656BD;
	Wed, 25 Mar 2009 19:02:10 +0000 (UTC)
	(envelope-from sobomax@FreeBSD.org)
Received: from sippysoft.com (gk1.360sip.com [72.236.70.240])
	by mx1.freebsd.org (Postfix) with ESMTP id DA63A8FC24;
	Wed, 25 Mar 2009 19:02:09 +0000 (UTC)
	(envelope-from sobomax@FreeBSD.org)
Received: from [192.168.1.38] (S0106001372fd1e07.vs.shawcable.net
	[70.71.171.106]) (authenticated bits=0)
	by sippysoft.com (8.14.3/8.14.3) with ESMTP id n2PIe6C0006462
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 25 Mar 2009 11:40:07 -0700 (PDT)
	(envelope-from sobomax@FreeBSD.org)
Message-ID: <49CA7A79.7080501@FreeBSD.org>
Date: Wed, 25 Mar 2009 11:39:53 -0700
From: Maxim Sobolev 
Organization: Sippy Software, Inc.
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
To: Christoph Mallon 
References: <200903192029.n2JKTN54074599@svn.freebsd.org>
	<49C4C974.5050209@gmx.de>
In-Reply-To: <49C4C974.5050209@gmx.de>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, Marius Strobl ,
	src-committers@FreeBSD.org, svn-src-all@FreeBSD.org
Subject: Re: svn commit: r190098 - in head/sys/sparc64: fhc sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 19:02:11 -0000

Christoph Mallon wrote:
> Sorry for the long essay, but I deem it important to tell how compilers 
> work these day.

Good point, maybe it would make sense to compress it somewhat and add to 
the style(9)?

-Maxim

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 20:15:48 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9AAD410656E4;
	Wed, 25 Mar 2009 20:15:48 +0000 (UTC)
	(envelope-from lulf@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7FA5E8FC43;
	Wed, 25 Mar 2009 20:15:48 +0000 (UTC)
	(envelope-from lulf@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2PKFm0I086545;
	Wed, 25 Mar 2009 20:15:48 GMT (envelope-from lulf@svn.freebsd.org)
Received: (from lulf@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2PKFmDc086540;
	Wed, 25 Mar 2009 20:15:48 GMT (envelope-from lulf@svn.freebsd.org)
Message-Id: <200903252015.n2PKFmDc086540@svn.freebsd.org>
From: Ulf Lilleengen 
Date: Wed, 25 Mar 2009 20:15:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190422 - in head: . contrib/csup
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 20:15:52 -0000

Author: lulf
Date: Wed Mar 25 20:15:48 2009
New Revision: 190422
URL: http://svn.freebsd.org/changeset/base/190422

Log:
  - Add proper error checking and printing to the CVSMode code when reading and
    writing from/to streams, as leaving them out stops csup from cleaning up on
    SIGINT and friends properly.
  
  MFC after:      1 week

Modified:
  head/contrib/csup/rcsfile.c
  head/contrib/csup/rcsfile.h
  head/contrib/csup/rcsparse.c
  head/contrib/csup/updater.c

Changes in other areas also in this revision:
Modified:
  head/   (props changed)

Modified: head/contrib/csup/rcsfile.c
==============================================================================
--- head/contrib/csup/rcsfile.c	Wed Mar 25 18:48:46 2009	(r190421)
+++ head/contrib/csup/rcsfile.c	Wed Mar 25 20:15:48 2009	(r190422)
@@ -140,7 +140,7 @@ static void		 rcsfile_insertsorteddelta(
 			     struct delta *);
 static struct stream 	*rcsfile_getdeltatext(struct rcsfile *, struct delta *,
 			     struct buf **);
-static void		 rcsdelta_writestring(char *, size_t, struct stream *);
+static int		 rcsdelta_writestring(char *, size_t, struct stream *);
 static void		 rcsdelta_insertbranch(struct delta *, struct branch *);
 
 /* Space formatting of RCS file. */
@@ -308,14 +308,19 @@ rcsfile_write(struct rcsfile *rf, struct
 
 	/* First write head. */
 	d = LIST_FIRST(&rf->trunk->deltalist);
-	stream_printf(dest, "head%s%s;\n", head_space, d->revnum);
+	if (stream_printf(dest, "head%s%s;\n", head_space, d->revnum) < 0)
+		return (-1);
 
 	/* Write branch, if we have. */
-	if (rf->branch != NULL)
-		stream_printf(dest, "branch%s%s;\n", branch_space, rf->branch);
+	if (rf->branch != NULL) {
+		if (stream_printf(dest, "branch%s%s;\n", branch_space,
+		    rf->branch) < 0)
+			return (-1);
+	}
 
 	/* Write access. */
-	stream_printf(dest, "access");
+	if (stream_printf(dest, "access") < 0)
+		return (-1);
 #if 0
 	if (!STAILQ_EMPTY(&rf->accesslist)) {
 		/*
@@ -324,32 +329,44 @@ rcsfile_write(struct rcsfile *rf, struct
 		 */
 	}
 #endif
-	stream_printf(dest, ";\n");
+	if (stream_printf(dest, ";\n") < 0)
+		return (-1);
 
 	/* Write out taglist. */
-	stream_printf(dest, "symbols");
+	if (stream_printf(dest, "symbols") < 0)
+		return (-1);
 	if (!STAILQ_EMPTY(&rf->taglist)) {
 		STAILQ_FOREACH(t, &rf->taglist, tag_next) {
-			stream_printf(dest, "\n%s%s:%s", tag_space, t->tag,
-			    t->revnum);
+			if (stream_printf(dest, "\n%s%s:%s", tag_space, t->tag,
+			    t->revnum) < 0)
+				return (-1);
 		}
 	}
-	stream_printf(dest, ";\n");
 
 	/* Write out locks and strict. */
-	stream_printf(dest, "locks;");
-	if (rf->strictlock)
-		stream_printf(dest, " strict;");
-	stream_printf(dest, "\n");
+	if (stream_printf(dest, ";\nlocks;") < 0)
+		return (-1);
+	if (rf->strictlock) {
+		if (stream_printf(dest, " strict;") < 0)
+			return (-1);
+	}
+	if (stream_printf(dest, "\n") < 0)
+		return (-1);
 
 	/* Write out the comment. */
-	if (rf->comment != NULL)
-		stream_printf(dest, "comment%s%s;\n", comment_space, rf->comment);
-	if (rf->expand != EXPAND_DEFAULT)
-		stream_printf(dest, "expand%s@%s@;\n", expand_space,
-		    keyword_encode_expand(rf->expand));
+	if (rf->comment != NULL) {
+		if (stream_printf(dest, "comment%s%s;\n", comment_space,
+		    rf->comment) < 0)
+			return (-1);
+	}
+	if (rf->expand != EXPAND_DEFAULT) {
+		if (stream_printf(dest, "expand%s@%s@;\n", expand_space,
+		    keyword_encode_expand(rf->expand)) < 0)
+			return (-1);
+	}
 
-	stream_printf(dest, "\n\n");
+	if (stream_printf(dest, "\n\n") < 0)
+		return (-1);
 
 	/*
 	 * Write out deltas. We use a stack where we push the appropriate deltas
@@ -364,14 +381,18 @@ rcsfile_write(struct rcsfile *rf, struct
 		/* Do not write out placeholders just to be safe. */
 		if (d->placeholder)
 			continue;
-		stream_printf(dest, "%s\n", d->revnum);
-		stream_printf(dest, "date%s%s;%sauthor %s;%sstate",
+		if (stream_printf(dest, "%s\n", d->revnum) < 0)
+			return (-1);
+		if (stream_printf(dest, "date%s%s;%sauthor %s;%sstate",
 		    date_space, d->revdate, auth_space, d->author,
-		    state_space);
-		if (d->state != NULL)
-			stream_printf(dest, " %s", d->state);
-		stream_printf(dest, ";\n");
-		stream_printf(dest, "branches");
+		    state_space) < 0)
+			return (-1);
+		if (d->state != NULL) {
+			if (stream_printf(dest, " %s", d->state) < 0)
+				return (-1);
+		}
+		if (stream_printf(dest, ";\nbranches") < 0)
+			return (-1);
 		/*
 		 * Write out our branches. Add them to a reversed list for use
 		 * later when we write out the text.
@@ -385,30 +406,36 @@ rcsfile_write(struct rcsfile *rf, struct
 
 		/* Push branch heads on stack. */
 		STAILQ_FOREACH(d_tmp, &deltalist_inverted, delta_prev) {
-			if (d_tmp == NULL)
-				err(1, "empty branch!");
-			stream_printf(dest, "\n%s%s", branches_space,
-			    d_tmp->revnum);
+			if (d_tmp == NULL) {
+				lprintf(2, "Empty branch!\n");
+				return (-1);
+			}
+			if (stream_printf(dest, "\n%s%s", branches_space,
+			    d_tmp->revnum) < 0)
+				return (-1);
 		}
-		stream_printf(dest, ";\n");
 
-		stream_printf(dest, "next%s", next_space);
+		if (stream_printf(dest, ";\nnext%s", next_space) < 0)
+			return (-1);
 		/* Push next delta on stack. */
 		d_next = LIST_NEXT(d, delta_next);
 		if (d_next != NULL) {
-			stream_printf(dest, "%s", d_next->revnum);
+			if (stream_printf(dest, "%s", d_next->revnum) < 0)
+				return (-1);
 			STAILQ_INSERT_HEAD(&deltastack, d_next, stack_next);
 		}
-		stream_printf(dest, ";\n\n");
+		if (stream_printf(dest, ";\n\n") < 0)
+			return (-1);
 	}
-	stream_printf(dest, "\n");
 	/* Write out desc. */
-	stream_printf(dest, "desc\n@@");
+	if (stream_printf(dest, "\ndesc\n@@") < 0)
+		return (-1);
 	d = LIST_FIRST(&rf->trunk->deltalist);
 
 	/* Write out deltatexts. */
 	error = rcsfile_write_deltatext(rf, dest);
-	stream_printf(dest, "\n");
+	if (stream_printf(dest, "\n") < 0)
+		return (-1);
 	return (error);
 }
 
@@ -438,21 +465,25 @@ rcsfile_write_deltatext(struct rcsfile *
 		/* Do not write out placeholders just to be safe. */
 		if (d->placeholder)
 			return (0);
-		stream_printf(dest, "\n\n\n%s\n", d->revnum);
-		stream_printf(dest, "log\n@");
+		if (stream_printf(dest, "\n\n\n%s\n", d->revnum) < 0)
+			return (-1);
+		if (stream_printf(dest, "log\n@") < 0)
+			return (-1);
 		in = stream_open_buf(d->log);
 		line = stream_getln(in, &size);
 		while (line != NULL) {
-			stream_write(dest, line, size);
+			if (stream_write(dest, line, size) == -1)
+				return (-1);
 			line = stream_getln(in, &size);
 		}
 		stream_close(in);
-		stream_printf(dest, "@\n");
-		stream_printf(dest, "text\n@");
+		if (stream_printf(dest, "@\ntext\n@") < 0)
+			return (-1);
 		error = rcsfile_puttext(rf, dest, d, d->prev);
 		if (error)
 			return (error);
-		stream_printf(dest, "@");
+		if (stream_printf(dest, "@") < 0)
+			return (-1);
 	
 		LIST_INIT(&branchlist_datesorted);
 		d_next = LIST_NEXT(d, delta_next);
@@ -535,7 +566,10 @@ rcsfile_puttext(struct rcsfile *rf, stru
 		in = stream_open_buf(d->text);
 		line = stream_getln(in, &size);
 		while (line != NULL) {
-			stream_write(dest, line, size);
+			if (stream_write(dest, line, size) == -1) {
+				error = -1;
+				goto cleanup;
+			}
 			line = stream_getln(in, &size);
 		}
 		stream_close(in);
@@ -549,7 +583,10 @@ rcsfile_puttext(struct rcsfile *rf, stru
 		}
 		line = stream_getln(orig, &size);
 		while (line != NULL) {
-			stream_write(dest, line, size);
+			if (stream_write(dest, line, size) == -1) {
+				error = -1;
+				goto cleanup;
+			}
 			line = stream_getln(orig, &size);
 		}
 		stream_close(orig);
@@ -1261,6 +1298,7 @@ int
 rcsdelta_addlog(struct delta *d, char *log, int len)
 {
 	struct stream *dest;
+	int nbytes;
 
 	assert(d != NULL);
 	/* Strip away '@' at beginning and end. */
@@ -1268,9 +1306,9 @@ rcsdelta_addlog(struct delta *d, char *l
 	len--;
 	log[len - 1] = '\0';
 	dest = stream_open_buf(d->log);
-	stream_write(dest, log, len - 1);
+	nbytes = stream_write(dest, log, len - 1);
 	stream_close(dest);
-	return (0);
+	return ((nbytes == -1) ? -1 : 0);
 }
 
 /* Add deltatext to a delta. Assume the delta already exists. */
@@ -1278,6 +1316,7 @@ int
 rcsdelta_addtext(struct delta *d, char *text, int len)
 {
 	struct stream *dest;
+	int nbytes;
 
 	assert(d != NULL);
 	/* Strip away '@' at beginning and end. */
@@ -1286,36 +1325,40 @@ rcsdelta_addtext(struct delta *d, char *
 	text[len - 1] = '\0';
 
 	dest = stream_open_buf(d->text);
-	stream_write(dest, text, len - 1);
+	nbytes = stream_write(dest, text, len - 1);
 	stream_close(dest);
-	return (0);
+	return ((nbytes == -1) ? -1 : 0);
 }
 
 /* Add a deltatext logline to a delta. */
-void
+int
 rcsdelta_appendlog(struct delta *d, char *logline, size_t size)
 {
 	struct stream *dest;
+	int error;
 
 	assert(d != NULL);
 	dest = stream_open_buf(d->log);
-	rcsdelta_writestring(logline, size, dest);
+	error = rcsdelta_writestring(logline, size, dest);
 	stream_close(dest);
+	return (error);
 }
 
 /* Add a deltatext textline to a delta. */
-void
+int
 rcsdelta_appendtext(struct delta *d, char *textline, size_t size)
 {
 	struct stream *dest;
+	int error;
 
 	assert(d != NULL);
 	dest = stream_open_buf(d->text);
-	rcsdelta_writestring(textline, size, dest);
+	error = rcsdelta_writestring(textline, size, dest);
 	stream_close(dest);
+	return (error);
 }
 
-static void
+static int 
 rcsdelta_writestring(char *textline, size_t size, struct stream *dest)
 {
 	char buf[3];
@@ -1332,8 +1375,10 @@ rcsdelta_writestring(char *textline, siz
 			buf[2] = '\0';
 			count = 2;
 		}
-		stream_write(dest, buf, count);
+		if (stream_write(dest, buf, count) == -1)
+			return (-1);
 	}
+	return (0);
 }
 
 /* Set delta state. */

Modified: head/contrib/csup/rcsfile.h
==============================================================================
--- head/contrib/csup/rcsfile.h	Wed Mar 25 18:48:46 2009	(r190421)
+++ head/contrib/csup/rcsfile.h	Wed Mar 25 20:15:48 2009	(r190422)
@@ -65,8 +65,8 @@ void		 rcsfile_importdelta(struct rcsfil
 
 int		 rcsdelta_addlog(struct delta *, char *, int);
 int		 rcsdelta_addtext(struct delta *, char *, int);
-void		 rcsdelta_appendlog(struct delta *, char *, size_t);
-void		 rcsdelta_appendtext(struct delta *, char *, size_t);
+int		 rcsdelta_appendlog(struct delta *, char *, size_t);
+int		 rcsdelta_appendtext(struct delta *, char *, size_t);
 void		 rcsdelta_setstate(struct delta *, char *);
 void		 rcsdelta_truncatetext(struct delta *, off_t);
 void		 rcsdelta_truncatelog(struct delta *, off_t);

Modified: head/contrib/csup/rcsparse.c
==============================================================================
--- head/contrib/csup/rcsparse.c	Wed Mar 25 18:48:46 2009	(r190421)
+++ head/contrib/csup/rcsparse.c	Wed Mar 25 20:15:48 2009	(r190422)
@@ -309,7 +309,7 @@ parse_deltatexts(struct rcsfile *rf, yys
 	error = 0;
 	/* In case we don't have deltatexts. */
 	if (token != NUM)
-		return (token);
+		return (-1);
 	do {
 		/* num */
 		assert(token == NUM);

Modified: head/contrib/csup/updater.c
==============================================================================
--- head/contrib/csup/updater.c	Wed Mar 25 18:48:46 2009	(r190421)
+++ head/contrib/csup/updater.c	Wed Mar 25 20:15:48 2009	(r190422)
@@ -1385,8 +1385,11 @@ updater_addfile(struct updater *up, stru
 	do {
 		nread = stream_read(up->rd, buf, (BUFSIZE > remains ?
 		    remains : BUFSIZE));
+		if (nread == -1)
+			return (UPDATER_ERR_PROTO);
 		remains -= nread;
-		stream_write(to, buf, nread);
+		if (stream_write(to, buf, nread) == -1)
+			goto bad;
 	} while (remains > 0);
 	stream_close(to);
 	line = stream_getln(up->rd, NULL);
@@ -1411,9 +1414,11 @@ updater_addfile(struct updater *up, stru
 	    FA_MODTIME | FA_MASK);
 	error = updater_updatefile(up, fup, md5, isfixup);
 	fup->wantmd5 = NULL;	/* So that it doesn't get freed. */
-	if (error)
-		return (error);
-	return (0);
+	return (error);
+bad:
+	xasprintf(&up->errmsg, "%s: Cannot write: %s", fup->temppath,
+	    strerror(errno));
+	return (UPDATER_ERR_MSG);
 }
 
 static int
@@ -1469,7 +1474,9 @@ updater_checkout(struct updater *up, str
 			if (nbytes == -1)
 				goto bad;
 		}
-		stream_write(to, line, size);
+		nbytes = stream_write(to, line, size);
+		if (nbytes == -1)
+			goto bad;
 		line = stream_getln(up->rd, &size);
 		first = 0;
 	}
@@ -1682,8 +1689,11 @@ updater_rcsedit(struct updater *up, stru
 	error = rcsfile_write(rf, dest);
 	stream_close(dest);
 	rcsfile_free(rf);
-	if (error)
-		lprintf(-1, "Error writing %s\n", name);
+	if (error) {
+		xasprintf(&up->errmsg, "%s: Cannot write: %s", fup->temppath,
+		    strerror(errno));
+		return (UPDATER_ERR_MSG);
+	}
 
 finish:
 	sr->sr_clientattr = fattr_frompath(path, FATTR_NOFOLLOW);
@@ -1768,7 +1778,9 @@ updater_addelta(struct rcsfile *rf, stru
 						size--;
 						logline++;
 					}
-					rcsdelta_appendlog(d, logline, size);
+					if (rcsdelta_appendlog(d, logline, size)
+					    < 0)
+						return (-1);
 					logline = stream_getln(rd, &size);
 				}
 			break;
@@ -1799,7 +1811,9 @@ updater_addelta(struct rcsfile *rf, stru
 						size--;
 						textline++;
 					}
-					rcsdelta_appendtext(d, textline, size);
+					if (rcsdelta_appendtext(d, textline,
+					    size) < 0)
+						return (-1);
 					textline = stream_getln(rd, &size);
 				}
 			break;
@@ -1839,8 +1853,15 @@ updater_append_file(struct updater *up, 
 
 	stream_filter_start(to, STREAM_FILTER_MD5, md5);
 	/* First write the existing content. */
-	while ((nread = read(fd, buf, BUFSIZE)) > 0)
-		stream_write(to, buf, nread);
+	while ((nread = read(fd, buf, BUFSIZE)) > 0) {
+		if (stream_write(to, buf, nread) == -1)
+			goto bad;
+	}
+	if (nread == -1) {
+		xasprintf(&up->errmsg, "%s: Error reading: %s",
+		    strerror(errno));
+		return (UPDATER_ERR_MSG);
+	}
 	close(fd);
 
 	bytes = fattr_filesize(fa) - pos;
@@ -1848,8 +1869,11 @@ updater_append_file(struct updater *up, 
 	do {
 		nread = stream_read(up->rd, buf,
 		    (BUFSIZE > bytes) ? bytes : BUFSIZE);
+		if (nread == -1)
+			return (UPDATER_ERR_PROTO);
 		bytes -= nread;
-		stream_write(to, buf, nread);
+		if (stream_write(to, buf, nread) == -1)
+			goto bad;
 	} while (bytes > 0);
 	stream_close(to);
 
@@ -1875,9 +1899,11 @@ updater_append_file(struct updater *up, 
 	    FA_MODTIME | FA_MASK);
 	error = updater_updatefile(up, fup, md5, 0);
 	fup->wantmd5 = NULL;	/* So that it doesn't get freed. */
-	if (error)
-		return (error);
-	return (0);
+	return (error);
+bad:
+	xasprintf(&up->errmsg, "%s: Cannot write: %s", fup->temppath,
+	    strerror(errno));
+	return (UPDATER_ERR_MSG);
 }
 
 /*

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 20:38:57 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7F6DD1065670;
	Wed, 25 Mar 2009 20:38:57 +0000 (UTC)
	(envelope-from ivoras@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6D45F8FC2E;
	Wed, 25 Mar 2009 20:38:57 +0000 (UTC)
	(envelope-from ivoras@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2PKcv82087618;
	Wed, 25 Mar 2009 20:38:57 GMT (envelope-from ivoras@svn.freebsd.org)
Received: (from ivoras@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2PKcvee087615;
	Wed, 25 Mar 2009 20:38:57 GMT (envelope-from ivoras@svn.freebsd.org)
Message-Id: <200903252038.n2PKcvee087615@svn.freebsd.org>
From: Ivan Voras 
Date: Wed, 25 Mar 2009 20:38:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190423 - head/sys/geom/label
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 20:38:57 -0000

Author: ivoras
Date: Wed Mar 25 20:38:57 2009
New Revision: 190423
URL: http://svn.freebsd.org/changeset/base/190423

Log:
  Create GEOM labels from UFS IDs, e.g. /dev/ufsid/49c97b1faa2adc43. UFS IDs
  are always present and can be used to identify file systems (useful if
  hardware devices move often).
  
  Actually-by:	pjd
  Approved by:	gnn (mentor)

Modified:
  head/sys/geom/label/g_label.c
  head/sys/geom/label/g_label.h
  head/sys/geom/label/g_label_ufs.c

Modified: head/sys/geom/label/g_label.c
==============================================================================
--- head/sys/geom/label/g_label.c	Wed Mar 25 20:15:48 2009	(r190422)
+++ head/sys/geom/label/g_label.c	Wed Mar 25 20:38:57 2009	(r190423)
@@ -77,7 +77,8 @@ struct g_class g_label_class = {
  * 6. Add your file system to manual page sbin/geom/class/label/glabel.8.
  */
 const struct g_label_desc *g_labels[] = {
-	&g_label_ufs,
+	&g_label_ufs_id,
+	&g_label_ufs_volume,
 	&g_label_iso9660,
 	&g_label_msdosfs,
 	&g_label_ext2fs,

Modified: head/sys/geom/label/g_label.h
==============================================================================
--- head/sys/geom/label/g_label.h	Wed Mar 25 20:15:48 2009	(r190422)
+++ head/sys/geom/label/g_label.h	Wed Mar 25 20:38:57 2009	(r190423)
@@ -64,7 +64,8 @@ struct g_label_desc {
 };
 
 /* Supported labels. */
-extern const struct g_label_desc g_label_ufs;
+extern const struct g_label_desc g_label_ufs_id;
+extern const struct g_label_desc g_label_ufs_volume;
 extern const struct g_label_desc g_label_iso9660;
 extern const struct g_label_desc g_label_msdosfs;
 extern const struct g_label_desc g_label_ext2fs;

Modified: head/sys/geom/label/g_label_ufs.c
==============================================================================
--- head/sys/geom/label/g_label_ufs.c	Wed Mar 25 20:15:48 2009	(r190422)
+++ head/sys/geom/label/g_label_ufs.c	Wed Mar 25 20:38:57 2009	(r190423)
@@ -39,12 +39,16 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#define G_LABEL_UFS_DIR	"ufs"
+#define G_LABEL_UFS_VOLUME_DIR	"ufs"
+#define G_LABEL_UFS_ID_DIR	"ufsid"
+
+#define	G_LABEL_UFS_VOLUME	0
+#define	G_LABEL_UFS_ID		1
 
 static const int superblocks[] = SBLOCKSEARCH;
 
 static void
-g_label_ufs_taste(struct g_consumer *cp, char *label, size_t size)
+g_label_ufs_taste_common(struct g_consumer *cp, char *label, size_t size, int what)
 {
 	struct g_provider *pp;
 	int sb, superblock;
@@ -96,18 +100,50 @@ g_label_ufs_taste(struct g_consumer *cp,
 		}
 		G_LABEL_DEBUG(1, "%s file system detected on %s.",
 		    fs->fs_magic == FS_UFS1_MAGIC ? "UFS1" : "UFS2", pp->name);
-		/* Check for volume label */
-		if (fs->fs_volname[0] == '\0') {
-			g_free(fs);
-			continue;
+		switch (what) {
+		case G_LABEL_UFS_VOLUME:
+			/* Check for volume label */
+			if (fs->fs_volname[0] == '\0') {
+				g_free(fs);
+				continue;
+			}
+			strlcpy(label, fs->fs_volname, size);
+			break;
+		case G_LABEL_UFS_ID:
+			if (fs->fs_id[0] == 0 && fs->fs_id[1] == 0) {
+				g_free(fs);
+				continue;
+			}
+			snprintf(label, size, "%08x%08x", fs->fs_id[0],
+			    fs->fs_id[1]);
+			break;
 		}
-		strlcpy(label, fs->fs_volname, size);
 		g_free(fs);
 		break;
 	}
 }
 
-const struct g_label_desc g_label_ufs = {
-	.ld_taste = g_label_ufs_taste,
-	.ld_dir = G_LABEL_UFS_DIR
+static void
+g_label_ufs_volume_taste(struct g_consumer *cp, char *label, size_t size)
+{
+
+	g_label_ufs_taste_common(cp, label, size, G_LABEL_UFS_VOLUME);
+}
+
+static void
+g_label_ufs_id_taste(struct g_consumer *cp, char *label, size_t size)
+{
+
+	g_label_ufs_taste_common(cp, label, size, G_LABEL_UFS_ID);
+}
+
+
+const struct g_label_desc g_label_ufs_volume = {
+	.ld_taste = g_label_ufs_volume_taste,
+	.ld_dir = G_LABEL_UFS_VOLUME_DIR
+};
+
+const struct g_label_desc g_label_ufs_id = {
+	.ld_taste = g_label_ufs_id_taste,
+	.ld_dir = G_LABEL_UFS_ID_DIR
 };

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 20:40:35 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2E9A4106567E;
	Wed, 25 Mar 2009 20:40:35 +0000 (UTC)
	(envelope-from ivoras@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1CB4E8FC16;
	Wed, 25 Mar 2009 20:40:35 +0000 (UTC)
	(envelope-from ivoras@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2PKeZHY087688;
	Wed, 25 Mar 2009 20:40:35 GMT (envelope-from ivoras@svn.freebsd.org)
Received: (from ivoras@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2PKeYhE087687;
	Wed, 25 Mar 2009 20:40:34 GMT (envelope-from ivoras@svn.freebsd.org)
Message-Id: <200903252040.n2PKeYhE087687@svn.freebsd.org>
From: Ivan Voras 
Date: Wed, 25 Mar 2009 20:40:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190424 - head/sbin/geom/class/label
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 20:40:35 -0000

Author: ivoras
Date: Wed Mar 25 20:40:34 2009
New Revision: 190424
URL: http://svn.freebsd.org/changeset/base/190424

Log:
  Man page accompanying r190423 - introduce UFS ID labels.
  
  Actually-by:	pjd
  Approved by:	gnn (mentor)

Modified:
  head/sbin/geom/class/label/glabel.8

Modified: head/sbin/geom/class/label/glabel.8
==============================================================================
--- head/sbin/geom/class/label/glabel.8	Wed Mar 25 20:38:57 2009	(r190423)
+++ head/sbin/geom/class/label/glabel.8	Wed Mar 25 20:40:34 2009	(r190424)
@@ -91,12 +91,18 @@ Currently supported file systems are:
 .Pp
 .Bl -bullet -offset indent -compact
 .It
-UFS1 (directory
+UFS1 volume names (directory
 .Pa /dev/ufs/ ) .
 .It
-UFS2 (directory
+UFS2 volume names (directory
 .Pa /dev/ufs/ ) .
 .It
+UFS1 file system IDs (directory
+.Pa /dev/ufsid/ ) .
+.It
+UFS2 file system IDs (directory
+.Pa /dev/ufsid/ ) .
+.It
 MSDOSFS (FAT12, FAT16, FAT32) (directory
 .Pa /dev/msdosfs/ ) .
 .It

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 21:20:16 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 04E8C106564A;
	Wed, 25 Mar 2009 21:20:15 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DF2778FC1E;
	Wed, 25 Mar 2009 21:20:15 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2PLKF3g088558;
	Wed, 25 Mar 2009 21:20:15 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2PLKFjP088556;
	Wed, 25 Mar 2009 21:20:15 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200903252120.n2PLKFjP088556@svn.freebsd.org>
From: Sam Leffler 
Date: Wed, 25 Mar 2009 21:20:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190425 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 21:20:18 -0000

Author: sam
Date: Wed Mar 25 21:20:15 2009
New Revision: 190425
URL: http://svn.freebsd.org/changeset/base/190425

Log:
  update; mostly to eliminate ambiguity about what hardware is supported

Modified:
  head/share/man/man4/ath.4
  head/share/man/man4/ath_hal.4

Modified: head/share/man/man4/ath.4
==============================================================================
--- head/share/man/man4/ath.4	Wed Mar 25 20:40:34 2009	(r190424)
+++ head/share/man/man4/ath.4	Wed Mar 25 21:20:15 2009	(r190425)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"/
-.Dd January 13, 2009
+.Dd March 25, 2009
 .Dt ATH 4
 .Os
 .Sh NAME
@@ -59,8 +59,6 @@ driver provides support for wireless net
 the Atheros AR5210, AR5211, AR5212, and AR5416 programming APIs.
 These APIs are used by a wide variety of chips; most all chips with
 a PCI and/or CardBus interface are supported.
-Chip-specific support is provided by the Atheros Hardware Access Layer
-(HAL).
 .Pp
 Supported features include 802.11 and 802.3 frames, power management, BSS,
 IBSS, TDMA, and host-based access point operation modes.
@@ -129,7 +127,7 @@ The driver also support
 .Cm tdma
 operation when compiled with
 .Cd "options AH_SUPPORT_TDMA"
-(and the wlan module is build with
+(and the wlan module is built with
 .Cd "options IEEE80211_SUPPORT_TDMA"
 to enable the associated 802.11 support).
 For more information on configuring this device, see
@@ -142,10 +140,8 @@ Wireless cards in Cardbus slots may be i
 .Sh HARDWARE
 The
 .Nm
-driver supports most Atheros Cardbus or PCI cards,
+driver supports all Atheros Cardbus and PCI cards,
 except those that are based on the AR5005VL chipset.
-More recent parts may require a hal that is not part of
-.Fb .
 .Pp
 A list of cards that are supported can be found at
 .Pa http://customerproducts.atheros.com/customerproducts/default.asp .
@@ -252,13 +248,6 @@ This should not happen.
 The Atheros Hardware Access Layer was unable to reset the hardware
 when switching channels during scanning.
 This should not happen.
-.It "ath%d: unable to allocate channel table"
-The driver was unable to allocate memory for the table used to hold
-the set of available channels.
-.It "ath%d: unable to collect channel list from hal"
-A problem occurred while querying the HAL to find the set of available
-channels for the device.
-This should not happen.
 .It "ath%d: failed to enable memory mapping"
 The driver was unable to enable memory-mapped I/O to the PCI device registers.
 This should not happen.
@@ -294,15 +283,6 @@ The
 device driver first appeared in
 .Fx 5.2 .
 .Sh CAVEATS
-Different regulatory domains have different default channels for adhoc
-mode.
-See
-.Xr ifconfig 8
-for information on how to change the channel.
-Different regulatory domains may not be able to communicate with each
-other with 802.11a as different regulatory domains do not necessarily
-have overlapping channels.
-.Pp
 Revision A1 of the D-LINK DWL-G520 and DWL-G650 are based on an
 Intersil PrismGT chip and are not supported by this driver.
 .Sh BUGS

Modified: head/share/man/man4/ath_hal.4
==============================================================================
--- head/share/man/man4/ath_hal.4	Wed Mar 25 20:40:34 2009	(r190424)
+++ head/share/man/man4/ath_hal.4	Wed Mar 25 21:20:15 2009	(r190425)
@@ -1,5 +1,5 @@
 .\"-
-.\" Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
+.\" Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
 .\" All rights reserved.
 .\""
 .\" Redistribution and use in source and binary forms, with or without
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"/
-.Dd November 30, 2008
+.Dd March 25, 2009
 .Dt ATH_HAL 4
 .Os
 .Sh NAME
@@ -52,10 +52,13 @@ or
 .\".Cd "device ath_rf2136"
 .\".Cd "device ath_rf2137"
 .Cd "device ath_ar9160"
+.Cd "device ath_ar9280"
 .Cd "options AH_SUPPORT_AR5416"
 .Sh DESCRIPTION
 The hal provides hardware support for wireless network adapters based on
-the Atheros AR5210, AR5211, AR5212, AR5416, and AR9160 chips.
+the Atheros AR5210, AR5211, AR5212, AR5213, AR2413, AR2417, AR2425,
+AR5413, AR5416, AR5418, AR5424, AR9160, and AR9280 chips (and companion
+RF/baseband parts).
 This code is part of the
 .Xr ath 4
 driver but configured separately to allow fine-grained control
@@ -63,7 +66,8 @@ over the set of chips supported.
 Selecting
 .Nm
 enables support for all PCI and Cardbus devices.
-Note this includes AR5416 devices and must be accompanied by the
+Note this includes AR5416, AR9160, and AR9280 devices and
+must be accompanied by the
 AH_SUPPORT_AR5416
 option to enable the extended hardware descriptor format used by
 AR5416 and later devices.

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 22:08:31 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 44A041065670;
	Wed, 25 Mar 2009 22:08:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 184028FC1D;
	Wed, 25 Mar 2009 22:08:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2PM8UBH090770;
	Wed, 25 Mar 2009 22:08:30 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2PM8Uwj090768;
	Wed, 25 Mar 2009 22:08:30 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200903252208.n2PM8Uwj090768@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 25 Mar 2009 22:08:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190426 - in head/sys: amd64/amd64 i386/isa
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 22:08:31 -0000

Author: jhb
Date: Wed Mar 25 22:08:30 2009
New Revision: 190426
URL: http://svn.freebsd.org/changeset/base/190426

Log:
  Fix a few nits in the earlier changes to prevent local information leakage
  in AMD FPUs:
  - Do not clear the affected state in the case that the FPU registers for
    the thread that already owns the FPU are changed via fpu_setregs().  The
    only local information the thread would see is its own state in that
    case.
  - Fix a type mismatch for the dummy variable used in a "fld".  It accepts
    a float, not a double.
  
  Reviewed by:	bde
  Approved by:	so (cperciva)
  MFC after:	1 month

Modified:
  head/sys/amd64/amd64/fpu.c
  head/sys/i386/isa/npx.c

Modified: head/sys/amd64/amd64/fpu.c
==============================================================================
--- head/sys/amd64/amd64/fpu.c	Wed Mar 25 21:20:15 2009	(r190425)
+++ head/sys/amd64/amd64/fpu.c	Wed Mar 25 22:08:30 2009	(r190426)
@@ -480,7 +480,6 @@ fpusetregs(struct thread *td, struct sav
 
 	s = intr_disable();
 	if (td == PCPU_GET(fpcurthread)) {
-		fpu_clean_state();
 		fxrstor(addr);
 		intr_restore(s);
 	} else {
@@ -499,10 +498,10 @@ fpusetregs(struct thread *td, struct sav
  * In order to avoid leaking this information across processes, we clean
  * these values by performing a dummy load before executing fxrstor().
  */
-static	double	dummy_variable = 0.0;
 static void
 fpu_clean_state(void)
 {
+	static float dummy_variable = 0.0;
 	u_short status;
 
 	/*

Modified: head/sys/i386/isa/npx.c
==============================================================================
--- head/sys/i386/isa/npx.c	Wed Mar 25 21:20:15 2009	(r190425)
+++ head/sys/i386/isa/npx.c	Wed Mar 25 22:08:30 2009	(r190426)
@@ -794,6 +794,11 @@ npxdna(void)
 	PCPU_SET(fpcurthread, curthread);
 	pcb = PCPU_GET(curpcb);
 
+#ifdef CPU_ENABLE_SSE
+	if (cpu_fxsr)
+		fpu_clean_state();
+#endif
+
 	if ((pcb->pcb_flags & PCB_NPXINITDONE) == 0) {
 		/*
 		 * This is the first time this thread has used the FPU or
@@ -976,10 +981,10 @@ fpusave(addr)
  * In order to avoid leaking this information across processes, we clean
  * these values by performing a dummy load before executing fxrstor().
  */
-static	double	dummy_variable = 0.0;
 static void
 fpu_clean_state(void)
 {
+	static float dummy_variable = 0.0;
 	u_short status;
 
 	/*
@@ -1005,10 +1010,9 @@ fpurstor(addr)
 {
 
 #ifdef CPU_ENABLE_SSE
-	if (cpu_fxsr) {
-		fpu_clean_state();
+	if (cpu_fxsr)
 		fxrstor(addr);
-	} else
+	else
 #endif
 		frstor(addr);
 }

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 22:12:07 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B79961065670;
	Wed, 25 Mar 2009 22:12:07 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A5ECB8FC0C;
	Wed, 25 Mar 2009 22:12:07 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2PMC7Qp090955;
	Wed, 25 Mar 2009 22:12:07 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2PMC78p090954;
	Wed, 25 Mar 2009 22:12:07 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200903252212.n2PMC78p090954@svn.freebsd.org>
From: Warner Losh 
Date: Wed, 25 Mar 2009 22:12:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190427 - head/sys/dev/fe
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 22:12:08 -0000

Author: imp
Date: Wed Mar 25 22:12:07 2009
New Revision: 190427
URL: http://svn.freebsd.org/changeset/base/190427

Log:
  It appears that the TDK LAK CD011 works with fe driver.  I don't have
  a dongle for the card, but it passes the sanity testsin the
  probe/attach routines and returns the correct MAC address.

Modified:
  head/sys/dev/fe/if_fe_pccard.c

Modified: head/sys/dev/fe/if_fe_pccard.c
==============================================================================
--- head/sys/dev/fe/if_fe_pccard.c	Wed Mar 25 22:08:30 2009	(r190426)
+++ head/sys/dev/fe/if_fe_pccard.c	Wed Mar 25 22:12:07 2009	(r190427)
@@ -73,6 +73,7 @@ static const struct fe_pccard_product {
 	{ PCMCIA_CARD(FUJITSU2, FMV_J182A), 0 },
 	{ PCMCIA_CARD(FUJITSU2, ITCFJ182A), 0 },
 	/* These need to be second */
+	{ PCMCIA_CARD(TDK, LAK_CD011), 0 }, 
 	{ PCMCIA_CARD(TDK, LAK_CD021BX), 0 }, 
 	{ PCMCIA_CARD(TDK, LAK_CF010), 0 }, 
 #if 0 /* XXX 86960-based? */

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 22:14:47 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 02672106567F;
	Wed, 25 Mar 2009 22:14:47 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DC7A18FC14;
	Wed, 25 Mar 2009 22:14:46 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2PMEkkq091033;
	Wed, 25 Mar 2009 22:14:46 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2PMEkQS091032;
	Wed, 25 Mar 2009 22:14:46 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200903252214.n2PMEkQS091032@svn.freebsd.org>
From: Warner Losh 
Date: Wed, 25 Mar 2009 22:14:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190428 - head/share/man/man4/man4.i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 22:14:47 -0000

Author: imp
Date: Wed Mar 25 22:14:46 2009
New Revision: 190428
URL: http://svn.freebsd.org/changeset/base/190428

Log:
  Add recently added cards.

Modified:
  head/share/man/man4/man4.i386/fe.4

Modified: head/share/man/man4/man4.i386/fe.4
==============================================================================
--- head/share/man/man4/man4.i386/fe.4	Wed Mar 25 22:12:07 2009	(r190427)
+++ head/share/man/man4/man4.i386/fe.4	Wed Mar 25 22:14:46 2009	(r190428)
@@ -149,7 +149,7 @@ Allied Telesis RE1000, RE1000Plus, ME150
 .It
 CONTEC C-NET(98)P2, C-NET (9N)E (110-pin), C-NET(9N)C (ExtCard)
 .It
-CONTEC C-NET(PC)C PCMCIA Ethernet
+CONTEC C-NET(PC)C PC Card Ethernet
 .It
 Eagle Tech NE200T
 .It
@@ -159,11 +159,11 @@ Fujitsu FMV-J182, FMV-J182A
 .It
 Fujitsu MB86960A, MB86965A
 .It
-Fujitsu MBH10303, MBH10302 Ethernet PCMCIA
+Fujitsu MBH10303, MBH10302 PC Card Ethernet
 .It
 Fujitsu Towa LA501 Ethernet
 .It
-HITACHI HT-4840-11
+HITACHI HT-4840-11 PC Card Ethernet
 .It
 NextCom J Link NC5310
 .It
@@ -173,7 +173,7 @@ RATOC REX-9880/9881/9882/9883
 .It
 TDK LAC-98012, LAC-98013, LAC-98025, LAC-9N011 (110-pin)
 .It
-TDK LAK-CD021, LAK-CD021A, LAK-CD021BX
+TDK LAK-CD011, LAK-CD021, LAK-CD021A, LAK-CD021BX
 .It
 Ungermann-Bass Access/PC N98C+(PC85152, PC85142), Access/NOTE
 N98(PC86132) (110-pin)

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 22:20:36 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 752401065672;
	Wed, 25 Mar 2009 22:20:36 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 638418FC12;
	Wed, 25 Mar 2009 22:20:36 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2PMKaBA091184;
	Wed, 25 Mar 2009 22:20:36 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2PMKaxp091183;
	Wed, 25 Mar 2009 22:20:36 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200903252220.n2PMKaxp091183@svn.freebsd.org>
From: Warner Losh 
Date: Wed, 25 Mar 2009 22:20:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190429 - head/sys/dev/pccard
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 22:20:37 -0000

Author: imp
Date: Wed Mar 25 22:20:36 2009
New Revision: 190429
URL: http://svn.freebsd.org/changeset/base/190429

Log:
  RIOS Systems co was naughty and used a 'random' id.  Use it with the
  PCCARD3 name to describe the RIOS PC Card III Ethernet that I have.

Modified:
  head/sys/dev/pccard/pccarddevs

Modified: head/sys/dev/pccard/pccarddevs
==============================================================================
--- head/sys/dev/pccard/pccarddevs	Wed Mar 25 22:14:46 2009	(r190428)
+++ head/sys/dev/pccard/pccarddevs	Wed Mar 25 22:20:36 2009	(r190429)
@@ -181,6 +181,7 @@ vendor RALINK			0x1814	Ralink Technology
  * with '0xc' look coherent enough that maybe somebody other than PCMCIA is
  * assigning numbers in that range.  Maybe JEITA?
  */
+vendor RIOS			0x492f	RIOS Systems Co
 vendor AIRVAST			0x50c2	AirVast Technology
 vendor ARCHOS			0x5241	Archos
 vendor DUAL			0x890f	Dual
@@ -545,6 +546,9 @@ product RAYTHEON WLAN		0x0000 WLAN Adapt
 /* RELIA Technologies Corporation */
 product RELIA COMBO		0x2452 Reliable Combo-L/M-56K
 
+/* RIOS Systems Co */
+product RIOS PCCARD3		0x0000 PC Card Ethernet
+
 /* Roland */
 product ROLAND SCP55		0x0001 Roland SCP-55
 

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 22:21:38 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7826C10656C4;
	Wed, 25 Mar 2009 22:21:38 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 667008FC1D;
	Wed, 25 Mar 2009 22:21:38 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2PMLcqi091237;
	Wed, 25 Mar 2009 22:21:38 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2PMLc2I091236;
	Wed, 25 Mar 2009 22:21:38 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200903252221.n2PMLc2I091236@svn.freebsd.org>
From: Warner Losh 
Date: Wed, 25 Mar 2009 22:21:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190430 - head/sys/dev/ed
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 22:21:39 -0000

Author: imp
Date: Wed Mar 25 22:21:38 2009
New Revision: 190430
URL: http://svn.freebsd.org/changeset/base/190430

Log:
  Add RIOS PCCARD 3.

Modified:
  head/sys/dev/ed/if_ed_pccard.c

Modified: head/sys/dev/ed/if_ed_pccard.c
==============================================================================
--- head/sys/dev/ed/if_ed_pccard.c	Wed Mar 25 22:20:36 2009	(r190429)
+++ head/sys/dev/ed/if_ed_pccard.c	Wed Mar 25 22:21:38 2009	(r190430)
@@ -206,6 +206,7 @@ static const struct ed_product {
 	{ PCMCIA_CARD(RACORE, FASTENET), NE2000DVF_AX88X90},
 	{ PCMCIA_CARD(RACORE, 8041TX), NE2000DVF_AX88X90 | NE2000DVF_TC5299J},
 	{ PCMCIA_CARD(RELIA, COMBO), 0},
+	{ PCMCIA_CARD(RIOS, PCCARD3), 0},
 	{ PCMCIA_CARD(RPTI, EP400), 0},
 	{ PCMCIA_CARD(RPTI, EP401), 0},
 	{ PCMCIA_CARD(SMC, EZCARD), 0},

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 25 22:21:53 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 980381065757;
	Wed, 25 Mar 2009 22:21:53 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6B5AA8FC3C;
	Wed, 25 Mar 2009 22:21:53 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2PMLrUs091277;
	Wed, 25 Mar 2009 22:21:53 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2PMLrXT091276;
	Wed, 25 Mar 2009 22:21:53 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200903252221.n2PMLrXT091276@svn.freebsd.org>
From: Warner Losh 
Date: Wed, 25 Mar 2009 22:21:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190431 - head/sys/dev/ed
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 22:21:54 -0000

Author: imp
Date: Wed Mar 25 22:21:53 2009
New Revision: 190431
URL: http://svn.freebsd.org/changeset/base/190431

Log:
  Tweak comments.

Modified:
  head/sys/dev/ed/if_ed.c

Modified: head/sys/dev/ed/if_ed.c
==============================================================================
--- head/sys/dev/ed/if_ed.c	Wed Mar 25 22:21:38 2009	(r190430)
+++ head/sys/dev/ed/if_ed.c	Wed Mar 25 22:21:53 2009	(r190431)
@@ -806,14 +806,15 @@ ed_rint(struct ed_softc *sc)
 			/*
 			 * Length is a wild value. There's a good chance that
 			 * this was caused by the NIC being old and buggy.
-			 * The bug is that the length low byte is duplicated in
-			 * the high byte. Try to recalculate the length based on
-			 * the pointer to the next packet.
-			 */
-			/*
-			 * NOTE: sc->next_packet is pointing at the current packet.
+			 * The bug is that the length low byte is duplicated
+			 * in the high byte. Try to recalculate the length
+			 * based on the pointer to the next packet.  Also,
+			 * need ot preserve offset into page.
+			 *
+			 * NOTE: sc->next_packet is pointing at the current
+			 * packet.
 			 */
-			len &= ED_PAGE_SIZE - 1;	/* preserve offset into page */
+			len &= ED_PAGE_SIZE - 1;
 			if (packet_hdr.next_packet >= sc->next_packet)
 				len += (packet_hdr.next_packet -
 				    sc->next_packet) * ED_PAGE_SIZE;
@@ -834,14 +835,14 @@ ed_rint(struct ed_softc *sc)
 		}
 
 		/*
-		 * Be fairly liberal about what we allow as a "reasonable" length
-		 * so that a [crufty] packet will make it to BPF (and can thus
-		 * be analyzed). Note that all that is really important is that
-		 * we have a length that will fit into one mbuf cluster or less;
-		 * the upper layer protocols can then figure out the length from
-		 * their own length field(s).
-		 * But make sure that we have at least a full ethernet header
-		 * or we would be unable to call ether_input() later.
+		 * Be fairly liberal about what we allow as a "reasonable"
+		 * length so that a [crufty] packet will make it to BPF (and
+		 * can thus be analyzed). Note that all that is really
+		 * important is that we have a length that will fit into one
+		 * mbuf cluster or less; the upper layer protocols can then
+		 * figure out the length from their own length field(s).  But
+		 * make sure that we have at least a full ethernet header or
+		 * we would be unable to call ether_input() later.
 		 */
 		if ((len >= sizeof(struct ed_ring) + ETHER_HDR_LEN) &&
 		    (len <= MCLBYTES) &&

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 02:10:19 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0A475106566C;
	Thu, 26 Mar 2009 02:10:19 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EC3F48FC12;
	Thu, 26 Mar 2009 02:10:18 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2Q2AIAA095934;
	Thu, 26 Mar 2009 02:10:18 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2Q2AICR095933;
	Thu, 26 Mar 2009 02:10:18 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200903260210.n2Q2AICR095933@svn.freebsd.org>
From: Robert Noland 
Date: Thu, 26 Mar 2009 02:10:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190433 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 02:10:19 -0000

Author: rnoland
Date: Thu Mar 26 02:10:18 2009
New Revision: 190433
URL: http://svn.freebsd.org/changeset/base/190433

Log:
  Fix up waiting on vblank again... This reverts a last minute change that
  I made on the last patch, it seems to upset suspend/resume and shutdown.
  
  MFC after:	3 days

Modified:
  head/sys/dev/drm/drm_irq.c

Modified: head/sys/dev/drm/drm_irq.c
==============================================================================
--- head/sys/dev/drm/drm_irq.c	Wed Mar 25 23:20:49 2009	(r190432)
+++ head/sys/dev/drm/drm_irq.c	Thu Mar 26 02:10:18 2009	(r190433)
@@ -463,16 +463,19 @@ int drm_wait_vblank(struct drm_device *d
 	} else {
 		DRM_DEBUG("waiting on vblank count %d, crtc %d\n",
 		    vblwait->request.sequence, crtc);
-		mtx_lock(&dev->irq_lock);
 		dev->vblank[crtc].last = vblwait->request.sequence;
 		for ( ret = 0 ; !ret && !(((drm_vblank_count(dev, crtc) -
 		    vblwait->request.sequence) <= (1 << 23)) ||
 		    !dev->irq_enabled) ; ) {
-			ret = mtx_sleep(&dev->vblank[crtc].queue,
-			    &dev->irq_lock, PCATCH, "vblwtq",
-			    3 * DRM_HZ);
+			mtx_lock(&dev->irq_lock);
+			if (!(((drm_vblank_count(dev, crtc) -
+			    vblwait->request.sequence) <= (1 << 23)) ||
+			    !dev->irq_enabled))
+				ret = mtx_sleep(&dev->vblank[crtc].queue,
+				    &dev->irq_lock, PCATCH, "vblwtq",
+				    3 * DRM_HZ);
+			mtx_unlock(&dev->irq_lock);
 		}
-		mtx_unlock(&dev->irq_lock);
 
 		if (ret != EINTR && ret != ERESTART) {
 			struct timeval now;

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 02:14:31 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 849F4106564A;
	Thu, 26 Mar 2009 02:14:31 +0000 (UTC)
	(envelope-from weongyo.jeong@gmail.com)
Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.230])
	by mx1.freebsd.org (Postfix) with ESMTP id 3B7598FC1A;
	Thu, 26 Mar 2009 02:14:31 +0000 (UTC)
	(envelope-from weongyo.jeong@gmail.com)
Received: by rv-out-0506.google.com with SMTP id l9so544444rvb.43
	for ; Wed, 25 Mar 2009 19:14:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:received:from:date:to:cc
	:subject:message-id:reply-to:references:mime-version:content-type
	:content-disposition:in-reply-to:user-agent:organization
	:x-operation-sytem;
	bh=nfd77SMQlC65z+2F088QuBCcDOI4yLBJ4XJJKOP8rus=;
	b=IkxUrvSF+lCyZEvgac5BUoW9rLWudk7ugpFDBICrjL2arDPfYJAG+fTdWFCFq6r+de
	kES8gX64TpeL/nX0Va7LQI+uPRrSGSbAy9Jtq+ziEjOvA9cffMDm4xcAGkGVgZaN5JfM
	fUsnO388jdQmixiOpKYQux4scP4cl4L/whkkI=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=from:date:to:cc:subject:message-id:reply-to:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent
	:organization:x-operation-sytem;
	b=Ul40FwajYBnW4DqxXzFxq/vno5eLa6si1zZP9rQBLDzB84mLSUH8OhmivhY5dQ971G
	bOqB8hnM4oYvAMpXiVkiZ+MZMJjJ1f7ZAVPa6rHPlzm06cIQXqk5c7FTZOUWpvwoBPJP
	uNpQVFzskOLWMNxMpbayzPCcQXigUMhuP8C/w=
Received: by 10.141.211.5 with SMTP id n5mr153498rvq.106.1238033670903;
	Wed, 25 Mar 2009 19:14:30 -0700 (PDT)
Received: from weongyo ([114.111.62.249])
	by mx.google.com with ESMTPS id g22sm17171879rvb.33.2009.03.25.19.14.28
	(version=SSLv3 cipher=RC4-MD5); Wed, 25 Mar 2009 19:14:30 -0700 (PDT)
Received: by weongyo (sSMTP sendmail emulation);
	Thu, 26 Mar 2009 11:14:26 +0900
From: Weongyo Jeong 
Date: Thu, 26 Mar 2009 11:14:26 +0900
To: Nathan Whitehorn 
Message-ID: <20090326021426.GA19018@weongyo.cdnetworks.kr>
References: <200903250342.n2P3gnxa064756@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200903250342.n2P3gnxa064756@svn.freebsd.org>
User-Agent: Mutt/1.4.2.3i
Organization: CDNetworks.
X-Operation-Sytem: FreeBSD
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r190403 - head/sys/powerpc/powermac
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: Weongyo Jeong 
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 02:14:32 -0000

On Wed, Mar 25, 2009 at 03:42:49AM +0000, Nathan Whitehorn wrote:
> Author: nwhitehorn
> Date: Wed Mar 25 03:42:49 2009
> New Revision: 190403
> URL: http://svn.freebsd.org/changeset/base/190403
> 
> Log:
>   Disable ATA DMA for ATAPI devices for now. Apparently, certain revisions
>   of this controller, in combination with certain ATAPI devices and phases
>   of the moon, will cause DMA operations for ATAPI to fail.
> 
> Modified:
>   head/sys/powerpc/powermac/ata_macio.c
> 
> Modified: head/sys/powerpc/powermac/ata_macio.c
> ==============================================================================
> --- head/sys/powerpc/powermac/ata_macio.c	Wed Mar 25 03:02:03 2009	(r190402)
> +++ head/sys/powerpc/powermac/ata_macio.c	Wed Mar 25 03:42:49 2009	(r190403)
> @@ -259,6 +259,10 @@ ata_macio_setmode(device_t parent, devic
>  
>  	mode = ata_limit_mode(dev, mode, sc->max_mode);
>  
> +	/* XXX Some controllers don't work correctly with ATAPI DMA */
> +	if (atadev->param.config & ATA_PROTO_ATAPI)
> +		mode = ata_limit_mode(dev, mode, ATA_PIO_MAX);
> +
>  	if (ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_SETXFER, 0, mode))
>  		return;

With this commit my iBook G4 boots successfully without setting
`hw.ata.atapi_dma=0'.  Thanks!  It'd be best if I can use ATAPI DMA
soon.

regards,
Weongyo Jeong


From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 02:59:11 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A50521065673;
	Thu, 26 Mar 2009 02:59:11 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 87D898FC19;
	Thu, 26 Mar 2009 02:59:11 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2Q2xBwa096883;
	Thu, 26 Mar 2009 02:59:11 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2Q2xBxQ096882;
	Thu, 26 Mar 2009 02:59:11 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <200903260259.n2Q2xBxQ096882@svn.freebsd.org>
From: Weongyo Jeong 
Date: Thu, 26 Mar 2009 02:59:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190434 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 02:59:12 -0000

Author: weongyo
Date: Thu Mar 26 02:59:10 2009
New Revision: 190434
URL: http://svn.freebsd.org/changeset/base/190434

Log:
  The malo(4) device driver first appeared in FreeBSD 7.1 not 8.0.
  
  Reported by:	John 
  MFC after:	3 days

Modified:
  head/share/man/man4/malo.4

Modified: head/share/man/man4/malo.4
==============================================================================
--- head/share/man/man4/malo.4	Thu Mar 26 02:10:18 2009	(r190433)
+++ head/share/man/man4/malo.4	Thu Mar 26 02:59:10 2009	(r190434)
@@ -121,4 +121,4 @@ ifconfig wlan create wlandev malo0 ssid 
 The
 .Nm
 device driver first appeared in
-.Fx 8.0 .
+.Fx 7.1 .

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 04:16:41 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4987B106564A;
	Thu, 26 Mar 2009 04:16:41 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 37AD88FC1A;
	Thu, 26 Mar 2009 04:16:41 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2Q4Gek9098561;
	Thu, 26 Mar 2009 04:16:40 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2Q4GeOp098560;
	Thu, 26 Mar 2009 04:16:40 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <200903260416.n2Q4GeOp098560@svn.freebsd.org>
From: Weongyo Jeong 
Date: Thu, 26 Mar 2009 04:16:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190435 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 04:16:41 -0000

Author: weongyo
Date: Thu Mar 26 04:16:40 2009
New Revision: 190435
URL: http://svn.freebsd.org/changeset/base/190435

Log:
  bwi(4) and mwl(4) doesn't exist at CURRENT.

Modified:
  head/share/man/man4/wlan.4

Modified: head/share/man/man4/wlan.4
==============================================================================
--- head/share/man/man4/wlan.4	Thu Mar 26 02:59:10 2009	(r190434)
+++ head/share/man/man4/wlan.4	Thu Mar 26 04:16:40 2009	(r190435)
@@ -164,11 +164,9 @@ was used to be compatible with
 .Sh SEE ALSO
 .Xr an 4 ,
 .Xr ath 4 ,
-.Xr bwi 4 ,
 .Xr ipw 4 ,
 .Xr iwi 4 ,
 .Xr iwn 4 ,
-.Xr mwl 4 ,
 .Xr netintro 4 ,
 .Xr ral 4 ,
 .Xr rum 4 ,

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 04:17:35 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D89C5106564A;
	Thu, 26 Mar 2009 04:17:35 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ACB4D8FC0C;
	Thu, 26 Mar 2009 04:17:35 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2Q4HZxr098613;
	Thu, 26 Mar 2009 04:17:35 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2Q4HZOr098612;
	Thu, 26 Mar 2009 04:17:35 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <200903260417.n2Q4HZOr098612@svn.freebsd.org>
From: Weongyo Jeong 
Date: Thu, 26 Mar 2009 04:17:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190436 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 04:17:36 -0000

Author: weongyo
Date: Thu Mar 26 04:17:35 2009
New Revision: 190436
URL: http://svn.freebsd.org/changeset/base/190436

Log:
  adds malo(4).

Modified:
  head/share/man/man4/wlan.4

Modified: head/share/man/man4/wlan.4
==============================================================================
--- head/share/man/man4/wlan.4	Thu Mar 26 04:16:40 2009	(r190435)
+++ head/share/man/man4/wlan.4	Thu Mar 26 04:17:35 2009	(r190436)
@@ -167,6 +167,7 @@ was used to be compatible with
 .Xr ipw 4 ,
 .Xr iwi 4 ,
 .Xr iwn 4 ,
+.Xr malo 4 ,
 .Xr netintro 4 ,
 .Xr ral 4 ,
 .Xr rum 4 ,

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 06:12:04 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A9E6D106566B;
	Thu, 26 Mar 2009 06:12:04 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 97FC78FC0C;
	Thu, 26 Mar 2009 06:12:04 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2Q6C4iB000789;
	Thu, 26 Mar 2009 06:12:04 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2Q6C4wR000786;
	Thu, 26 Mar 2009 06:12:04 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <200903260612.n2Q6C4wR000786@svn.freebsd.org>
From: Weongyo Jeong 
Date: Thu, 26 Mar 2009 06:12:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190437 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 06:12:05 -0000

Author: weongyo
Date: Thu Mar 26 06:12:04 2009
New Revision: 190437
URL: http://svn.freebsd.org/changeset/base/190437

Log:
  bump date.
  
  Pointed by:	yongari

Modified:
  head/share/man/man4/malo.4
  head/share/man/man4/wlan.4

Modified: head/share/man/man4/malo.4
==============================================================================
--- head/share/man/man4/malo.4	Thu Mar 26 04:17:35 2009	(r190436)
+++ head/share/man/man4/malo.4	Thu Mar 26 06:12:04 2009	(r190437)
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"/
-.Dd April 13, 2008
+.Dd March 26, 2009
 .Dt MALO 4
 .Os
 .Sh NAME

Modified: head/share/man/man4/wlan.4
==============================================================================
--- head/share/man/man4/wlan.4	Thu Mar 26 04:17:35 2009	(r190436)
+++ head/share/man/man4/wlan.4	Thu Mar 26 06:12:04 2009	(r190437)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 12, 2008
+.Dd March 26, 2009
 .Dt WLAN 4
 .Os
 .Sh NAME

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 10:22:41 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 40E5D1065672;
	Thu, 26 Mar 2009 10:22:41 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2F2588FC14;
	Thu, 26 Mar 2009 10:22:41 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2QAMeqk014882;
	Thu, 26 Mar 2009 10:22:40 GMT (envelope-from luigi@svn.freebsd.org)
Received: (from luigi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2QAMe1l014881;
	Thu, 26 Mar 2009 10:22:40 GMT (envelope-from luigi@svn.freebsd.org)
Message-Id: <200903261022.n2QAMe1l014881@svn.freebsd.org>
From: Luigi Rizzo 
Date: Thu, 26 Mar 2009 10:22:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190438 - head/release/picobsd/floppy.tree/etc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 10:22:41 -0000

Author: luigi
Date: Thu Mar 26 10:22:40 2009
New Revision: 190438
URL: http://svn.freebsd.org/changeset/base/190438

Log:
  there is no dev_mkdb anymore

Modified:
  head/release/picobsd/floppy.tree/etc/rc1

Modified: head/release/picobsd/floppy.tree/etc/rc1
==============================================================================
--- head/release/picobsd/floppy.tree/etc/rc1	Thu Mar 26 06:12:04 2009	(r190437)
+++ head/release/picobsd/floppy.tree/etc/rc1	Thu Mar 26 10:22:40 2009	(r190438)
@@ -45,7 +45,6 @@ mount -a -t nfs
 [ -n "$network_pass2_done" ] && network_pass3
 
 pwd_mkdb -p ./master.passwd
-dev_mkdb
 
 [ -f /etc/syslog.conf -a -f /stand/syslogd ] && \
 	{ echo "Starting syslogd."; syslogd ${syslogd_flags} ; }

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 14:47:03 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 28EBD1065680;
	Thu, 26 Mar 2009 14:47:03 +0000 (UTC)
	(envelope-from chris@hitnet.RWTH-Aachen.DE)
Received: from mta-1.ms.rz.rwth-aachen.de (mta-1.ms.rz.RWTH-Aachen.DE
	[134.130.7.72])
	by mx1.freebsd.org (Postfix) with ESMTP id C28B98FC08;
	Thu, 26 Mar 2009 14:47:02 +0000 (UTC)
	(envelope-from chris@hitnet.RWTH-Aachen.DE)
MIME-version: 1.0
Received: from ironport-out-1.rz.rwth-aachen.de ([134.130.5.40])
	by mta-1.ms.rz.RWTH-Aachen.de
	(Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008))
	with ESMTP id <0KH4001YKACB4MB0@mta-1.ms.rz.RWTH-Aachen.de>; Thu,
	26 Mar 2009 15:16:59 +0100 (CET)
X-IronPort-AV: E=Sophos;i="4.38,426,1233529200";   d="scan'208";a="6132528"
Received: from smarthost-2.ms.rz.rwth-aachen.de (HELO smarthost.rwth-aachen.de)
	([134.130.7.90]) by ironport-in-1.rz.rwth-aachen.de with ESMTP; Thu,
	26 Mar 2009 15:16:59 +0100
Received: from bigboss.hitnet.rwth-aachen.de
	(bigspace.hitnet.RWTH-Aachen.DE [137.226.181.2])	by
	smarthost.rwth-aachen.de
	(8.13.8+Sun/8.13.8/1) with ESMTP id n2QEGxi7004976; Thu,
	26 Mar 2009 15:16:59 +0100 (CET)
Received: from haakonia.hitnet.rwth-aachen.de ([137.226.181.92])
	by bigboss.hitnet.rwth-aachen.de with esmtps
	(TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32)	(Exim 4.63)
	(envelope-from )	id 1LmqOB-0007K6-JQ; Thu,
	26 Mar 2009 15:16:59 +0100
Received: by haakonia.hitnet.rwth-aachen.de (Postfix, from userid 1001)
	id 564B93F41B; Thu, 26 Mar 2009 15:16:59 +0100 (CET)
Date: Thu, 26 Mar 2009 15:16:59 +0100
From: Christian Brueffer 
To: Alexander Leidinger 
Message-id: <20090326141659.GA1268@haakonia.hitnet.RWTH-Aachen.DE>
References: <200903161633.n2GGX966065825@svn.freebsd.org>
	<49C4CCC1.6010704@gmx.de>
	<20090325133915.30120cb1ea7kla0o@webmail.leidinger.net>
Content-type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary=ReaqsoxgOBHFXBhH
Content-disposition: inline
In-reply-to: <20090325133915.30120cb1ea7kla0o@webmail.leidinger.net>
X-Operating-System: FreeBSD 6.4-STABLE
X-PGP-Key: http://people.FreeBSD.org/~brueffer/brueffer.key.asc
X-PGP-Fingerprint: A5C8 2099 19FF AACA F41B  B29B 6C76 178C A0ED 982D
User-Agent: Mutt/1.5.11
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	Christoph Mallon ,
	Gabor Kovesdan , src-committers@FreeBSD.org
Subject: Re: svn commit: r189883 - head/lib/libc/nls
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 14:47:05 -0000


--ReaqsoxgOBHFXBhH
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Mar 25, 2009 at 01:39:15PM +0100, Alexander Leidinger wrote:
> Quoting Christoph Mallon  (from Sat, 21 Mar =20
> 2009 12:17:21 +0100):
>=20
> >Gabor Kovesdan schrieb:
> [...]
> >>Modified: head/lib/libc/nls/de_DE.ISO8859-1.msg
>=20
> [improvement suggestions]
>=20
> I just committed an update to it, it should be better now. People =20
> which still think there's room for improvement are welcome to send a =20
> PR with a patch.
>=20

Thanks for taking care of this, Alex!

- Christian

--=20
Christian Brueffer	chris@unixpages.org	brueffer@FreeBSD.org
GPG Key:	 http://people.freebsd.org/~brueffer/brueffer.key.asc
GPG Fingerprint: A5C8 2099 19FF AACA F41B  B29B 6C76 178C A0ED 982D

--ReaqsoxgOBHFXBhH
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (FreeBSD)

iD8DBQFJy45bbHYXjKDtmC0RAhNmAJ9LuaTWbhWm5CTZhPw/+XUCywvVQACgmK8F
l0mp7K3FinqvluZLyd7EqOA=
=dTAj
-----END PGP SIGNATURE-----

--ReaqsoxgOBHFXBhH--

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 16:42:24 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C2C4F106566B;
	Thu, 26 Mar 2009 16:42:24 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B12338FC14;
	Thu, 26 Mar 2009 16:42:24 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2QGgOl1023042;
	Thu, 26 Mar 2009 16:42:24 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2QGgOTu023041;
	Thu, 26 Mar 2009 16:42:24 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <200903261642.n2QGgOTu023041@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Thu, 26 Mar 2009 16:42:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190443 - head/sys/geom/part
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 16:42:25 -0000

Author: marcel
Date: Thu Mar 26 16:42:24 2009
New Revision: 190443
URL: http://svn.freebsd.org/changeset/base/190443

Log:
  Change the priority from high to normal. This makes sure that
  the BSD or GPT schemes can take precedence as appropriate.

Modified:
  head/sys/geom/part/g_part_ebr.c

Modified: head/sys/geom/part/g_part_ebr.c
==============================================================================
--- head/sys/geom/part/g_part_ebr.c	Thu Mar 26 14:20:16 2009	(r190442)
+++ head/sys/geom/part/g_part_ebr.c	Thu Mar 26 16:42:24 2009	(r190443)
@@ -420,7 +420,7 @@ g_part_ebr_probe(struct g_part_table *ta
 			goto out;
 	}
 
-	res = G_PART_PROBE_PRI_HIGH;
+	res = G_PART_PROBE_PRI_NORM;
 
  out:
 	g_free(buf);

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 17:14:23 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 81BE81065753;
	Thu, 26 Mar 2009 17:14:23 +0000 (UTC)
	(envelope-from ambrisko@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6B5668FC1B;
	Thu, 26 Mar 2009 17:14:23 +0000 (UTC)
	(envelope-from ambrisko@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2QHENSi023740;
	Thu, 26 Mar 2009 17:14:23 GMT
	(envelope-from ambrisko@svn.freebsd.org)
Received: (from ambrisko@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2QHENQ2023732;
	Thu, 26 Mar 2009 17:14:23 GMT
	(envelope-from ambrisko@svn.freebsd.org)
Message-Id: <200903261714.n2QHENQ2023732@svn.freebsd.org>
From: Doug Ambrisko 
Date: Thu, 26 Mar 2009 17:14:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190445 - in head/sys: amd64/linux32 compat/linprocfs
	compat/linux conf dev/ipmi modules/ipmi modules/linprocfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 17:14:26 -0000

Author: ambrisko
Date: Thu Mar 26 17:14:22 2009
New Revision: 190445
URL: http://svn.freebsd.org/changeset/base/190445

Log:
  Add stuff to support upcoming BMC/IPMI flashing of newer Dell machine
  via the Linux tool.
       -  Add Linux shim to ipmi(4)
       -  Create a partitions file to linprocfs to make Linux fdisk see
          disks.  This file is dynamic so we can see disks come and go.
       -  Convert msdosfs to vfat in mtab since Linux uses that for
          msdosfs.
       -  In the Linux mount path convert vfat passed in to msdosfs
          so Linux mount works on FreeBSD.  Note that tasting works
          so that if da0 is a msdos file system
                  /compat/linux/bin/mount /dev/da0 /mnt
          works.
       -  fix a 64it bug for l_off_t.
  Grabing sh, mount, fdisk, df from Linux, creating a symlink of mtab to
  /compat/linux/etc/mtab and then some careful unpacking of the Linux bmc
  update tool and hacking makes it work on newer Dell boxes.  Note, probably
  if you can't figure out how to do this, then you probably shouldn't be
  doing it :-)

Added:
  head/sys/dev/ipmi/ipmi_linux.c   (contents, props changed)
Modified:
  head/sys/amd64/linux32/linux.h
  head/sys/compat/linprocfs/linprocfs.c
  head/sys/compat/linux/linux_file.c
  head/sys/conf/files.amd64
  head/sys/conf/files.i386
  head/sys/modules/ipmi/Makefile
  head/sys/modules/linprocfs/Makefile

Modified: head/sys/amd64/linux32/linux.h
==============================================================================
--- head/sys/amd64/linux32/linux.h	Thu Mar 26 17:04:08 2009	(r190444)
+++ head/sys/amd64/linux32/linux.h	Thu Mar 26 17:14:22 2009	(r190445)
@@ -79,7 +79,7 @@ typedef l_ulong		l_ino_t;
 typedef l_int		l_key_t;
 typedef l_longlong	l_loff_t;
 typedef l_ushort	l_mode_t;
-typedef l_long		l_off_t;
+typedef l_ulong		l_off_t;
 typedef l_int		l_pid_t;
 typedef l_uint		l_size_t;
 typedef l_long		l_suseconds_t;

Modified: head/sys/compat/linprocfs/linprocfs.c
==============================================================================
--- head/sys/compat/linprocfs/linprocfs.c	Thu Mar 26 17:04:08 2009	(r190444)
+++ head/sys/compat/linprocfs/linprocfs.c	Thu Mar 26 17:14:22 2009	(r190445)
@@ -75,6 +75,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -90,6 +91,9 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#include 
+#include 
+
 #if defined(__i386__) || defined(__amd64__)
 #include 
 #include 
@@ -359,6 +363,9 @@ linprocfs_domtab(PFS_FILL_ARGS)
 			sbuf_printf(sb, "/sys %s sysfs %s", mntto,
 			    mp->mnt_stat.f_flags & MNT_RDONLY ? "ro" : "rw");
 		} else {
+			/* For Linux msdosfs is called vfat */
+			if (strcmp(fstype, "msdosfs") == 0)
+				fstype = "vfat";
 			sbuf_printf(sb, "%s %s %s %s", mntfrom, mntto, fstype,
 			    mp->mnt_stat.f_flags & MNT_RDONLY ? "ro" : "rw");
 		}
@@ -383,6 +390,69 @@ linprocfs_domtab(PFS_FILL_ARGS)
 }
 
 /*
+ * Filler function for proc/partitions
+ *
+ */
+static int
+linprocfs_dopartitions(PFS_FILL_ARGS)
+{
+	struct g_class *cp;
+	struct g_geom *gp;
+	struct g_provider *pp;
+	struct nameidata nd;
+	const char *lep;
+	char  *dlep, *flep;
+	size_t lep_len;
+	int error;
+	int major, minor;
+
+	/* resolve symlinks etc. in the emulation tree prefix */
+	NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, linux_emul_path, td);
+	flep = NULL;
+	error = namei(&nd);
+	lep = linux_emul_path;
+	if (error == 0) {
+		if (vn_fullpath(td, nd.ni_vp, &dlep, &flep) == 0)
+			lep = dlep;
+		vrele(nd.ni_vp);
+		VFS_UNLOCK_GIANT(NDHASGIANT(&nd));
+	}
+	lep_len = strlen(lep);
+
+	g_topology_lock();
+	error = 0;
+	sbuf_printf(sb, "major minor  #blocks  name rio rmerge rsect "
+	    "ruse wio wmerge wsect wuse running use aveq\n");
+
+	LIST_FOREACH(cp, &g_classes, class) {
+		if (strcmp(cp->name, "DISK") == 0 ||
+		    strcmp(cp->name, "PART") == 0)
+			LIST_FOREACH(gp, &cp->geom, geom) {
+				LIST_FOREACH(pp, &gp->provider, provider) {
+					if (linux_driver_get_major_minor(
+					    pp->name, &major, &minor) != 0) {
+						major = 0;
+						minor = 0;
+					}
+					sbuf_printf(sb, "%d %d %lld %s "
+					    "%d %d %d %d %d "
+					     "%d %d %d %d %d %d\n",
+					     major, minor,
+					     (long long)pp->mediasize, pp->name,
+					     0, 0, 0, 0, 0,
+					     0, 0, 0, 0, 0, 0);
+				}
+			}
+	}
+	g_topology_unlock();
+
+	if (flep != NULL)
+		free(flep, M_TEMP);
+	return (error);
+}
+
+
+/*
  * Filler function for proc/stat
  */
 static int
@@ -1206,6 +1276,8 @@ linprocfs_init(PFS_INIT_ARGS)
 	    NULL, NULL, NULL, PFS_RD);
 	pfs_create_file(root, "mtab", &linprocfs_domtab,
 	    NULL, NULL, NULL, PFS_RD);
+	pfs_create_file(root, "partitions", &linprocfs_dopartitions,
+	    NULL, NULL, NULL, PFS_RD);
 	pfs_create_link(root, "self", &procfs_docurproc,
 	    NULL, NULL, NULL, 0);
 	pfs_create_file(root, "stat", &linprocfs_dostat,

Modified: head/sys/compat/linux/linux_file.c
==============================================================================
--- head/sys/compat/linux/linux_file.c	Thu Mar 26 17:04:08 2009	(r190444)
+++ head/sys/compat/linux/linux_file.c	Thu Mar 26 17:14:22 2009	(r190445)
@@ -1109,6 +1109,9 @@ linux_mount(struct thread *td, struct li
 	} else if (strcmp(fstypename, "proc") == 0) {
 		strcpy(fstypename, "linprocfs");
 		fsdata = NULL;
+	} else if (strcmp(fstypename, "vfat") == 0) {
+		strcpy(fstypename, "msdosfs");
+		fsdata = NULL;
 	} else {
 		return (ENODEV);
 	}
@@ -1135,6 +1138,12 @@ linux_mount(struct thread *td, struct li
 			"fstype", fstypename,
 			"fspath", mntonname,
 			NULL);
+	} else if (strcmp(fstypename, "msdosfs") == 0) {
+		error = kernel_vmount(fsflags,
+			"fstype", fstypename,
+			"fspath", mntonname,
+			"from", mntfromname,
+			NULL);
 	} else
 		error = EOPNOTSUPP;
 	return (error);

Modified: head/sys/conf/files.amd64
==============================================================================
--- head/sys/conf/files.amd64	Thu Mar 26 17:04:08 2009	(r190444)
+++ head/sys/conf/files.amd64	Thu Mar 26 17:14:22 2009	(r190445)
@@ -183,6 +183,7 @@ dev/ipmi/ipmi_smbus.c		optional	ipmi smb
 dev/ipmi/ipmi_smbios.c		optional	ipmi
 dev/ipmi/ipmi_ssif.c		optional	ipmi smbus
 dev/ipmi/ipmi_pci.c		optional	ipmi pci
+dev/ipmi/ipmi_linux.c		optional	ipmi linux_compat32
 dev/fdc/fdc.c			optional	fdc
 dev/fdc/fdc_acpi.c		optional	fdc
 dev/fdc/fdc_isa.c		optional	fdc isa

Modified: head/sys/conf/files.i386
==============================================================================
--- head/sys/conf/files.i386	Thu Mar 26 17:04:08 2009	(r190444)
+++ head/sys/conf/files.i386	Thu Mar 26 17:14:22 2009	(r190445)
@@ -196,6 +196,7 @@ dev/ipmi/ipmi_smbus.c		optional ipmi smb
 dev/ipmi/ipmi_smbios.c		optional ipmi
 dev/ipmi/ipmi_ssif.c		optional ipmi smbus
 dev/ipmi/ipmi_pci.c		optional ipmi pci
+dev/ipmi/ipmi_linux.c		optional ipmi linux_compat
 dev/kbd/kbd.c			optional atkbd | sc | ukbd | usb2_input_kbd
 dev/le/if_le_isa.c		optional le isa
 dev/mem/memutil.c		optional mem

Added: head/sys/dev/ipmi/ipmi_linux.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/ipmi/ipmi_linux.c	Thu Mar 26 17:14:22 2009	(r190445)
@@ -0,0 +1,113 @@
+/*-
+ * Copyright (c) 2009 IronPort Systems Inc. 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+/*
+ * Linux ioctl handler for the ipmi device driver
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#ifdef __amd64__
+#include 
+#include 
+#else
+#include 
+#include 
+#endif
+#include 
+#include 
+#include 
+
+/* There are multiple ioctl number ranges that need to be handled */
+#define IPMI_LINUX_IOCTL_MIN  0x690b
+#define IPMI_LINUX_IOCTL_MAX  0x6915
+
+/* Linux versions of ioctl's */
+#define L_IPMICTL_RECEIVE_MSG_TRUNC       _IOWR(IPMI_IOC_MAGIC, 11, struct ipmi_recv)
+#define L_IPMICTL_RECEIVE_MSG             _IOWR(IPMI_IOC_MAGIC, 12, struct ipmi_recv)
+#define L_IPMICTL_SEND_COMMAND            _IOW(IPMI_IOC_MAGIC, 13, struct ipmi_req)
+#define L_IPMICTL_REGISTER_FOR_CMD        _IOW(IPMI_IOC_MAGIC, 14, struct ipmi_cmdspec)
+#define L_IPMICTL_UNREGISTER_FOR_CMD      _IOW(IPMI_IOC_MAGIC, 15, struct ipmi_cmdspec)
+#define L_IPMICTL_SET_GETS_EVENTS_CMD     _IOW(IPMI_IOC_MAGIC, 16, int)
+#define L_IPMICTL_SET_MY_ADDRESS_CMD      _IOW(IPMI_IOC_MAGIC, 17, unsigned int)
+#define L_IPMICTL_GET_MY_ADDRESS_CMD      _IOW(IPMI_IOC_MAGIC, 18, unsigned int)
+#define L_IPMICTL_SET_MY_LUN_CMD          _IOW(IPMI_IOC_MAGIC, 19, unsigned int)
+#define L_IPMICTL_GET_MY_LUN_CMD          _IOW(IPMI_IOC_MAGIC, 20, unsigned int)
+
+static linux_ioctl_function_t ipmi_linux_ioctl;
+static struct linux_ioctl_handler ipmi_linux_handler = {ipmi_linux_ioctl,
+						       IPMI_LINUX_IOCTL_MIN,
+						       IPMI_LINUX_IOCTL_MAX};
+
+SYSINIT  (ipmi_linux_register,   SI_SUB_KLD, SI_ORDER_MIDDLE,
+	  linux_ioctl_register_handler, &ipmi_linux_handler);
+SYSUNINIT(ipmi_linux_unregister, SI_SUB_KLD, SI_ORDER_MIDDLE,
+	  linux_ioctl_unregister_handler, &ipmi_linux_handler);
+
+static int
+ipmi_linux_modevent(module_t mod, int type, void *data)
+{
+	/* Do we care about any specific load/unload actions? */
+	return (0);
+}
+
+DEV_MODULE(ipmi_linux, ipmi_linux_modevent, NULL);
+MODULE_DEPEND(ipmi_linux, linux, 1, 1, 1);
+
+static int
+ipmi_linux_ioctl(struct thread *td, struct linux_ioctl_args *args)
+{
+	struct file *fp;
+	u_long cmd;
+	int error;
+
+	if ((error = fget(td, args->fd, &fp)) != 0)
+		return (error);
+	cmd = args->cmd;
+
+	switch(cmd) {
+	case L_IPMICTL_GET_MY_ADDRESS_CMD:
+		cmd = IPMICTL_GET_MY_ADDRESS_CMD;
+		break;
+	case L_IPMICTL_GET_MY_LUN_CMD:
+		cmd = IPMICTL_GET_MY_LUN_CMD;
+		break;
+	}
+	/*
+	 * Pass the ioctl off to our standard handler.
+	 */
+	error = (fo_ioctl(fp, cmd, (caddr_t)args->arg, td->td_ucred, td));
+	fdrop(fp, td);
+	return (error);
+}

Modified: head/sys/modules/ipmi/Makefile
==============================================================================
--- head/sys/modules/ipmi/Makefile	Thu Mar 26 17:04:08 2009	(r190444)
+++ head/sys/modules/ipmi/Makefile	Thu Mar 26 17:14:22 2009	(r190445)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+SUBDIR+= ipmi_linux
+
 .PATH: ${.CURDIR}/../../dev/ipmi
 
 # XXX - ipmi_smbus and ipmi_ssif depend on smbus

Modified: head/sys/modules/linprocfs/Makefile
==============================================================================
--- head/sys/modules/linprocfs/Makefile	Thu Mar 26 17:04:08 2009	(r190444)
+++ head/sys/modules/linprocfs/Makefile	Thu Mar 26 17:14:22 2009	(r190445)
@@ -4,6 +4,7 @@
 
 KMOD=	linprocfs
 SRCS=	vnode_if.h \
+	device_if.h bus_if.h \
 	linprocfs.c \
 	opt_compat.h \
 	opt_route.h

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 17:36:20 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1E8D51065672;
	Thu, 26 Mar 2009 17:36:20 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0CD918FC19;
	Thu, 26 Mar 2009 17:36:20 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2QHaJdg024250;
	Thu, 26 Mar 2009 17:36:19 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2QHaJhZ024249;
	Thu, 26 Mar 2009 17:36:19 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200903261736.n2QHaJhZ024249@svn.freebsd.org>
From: Warner Losh 
Date: Thu, 26 Mar 2009 17:36:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190446 - head/sys/dev/ed
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 17:36:21 -0000

Author: imp
Date: Thu Mar 26 17:36:19 2009
New Revision: 190446
URL: http://svn.freebsd.org/changeset/base/190446

Log:
  Allow the attach routine to fail gracefully and not panic the system.

Modified:
  head/sys/dev/ed/if_ed.c

Modified: head/sys/dev/ed/if_ed.c
==============================================================================
--- head/sys/dev/ed/if_ed.c	Thu Mar 26 17:14:22 2009	(r190445)
+++ head/sys/dev/ed/if_ed.c	Thu Mar 26 17:36:19 2009	(r190446)
@@ -389,7 +389,8 @@ ed_detach(device_t dev)
 		callout_drain(&sc->tick_ch);
 		ether_ifdetach(ifp);
 	}
-	bus_teardown_intr(dev, sc->irq_res, sc->irq_handle);
+	if (sc->irq_res != NULL && sc->irq_handle)
+		bus_teardown_intr(dev, sc->irq_res, sc->irq_handle);
 	ed_release_resources(dev);
 	ED_LOCK_DESTROY(sc);
 	bus_generic_detach(dev);

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 18:07:13 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CDE79106566C;
	Thu, 26 Mar 2009 18:07:13 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BAB478FC1A;
	Thu, 26 Mar 2009 18:07:13 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2QI7Dct024861;
	Thu, 26 Mar 2009 18:07:13 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2QI7DmB024860;
	Thu, 26 Mar 2009 18:07:13 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200903261807.n2QI7DmB024860@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 26 Mar 2009 18:07:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190447 - in head/sys: amd64/amd64 i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 18:07:14 -0000

Author: kib
Date: Thu Mar 26 18:07:13 2009
New Revision: 190447
URL: http://svn.freebsd.org/changeset/base/190447

Log:
  Convert gdt_segs and ldt_segs initialization to C99 style.
  
  Reviewed by:	jhb

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/i386/i386/machdep.c

Modified: head/sys/amd64/amd64/machdep.c
==============================================================================
--- head/sys/amd64/amd64/machdep.c	Thu Mar 26 17:36:19 2009	(r190446)
+++ head/sys/amd64/amd64/machdep.c	Thu Mar 26 18:07:13 2009	(r190447)
@@ -818,87 +818,86 @@ struct amd64tss common_tss[MAXCPU];
 /* software prototypes -- in more palatable form */
 struct soft_segment_descriptor gdt_segs[] = {
 /* GNULL_SEL	0 Null Descriptor */
-{	0x0,			/* segment base address  */
-	0x0,			/* length */
-	0,			/* segment type */
-	0,			/* segment descriptor priority level */
-	0,			/* segment descriptor present */
-	0,			/* long */
-	0,			/* default 32 vs 16 bit size */
-	0  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0x0,
+	.ssd_type = 0,
+	.ssd_dpl = 0,
+	.ssd_p = 0,
+	.ssd_long = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 0		},
 /* GCODE_SEL	1 Code Descriptor for kernel */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMERA,		/* segment type */
-	SEL_KPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	1,			/* long */
-	0,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMERA,
+	.ssd_dpl = SEL_KPL,
+	.ssd_p = 1,
+	.ssd_long = 1,
+	.ssd_def32 = 0,
+	.ssd_gran = 1		},
 /* GDATA_SEL	2 Data Descriptor for kernel */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMRWA,		/* segment type */
-	SEL_KPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	1,			/* long */
-	0,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMRWA,
+	.ssd_dpl = SEL_KPL,
+	.ssd_p = 1,
+	.ssd_long = 1,
+	.ssd_def32 = 0,
+	.ssd_gran = 1		},
 /* GUCODE32_SEL	3 32 bit Code Descriptor for user */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMERA,		/* segment type */
-	SEL_UPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0,			/* long */
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMERA,
+	.ssd_dpl = SEL_UPL,
+	.ssd_p = 1,
+	.ssd_long = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 /* GUDATA_SEL	4 32/64 bit Data Descriptor for user */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMRWA,		/* segment type */
-	SEL_UPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0,			/* long */
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMRWA,
+	.ssd_dpl = SEL_UPL,
+	.ssd_p = 1,
+	.ssd_long = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 /* GUCODE_SEL	5 64 bit Code Descriptor for user */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMERA,		/* segment type */
-	SEL_UPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	1,			/* long */
-	0,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMERA,
+	.ssd_dpl = SEL_UPL,
+	.ssd_p = 1,
+	.ssd_long = 1,
+	.ssd_def32 = 0,
+	.ssd_gran = 1		},
 /* GPROC0_SEL	6 Proc 0 Tss Descriptor */
-{
-	0x0,			/* segment base address */
-	sizeof(struct amd64tss)-1,/* length */
-	SDT_SYSTSS,		/* segment type */
-	SEL_KPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0,			/* long */
-	0,			/* unused - default 32 vs 16 bit size */
-	0  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = sizeof(struct amd64tss)-1,
+	.ssd_type = SDT_SYSTSS,
+	.ssd_dpl = SEL_KPL,
+	.ssd_p = 1,
+	.ssd_long = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 0		},
 /* Actually, the TSS is a system descriptor which is double size */
-{	0x0,			/* segment base address  */
-	0x0,			/* length */
-	0,			/* segment type */
-	0,			/* segment descriptor priority level */
-	0,			/* segment descriptor present */
-	0,			/* long */
-	0,			/* default 32 vs 16 bit size */
-	0  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0x0,
+	.ssd_type = 0,
+	.ssd_dpl = 0,
+	.ssd_p = 0,
+	.ssd_long = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 0		},
 /* GUGS32_SEL	8 32 bit GS Descriptor for user */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMRWA,		/* segment type */
-	SEL_UPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0,			/* long */
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMRWA,
+	.ssd_dpl = SEL_UPL,
+	.ssd_p = 1,
+	.ssd_long = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 };
 
 void

Modified: head/sys/i386/i386/machdep.c
==============================================================================
--- head/sys/i386/i386/machdep.c	Thu Mar 26 17:36:19 2009	(r190446)
+++ head/sys/i386/i386/machdep.c	Thu Mar 26 18:07:13 2009	(r190447)
@@ -1515,236 +1515,236 @@ extern  vm_offset_t	proc0kstack;
  */
 struct soft_segment_descriptor gdt_segs[] = {
 /* GNULL_SEL	0 Null Descriptor */
-{	0x0,			/* segment base address  */
-	0x0,			/* length */
-	0,			/* segment type */
-	SEL_KPL,		/* segment descriptor priority level */
-	0,			/* segment descriptor present */
-	0, 0,
-	0,			/* default 32 vs 16 bit size */
-	0  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0x0,
+	.ssd_type = 0,
+	.ssd_dpl = SEL_KPL,
+	.ssd_p = 0,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 0		},
 /* GPRIV_SEL	1 SMP Per-Processor Private Data Descriptor */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMRWA,		/* segment type */
-	SEL_KPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMRWA,
+	.ssd_dpl = SEL_KPL,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 /* GUFS_SEL	2 %fs Descriptor for user */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMRWA,		/* segment type */
-	SEL_UPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMRWA,
+	.ssd_dpl = SEL_UPL,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 /* GUGS_SEL	3 %gs Descriptor for user */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMRWA,		/* segment type */
-	SEL_UPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMRWA,
+	.ssd_dpl = SEL_UPL,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 /* GCODE_SEL	4 Code Descriptor for kernel */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMERA,		/* segment type */
-	SEL_KPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMERA,
+	.ssd_dpl = SEL_KPL,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 /* GDATA_SEL	5 Data Descriptor for kernel */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMRWA,		/* segment type */
-	SEL_KPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMRWA,
+	.ssd_dpl = SEL_KPL,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 /* GUCODE_SEL	6 Code Descriptor for user */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMERA,		/* segment type */
-	SEL_UPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMERA,
+	.ssd_dpl = SEL_UPL,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 /* GUDATA_SEL	7 Data Descriptor for user */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMRWA,		/* segment type */
-	SEL_UPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMRWA,
+	.ssd_dpl = SEL_UPL,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 /* GBIOSLOWMEM_SEL 8 BIOS access to realmode segment 0x40, must be #8 in GDT */
-{	0x400,			/* segment base address */
-	0xfffff,		/* length */
-	SDT_MEMRWA,		/* segment type */
-	SEL_KPL,			/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x400,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMRWA,
+	.ssd_dpl = SEL_KPL,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 #ifndef XEN
 /* GPROC0_SEL	9 Proc 0 Tss Descriptor */
 {
-	0x0,			/* segment base address */
-	sizeof(struct i386tss)-1,/* length  */
-	SDT_SYS386TSS,		/* segment type */
-	0,			/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	0,			/* unused - default 32 vs 16 bit size */
-	0  			/* limit granularity (byte/page units)*/ },
+	.ssd_base = 0x0,
+	.ssd_limit = sizeof(struct i386tss)-1,
+	.ssd_type = SDT_SYS386TSS,
+	.ssd_dpl = 0,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 0		},
 /* GLDT_SEL	10 LDT Descriptor */
-{	(int) ldt,		/* segment base address  */
-	sizeof(ldt)-1,		/* length - all address space */
-	SDT_SYSLDT,		/* segment type */
-	SEL_UPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	0,			/* unused - default 32 vs 16 bit size */
-	0  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = (int) ldt,
+	.ssd_limit = sizeof(ldt)-1,
+	.ssd_type = SDT_SYSLDT,
+	.ssd_dpl = SEL_UPL,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 0		},
 /* GUSERLDT_SEL	11 User LDT Descriptor per process */
-{	(int) ldt,		/* segment base address  */
-	(512 * sizeof(union descriptor)-1),		/* length */
-	SDT_SYSLDT,		/* segment type */
-	0,			/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	0,			/* unused - default 32 vs 16 bit size */
-	0  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = (int) ldt,
+	.ssd_limit = (512 * sizeof(union descriptor)-1),
+	.ssd_type = SDT_SYSLDT,
+	.ssd_dpl = 0,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 0		},
 /* GPANIC_SEL	12 Panic Tss Descriptor */
-{	(int) &dblfault_tss,	/* segment base address  */
-	sizeof(struct i386tss)-1,/* length - all address space */
-	SDT_SYS386TSS,		/* segment type */
-	0,			/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	0,			/* unused - default 32 vs 16 bit size */
-	0  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = (int) &dblfault_tss,
+	.ssd_limit = sizeof(struct i386tss)-1,
+	.ssd_type = SDT_SYS386TSS,
+	.ssd_dpl = 0,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 0		},
 /* GBIOSCODE32_SEL 13 BIOS 32-bit interface (32bit Code) */
-{	0,			/* segment base address (overwritten)  */
-	0xfffff,		/* length */
-	SDT_MEMERA,		/* segment type */
-	0,			/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	0,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMERA,
+	.ssd_dpl = 0,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 1		},
 /* GBIOSCODE16_SEL 14 BIOS 32-bit interface (16bit Code) */
-{	0,			/* segment base address (overwritten)  */
-	0xfffff,		/* length */
-	SDT_MEMERA,		/* segment type */
-	0,			/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	0,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMERA,
+	.ssd_dpl = 0,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 1		},
 /* GBIOSDATA_SEL 15 BIOS 32-bit interface (Data) */
-{	0,			/* segment base address (overwritten) */
-	0xfffff,		/* length */
-	SDT_MEMRWA,		/* segment type */
-	0,			/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMRWA,
+	.ssd_dpl = 0,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 /* GBIOSUTIL_SEL 16 BIOS 16-bit interface (Utility) */
-{	0,			/* segment base address (overwritten) */
-	0xfffff,		/* length */
-	SDT_MEMRWA,		/* segment type */
-	0,			/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	0,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMRWA,
+	.ssd_dpl = 0,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 1		},
 /* GBIOSARGS_SEL 17 BIOS 16-bit interface (Arguments) */
-{	0,			/* segment base address (overwritten) */
-	0xfffff,		/* length */
-	SDT_MEMRWA,		/* segment type */
-	0,			/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	0,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMRWA,
+	.ssd_dpl = 0,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 1		},
 /* GNDIS_SEL	18 NDIS Descriptor */
-{	0x0,			/* segment base address  */
-	0x0,			/* length */
-	0,			/* segment type */
-	0,			/* segment descriptor priority level */
-	0,			/* segment descriptor present */
-	0, 0,
-	0,			/* default 32 vs 16 bit size */
-	0  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0x0,
+	.ssd_type = 0,
+	.ssd_dpl = 0,
+	.ssd_p = 0,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 0		},
 #endif /* !XEN */
 };
 
 static struct soft_segment_descriptor ldt_segs[] = {
 	/* Null Descriptor - overwritten by call gate */
-{	0x0,			/* segment base address  */
-	0x0,			/* length - all address space */
-	0,			/* segment type */
-	0,			/* segment descriptor priority level */
-	0,			/* segment descriptor present */
-	0, 0,
-	0,			/* default 32 vs 16 bit size */
-	0  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0x0,
+	.ssd_type = 0,
+	.ssd_dpl = 0,
+	.ssd_p = 0,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 0		},
 	/* Null Descriptor - overwritten by call gate */
-{	0x0,			/* segment base address  */
-	0x0,			/* length - all address space */
-	0,			/* segment type */
-	0,			/* segment descriptor priority level */
-	0,			/* segment descriptor present */
-	0, 0,
-	0,			/* default 32 vs 16 bit size */
-	0  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0x0,
+	.ssd_type = 0,
+	.ssd_dpl = 0,
+	.ssd_p = 0,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 0		},
 	/* Null Descriptor - overwritten by call gate */
-{	0x0,			/* segment base address  */
-	0x0,			/* length - all address space */
-	0,			/* segment type */
-	0,			/* segment descriptor priority level */
-	0,			/* segment descriptor present */
-	0, 0,
-	0,			/* default 32 vs 16 bit size */
-	0  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0x0,
+	.ssd_type = 0,
+	.ssd_dpl = 0,
+	.ssd_p = 0,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 0		},
 	/* Code Descriptor for user */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMERA,		/* segment type */
-	SEL_UPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMERA,
+	.ssd_dpl = SEL_UPL,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 	/* Null Descriptor - overwritten by call gate */
-{	0x0,			/* segment base address  */
-	0x0,			/* length - all address space */
-	0,			/* segment type */
-	0,			/* segment descriptor priority level */
-	0,			/* segment descriptor present */
-	0, 0,
-	0,			/* default 32 vs 16 bit size */
-	0  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0x0,
+	.ssd_type = 0,
+	.ssd_dpl = 0,
+	.ssd_p = 0,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 0		},
 	/* Data Descriptor for user */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMRWA,		/* segment type */
-	SEL_UPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMRWA,
+	.ssd_dpl = SEL_UPL,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 };
 
 void

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 18:54:52 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E193D106567F
	for ; Thu, 26 Mar 2009 18:54:52 +0000 (UTC)
	(envelope-from max@love2party.net)
Received: from moutng.kundenserver.de (moutng.kundenserver.de
	[212.227.126.177])
	by mx1.freebsd.org (Postfix) with ESMTP id 728B28FC14
	for ; Thu, 26 Mar 2009 18:54:52 +0000 (UTC)
	(envelope-from max@love2party.net)
Received: from vampire.homelinux.org (dslb-088-066-050-162.pools.arcor-ip.net
	[88.66.50.162])
	by mrelayeu.kundenserver.de (node=mrelayeu4) with ESMTP (Nemesis)
	id 0ML21M-1Lmuj51B2A-0007y5; Thu, 26 Mar 2009 19:54:51 +0100
Received: (qmail 91923 invoked from network); 26 Mar 2009 18:54:50 -0000
Received: from fbsd8.laiers.local (192.168.4.200)
	by ns1.laiers.local with SMTP; 26 Mar 2009 18:54:50 -0000
From: Max Laier 
Organization: FreeBSD
To: Doug Ambrisko 
Date: Thu, 26 Mar 2009 19:54:49 +0100
User-Agent: KMail/1.11.0 (FreeBSD/8.0-CURRENT; KDE/4.2.1; i386; ; )
References: <200903261714.n2QHENQ2023732@svn.freebsd.org>
In-Reply-To: <200903261714.n2QHENQ2023732@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200903261954.50533.max@love2party.net>
X-Provags-ID: V01U2FsdGVkX19t0RYMqCfGUZhAl0+qW8qj/viM9etVeM3YC32
	5Yqt40nqSpbmil3r3j2x65Qh6VP7f9EGqua1yb0mb0aTLxC6Cd
	A7a/tie+oqvTRVKGz1PfA==
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r190445 - in head/sys: amd64/linux32
	compat/linprocfs compat/linux conf dev/ipmi modules/ipmi
	modules/linprocfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 18:54:54 -0000

On Thursday 26 March 2009 18:14:23 Doug Ambrisko wrote:
> Author: ambrisko
> Date: Thu Mar 26 17:14:22 2009
> New Revision: 190445
> URL: http://svn.freebsd.org/changeset/base/190445
>
> Log:
>   Add stuff to support upcoming BMC/IPMI flashing of newer Dell machine
>   via the Linux tool.
>        -  Add Linux shim to ipmi(4)
>        -  Create a partitions file to linprocfs to make Linux fdisk see
>           disks.  This file is dynamic so we can see disks come and go.
>        -  Convert msdosfs to vfat in mtab since Linux uses that for
>           msdosfs.
>        -  In the Linux mount path convert vfat passed in to msdosfs
>           so Linux mount works on FreeBSD.  Note that tasting works
>           so that if da0 is a msdos file system
>                   /compat/linux/bin/mount /dev/da0 /mnt
>           works.
>        -  fix a 64it bug for l_off_t.
>   Grabing sh, mount, fdisk, df from Linux, creating a symlink of mtab to
>   /compat/linux/etc/mtab and then some careful unpacking of the Linux bmc
>   update tool and hacking makes it work on newer Dell boxes.  Note,
> probably if you can't figure out how to do this, then you probably
> shouldn't be doing it :-)
>
> Added:
>   head/sys/dev/ipmi/ipmi_linux.c   (contents, props changed)
> Modified:
>   head/sys/amd64/linux32/linux.h
>   head/sys/compat/linprocfs/linprocfs.c
>   head/sys/compat/linux/linux_file.c
>   head/sys/conf/files.amd64
>   head/sys/conf/files.i386
>   head/sys/modules/ipmi/Makefile
>   head/sys/modules/linprocfs/Makefile
...
> Modified: head/sys/modules/ipmi/Makefile
> ===========================================================================
>=== --- head/sys/modules/ipmi/Makefile	Thu Mar 26 17:04:08 2009	(r190444)
> +++ head/sys/modules/ipmi/Makefile	Thu Mar 26 17:14:22 2009	(r190445) @@
> -1,5 +1,7 @@
>  # $FreeBSD$
>
> +SUBDIR+= ipmi_linux
> +

the ipmi_linux subdir is missing from this commit.

-- 
/"\  Best regards,                      | mlaier@freebsd.org
\ /  Max Laier                          | ICQ #67774661
 X   http://pf4freebsd.love2party.net/  | mlaier@EFnet
/ \  ASCII Ribbon Campaign              | Against HTML Mail and News

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 19:04:12 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2CC0B106564A;
	Thu, 26 Mar 2009 19:04:12 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1BD108FC0A;
	Thu, 26 Mar 2009 19:04:12 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2QJ4BvC028537;
	Thu, 26 Mar 2009 19:04:11 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2QJ4BuO028536;
	Thu, 26 Mar 2009 19:04:11 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200903261904.n2QJ4BuO028536@svn.freebsd.org>
From: Sam Leffler 
Date: Thu, 26 Mar 2009 19:04:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190448 - head/sys/net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 19:04:12 -0000

Author: sam
Date: Thu Mar 26 19:04:11 2009
New Revision: 190448
URL: http://svn.freebsd.org/changeset/base/190448

Log:
  adjust tdma ie offset when beacon frame contents changes

Modified:
  head/sys/net80211/ieee80211_output.c

Modified: head/sys/net80211/ieee80211_output.c
==============================================================================
--- head/sys/net80211/ieee80211_output.c	Thu Mar 26 18:07:13 2009	(r190447)
+++ head/sys/net80211/ieee80211_output.c	Thu Mar 26 19:04:11 2009	(r190448)
@@ -2666,6 +2666,9 @@ ieee80211_beacon_update(struct ieee80211
 				bo->bo_tim_trailer += adjust;
 				bo->bo_erp += adjust;
 				bo->bo_htinfo += adjust;
+#ifdef IEEE80211_TDMA_SUPPORT
+				bo->bo_tdma += adjust;
+#endif
 				bo->bo_appie += adjust;
 				bo->bo_wme += adjust;
 				bo->bo_csa += adjust;
@@ -2710,6 +2713,9 @@ ieee80211_beacon_update(struct ieee80211
 				memmove(&csa[1], csa, bo->bo_csa_trailer_len);
 				bo->bo_erp += sizeof(*csa);
 				bo->bo_wme += sizeof(*csa);
+#ifdef IEEE80211_TDMA_SUPPORT
+				bo->bo_tdma += sizeof(*csa);
+#endif
 				bo->bo_appie += sizeof(*csa);
 				bo->bo_csa_trailer_len += sizeof(*csa);
 				bo->bo_tim_trailer_len += sizeof(*csa);

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 19:06:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 88C64106566C;
	Thu, 26 Mar 2009 19:06:00 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 77D1A8FC13;
	Thu, 26 Mar 2009 19:06:00 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2QJ60lo028947;
	Thu, 26 Mar 2009 19:06:00 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2QJ60fA028946;
	Thu, 26 Mar 2009 19:06:00 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200903261906.n2QJ60fA028946@svn.freebsd.org>
From: Sam Leffler 
Date: Thu, 26 Mar 2009 19:06:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190449 - head/sys/net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 19:06:01 -0000

Author: sam
Date: Thu Mar 26 19:06:00 2009
New Revision: 190449
URL: http://svn.freebsd.org/changeset/base/190449

Log:
  need to adjust htinfo offset when csa is inserted

Modified:
  head/sys/net80211/ieee80211_output.c

Modified: head/sys/net80211/ieee80211_output.c
==============================================================================
--- head/sys/net80211/ieee80211_output.c	Thu Mar 26 19:04:11 2009	(r190448)
+++ head/sys/net80211/ieee80211_output.c	Thu Mar 26 19:06:00 2009	(r190449)
@@ -2712,6 +2712,7 @@ ieee80211_beacon_update(struct ieee80211
 			if (vap->iv_csa_count == 0) {
 				memmove(&csa[1], csa, bo->bo_csa_trailer_len);
 				bo->bo_erp += sizeof(*csa);
+				bo->bo_htinfo += sizeof(*csa);
 				bo->bo_wme += sizeof(*csa);
 #ifdef IEEE80211_TDMA_SUPPORT
 				bo->bo_tdma += sizeof(*csa);

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 19:07:56 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D94FA1065673;
	Thu, 26 Mar 2009 19:07:56 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C7D438FC1A;
	Thu, 26 Mar 2009 19:07:56 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2QJ7uP5029390;
	Thu, 26 Mar 2009 19:07:56 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2QJ7utA029389;
	Thu, 26 Mar 2009 19:07:56 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200903261907.n2QJ7utA029389@svn.freebsd.org>
From: Sam Leffler 
Date: Thu, 26 Mar 2009 19:07:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190450 - head/sys/net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 19:07:57 -0000

Author: sam
Date: Thu Mar 26 19:07:56 2009
New Revision: 190450
URL: http://svn.freebsd.org/changeset/base/190450

Log:
  dynamic turbo mode is only implemented in sta mode; don't enable it
  for other operating modes based on the capability

Modified:
  head/sys/net80211/ieee80211_superg.c

Modified: head/sys/net80211/ieee80211_superg.c
==============================================================================
--- head/sys/net80211/ieee80211_superg.c	Thu Mar 26 19:06:00 2009	(r190449)
+++ head/sys/net80211/ieee80211_superg.c	Thu Mar 26 19:07:56 2009	(r190450)
@@ -65,7 +65,9 @@ ieee80211_superg_vattach(struct ieee8021
 {
 	if (vap->iv_caps & IEEE80211_C_FF)
 		vap->iv_flags |= IEEE80211_F_FF;
-	if (vap->iv_caps & IEEE80211_C_TURBOP)
+	/* NB: we only implement sta mode */
+	if (vap->iv_opmode == IEEE80211_M_STA &&
+	    (vap->iv_caps & IEEE80211_C_TURBOP))
 		vap->iv_flags |= IEEE80211_F_TURBOP;
 }
 

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 19:13:12 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 73B5D106566B;
	Thu, 26 Mar 2009 19:13:11 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7E9318FC14;
	Thu, 26 Mar 2009 19:13:11 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2QJDBp6030456;
	Thu, 26 Mar 2009 19:13:11 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2QJDBTe030452;
	Thu, 26 Mar 2009 19:13:11 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200903261913.n2QJDBTe030452@svn.freebsd.org>
From: Sam Leffler 
Date: Thu, 26 Mar 2009 19:13:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190451 - head/sys/net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 19:13:13 -0000

Author: sam
Date: Thu Mar 26 19:13:11 2009
New Revision: 190451
URL: http://svn.freebsd.org/changeset/base/190451

Log:
  Fix enough bits so that fast frames work again:
  o include ath ie in beacon frames
  o fix probe response check for including ath ie
  o add ieee80211_add_athcap shorthand for ap-side ie additions

Modified:
  head/sys/net80211/ieee80211_output.c
  head/sys/net80211/ieee80211_proto.h
  head/sys/net80211/ieee80211_superg.c
  head/sys/net80211/ieee80211_superg.h

Modified: head/sys/net80211/ieee80211_output.c
==============================================================================
--- head/sys/net80211/ieee80211_output.c	Thu Mar 26 19:07:56 2009	(r190450)
+++ head/sys/net80211/ieee80211_output.c	Thu Mar 26 19:13:11 2009	(r190451)
@@ -1852,13 +1852,13 @@ ieee80211_send_mgmt(struct ieee80211_nod
 		    ni->ni_ies.htcap_ie[0] == IEEE80211_ELEMID_VENDOR)
 			frm = ieee80211_add_htcap_vendor(frm, ni);
 #ifdef IEEE80211_SUPPORT_SUPERG
-		if (IEEE80211_ATH_CAP(vap, ni, IEEE80211_F_ATHEROS))
-			frm = ieee80211_add_ath(frm,
+		if (IEEE80211_ATH_CAP(vap, ni, IEEE80211_F_ATHEROS)) {
+			frm = ieee80211_add_ath(frm, 
 				IEEE80211_ATH_CAP(vap, ni, IEEE80211_F_ATHEROS),
-				(vap->iv_flags & IEEE80211_F_WPA) == 0 &&
-				ni->ni_authmode != IEEE80211_AUTH_8021X &&
-				vap->iv_def_txkey != IEEE80211_KEYIX_NONE ?
-				vap->iv_def_txkey : 0x7fff);
+				((vap->iv_flags & IEEE80211_F_WPA) == 0 &&
+				 ni->ni_authmode != IEEE80211_AUTH_8021X) ?
+				vap->iv_def_txkey : IEEE80211_KEYIX_NONE);
+		}
 #endif /* IEEE80211_SUPPORT_SUPERG */
 		if (vap->iv_appie_assocreq != NULL)
 			frm = add_appie(frm, vap->iv_appie_assocreq);
@@ -1934,9 +1934,11 @@ ieee80211_send_mgmt(struct ieee80211_nod
 		}
 #ifdef IEEE80211_SUPPORT_SUPERG
 		if (IEEE80211_ATH_CAP(vap, ni, IEEE80211_F_ATHEROS))
-			frm = ieee80211_add_ath(frm,
+			frm = ieee80211_add_ath(frm, 
 				IEEE80211_ATH_CAP(vap, ni, IEEE80211_F_ATHEROS),
-				ni->ni_ath_defkeyix);
+				((vap->iv_flags & IEEE80211_F_WPA) == 0 &&
+				 ni->ni_authmode != IEEE80211_AUTH_8021X) ?
+				vap->iv_def_txkey : IEEE80211_KEYIX_NONE);
 #endif /* IEEE80211_SUPPORT_SUPERG */
 		if (vap->iv_appie_assocresp != NULL)
 			frm = add_appie(frm, vap->iv_appie_assocresp);
@@ -2124,9 +2126,9 @@ ieee80211_alloc_proberesp(struct ieee802
 		frm = ieee80211_add_htinfo_vendor(frm, bss);
 	}
 #ifdef IEEE80211_SUPPORT_SUPERG
-	if (bss->ni_ies.ath_ie != NULL && legacy != IEEE80211_SEND_LEGACY_11B)
-		frm = ieee80211_add_ath(frm, bss->ni_ath_flags,
-			bss->ni_ath_defkeyix);
+	if ((vap->iv_flags & IEEE80211_F_ATHEROS) &&
+	    legacy != IEEE80211_SEND_LEGACY_11B)
+		frm = ieee80211_add_athcaps(frm, bss);
 #endif
 	if (vap->iv_appie_proberesp != NULL)
 		frm = add_appie(frm, vap->iv_appie_proberesp);
@@ -2320,6 +2322,7 @@ ieee80211_beacon_construct(struct mbuf *
 	 *	[tlv] WME parameters
 	 *	[tlv] Vendor OUI HT capabilities (optional)
 	 *	[tlv] Vendor OUI HT information (optional)
+	 *	[tlv] Atheros capabilities (optional)
 	 *	[tlv] TDMA parameters (optional)
 	 *	[tlv] application data (optional)
 	 */
@@ -2410,6 +2413,12 @@ ieee80211_beacon_construct(struct mbuf *
 		frm = ieee80211_add_htcap_vendor(frm, ni);
 		frm = ieee80211_add_htinfo_vendor(frm, ni);
 	}
+#ifdef IEEE80211_SUPPORT_SUPERG
+	if (vap->iv_flags & IEEE80211_F_ATHEROS) {
+		bo->bo_ath = frm;
+		frm = ieee80211_add_athcaps(frm, ni);
+	}
+#endif
 #ifdef IEEE80211_SUPPORT_TDMA
 	if (vap->iv_caps & IEEE80211_C_TDMA) {
 		bo->bo_tdma = frm;
@@ -2489,6 +2498,9 @@ ieee80211_beacon_alloc(struct ieee80211_
 		 + 4+2*sizeof(struct ieee80211_ie_htinfo)/* HT info */
 		 + (vap->iv_caps & IEEE80211_C_WME ?	/* WME */
 			sizeof(struct ieee80211_wme_param) : 0)
+#ifdef IEEE80211_SUPPORT_SUPERG
+		 + sizeof(struct ieee80211_ath_ie)	/* ATH */
+#endif
 #ifdef IEEE80211_SUPPORT_TDMA
 		 + (vap->iv_caps & IEEE80211_C_TDMA ?	/* TDMA */
 			sizeof(struct ieee80211_tdma_param) : 0)
@@ -2666,6 +2678,9 @@ ieee80211_beacon_update(struct ieee80211
 				bo->bo_tim_trailer += adjust;
 				bo->bo_erp += adjust;
 				bo->bo_htinfo += adjust;
+#ifdef IEEE80211_SUPERG_SUPPORT
+				bo->bo_ath += adjust;
+#endif
 #ifdef IEEE80211_TDMA_SUPPORT
 				bo->bo_tdma += adjust;
 #endif
@@ -2714,6 +2729,9 @@ ieee80211_beacon_update(struct ieee80211
 				bo->bo_erp += sizeof(*csa);
 				bo->bo_htinfo += sizeof(*csa);
 				bo->bo_wme += sizeof(*csa);
+#ifdef IEEE80211_SUPERG_SUPPORT
+				bo->bo_ath += sizeof(*csa);
+#endif
 #ifdef IEEE80211_TDMA_SUPPORT
 				bo->bo_tdma += sizeof(*csa);
 #endif
@@ -2736,6 +2754,12 @@ ieee80211_beacon_update(struct ieee80211
 			(void) ieee80211_add_erp(bo->bo_erp, ic);
 			clrbit(bo->bo_flags, IEEE80211_BEACON_ERP);
 		}
+#ifdef IEEE80211_SUPPORT_SUPERG
+		if (isset(bo->bo_flags,  IEEE80211_BEACON_ATH)) {
+			ieee80211_add_athcaps(bo->bo_ath, ni);
+			clrbit(bo->bo_flags, IEEE80211_BEACON_ATH);
+		}
+#endif
 	}
 	if (isset(bo->bo_flags, IEEE80211_BEACON_APPIE)) {
 		const struct ieee80211_appie *aie = vap->iv_appie_beacon;

Modified: head/sys/net80211/ieee80211_proto.h
==============================================================================
--- head/sys/net80211/ieee80211_proto.h	Thu Mar 26 19:07:56 2009	(r190450)
+++ head/sys/net80211/ieee80211_proto.h	Thu Mar 26 19:13:11 2009	(r190451)
@@ -300,6 +300,7 @@ struct ieee80211_beacon_offsets {
 	uint16_t	bo_tim_trailer_len;/* tim trailer length in bytes */
 	uint8_t		*bo_erp;	/* start of ERP element */
 	uint8_t		*bo_htinfo;	/* start of HT info element */
+	uint8_t		*bo_ath;	/* start of ATH parameters */
 	uint8_t		*bo_appie;	/* start of AppIE element */
 	uint16_t	bo_appie_len;	/* AppIE length in bytes */
 	uint16_t	bo_csa_trailer_len;;
@@ -330,6 +331,7 @@ enum {
 	IEEE80211_BEACON_CFP	= 6,	/* CFParms */
 	IEEE80211_BEACON_CSA	= 7,	/* Channel Switch Announcement */
 	IEEE80211_BEACON_TDMA	= 9,	/* TDMA Info */
+	IEEE80211_BEACON_ATH	= 10,	/* ATH parameters */
 };
 int	ieee80211_beacon_update(struct ieee80211_node *,
 		struct ieee80211_beacon_offsets *, struct mbuf *, int mcast);

Modified: head/sys/net80211/ieee80211_superg.c
==============================================================================
--- head/sys/net80211/ieee80211_superg.c	Thu Mar 26 19:07:56 2009	(r190450)
+++ head/sys/net80211/ieee80211_superg.c	Thu Mar 26 19:13:11 2009	(r190451)
@@ -81,7 +81,7 @@ ieee80211_superg_vdetach(struct ieee8021
  * Add a WME information element to a frame.
  */
 uint8_t *
-ieee80211_add_ath(uint8_t *frm, uint8_t caps, uint16_t defkeyix)
+ieee80211_add_ath(uint8_t *frm, uint8_t caps, ieee80211_keyix defkeyix)
 {
 	static const struct ieee80211_ath_ie info = {
 		.ath_id		= IEEE80211_ELEMID_VENDOR,
@@ -95,12 +95,29 @@ ieee80211_add_ath(uint8_t *frm, uint8_t 
 
 	memcpy(frm, &info, sizeof(info));
 	ath->ath_capability = caps;
-	ath->ath_defkeyix[0] = (defkeyix & 0xff);
-	ath->ath_defkeyix[1] = ((defkeyix >> 8) & 0xff);
+	if (defkeyix != IEEE80211_KEYIX_NONE) {
+		ath->ath_defkeyix[0] = (defkeyix & 0xff);
+		ath->ath_defkeyix[1] = ((defkeyix >> 8) & 0xff);
+	} else {
+		ath->ath_defkeyix[0] = 0xff;
+		ath->ath_defkeyix[1] = 0x7f;
+	}
 	return frm + sizeof(info); 
 }
 #undef ATH_OUI_BYTES
 
+uint8_t *
+ieee80211_add_athcaps(uint8_t *frm, const struct ieee80211_node *bss)
+{
+	const struct ieee80211vap *vap = bss->ni_vap;
+
+	return ieee80211_add_ath(frm,
+	    vap->iv_flags & IEEE80211_F_ATHEROS,
+	    ((vap->iv_flags & IEEE80211_F_WPA) == 0 &&
+	    bss->ni_authmode != IEEE80211_AUTH_8021X) ?
+	    vap->iv_def_txkey : IEEE80211_KEYIX_NONE);
+}
+
 void
 ieee80211_parse_ath(struct ieee80211_node *ni, uint8_t *ie)
 {

Modified: head/sys/net80211/ieee80211_superg.h
==============================================================================
--- head/sys/net80211/ieee80211_superg.h	Thu Mar 26 19:07:56 2009	(r190450)
+++ head/sys/net80211/ieee80211_superg.h	Thu Mar 26 19:13:11 2009	(r190451)
@@ -36,7 +36,8 @@ void	ieee80211_superg_detach(struct ieee
 void	ieee80211_superg_vattach(struct ieee80211vap *);
 void	ieee80211_superg_vdetach(struct ieee80211vap *);
 
-uint8_t *ieee80211_add_ath(uint8_t *frm, uint8_t caps, uint16_t defkeyix);
+uint8_t *ieee80211_add_ath(uint8_t *, uint8_t, ieee80211_keyix);
+uint8_t *ieee80211_add_athcaps(uint8_t *, const struct ieee80211_node *);
 void	ieee80211_parse_ath(struct ieee80211_node *, uint8_t *);
 int	ieee80211_parse_athparams(struct ieee80211_node *, uint8_t *,
 	    const struct ieee80211_frame *);

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 19:15:31 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B3B201065670;
	Thu, 26 Mar 2009 19:15:31 +0000 (UTC)
	(envelope-from ambrisko@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A1DA48FC1E;
	Thu, 26 Mar 2009 19:15:31 +0000 (UTC)
	(envelope-from ambrisko@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2QJFV5O030969;
	Thu, 26 Mar 2009 19:15:31 GMT
	(envelope-from ambrisko@svn.freebsd.org)
Received: (from ambrisko@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2QJFVuo030968;
	Thu, 26 Mar 2009 19:15:31 GMT
	(envelope-from ambrisko@svn.freebsd.org)
Message-Id: <200903261915.n2QJFVuo030968@svn.freebsd.org>
From: Doug Ambrisko 
Date: Thu, 26 Mar 2009 19:15:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190452 - head/sys/modules/ipmi/ipmi_linux
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 19:15:32 -0000

Author: ambrisko
Date: Thu Mar 26 19:15:31 2009
New Revision: 190452
URL: http://svn.freebsd.org/changeset/base/190452

Log:
  Add in forgotten module ipmi_linux.
  
  Found by:	mlaier

Added:
  head/sys/modules/ipmi/ipmi_linux/
  head/sys/modules/ipmi/ipmi_linux/Makefile   (contents, props changed)

Added: head/sys/modules/ipmi/ipmi_linux/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/modules/ipmi/ipmi_linux/Makefile	Thu Mar 26 19:15:31 2009	(r190452)
@@ -0,0 +1,8 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../../../dev/ipmi
+
+KMOD=	ipmi_linux
+SRCS=	ipmi_linux.c
+
+.include 

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 19:45:50 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AE04A106567E;
	Thu, 26 Mar 2009 19:45:50 +0000 (UTC)
	(envelope-from ambrisko@ambrisko.com)
Received: from mail.ambrisko.com (mail.ambrisko.com [64.174.51.43])
	by mx1.freebsd.org (Postfix) with ESMTP id 705188FC0C;
	Thu, 26 Mar 2009 19:45:50 +0000 (UTC)
	(envelope-from ambrisko@ambrisko.com)
X-Ambrisko-Me: Yes
Received: from server2.ambrisko.com (HELO www.ambrisko.com) ([192.168.1.2])
	by ironport.ambrisko.com with ESMTP; 26 Mar 2009 12:18:09 -0700
Received: from ambrisko.com (localhost [127.0.0.1])
	by www.ambrisko.com (8.14.3/8.14.1) with ESMTP id n2QJHI7x067943;
	Thu, 26 Mar 2009 12:17:18 -0700 (PDT)
	(envelope-from ambrisko@ambrisko.com)
Received: (from ambrisko@localhost)
	by ambrisko.com (8.14.3/8.14.3/Submit) id n2QJHI3i067942;
	Thu, 26 Mar 2009 12:17:18 -0700 (PDT) (envelope-from ambrisko)
From: Doug Ambrisko 
Message-Id: <200903261917.n2QJHI3i067942@ambrisko.com>
In-Reply-To: <200903261954.50533.max@love2party.net>
To: Max Laier 
Date: Thu, 26 Mar 2009 12:17:18 -0700 (PDT)
X-Mailer: ELM [version 2.4ME+ PL94b (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Cc: svn-src-head@freebsd.org, Doug Ambrisko ,
	svn-src-all@freebsd.org, src-committers@freebsd.org
Subject: Re: svn commit: r190445 - in head/sys: amd64/linux32
 compat/linprocfs
 compat/linux conf dev/ipmi modules/ipmi modules/linprocfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 19:45:51 -0000

Max Laier writes:
| On Thursday 26 March 2009 18:14:23 Doug Ambrisko wrote:
| > Author: ambrisko
| > Date: Thu Mar 26 17:14:22 2009
| > New Revision: 190445
| > URL: http://svn.freebsd.org/changeset/base/190445
| >
| > Log:
| >   Add stuff to support upcoming BMC/IPMI flashing of newer Dell machine
| >   via the Linux tool.
| >        -  Add Linux shim to ipmi(4)
| >        -  Create a partitions file to linprocfs to make Linux fdisk see
| >           disks.  This file is dynamic so we can see disks come and go.
| >        -  Convert msdosfs to vfat in mtab since Linux uses that for
| >           msdosfs.
| >        -  In the Linux mount path convert vfat passed in to msdosfs
| >           so Linux mount works on FreeBSD.  Note that tasting works
| >           so that if da0 is a msdos file system
| >                   /compat/linux/bin/mount /dev/da0 /mnt
| >           works.
| >        -  fix a 64it bug for l_off_t.
| >   Grabing sh, mount, fdisk, df from Linux, creating a symlink of mtab to
| >   /compat/linux/etc/mtab and then some careful unpacking of the Linux bmc
| >   update tool and hacking makes it work on newer Dell boxes.  Note,
| > probably if you can't figure out how to do this, then you probably
| > shouldn't be doing it :-)
| >
| > Added:
| >   head/sys/dev/ipmi/ipmi_linux.c   (contents, props changed)
| > Modified:
| >   head/sys/amd64/linux32/linux.h
| >   head/sys/compat/linprocfs/linprocfs.c
| >   head/sys/compat/linux/linux_file.c
| >   head/sys/conf/files.amd64
| >   head/sys/conf/files.i386
| >   head/sys/modules/ipmi/Makefile
| >   head/sys/modules/linprocfs/Makefile
| ...

Should be fixed now.  I was in the process of checking the stuff back
from CVS was working in a clean tree but hadn't finished it yet.

Thanks,

Doug A.

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 20:23:22 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8676A106566C;
	Thu, 26 Mar 2009 20:23:22 +0000 (UTC)
	(envelope-from ambrisko@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3863C8FC22;
	Thu, 26 Mar 2009 20:23:22 +0000 (UTC)
	(envelope-from ambrisko@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2QKNLEe036607;
	Thu, 26 Mar 2009 20:23:21 GMT
	(envelope-from ambrisko@svn.freebsd.org)
Received: (from ambrisko@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2QKNLBs036605;
	Thu, 26 Mar 2009 20:23:21 GMT
	(envelope-from ambrisko@svn.freebsd.org)
Message-Id: <200903262023.n2QKNLBs036605@svn.freebsd.org>
From: Doug Ambrisko 
Date: Thu, 26 Mar 2009 20:23:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190453 - head/sys/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 20:23:23 -0000

Author: ambrisko
Date: Thu Mar 26 20:23:21 2009
New Revision: 190453
URL: http://svn.freebsd.org/changeset/base/190453

Log:
  Sigh, not my day.  Check-in the update version that didn't have
  the linux_compat mistakes.

Modified:
  head/sys/conf/files.amd64
  head/sys/conf/files.i386

Modified: head/sys/conf/files.amd64
==============================================================================
--- head/sys/conf/files.amd64	Thu Mar 26 19:15:31 2009	(r190452)
+++ head/sys/conf/files.amd64	Thu Mar 26 20:23:21 2009	(r190453)
@@ -183,7 +183,7 @@ dev/ipmi/ipmi_smbus.c		optional	ipmi smb
 dev/ipmi/ipmi_smbios.c		optional	ipmi
 dev/ipmi/ipmi_ssif.c		optional	ipmi smbus
 dev/ipmi/ipmi_pci.c		optional	ipmi pci
-dev/ipmi/ipmi_linux.c		optional	ipmi linux_compat32
+dev/ipmi/ipmi_linux.c		optional	ipmi compat_linux32
 dev/fdc/fdc.c			optional	fdc
 dev/fdc/fdc_acpi.c		optional	fdc
 dev/fdc/fdc_isa.c		optional	fdc isa

Modified: head/sys/conf/files.i386
==============================================================================
--- head/sys/conf/files.i386	Thu Mar 26 19:15:31 2009	(r190452)
+++ head/sys/conf/files.i386	Thu Mar 26 20:23:21 2009	(r190453)
@@ -196,7 +196,7 @@ dev/ipmi/ipmi_smbus.c		optional ipmi smb
 dev/ipmi/ipmi_smbios.c		optional ipmi
 dev/ipmi/ipmi_ssif.c		optional ipmi smbus
 dev/ipmi/ipmi_pci.c		optional ipmi pci
-dev/ipmi/ipmi_linux.c		optional ipmi linux_compat
+dev/ipmi/ipmi_linux.c		optional ipmi compat_linux
 dev/kbd/kbd.c			optional atkbd | sc | ukbd | usb2_input_kbd
 dev/le/if_le_isa.c		optional le isa
 dev/mem/memutil.c		optional mem

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 20:54:34 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 141E01065673;
	Thu, 26 Mar 2009 20:54:34 +0000 (UTC)
	(envelope-from rdivacky@vlk.vlakno.cz)
Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190])
	by mx1.freebsd.org (Postfix) with ESMTP id 8AB2A8FC08;
	Thu, 26 Mar 2009 20:54:33 +0000 (UTC)
	(envelope-from rdivacky@vlk.vlakno.cz)
Received: from localhost (localhost [127.0.0.1])
	by vlakno.cz (Postfix) with ESMTP id 6429A9CB071;
	Thu, 26 Mar 2009 21:53:59 +0100 (CET)
X-Virus-Scanned: amavisd-new at vlakno.cz
Received: from vlakno.cz ([127.0.0.1])
	by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id IdjoQ18ZVoOu; Thu, 26 Mar 2009 21:53:57 +0100 (CET)
Received: from vlk.vlakno.cz (localhost [127.0.0.1])
	by vlakno.cz (Postfix) with ESMTP id E3FF49CB129;
	Thu, 26 Mar 2009 21:53:56 +0100 (CET)
Received: (from rdivacky@localhost)
	by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id n2QKrucl017850;
	Thu, 26 Mar 2009 21:53:56 +0100 (CET) (envelope-from rdivacky)
Date: Thu, 26 Mar 2009 21:53:56 +0100
From: Roman Divacky 
To: Doug Ambrisko 
Message-ID: <20090326205356.GA17416@freebsd.org>
References: <200903261714.n2QHENQ2023732@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="W/nzBZO5zC0uMSeA"
Content-Disposition: inline
In-Reply-To: <200903261714.n2QHENQ2023732@svn.freebsd.org>
User-Agent: Mutt/1.4.2.3i
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r190445 - in head/sys: amd64/linux32
	compat/linprocfs compat/linux conf dev/ipmi modules/ipmi
	modules/linprocfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 20:54:34 -0000


--W/nzBZO5zC0uMSeA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Mar 26, 2009 at 05:14:23PM +0000, Doug Ambrisko wrote:
> Author: ambrisko
> Date: Thu Mar 26 17:14:22 2009
> New Revision: 190445
> URL: http://svn.freebsd.org/changeset/base/190445
>=20
> Log:
>   Add stuff to support upcoming BMC/IPMI flashing of newer Dell machine
>   via the Linux tool.
>        -  Add Linux shim to ipmi(4)
>        -  Create a partitions file to linprocfs to make Linux fdisk see
>           disks.  This file is dynamic so we can see disks come and go.
>        -  Convert msdosfs to vfat in mtab since Linux uses that for
>           msdosfs.
>        -  In the Linux mount path convert vfat passed in to msdosfs
>           so Linux mount works on FreeBSD.  Note that tasting works
>           so that if da0 is a msdos file system
>                   /compat/linux/bin/mount /dev/da0 /mnt
>           works.
>        -  fix a 64it bug for l_off_t.
>   Grabing sh, mount, fdisk, df from Linux, creating a symlink of mtab to
>   /compat/linux/etc/mtab and then some careful unpacking of the Linux bmc
>   update tool and hacking makes it work on newer Dell boxes.  Note, proba=
bly
>   if you can't figure out how to do this, then you probably shouldn't be
>   doing it :-)
>=20
> Added:
>   head/sys/dev/ipmi/ipmi_linux.c   (contents, props changed)
> Modified:
>   head/sys/amd64/linux32/linux.h
>   head/sys/compat/linprocfs/linprocfs.c
>   head/sys/compat/linux/linux_file.c
>   head/sys/conf/files.amd64
>   head/sys/conf/files.i386
>   head/sys/modules/ipmi/Makefile
>   head/sys/modules/linprocfs/Makefile
>=20
> Modified: head/sys/amd64/linux32/linux.h
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/amd64/linux32/linux.h	Thu Mar 26 17:04:08 2009	(r190444)
> +++ head/sys/amd64/linux32/linux.h	Thu Mar 26 17:14:22 2009	(r190445)
> @@ -79,7 +79,7 @@ typedef l_ulong		l_ino_t;
>  typedef l_int		l_key_t;
>  typedef l_longlong	l_loff_t;
>  typedef l_ushort	l_mode_t;
> -typedef l_long		l_off_t;
> +typedef l_ulong		l_off_t;

where did you get this idea? my copy of linux 2.6.16 shows that off_t
is being declared as long. can you be more specific about the background
of this change? what does it fix?


--W/nzBZO5zC0uMSeA
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (FreeBSD)

iEYEARECAAYFAknL62QACgkQLVEj6D3CBEzAVACfXRzg3XrJWe8g3hb4DP4rmUj7
DG4AoIHJ1JKZIMltt3tykTcB+dl4LNz4
=Cfl5
-----END PGP SIGNATURE-----

--W/nzBZO5zC0uMSeA--

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 21:10:37 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8C5B9106564A;
	Thu, 26 Mar 2009 21:10:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7AB0C8FC16;
	Thu, 26 Mar 2009 21:10:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2QLAb2N037617;
	Thu, 26 Mar 2009 21:10:37 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2QLAbHD037615;
	Thu, 26 Mar 2009 21:10:37 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200903262110.n2QLAbHD037615@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 26 Mar 2009 21:10:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190454 - head/sys/dev/acpica
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 21:10:38 -0000

Author: jhb
Date: Thu Mar 26 21:10:35 2009
New Revision: 190454
URL: http://svn.freebsd.org/changeset/base/190454

Log:
  Move the code to update cpu_cx_count out of acpi_cpu_generic_cx_probe() and
  into acpi_cpu_startup() which is where all the other code to update this
  global variable lives.  This fixes a bug where cpu_cx_count was not updated
  correctly if acpi_cpu_generic_cx_probe() returned early.
  
  PR:		kern/108581
  Debugged by:	Bruce Cran
  Reviewed by:	avg, njl, sepotvin
  MFC after:	3 days

Modified:
  head/sys/dev/acpica/acpi_cpu.c

Modified: head/sys/dev/acpica/acpi_cpu.c
==============================================================================
--- head/sys/dev/acpica/acpi_cpu.c	Thu Mar 26 20:23:21 2009	(r190453)
+++ head/sys/dev/acpica/acpi_cpu.c	Thu Mar 26 21:10:35 2009	(r190454)
@@ -609,10 +609,6 @@ acpi_cpu_generic_cx_probe(struct acpi_cp
 	    sc->cpu_cx_count++;
 	}
     }
-
-    /* Update the largest cx_count seen so far */
-    if (sc->cpu_cx_count > cpu_cx_count)
-	cpu_cx_count = sc->cpu_cx_count;
 }
 
 /*
@@ -752,6 +748,8 @@ acpi_cpu_startup(void *arg)
 	for (i = 0; i < cpu_ndevices; i++) {
 	    sc = device_get_softc(cpu_devices[i]);
 	    acpi_cpu_generic_cx_probe(sc);
+	    if (sc->cpu_cx_count > cpu_cx_count)
+		    cpu_cx_count = sc->cpu_cx_count;
 	}
 
 	/*

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 21:20:17 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 073151065675;
	Thu, 26 Mar 2009 21:20:17 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 8FC9C8FC1D;
	Thu, 26 Mar 2009 21:20:16 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n2QLH8DC050764;
	Thu, 26 Mar 2009 15:17:08 -0600 (MDT) (envelope-from imp@bsdimp.com)
Date: Thu, 26 Mar 2009 15:17:45 -0600 (MDT)
Message-Id: <20090326.151745.387192852.imp@bsdimp.com>
To: rdivacky@FreeBSD.org
From: "M. Warner Losh" 
In-Reply-To: <20090326205356.GA17416@freebsd.org>
References: <200903261714.n2QHENQ2023732@svn.freebsd.org>
	<20090326205356.GA17416@freebsd.org>
X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, ambrisko@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r190445 - in head/sys: amd64/linux32
 compat/linprocfs compat/linux conf dev/ipmi modules/ipmi modules/linprocfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 21:20:18 -0000

In message: <20090326205356.GA17416@freebsd.org>
            Roman Divacky  writes:
: On Thu, Mar 26, 2009 at 05:14:23PM +0000, Doug Ambrisko wrote:
: > Author: ambrisko
: > Date: Thu Mar 26 17:14:22 2009
: > New Revision: 190445
: > URL: http://svn.freebsd.org/changeset/base/190445
: > 
: > Log:
: >   Add stuff to support upcoming BMC/IPMI flashing of newer Dell machine
: >   via the Linux tool.
: >        -  Add Linux shim to ipmi(4)
: >        -  Create a partitions file to linprocfs to make Linux fdisk see
: >           disks.  This file is dynamic so we can see disks come and go.
: >        -  Convert msdosfs to vfat in mtab since Linux uses that for
: >           msdosfs.
: >        -  In the Linux mount path convert vfat passed in to msdosfs
: >           so Linux mount works on FreeBSD.  Note that tasting works
: >           so that if da0 is a msdos file system
: >                   /compat/linux/bin/mount /dev/da0 /mnt
: >           works.
: >        -  fix a 64it bug for l_off_t.
: >   Grabing sh, mount, fdisk, df from Linux, creating a symlink of mtab to
: >   /compat/linux/etc/mtab and then some careful unpacking of the Linux bmc
: >   update tool and hacking makes it work on newer Dell boxes.  Note, probably
: >   if you can't figure out how to do this, then you probably shouldn't be
: >   doing it :-)
: > 
: > Added:
: >   head/sys/dev/ipmi/ipmi_linux.c   (contents, props changed)
: > Modified:
: >   head/sys/amd64/linux32/linux.h
: >   head/sys/compat/linprocfs/linprocfs.c
: >   head/sys/compat/linux/linux_file.c
: >   head/sys/conf/files.amd64
: >   head/sys/conf/files.i386
: >   head/sys/modules/ipmi/Makefile
: >   head/sys/modules/linprocfs/Makefile
: > 
: > Modified: head/sys/amd64/linux32/linux.h
: > ==============================================================================
: > --- head/sys/amd64/linux32/linux.h	Thu Mar 26 17:04:08 2009	(r190444)
: > +++ head/sys/amd64/linux32/linux.h	Thu Mar 26 17:14:22 2009	(r190445)
: > @@ -79,7 +79,7 @@ typedef l_ulong		l_ino_t;
: >  typedef l_int		l_key_t;
: >  typedef l_longlong	l_loff_t;
: >  typedef l_ushort	l_mode_t;
: > -typedef l_long		l_off_t;
: > +typedef l_ulong		l_off_t;
: 
: where did you get this idea? my copy of linux 2.6.16 shows that off_t
: is being declared as long. can you be more specific about the background
: of this change? what does it fix?

Especially since off_t can be negative.

Warner


From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 21:29:05 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 51385106566B;
	Thu, 26 Mar 2009 21:29:05 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3ECC28FC0C;
	Thu, 26 Mar 2009 21:29:05 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2QLT5I7038156;
	Thu, 26 Mar 2009 21:29:05 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2QLT4T0038153;
	Thu, 26 Mar 2009 21:29:04 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200903262129.n2QLT4T0038153@svn.freebsd.org>
From: Sam Leffler 
Date: Thu, 26 Mar 2009 21:29:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190455 - head/sys/net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 21:29:05 -0000

Author: sam
Date: Thu Mar 26 21:29:03 2009
New Revision: 190455
URL: http://svn.freebsd.org/changeset/base/190455

Log:
  o move tdma+superg protocol defs out of public view
  o add #ifdef _KERNEL to superg+tdma include files so they can be used
    by user code to get the protocol defs

Modified:
  head/sys/net80211/ieee80211.h
  head/sys/net80211/ieee80211_superg.c
  head/sys/net80211/ieee80211_superg.h
  head/sys/net80211/ieee80211_tdma.c
  head/sys/net80211/ieee80211_tdma.h

Modified: head/sys/net80211/ieee80211.h
==============================================================================
--- head/sys/net80211/ieee80211.h	Thu Mar 26 21:10:35 2009	(r190454)
+++ head/sys/net80211/ieee80211.h	Thu Mar 26 21:29:03 2009	(r190455)
@@ -733,28 +733,6 @@ struct ieee80211_csa_ie {
 	uint8_t		csa_count;		/* Channel Switch Count */
 } __packed;
 
-/*
- * Atheros advanced capability information element.
- */
-struct ieee80211_ath_ie {
-	uint8_t		ath_id;			/* IEEE80211_ELEMID_VENDOR */
-	uint8_t		ath_len;		/* length in bytes */
-	uint8_t		ath_oui[3];		/* 0x00, 0x03, 0x7f */
-	uint8_t		ath_oui_type;		/* OUI type */
-	uint8_t		ath_oui_subtype;	/* OUI subtype */
-	uint8_t		ath_version;		/* spec revision */
-	uint8_t		ath_capability;		/* capability info */
-#define	ATHEROS_CAP_TURBO_PRIME		0x01	/* dynamic turbo--aka Turbo' */
-#define	ATHEROS_CAP_COMPRESSION		0x02	/* data compression */
-#define	ATHEROS_CAP_FAST_FRAME		0x04	/* fast (jumbo) frames */
-#define	ATHEROS_CAP_XR			0x08	/* Xtended Range support */
-#define	ATHEROS_CAP_AR			0x10	/* Advanded Radar support */
-#define	ATHEROS_CAP_BURST		0x20	/* Bursting - not negotiated */
-#define	ATHEROS_CAP_WME			0x40	/* CWMin tuning */
-#define	ATHEROS_CAP_BOOST		0x80	/* use turbo/!turbo mode */
-	uint8_t		ath_defkeyix[2];
-} __packed;
-
 /* rate set entries are in .5 Mb/s units, and potentially marked as basic */
 #define	IEEE80211_RATE_BASIC		0x80
 #define	IEEE80211_RATE_VAL		0x7f
@@ -768,9 +746,11 @@ struct ieee80211_ath_ie {
 	"\20\1NON_ERP_PRESENT\2USE_PROTECTION\3LONG_PREAMBLE"
 
 #define	ATH_OUI			0x7f0300	/* Atheros OUI */
-#define	ATH_OUI_TYPE		0x01
-#define	ATH_OUI_SUBTYPE		0x01
-#define	ATH_OUI_VERSION		0x00
+#define	ATH_OUI_TYPE		0x01		/* Atheros protocol ie */
+
+/* NB: Atheros allocated the OUI for this purpose ~2005 but beware ... */
+#define	TDMA_OUI		ATH_OUI
+#define	TDMA_OUI_TYPE		0x02		/* TDMA protocol ie */
 
 #define	BCM_OUI			0x4c9000	/* Broadcom OUI */
 #define	BCM_OUI_HTCAP		51		/* pre-draft HTCAP ie */
@@ -1048,71 +1028,4 @@ struct ieee80211_duration {
 				 IEEE80211_DUR_DS_SLOW_PLCPHDR + \
 				 IEEE80211_DUR_DIFS)
 
-/*
- * Atheros fast-frame encapsulation format.
- * FF max payload:
- * 802.2 + FFHDR + HPAD + 802.3 + 802.2 + 1500 + SPAD + 802.3 + 802.2 + 1500:
- *   8   +   4   +  4   +   14  +   8   + 1500 +  6   +   14  +   8   + 1500
- * = 3066
- */
-/* fast frame header is 32-bits */
-#define	ATH_FF_PROTO	0x0000003f	/* protocol */
-#define	ATH_FF_PROTO_S	0
-#define	ATH_FF_FTYPE	0x000000c0	/* frame type */
-#define	ATH_FF_FTYPE_S	6
-#define	ATH_FF_HLEN32	0x00000300	/* optional hdr length */
-#define	ATH_FF_HLEN32_S	8
-#define	ATH_FF_SEQNUM	0x001ffc00	/* sequence number */
-#define	ATH_FF_SEQNUM_S	10
-#define	ATH_FF_OFFSET	0xffe00000	/* offset to 2nd payload */
-#define	ATH_FF_OFFSET_S	21
-
-#define	ATH_FF_MAX_HDR_PAD	4
-#define	ATH_FF_MAX_SEP_PAD	6
-#define	ATH_FF_MAX_HDR		30
-
-#define	ATH_FF_PROTO_L2TUNNEL	0	/* L2 tunnel protocol */
-#define	ATH_FF_ETH_TYPE		0x88bd	/* Ether type for encapsulated frames */
-#define	ATH_FF_SNAP_ORGCODE_0	0x00
-#define	ATH_FF_SNAP_ORGCODE_1	0x03
-#define	ATH_FF_SNAP_ORGCODE_2	0x7f
-
-/* NB: Atheros allocated the OUI for this purpose ~2005 but beware ... */
-#define	TDMA_OUI		ATH_OUI
-#define	TDMA_OUI_TYPE		0x02
-#define	TDMA_VERSION_V2		2
-#define	TDMA_VERSION		TDMA_VERSION_V2
-
-/* NB: we only support 2 right now but protocol handles up to 8 */
-#define	TDMA_MAXSLOTS		2	/* max slots/sta's */
-
-#define	TDMA_PARAM_LEN_V2	sizeof(struct ieee80211_tdma_param)
-
-struct ieee80211_tdma_param {
-	u_int8_t	tdma_id;	/* IEEE80211_ELEMID_VENDOR */
-	u_int8_t	tdma_len;
-	u_int8_t	tdma_oui[3];	/* 0x00, 0x03, 0x7f */
-	u_int8_t	tdma_type;	/* OUI type */
-	u_int8_t	tdma_subtype;	/* OUI subtype */
-#define	TDMA_SUBTYPE_PARAM	0x01
-	u_int8_t	tdma_version;	/* spec revision */
-	u_int8_t	tdma_slot;	/* station slot # [0..7] */
-	u_int8_t	tdma_slotcnt;	/* bss slot count [1..8] */
-	u_int16_t	tdma_slotlen;	/* bss slot len (100us) */
-	u_int8_t	tdma_bintval;	/* beacon interval (superframes) */
-	u_int8_t	tdma_inuse[1];	/* slot occupancy map */
-	u_int8_t	tdma_pad[2];
-	u_int8_t	tdma_tstamp[8];	/* timestamp from last beacon */
-} __packed;
-
-#define	TDMA_VERSION_VALID(_version) \
-	(TDMA_VERSION_V2 <= (_version) && (_version) <= TDMA_VERSION)
-#define	TDMA_SLOTCNT_VALID(_slotcnt) \
-	(2 <= (_slotcnt) && (_slotcnt) <= TDMA_MAXSLOTS)
-/* XXX magic constants */
-#define	TDMA_SLOTLEN_VALID(_slotlen) \
-	(2*100 <= (_slotlen) && (unsigned)(_slotlen) <= 0xfffff)
-/* XXX probably should set a max */
-#define	TDMA_BINTVAL_VALID(_bintval)	(1 <= (_bintval))
-
 #endif /* _NET80211_IEEE80211_H_ */

Modified: head/sys/net80211/ieee80211_superg.c
==============================================================================
--- head/sys/net80211/ieee80211_superg.c	Thu Mar 26 21:10:35 2009	(r190454)
+++ head/sys/net80211/ieee80211_superg.c	Thu Mar 26 21:29:03 2009	(r190455)
@@ -47,6 +47,35 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+/*
+ * Atheros fast-frame encapsulation format.
+ * FF max payload:
+ * 802.2 + FFHDR + HPAD + 802.3 + 802.2 + 1500 + SPAD + 802.3 + 802.2 + 1500:
+ *   8   +   4   +  4   +   14  +   8   + 1500 +  6   +   14  +   8   + 1500
+ * = 3066
+ */
+/* fast frame header is 32-bits */
+#define	ATH_FF_PROTO	0x0000003f	/* protocol */
+#define	ATH_FF_PROTO_S	0
+#define	ATH_FF_FTYPE	0x000000c0	/* frame type */
+#define	ATH_FF_FTYPE_S	6
+#define	ATH_FF_HLEN32	0x00000300	/* optional hdr length */
+#define	ATH_FF_HLEN32_S	8
+#define	ATH_FF_SEQNUM	0x001ffc00	/* sequence number */
+#define	ATH_FF_SEQNUM_S	10
+#define	ATH_FF_OFFSET	0xffe00000	/* offset to 2nd payload */
+#define	ATH_FF_OFFSET_S	21
+
+#define	ATH_FF_MAX_HDR_PAD	4
+#define	ATH_FF_MAX_SEP_PAD	6
+#define	ATH_FF_MAX_HDR		30
+
+#define	ATH_FF_PROTO_L2TUNNEL	0	/* L2 tunnel protocol */
+#define	ATH_FF_ETH_TYPE		0x88bd	/* Ether type for encapsulated frames */
+#define	ATH_FF_SNAP_ORGCODE_0	0x00
+#define	ATH_FF_SNAP_ORGCODE_1	0x03
+#define	ATH_FF_SNAP_ORGCODE_2	0x7f
+
 #define	ETHER_HEADER_COPY(dst, src) \
 	memcpy(dst, src, sizeof(struct ether_header))
 

Modified: head/sys/net80211/ieee80211_superg.h
==============================================================================
--- head/sys/net80211/ieee80211_superg.h	Thu Mar 26 21:10:35 2009	(r190454)
+++ head/sys/net80211/ieee80211_superg.h	Thu Mar 26 21:29:03 2009	(r190455)
@@ -31,6 +31,32 @@
  * Atheros' 802.11 SuperG protocol support.
  */
 
+/*
+ * Atheros advanced capability information element.
+ */
+struct ieee80211_ath_ie {
+	uint8_t		ath_id;			/* IEEE80211_ELEMID_VENDOR */
+	uint8_t		ath_len;		/* length in bytes */
+	uint8_t		ath_oui[3];		/* ATH_OUI */
+	uint8_t		ath_oui_type;		/* ATH_OUI_TYPE */
+	uint8_t		ath_oui_subtype;	/* ATH_OUI_SUBTYPE */
+	uint8_t		ath_version;		/* spec revision */
+	uint8_t		ath_capability;		/* capability info */
+#define	ATHEROS_CAP_TURBO_PRIME		0x01	/* dynamic turbo--aka Turbo' */
+#define	ATHEROS_CAP_COMPRESSION		0x02	/* data compression */
+#define	ATHEROS_CAP_FAST_FRAME		0x04	/* fast (jumbo) frames */
+#define	ATHEROS_CAP_XR			0x08	/* Xtended Range support */
+#define	ATHEROS_CAP_AR			0x10	/* Advanded Radar support */
+#define	ATHEROS_CAP_BURST		0x20	/* Bursting - not negotiated */
+#define	ATHEROS_CAP_WME			0x40	/* CWMin tuning */
+#define	ATHEROS_CAP_BOOST		0x80	/* use turbo/!turbo mode */
+	uint8_t		ath_defkeyix[2];
+} __packed;
+
+#define	ATH_OUI_VERSION		0x00
+#define	ATH_OUI_SUBTYPE		0x01
+
+#ifdef _KERNEL
 void	ieee80211_superg_attach(struct ieee80211com *);
 void	ieee80211_superg_detach(struct ieee80211com *);
 void	ieee80211_superg_vattach(struct ieee80211vap *);
@@ -54,4 +80,5 @@ ieee80211_decap_fastframe(struct ieee802
 	return IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_FF) ?
 	    ieee80211_ff_decap(ni, m) : m;
 }
+#endif /* _KERNEL */
 #endif /* _NET80211_IEEE80211_SUPERG_H_ */

Modified: head/sys/net80211/ieee80211_tdma.c
==============================================================================
--- head/sys/net80211/ieee80211_tdma.c	Thu Mar 26 21:10:35 2009	(r190454)
+++ head/sys/net80211/ieee80211_tdma.c	Thu Mar 26 21:29:03 2009	(r190455)
@@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
  * IEEE 802.11 TDMA mode support.
  */
 #include "opt_inet.h"
+#include "opt_tdma.h"
 #include "opt_wlan.h"
 
 #include 
@@ -59,7 +60,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include "opt_tdma.h"
 #ifndef TDMA_SLOTLEN_DEFAULT
 #define	TDMA_SLOTLEN_DEFAULT	10*1000		/* 10ms */
 #endif
@@ -94,6 +94,16 @@ __FBSDID("$FreeBSD$");
 #define	TDMA_TXRATE_11NG_DEFAULT	(4 | IEEE80211_RATE_MCS)
 #endif
 
+#define	TDMA_VERSION_VALID(_version) \
+	(TDMA_VERSION_V2 <= (_version) && (_version) <= TDMA_VERSION)
+#define	TDMA_SLOTCNT_VALID(_slotcnt) \
+	(2 <= (_slotcnt) && (_slotcnt) <= TDMA_MAXSLOTS)
+/* XXX magic constants */
+#define	TDMA_SLOTLEN_VALID(_slotlen) \
+	(2*100 <= (_slotlen) && (unsigned)(_slotlen) <= 0xfffff)
+/* XXX probably should set a max */
+#define	TDMA_BINTVAL_VALID(_bintval)	(1 <= (_bintval))
+
 static void tdma_vdetach(struct ieee80211vap *vap);
 static int tdma_newstate(struct ieee80211vap *, enum ieee80211_state, int);
 static void tdma_beacon_miss(struct ieee80211vap *vap);

Modified: head/sys/net80211/ieee80211_tdma.h
==============================================================================
--- head/sys/net80211/ieee80211_tdma.h	Thu Mar 26 21:10:35 2009	(r190454)
+++ head/sys/net80211/ieee80211_tdma.h	Thu Mar 26 21:29:03 2009	(r190455)
@@ -31,6 +31,39 @@
 /*
  * TDMA-mode implementation definitions.
  */
+
+#define	TDMA_SUBTYPE_PARAM	0x01
+#define	TDMA_VERSION_V2		2
+#define	TDMA_VERSION		TDMA_VERSION_V2
+
+/* NB: we only support 2 right now but protocol handles up to 8 */
+#define	TDMA_MAXSLOTS		2	/* max slots/sta's */
+
+#define	TDMA_PARAM_LEN_V2	sizeof(struct ieee80211_tdma_param)
+
+/*
+ * TDMA information element.
+ */
+struct ieee80211_tdma_param {
+	u_int8_t	tdma_id;	/* IEEE80211_ELEMID_VENDOR */
+	u_int8_t	tdma_len;
+	u_int8_t	tdma_oui[3];	/* TDMA_OUI */
+	u_int8_t	tdma_type;	/* TDMA_OUI_TYPE */
+	u_int8_t	tdma_subtype;	/* TDMA_SUBTYPE_PARAM */
+	u_int8_t	tdma_version;	/* spec revision */
+	u_int8_t	tdma_slot;	/* station slot # [0..7] */
+	u_int8_t	tdma_slotcnt;	/* bss slot count [1..8] */
+	u_int16_t	tdma_slotlen;	/* bss slot len (100us) */
+	u_int8_t	tdma_bintval;	/* beacon interval (superframes) */
+	u_int8_t	tdma_inuse[1];	/* slot occupancy map */
+	u_int8_t	tdma_pad[2];
+	u_int8_t	tdma_tstamp[8];	/* timestamp from last beacon */
+} __packed;
+
+#ifdef _KERNEL
+/*
+ * Implementation state.
+ */
 struct ieee80211_tdma_state {
 	u_int	tdma_slotlen;		/* bss slot length (us) */
 	uint8_t	tdma_version;		/* protocol version to use */
@@ -65,4 +98,5 @@ uint8_t *ieee80211_add_tdma(uint8_t *frm
 struct ieee80211_beacon_offsets;
 void	ieee80211_tdma_update_beacon(struct ieee80211vap *vap,
 	    struct ieee80211_beacon_offsets *bo);
+#endif /* _KERNEL */
 #endif /* !_NET80211_IEEE80211_TDMA_H_ */

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 21:29:39 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 04C1F1065677;
	Thu, 26 Mar 2009 21:29:39 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E61A28FC13;
	Thu, 26 Mar 2009 21:29:38 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2QLTc1W038202;
	Thu, 26 Mar 2009 21:29:38 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2QLTclp038201;
	Thu, 26 Mar 2009 21:29:38 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200903262129.n2QLTclp038201@svn.freebsd.org>
From: Sam Leffler 
Date: Thu, 26 Mar 2009 21:29:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190456 - head/sbin/ifconfig
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 21:29:41 -0000

Author: sam
Date: Thu Mar 26 21:29:38 2009
New Revision: 190456
URL: http://svn.freebsd.org/changeset/base/190456

Log:
  add superg+tdma include files for protocol defs needed to do ie parsing

Modified:
  head/sbin/ifconfig/ifieee80211.c

Modified: head/sbin/ifconfig/ifieee80211.c
==============================================================================
--- head/sbin/ifconfig/ifieee80211.c	Thu Mar 26 21:29:03 2009	(r190455)
+++ head/sbin/ifconfig/ifieee80211.c	Thu Mar 26 21:29:38 2009	(r190456)
@@ -78,6 +78,9 @@
 #include 
 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -3020,13 +3023,6 @@ list_scan(int s)
 	} while (len >= sizeof(struct ieee80211req_scan_result));
 }
 
-#ifdef __FreeBSD__
-#include 
-#endif
-#ifdef __NetBSD__
-#include 
-#endif
-
 static void
 scan_and_wait(int s)
 {

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 21:29:43 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7C28C1065697;
	Thu, 26 Mar 2009 21:29:43 +0000 (UTC)
	(envelope-from ambrisko@ambrisko.com)
Received: from mail.ambrisko.com (mail.ambrisko.com [64.174.51.43])
	by mx1.freebsd.org (Postfix) with ESMTP id 33A248FC28;
	Thu, 26 Mar 2009 21:29:43 +0000 (UTC)
	(envelope-from ambrisko@ambrisko.com)
X-Ambrisko-Me: Yes
Received: from server2.ambrisko.com (HELO www.ambrisko.com) ([192.168.1.2])
	by ironport.ambrisko.com with ESMTP; 26 Mar 2009 14:30:34 -0700
Received: from ambrisko.com (localhost [127.0.0.1])
	by www.ambrisko.com (8.14.3/8.14.1) with ESMTP id n2QLTgUv076135;
	Thu, 26 Mar 2009 14:29:42 -0700 (PDT)
	(envelope-from ambrisko@ambrisko.com)
Received: (from ambrisko@localhost)
	by ambrisko.com (8.14.3/8.14.3/Submit) id n2QLTgV9076134;
	Thu, 26 Mar 2009 14:29:42 -0700 (PDT) (envelope-from ambrisko)
From: Doug Ambrisko 
Message-Id: <200903262129.n2QLTgV9076134@ambrisko.com>
In-Reply-To: <20090326205356.GA17416@freebsd.org>
To: Roman Divacky 
Date: Thu, 26 Mar 2009 14:29:42 -0700 (PDT)
X-Mailer: ELM [version 2.4ME+ PL94b (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Cc: svn-src-head@freebsd.org, Doug Ambrisko ,
	svn-src-all@freebsd.org, src-committers@freebsd.org
Subject: Re: svn commit: r190445 - in head/sys: amd64/linux32
 compat/linprocfs
 compat/linux conf dev/ipmi modules/ipmi modules/linprocfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 21:29:46 -0000

Roman Divacky writes:
| On Thu, Mar 26, 2009 at 05:14:23PM +0000, Doug Ambrisko wrote:
| > Author: ambrisko
| > Date: Thu Mar 26 17:14:22 2009
| > New Revision: 190445
| > URL: http://svn.freebsd.org/changeset/base/190445
| > 
| > Log:
| >   Add stuff to support upcoming BMC/IPMI flashing of newer Dell machine
| >   via the Linux tool.
| >        -  Add Linux shim to ipmi(4)
| >        -  Create a partitions file to linprocfs to make Linux fdisk see
| >           disks.  This file is dynamic so we can see disks come and go.
| >        -  Convert msdosfs to vfat in mtab since Linux uses that for
| >           msdosfs.
| >        -  In the Linux mount path convert vfat passed in to msdosfs
| >           so Linux mount works on FreeBSD.  Note that tasting works
| >           so that if da0 is a msdos file system
| >                   /compat/linux/bin/mount /dev/da0 /mnt
| >           works.
| >        -  fix a 64it bug for l_off_t.
| >   Grabing sh, mount, fdisk, df from Linux, creating a symlink of mtab to
| >   /compat/linux/etc/mtab and then some careful unpacking of the Linux bmc
| >   update tool and hacking makes it work on newer Dell boxes.  Note, probably
| >   if you can't figure out how to do this, then you probably shouldn't be
| >   doing it :-)
| > 
| > Added:
| >   head/sys/dev/ipmi/ipmi_linux.c   (contents, props changed)
| > Modified:
| >   head/sys/amd64/linux32/linux.h
| >   head/sys/compat/linprocfs/linprocfs.c
| >   head/sys/compat/linux/linux_file.c
| >   head/sys/conf/files.amd64
| >   head/sys/conf/files.i386
| >   head/sys/modules/ipmi/Makefile
| >   head/sys/modules/linprocfs/Makefile
| > 
| > Modified: head/sys/amd64/linux32/linux.h
| > ==============================================================================
| > --- head/sys/amd64/linux32/linux.h	Thu Mar 26 17:04:08 2009	(r190444)
| > +++ head/sys/amd64/linux32/linux.h	Thu Mar 26 17:14:22 2009	(r190445)
| > @@ -79,7 +79,7 @@ typedef l_ulong		l_ino_t;
| >  typedef l_int		l_key_t;
| >  typedef l_longlong	l_loff_t;
| >  typedef l_ushort	l_mode_t;
| > -typedef l_long		l_off_t;
| > +typedef l_ulong		l_off_t;
| 
| where did you get this idea? my copy of linux 2.6.16 shows that off_t
| is being declared as long. can you be more specific about the background
| of this change? what does it fix?

Maybe you have another suggestion to fix this.  The problem showed up
when doing a mmap of 0xcf79c000 into 0xffffffffcf79c000 also a mmap
of 0xf0000 ended up the same way.  This caused it to fail.  Note this
is only on amd64 with a Linux.  It didn't happen with a FreeBSD i386
version on amd64.  Here is a sample test program:
--------------------------------------------------------------------
#include 
#include 
#include 
#include 
#include 
#include 

test(int fd, off_t off, size_t len){
        char *temp;
        int i;
        unsigned int sum;
        int fdout;
        char str[100];
        int out;

        printf("checking %u/%u %x/%x\n",off,len,off,len);
        temp=mmap(NULL, len, PROT_READ, MAP_SHARED, fd, off);
        printf("Returned %x\n",temp);
        if (temp == MAP_FAILED) {
                perror("Couldn't map");
        } else
                for(i=0;i%x\n",sum);
        sprintf(str, "dump.%x",off);
        fdout=open(str,O_WRONLY|O_CREAT|O_TRUNC,0666);
        if (fdout==-1) {
                printf("failed to create %s\n",str);
        } else {
                out=write(fdout,temp,len);
                printf("What %d %d, %x\n",out,len,temp);
                close(fdout);
        }
/*
        printf("press enter to continue\n");
        scanf("%d",&fdout);
*/
        munmap(temp, len);
}

main(){
        int fd, i;

        fd=open("/dev/mem",O_RDONLY);
        if (fd==-1) {
                printf("Can't open /dev/mem\n");
                exit(1);
        }
        test(fd,0xf0000,4096);
        test(fd,0xfe000,4096);
        test(fd,0xcf7f0000,4096);
        test(fd,0xcf79c000,4096);
}
--------------------------------------------------------------------
I can toss a compiled Linux/i386, FreeBSD/i386 and FreeBSD/amd64 versions
up on my web server.  I added a printf to the native mmap kernel function
to print out the address being passed to it.

Thanks,

Doug A.

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 21:59:13 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 40950106566B;
	Thu, 26 Mar 2009 21:59:13 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id F42038FC0A;
	Thu, 26 Mar 2009 21:59:12 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net
	[98.109.39.197])
	by cyrus.watson.org (Postfix) with ESMTPSA id 932F546B32;
	Thu, 26 Mar 2009 17:59:12 -0400 (EDT)
Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0)
	by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n2QLwkmT086524;
	Thu, 26 Mar 2009 17:59:06 -0400 (EDT) (envelope-from jhb@freebsd.org)
From: John Baldwin 
To: Doug Ambrisko 
Date: Thu, 26 Mar 2009 17:58:27 -0400
User-Agent: KMail/1.9.7
References: <200903262129.n2QLTgV9076134@ambrisko.com>
In-Reply-To: <200903262129.n2QLTgV9076134@ambrisko.com>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200903261758.28547.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by
	milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]);
	Thu, 26 Mar 2009 17:59:06 -0400 (EDT)
X-Virus-Scanned: ClamAV 0.94.2/9171/Thu Mar 26 13:49:28 2009 on
	server.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 
	autolearn=ham version=3.1.3
X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx
Cc: svn-src-head@freebsd.org, Doug Ambrisko ,
	Roman Divacky , src-committers@freebsd.org,
	svn-src-all@freebsd.org
Subject: Re: svn commit: r190445 - in head/sys: amd64/linux32
	compat/linprocfs compat/linux conf dev/ipmi modules/ipmi
	modules/linprocfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 21:59:13 -0000

On Thursday 26 March 2009 5:29:42 pm Doug Ambrisko wrote:
> Roman Divacky writes:
> | On Thu, Mar 26, 2009 at 05:14:23PM +0000, Doug Ambrisko wrote:
> | > Author: ambrisko
> | > Date: Thu Mar 26 17:14:22 2009
> | > New Revision: 190445
> | > URL: http://svn.freebsd.org/changeset/base/190445
> | > 
> | > Log:
> | >   Add stuff to support upcoming BMC/IPMI flashing of newer Dell machine
> | >   via the Linux tool.
> | >        -  Add Linux shim to ipmi(4)
> | >        -  Create a partitions file to linprocfs to make Linux fdisk see
> | >           disks.  This file is dynamic so we can see disks come and go.
> | >        -  Convert msdosfs to vfat in mtab since Linux uses that for
> | >           msdosfs.
> | >        -  In the Linux mount path convert vfat passed in to msdosfs
> | >           so Linux mount works on FreeBSD.  Note that tasting works
> | >           so that if da0 is a msdos file system
> | >                   /compat/linux/bin/mount /dev/da0 /mnt
> | >           works.
> | >        -  fix a 64it bug for l_off_t.
> | >   Grabing sh, mount, fdisk, df from Linux, creating a symlink of mtab to
> | >   /compat/linux/etc/mtab and then some careful unpacking of the Linux 
bmc
> | >   update tool and hacking makes it work on newer Dell boxes.  Note, 
probably
> | >   if you can't figure out how to do this, then you probably shouldn't be
> | >   doing it :-)
> | > 
> | > Added:
> | >   head/sys/dev/ipmi/ipmi_linux.c   (contents, props changed)
> | > Modified:
> | >   head/sys/amd64/linux32/linux.h
> | >   head/sys/compat/linprocfs/linprocfs.c
> | >   head/sys/compat/linux/linux_file.c
> | >   head/sys/conf/files.amd64
> | >   head/sys/conf/files.i386
> | >   head/sys/modules/ipmi/Makefile
> | >   head/sys/modules/linprocfs/Makefile
> | > 
> | > Modified: head/sys/amd64/linux32/linux.h
> | > 
==============================================================================
> | > --- head/sys/amd64/linux32/linux.h	Thu Mar 26 17:04:08 2009	(r190444)
> | > +++ head/sys/amd64/linux32/linux.h	Thu Mar 26 17:14:22 2009	(r190445)
> | > @@ -79,7 +79,7 @@ typedef l_ulong		l_ino_t;
> | >  typedef l_int		l_key_t;
> | >  typedef l_longlong	l_loff_t;
> | >  typedef l_ushort	l_mode_t;
> | > -typedef l_long		l_off_t;
> | > +typedef l_ulong		l_off_t;
> | 
> | where did you get this idea? my copy of linux 2.6.16 shows that off_t
> | is being declared as long. can you be more specific about the background
> | of this change? what does it fix?
> 
> Maybe you have another suggestion to fix this.  The problem showed up
> when doing a mmap of 0xcf79c000 into 0xffffffffcf79c000 also a mmap
> of 0xf0000 ended up the same way.  This caused it to fail.  Note this
> is only on amd64 with a Linux.  It didn't happen with a FreeBSD i386
> version on amd64.  Here is a sample test program:

I'm sure this can be easily fixed in the Linux mmap() handlers instead.  Do 
you know if your Linux binary is using mmap2() or the old mmap()?

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 22:04:54 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E76761065675;
	Thu, 26 Mar 2009 22:04:54 +0000 (UTC)
	(envelope-from gabor@FreeBSD.org)
Received: from server.mypc.hu (server.mypc.hu [87.229.73.95])
	by mx1.freebsd.org (Postfix) with ESMTP id 92C058FC13;
	Thu, 26 Mar 2009 22:04:54 +0000 (UTC)
	(envelope-from gabor@FreeBSD.org)
Received: from localhost (localhost [127.0.0.1])
	by server.mypc.hu (Postfix) with ESMTP id 950F614D8892;
	Thu, 26 Mar 2009 23:04:53 +0100 (CET)
X-Virus-Scanned: amavisd-new at t-hosting.hu
Received: from server.mypc.hu ([127.0.0.1])
	by localhost (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id AU7WFTvbopjg; Thu, 26 Mar 2009 23:04:52 +0100 (CET)
Received: from [192.168.1.105] (catv-80-98-231-64.catv.broadband.hu
	[80.98.231.64])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by server.mypc.hu (Postfix) with ESMTPSA id 98FC114D888D;
	Thu, 26 Mar 2009 23:04:52 +0100 (CET)
Message-ID: <49CBFC02.2000506@FreeBSD.org>
Date: Thu, 26 Mar 2009 23:04:50 +0100
From: =?ISO-8859-1?Q?G=E1bor_K=F6vesd=E1n?= 
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
To: Robert Watson 
References: <200903131040.n2DAecSO061131@svn.freebsd.org>
	
	<49BB0DF0.3020907@FreeBSD.org>
	
In-Reply-To: 
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Cc: Gabor Pali , doc@FreeBSD.org,
	Tom Rhodes , Rene Ladan ,
	Giorgos Keramidas ,
	Manolis Kiagias ,
	svn-src-head@freebsd.org, "Sean C. Farley" 
Subject: Re: NLS additions to I18N chapter of developers-handbook [Was: Re:
 svn commit: r189765 - in head: . lib/libc lib/libc/nls]
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 22:04:55 -0000

Robert Watson escribió:
> Do you have any advice on what to do for libraries that provide error 
> strings in their own error spaces?  Is it intended that the library's 
> init and destroy functions will open and close catalogues?  Will this 
> work if the application the library is used by doesn't know about 
> catalogues?  Etc...
I've made one more little addition, which can be useful to spare with 
error strings. :)
http://kovesdan.org/patches/nls-doc2.diff

-- 
Gabor Kovesdan
FreeBSD Volunteer

EMAIL: gabor@FreeBSD.org .:|:. gabor@kovesdan.org
WEB:   http://people.FreeBSD.org/~gabor .:|:. http://kovesdan.org


From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 22:09:24 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 28F92106566C;
	Thu, 26 Mar 2009 22:09:24 +0000 (UTC)
	(envelope-from ambrisko@ambrisko.com)
Received: from mail.ambrisko.com (mail.ambrisko.com [64.174.51.43])
	by mx1.freebsd.org (Postfix) with ESMTP id D76448FC19;
	Thu, 26 Mar 2009 22:09:23 +0000 (UTC)
	(envelope-from ambrisko@ambrisko.com)
X-Ambrisko-Me: Yes
Received: from server2.ambrisko.com (HELO www.ambrisko.com) ([192.168.1.2])
	by ironport.ambrisko.com with ESMTP; 26 Mar 2009 15:10:15 -0700
Received: from ambrisko.com (localhost [127.0.0.1])
	by www.ambrisko.com (8.14.3/8.14.1) with ESMTP id n2QM9Nhl078656;
	Thu, 26 Mar 2009 15:09:23 -0700 (PDT)
	(envelope-from ambrisko@ambrisko.com)
Received: (from ambrisko@localhost)
	by ambrisko.com (8.14.3/8.14.3/Submit) id n2QM9NdZ078655;
	Thu, 26 Mar 2009 15:09:23 -0700 (PDT) (envelope-from ambrisko)
From: Doug Ambrisko 
Message-Id: <200903262209.n2QM9NdZ078655@ambrisko.com>
In-Reply-To: <200903261758.28547.jhb@freebsd.org>
To: John Baldwin 
Date: Thu, 26 Mar 2009 15:09:23 -0700 (PDT)
X-Mailer: ELM [version 2.4ME+ PL94b (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Cc: Doug Ambrisko , src-committers@freebsd.org,
	Doug Ambrisko ,
	Roman Divacky , svn-src-head@freebsd.org,
	svn-src-all@freebsd.org
Subject: Re: svn commit: r190445 - in head/sys: amd64/linux32
 compat/linprocfs
 compat/linux conf dev/ipmi modules/ipmi modules/linprocfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 22:09:24 -0000

John Baldwin writes:
| On Thursday 26 March 2009 5:29:42 pm Doug Ambrisko wrote:
	[snip]
| > Maybe you have another suggestion to fix this.  The problem showed up
| > when doing a mmap of 0xcf79c000 into 0xffffffffcf79c000 also a mmap
| > of 0xf0000 ended up the same way.  This caused it to fail.  Note this
| > is only on amd64 with a Linux.  It didn't happen with a FreeBSD i386
| > version on amd64.  Here is a sample test program:
| 
| I'm sure this can be easily fixed in the Linux mmap() handlers instead.  Do 
| you know if your Linux binary is using mmap2() or the old mmap()?

I think it uses linux_mmap then bouncing it to linux_mmap_common.
linux_mmap_common had it right but when it mmap picked it up then 
it was wrong in my intrumentation. 

I'll flip the l_off_t type back and then instrument it more to find
out when things are going bad.  I missed the other usage of l_off_t
so I agree this is a bad change.  However, I wonder if the other
usage of l_off_t actually works right or there is a bug with that
as well?

I should be able to get something put together pretty quick and
send it for review.

Thanks,

Doug A.

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 26 22:29:10 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 08445106566C;
	Thu, 26 Mar 2009 22:29:10 +0000 (UTC)
	(envelope-from scottl@samsco.org)
Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57])
	by mx1.freebsd.org (Postfix) with ESMTP id AC5CB8FC08;
	Thu, 26 Mar 2009 22:29:09 +0000 (UTC)
	(envelope-from scottl@samsco.org)
Received: from phobos.local ([192.168.254.200]) (authenticated bits=0)
	by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id n2QMT4TI056217;
	Thu, 26 Mar 2009 16:29:04 -0600 (MDT)
	(envelope-from scottl@samsco.org)
Message-ID: <49CC01B0.10801@samsco.org>
Date: Thu, 26 Mar 2009 16:29:04 -0600
From: Scott Long 
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US;
	rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9
MIME-Version: 1.0
To: Doug Ambrisko 
References: <200903262209.n2QM9NdZ078655@ambrisko.com>
In-Reply-To: <200903262209.n2QM9NdZ078655@ambrisko.com>
X-Enigmail-Version: 0.95.6
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Status: No, score=-4.4 required=3.8 tests=ALL_TRUSTED,BAYES_00
	autolearn=ham version=3.1.8
X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org
Cc: Doug Ambrisko , src-committers@FreeBSD.org,
	John Baldwin ,
	Roman Divacky , svn-src-head@FreeBSD.org,
	svn-src-all@FreeBSD.org
Subject: Re: svn commit: r190445 - in head/sys: amd64/linux32
 compat/linprocfs
 compat/linux conf dev/ipmi modules/ipmi modules/linprocfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 22:29:10 -0000

Doug Ambrisko wrote:
> John Baldwin writes:
> | On Thursday 26 March 2009 5:29:42 pm Doug Ambrisko wrote:
> 	[snip]
> | > Maybe you have another suggestion to fix this.  The problem showed up
> | > when doing a mmap of 0xcf79c000 into 0xffffffffcf79c000 also a mmap
> | > of 0xf0000 ended up the same way.  This caused it to fail.  Note this
> | > is only on amd64 with a Linux.  It didn't happen with a FreeBSD i386
> | > version on amd64.  Here is a sample test program:
> | 
> | I'm sure this can be easily fixed in the Linux mmap() handlers instead.  Do 
> | you know if your Linux binary is using mmap2() or the old mmap()?
> 
> I think it uses linux_mmap then bouncing it to linux_mmap_common.
> linux_mmap_common had it right but when it mmap picked it up then 
> it was wrong in my intrumentation. 
> 
> I'll flip the l_off_t type back and then instrument it more to find
> out when things are going bad.  I missed the other usage of l_off_t
> so I agree this is a bad change.  However, I wonder if the other
> usage of l_off_t actually works right or there is a bug with that
> as well?

Well, ultimately remember that offsets can be negative, by definition.

Scott

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 00:09:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3BCDB106566C;
	Fri, 27 Mar 2009 00:09:00 +0000 (UTC)
	(envelope-from ambrisko@ambrisko.com)
Received: from mail.ambrisko.com (mail.ambrisko.com [64.174.51.43])
	by mx1.freebsd.org (Postfix) with ESMTP id DFC068FC0A;
	Fri, 27 Mar 2009 00:08:59 +0000 (UTC)
	(envelope-from ambrisko@ambrisko.com)
X-Ambrisko-Me: Yes
Received: from server2.ambrisko.com (HELO www.ambrisko.com) ([192.168.1.2])
	by ironport.ambrisko.com with ESMTP; 26 Mar 2009 17:09:51 -0700
Received: from ambrisko.com (localhost [127.0.0.1])
	by www.ambrisko.com (8.14.3/8.14.1) with ESMTP id n2R08xaK085981;
	Thu, 26 Mar 2009 17:08:59 -0700 (PDT)
	(envelope-from ambrisko@ambrisko.com)
Received: (from ambrisko@localhost)
	by ambrisko.com (8.14.3/8.14.3/Submit) id n2R08xBg085980;
	Thu, 26 Mar 2009 17:08:59 -0700 (PDT) (envelope-from ambrisko)
From: Doug Ambrisko 
Message-Id: <200903270008.n2R08xBg085980@ambrisko.com>
In-Reply-To: <200903262209.n2QM9NdZ078655@ambrisko.com>
To: Doug Ambrisko 
Date: Thu, 26 Mar 2009 17:08:59 -0700 (PDT)
X-Mailer: ELM [version 2.4ME+ PL94b (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Cc: Doug Ambrisko , src-committers@freebsd.org,
	John Baldwin ,
	Roman Divacky , svn-src-head@freebsd.org,
	svn-src-all@freebsd.org
Subject: Re: svn commit: r190445 - in head/sys: amd64/linux32
 compat/linprocfs
 compat/linux conf dev/ipmi modules/ipmi modules/linprocfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 00:09:00 -0000

Doug Ambrisko writes:
| John Baldwin writes:
| | On Thursday 26 March 2009 5:29:42 pm Doug Ambrisko wrote:
| 	[snip]
| | > Maybe you have another suggestion to fix this.  The problem showed up
| | > when doing a mmap of 0xcf79c000 into 0xffffffffcf79c000 also a mmap
| | > of 0xf0000 ended up the same way.  This caused it to fail.  Note this
| | > is only on amd64 with a Linux.  It didn't happen with a FreeBSD i386
| | > version on amd64.  Here is a sample test program:
| | 
| | I'm sure this can be easily fixed in the Linux mmap() handlers instead.  Do 
| | you know if your Linux binary is using mmap2() or the old mmap()?
| 
| I think it uses linux_mmap then bouncing it to linux_mmap_common.
| linux_mmap_common had it right but when it mmap picked it up then 
| it was wrong in my intrumentation. 
| 
| I'll flip the l_off_t type back and then instrument it more to find
| out when things are going bad.  I missed the other usage of l_off_t
| so I agree this is a bad change.  However, I wonder if the other
| usage of l_off_t actually works right or there is a bug with that
| as well?
| 
| I should be able to get something put together pretty quick and
| send it for review.

Okay, I did some more instrumenting again and found that I was 
slightly wrong.  The mmap that was failing was 0xcf79c000 and not
0xf0000.  This probably makes since since the sign bit was set
on 0xcf79c000.  However, it appear mmap doesn't really do negative
seeks.  Looking at the freebsd32_mmap the structure it uses for
args is:
  struct freebsd6_freebsd32_mmap_args {
        char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)];
        char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
        char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)];
        char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
        char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
        char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
        char poslo_l_[PADL_(u_int32_t)]; u_int32_t poslo; char poslo_r_[PADR_(u_int32_t)];
        char poshi_l_[PADL_(u_int32_t)]; u_int32_t poshi; char poshi_r_[PADR_(u_int32_t)];
  };
with both the high and the lows being u_int32_t.

So I wonder if in the linux32 the structure that is:
  struct l_mmap_argv {
        l_uintptr_t     addr;
        l_size_t        len;
        l_int           prot;
        l_int           flags;
        l_int           fd;
        l_off_t         pgoff;
  } __packed;
should be uint32_t for pgoff?

Using this patch things work okay:

Index: linux.h
===================================================================
RCS file: /usr/local/cvsroot/freebsd/src/sys/amd64/linux32/linux.h,v
retrieving revision 1.24
diff -u -p -r1.24 linux.h
--- linux.h	26 Mar 2009 17:14:22 -0000	1.24
+++ linux.h	27 Mar 2009 00:01:07 -0000
@@ -79,7 +79,7 @@ typedef l_ulong		l_ino_t;
 typedef l_int		l_key_t;
 typedef l_longlong	l_loff_t;
 typedef l_ushort	l_mode_t;
-typedef l_ulong		l_off_t;
+typedef l_long		l_off_t;
 typedef l_int		l_pid_t;
 typedef l_uint		l_size_t;
 typedef l_long		l_suseconds_t;
Index: linux32_machdep.c
===================================================================
RCS file: /usr/local/cvsroot/freebsd/src/sys/amd64/linux32/linux32_machdep.c,v
retrieving revision 1.52
diff -u -p -r1.52 linux32_machdep.c
--- linux32_machdep.c	18 Feb 2009 16:11:39 -0000	1.52
+++ linux32_machdep.c	27 Mar 2009 00:01:07 -0000
@@ -788,6 +788,7 @@ linux_mmap(struct thread *td, struct lin
 {
 	int error;
 	struct l_mmap_argv linux_args;
+	uint32_t pos;
 
 	error = copyin(args->ptr, &linux_args, sizeof(linux_args));
 	if (error)
@@ -801,7 +802,10 @@ linux_mmap(struct thread *td, struct lin
 #endif
 	if ((linux_args.pgoff % PAGE_SIZE) != 0)
 		return (EINVAL);
-	linux_args.pgoff /= PAGE_SIZE;
+	pos = linux_args.pgoff;
+	pos /= PAGE_SIZE;
+	linux_args.pgoff = pos;
+	
 
 	return (linux_mmap_common(td, &linux_args));
 }


So which should we do?  The uint32_t for the /= PAGE_SIZE or in
the mmap structure?  FWIW, they are mmaping /dev/mem and grabbing
the SMBIOS structure put at 0xcf79c000 and 0xcf7f0000 which are not
negative offsets.  linux_mmap2 and linux_common don't really have
this problem in this case since they are using the memory address 
/ PAGE_SIZE.  So they don't run into this sign problem like this.
I've confirmed that that above patch makes the Linux BMC firmware
upgrade tool works.  On a real Linux machine it also mmaps these
addresses and it works there otherwise the program goes into the
weeds since it can't find the IPMI controller.  This change only
mucks with linux_mmap.

Thanks,

Doug A.

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 03:17:25 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CBC831065673;
	Fri, 27 Mar 2009 03:17:25 +0000 (UTC)
	(envelope-from jmallett@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A161E8FC25;
	Fri, 27 Mar 2009 03:17:25 +0000 (UTC)
	(envelope-from jmallett@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2R3HPMJ046527;
	Fri, 27 Mar 2009 03:17:25 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2R3HPR6046525;
	Fri, 27 Mar 2009 03:17:25 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <200903270317.n2R3HPR6046525@svn.freebsd.org>
From: Juli Mallett 
Date: Fri, 27 Mar 2009 03:17:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190458 - head/sys/dev/wpi
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 03:17:26 -0000

Author: jmallett
Date: Fri Mar 27 03:17:25 2009
New Revision: 190458
URL: http://svn.freebsd.org/changeset/base/190458

Log:
  o) Check that no overrun or CRC errors were encountered in receiving a
     packet.  Linux, OpenBSD and our iwn(4) all do this.  It also results in
     a huge performance improvement (and the rejection of a fair number of
     apparently-bad packets on receive) on my hardware.
  o) Like the wpi(4) driver in OpenBSD, and like our iwn(4), also drop runt
     packets.
  o) Don't bother doing IFQ_POLL and then IFQ_DRV_DEQUEUE, just do
     IFQ_DRV_DEQUEUE outright.  This is more similar to how OpenBSD and our
     iwn(4) work.
  
  Reviewed by:	sam

Modified:
  head/sys/dev/wpi/if_wpi.c
  head/sys/dev/wpi/if_wpireg.h

Modified: head/sys/dev/wpi/if_wpi.c
==============================================================================
--- head/sys/dev/wpi/if_wpi.c	Thu Mar 26 22:54:19 2009	(r190457)
+++ head/sys/dev/wpi/if_wpi.c	Fri Mar 27 03:17:25 2009	(r190458)
@@ -1473,6 +1473,20 @@ wpi_rx_intr(struct wpi_softc *sc, struct
 	    le16toh(head->len), (int8_t)stat->rssi, head->rate, head->chan,
 	    (uintmax_t)le64toh(tail->tstamp)));
 
+	/* discard Rx frames with bad CRC early */
+	if ((le32toh(tail->flags) & WPI_RX_NOERROR) != WPI_RX_NOERROR) {
+		DPRINTFN(WPI_DEBUG_RX, ("%s: rx flags error %x\n", __func__,
+		    le32toh(tail->flags)));
+		ifp->if_ierrors++;
+		return;
+	}
+	if (le16toh(head->len) < sizeof (struct ieee80211_frame)) {
+		DPRINTFN(WPI_DEBUG_RX, ("%s: frame too short: %d\n", __func__,
+		    le16toh(head->len)));
+		ifp->if_ierrors++;
+		return;
+	}
+
 	/* XXX don't need mbuf, just dma buffer */
 	mnew = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, MJUMPAGESIZE);
 	if (mnew == NULL) {
@@ -2029,7 +2043,7 @@ wpi_start_locked(struct ifnet *ifp)
 		return;
 
 	for (;;) {
-		IFQ_POLL(&ifp->if_snd, m);
+		IFQ_DRV_DEQUEUE(&ifp->if_snd, m);
 		if (m == NULL)
 			break;
 		/* no QoS encapsulation for EAPOL frames */
@@ -2040,7 +2054,6 @@ wpi_start_locked(struct ifnet *ifp)
 			ifp->if_drv_flags |= IFF_DRV_OACTIVE;
 			break;
 		}
-		IFQ_DRV_DEQUEUE(&ifp->if_snd, m);
 		ni = (struct ieee80211_node *) m->m_pkthdr.rcvif;
 		m = ieee80211_encap(ni, m);
 		if (m == NULL) {

Modified: head/sys/dev/wpi/if_wpireg.h
==============================================================================
--- head/sys/dev/wpi/if_wpireg.h	Thu Mar 26 22:54:19 2009	(r190457)
+++ head/sys/dev/wpi/if_wpireg.h	Fri Mar 27 03:17:25 2009	(r190458)
@@ -235,12 +235,10 @@ struct wpi_rx_head {
 
 struct wpi_rx_tail {
 	uint32_t	flags;
-#if 0
 #define WPI_RX_NO_CRC_ERR	(1 << 0)
 #define WPI_RX_NO_OVFL_ERR	(1 << 1)
 /* shortcut for the above */
 #define WPI_RX_NOERROR		(WPI_RX_NO_CRC_ERR | WPI_RX_NO_OVFL_ERR)
-#endif
 	uint64_t	tstamp;
 	uint32_t	tbeacon;
 } __packed;

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 03:45:42 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 810921065670;
	Fri, 27 Mar 2009 03:45:42 +0000 (UTC)
	(envelope-from nyan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6DCC38FC0C;
	Fri, 27 Mar 2009 03:45:42 +0000 (UTC)
	(envelope-from nyan@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2R3jg6s047062;
	Fri, 27 Mar 2009 03:45:42 GMT (envelope-from nyan@svn.freebsd.org)
Received: (from nyan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2R3jg5u047061;
	Fri, 27 Mar 2009 03:45:42 GMT (envelope-from nyan@svn.freebsd.org)
Message-Id: <200903270345.n2R3jg5u047061@svn.freebsd.org>
From: Takahashi Yoshihiro 
Date: Fri, 27 Mar 2009 03:45:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190459 - head/sys/pc98/pc98
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 03:45:43 -0000

Author: nyan
Date: Fri Mar 27 03:45:42 2009
New Revision: 190459
URL: http://svn.freebsd.org/changeset/base/190459

Log:
  MFi386: r190447
  
    Convert gdt_segs and ldt_segs initialization to C99 style.

Modified:
  head/sys/pc98/pc98/machdep.c

Modified: head/sys/pc98/pc98/machdep.c
==============================================================================
--- head/sys/pc98/pc98/machdep.c	Fri Mar 27 03:17:25 2009	(r190458)
+++ head/sys/pc98/pc98/machdep.c	Fri Mar 27 03:45:42 2009	(r190459)
@@ -1308,234 +1308,234 @@ extern  vm_offset_t	proc0kstack;
  */
 struct soft_segment_descriptor gdt_segs[] = {
 /* GNULL_SEL	0 Null Descriptor */
-{	0x0,			/* segment base address  */
-	0x0,			/* length */
-	0,			/* segment type */
-	0,			/* segment descriptor priority level */
-	0,			/* segment descriptor present */
-	0, 0,
-	0,			/* default 32 vs 16 bit size */
-	0  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0x0,
+	.ssd_type = 0,
+	.ssd_dpl = 0,
+	.ssd_p = 0,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 0		},
 /* GPRIV_SEL	1 SMP Per-Processor Private Data Descriptor */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMRWA,		/* segment type */
-	0,			/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMRWA,
+	.ssd_dpl = 0,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 /* GUFS_SEL	2 %fs Descriptor for user */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMRWA,		/* segment type */
-	SEL_UPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMRWA,
+	.ssd_dpl = SEL_UPL,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 /* GUGS_SEL	3 %gs Descriptor for user */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMRWA,		/* segment type */
-	SEL_UPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMRWA,
+	.ssd_dpl = SEL_UPL,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 /* GCODE_SEL	4 Code Descriptor for kernel */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMERA,		/* segment type */
-	0,			/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMERA,
+	.ssd_dpl = 0,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 /* GDATA_SEL	5 Data Descriptor for kernel */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMRWA,		/* segment type */
-	0,			/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMRWA,
+	.ssd_dpl = 0,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 /* GUCODE_SEL	6 Code Descriptor for user */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMERA,		/* segment type */
-	SEL_UPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMERA,
+	.ssd_dpl = SEL_UPL,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 /* GUDATA_SEL	7 Data Descriptor for user */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMRWA,		/* segment type */
-	SEL_UPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMRWA,
+	.ssd_dpl = SEL_UPL,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 /* GBIOSLOWMEM_SEL 8 BIOS access to realmode segment 0x40, must be #8 in GDT */
-{	0x400,			/* segment base address */
-	0xfffff,		/* length */
-	SDT_MEMRWA,		/* segment type */
-	0,			/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x400,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMRWA,
+	.ssd_dpl = 0,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 /* GPROC0_SEL	9 Proc 0 Tss Descriptor */
 {
-	0x0,			/* segment base address */
-	sizeof(struct i386tss)-1,/* length  */
-	SDT_SYS386TSS,		/* segment type */
-	0,			/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	0,			/* unused - default 32 vs 16 bit size */
-	0  			/* limit granularity (byte/page units)*/ },
+	.ssd_base = 0x0,
+	.ssd_limit = sizeof(struct i386tss)-1,
+	.ssd_type = SDT_SYS386TSS,
+	.ssd_dpl = 0,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 0		},
 /* GLDT_SEL	10 LDT Descriptor */
-{	(int) ldt,		/* segment base address  */
-	sizeof(ldt)-1,		/* length - all address space */
-	SDT_SYSLDT,		/* segment type */
-	SEL_UPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	0,			/* unused - default 32 vs 16 bit size */
-	0  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = (int) ldt,
+	.ssd_limit = sizeof(ldt)-1,
+	.ssd_type = SDT_SYSLDT,
+	.ssd_dpl = SEL_UPL,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 0		},
 /* GUSERLDT_SEL	11 User LDT Descriptor per process */
-{	(int) ldt,		/* segment base address  */
-	(512 * sizeof(union descriptor)-1),		/* length */
-	SDT_SYSLDT,		/* segment type */
-	0,			/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	0,			/* unused - default 32 vs 16 bit size */
-	0  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = (int) ldt,
+	.ssd_limit = (512 * sizeof(union descriptor)-1),
+	.ssd_type = SDT_SYSLDT,
+	.ssd_dpl = 0,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 0		},
 /* GPANIC_SEL	12 Panic Tss Descriptor */
-{	(int) &dblfault_tss,	/* segment base address  */
-	sizeof(struct i386tss)-1,/* length - all address space */
-	SDT_SYS386TSS,		/* segment type */
-	0,			/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	0,			/* unused - default 32 vs 16 bit size */
-	0  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = (int) &dblfault_tss,
+	.ssd_limit = sizeof(struct i386tss)-1,
+	.ssd_type = SDT_SYS386TSS,
+	.ssd_dpl = 0,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 0		},
 /* GBIOSCODE32_SEL 13 BIOS 32-bit interface (32bit Code) */
-{	0,			/* segment base address (overwritten)  */
-	0xfffff,		/* length */
-	SDT_MEMERA,		/* segment type */
-	0,			/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	0,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMERA,
+	.ssd_dpl = 0,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 1		},
 /* GBIOSCODE16_SEL 14 BIOS 32-bit interface (16bit Code) */
-{	0,			/* segment base address (overwritten)  */
-	0xfffff,		/* length */
-	SDT_MEMERA,		/* segment type */
-	0,			/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	0,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMERA,
+	.ssd_dpl = 0,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 1		},
 /* GBIOSDATA_SEL 15 BIOS 32-bit interface (Data) */
-{	0,			/* segment base address (overwritten) */
-	0xfffff,		/* length */
-	SDT_MEMRWA,		/* segment type */
-	0,			/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMRWA,
+	.ssd_dpl = 0,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 /* GBIOSUTIL_SEL 16 BIOS 16-bit interface (Utility) */
-{	0,			/* segment base address (overwritten) */
-	0xfffff,		/* length */
-	SDT_MEMRWA,		/* segment type */
-	0,			/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	0,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMRWA,
+	.ssd_dpl = 0,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 1		},
 /* GBIOSARGS_SEL 17 BIOS 16-bit interface (Arguments) */
-{	0,			/* segment base address (overwritten) */
-	0xfffff,		/* length */
-	SDT_MEMRWA,		/* segment type */
-	0,			/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	0,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMRWA,
+	.ssd_dpl = 0,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 1		},
 /* GNDIS_SEL	18 NDIS Descriptor */
-{	0x0,			/* segment base address  */
-	0x0,			/* length */
-	0,			/* segment type */
-	0,			/* segment descriptor priority level */
-	0,			/* segment descriptor present */
-	0, 0,
-	0,			/* default 32 vs 16 bit size */
-	0  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0x0,
+	.ssd_type = 0,
+	.ssd_dpl = 0,
+	.ssd_p = 0,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 0		},
 };
 
 static struct soft_segment_descriptor ldt_segs[] = {
 	/* Null Descriptor - overwritten by call gate */
-{	0x0,			/* segment base address  */
-	0x0,			/* length - all address space */
-	0,			/* segment type */
-	0,			/* segment descriptor priority level */
-	0,			/* segment descriptor present */
-	0, 0,
-	0,			/* default 32 vs 16 bit size */
-	0  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0x0,
+	.ssd_type = 0,
+	.ssd_dpl = 0,
+	.ssd_p = 0,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 0		},
 	/* Null Descriptor - overwritten by call gate */
-{	0x0,			/* segment base address  */
-	0x0,			/* length - all address space */
-	0,			/* segment type */
-	0,			/* segment descriptor priority level */
-	0,			/* segment descriptor present */
-	0, 0,
-	0,			/* default 32 vs 16 bit size */
-	0  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0x0,
+	.ssd_type = 0,
+	.ssd_dpl = 0,
+	.ssd_p = 0,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 0		},
 	/* Null Descriptor - overwritten by call gate */
-{	0x0,			/* segment base address  */
-	0x0,			/* length - all address space */
-	0,			/* segment type */
-	0,			/* segment descriptor priority level */
-	0,			/* segment descriptor present */
-	0, 0,
-	0,			/* default 32 vs 16 bit size */
-	0  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0x0,
+	.ssd_type = 0,
+	.ssd_dpl = 0,
+	.ssd_p = 0,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 0		},
 	/* Code Descriptor for user */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMERA,		/* segment type */
-	SEL_UPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMERA,
+	.ssd_dpl = SEL_UPL,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 	/* Null Descriptor - overwritten by call gate */
-{	0x0,			/* segment base address  */
-	0x0,			/* length - all address space */
-	0,			/* segment type */
-	0,			/* segment descriptor priority level */
-	0,			/* segment descriptor present */
-	0, 0,
-	0,			/* default 32 vs 16 bit size */
-	0  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0x0,
+	.ssd_type = 0,
+	.ssd_dpl = 0,
+	.ssd_p = 0,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 0		},
 	/* Data Descriptor for user */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMRWA,		/* segment type */
-	SEL_UPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0, 0,
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMRWA,
+	.ssd_dpl = SEL_UPL,
+	.ssd_p = 1,
+	.ssd_xx = 0, .ssd_xx1 = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 };
 
 void

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 03:52:08 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CF838106564A;
	Fri, 27 Mar 2009 03:52:08 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BDD0C8FC0A;
	Fri, 27 Mar 2009 03:52:08 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2R3q82k047225;
	Fri, 27 Mar 2009 03:52:08 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2R3q8Qb047224;
	Fri, 27 Mar 2009 03:52:08 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200903270352.n2R3q8Qb047224@svn.freebsd.org>
From: Andrew Thompson 
Date: Fri, 27 Mar 2009 03:52:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190460 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 03:52:09 -0000

Author: thompsa
Date: Fri Mar 27 03:52:08 2009
New Revision: 190460
URL: http://svn.freebsd.org/changeset/base/190460

Log:
  Skip the allocation of the root hold token if the mount already happened.

Modified:
  head/sys/kern/vfs_mount.c

Modified: head/sys/kern/vfs_mount.c
==============================================================================
--- head/sys/kern/vfs_mount.c	Fri Mar 27 03:45:42 2009	(r190459)
+++ head/sys/kern/vfs_mount.c	Fri Mar 27 03:52:08 2009	(r190460)
@@ -1357,6 +1357,9 @@ root_mount_hold(const char *identifier)
 {
 	struct root_hold_token *h;
 
+	if (root_mounted())
+		return (NULL);
+
 	h = malloc(sizeof *h, M_DEVBUF, M_ZERO | M_WAITOK);
 	h->who = identifier;
 	mtx_lock(&mountlist_mtx);
@@ -1372,6 +1375,8 @@ void
 root_mount_rel(struct root_hold_token *h)
 {
 
+	if (h == NULL)
+		return;
 	mtx_lock(&mountlist_mtx);
 	LIST_REMOVE(h, list);
 	wakeup(&root_holds);

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 05:35:12 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DCE2F1065675;
	Fri, 27 Mar 2009 05:35:12 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CB1E18FC19;
	Fri, 27 Mar 2009 05:35:12 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2R5ZCV3049142;
	Fri, 27 Mar 2009 05:35:12 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2R5ZCd2049141;
	Fri, 27 Mar 2009 05:35:12 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <200903270535.n2R5ZCd2049141@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Fri, 27 Mar 2009 05:35:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190461 - head/sys/geom/part
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 05:35:13 -0000

Author: marcel
Date: Fri Mar 27 05:35:12 2009
New Revision: 190461
URL: http://svn.freebsd.org/changeset/base/190461

Log:
  Sharpen the saw:
  o  Don't create an APM scheme underneath another scheme when
     the probe doesn't allow it.
  o  APM uses 32-bit block numbers. Limit the scheme to 2^32-1
     blocks when the media is larger.

Modified:
  head/sys/geom/part/g_part_apm.c

Modified: head/sys/geom/part/g_part_apm.c
==============================================================================
--- head/sys/geom/part/g_part_apm.c	Fri Mar 27 03:52:08 2009	(r190460)
+++ head/sys/geom/part/g_part_apm.c	Fri Mar 27 05:35:12 2009	(r190461)
@@ -216,6 +216,11 @@ g_part_apm_create(struct g_part_table *b
 {
 	struct g_provider *pp;
 	struct g_part_apm_table *table;
+	uint32_t last;
+
+	/* We don't nest, which means that our depth should be 0. */
+	if (basetable->gpt_depth != 0)
+		return (ENXIO);
 
 	table = (struct g_part_apm_table *)basetable;
 	pp = gpp->gpp_provider;
@@ -223,12 +228,15 @@ g_part_apm_create(struct g_part_table *b
 	    pp->mediasize < (2 + 2 * basetable->gpt_entries) * pp->sectorsize)
 		return (ENOSPC);
 
+	/* APM uses 32-bit LBAs. */
+	last = MIN(pp->mediasize / pp->sectorsize, 0xffffffff) - 1;
+
 	basetable->gpt_first = 2 + basetable->gpt_entries;
-	basetable->gpt_last = (pp->mediasize / pp->sectorsize) - 1;
+	basetable->gpt_last = last;
 
 	table->ddr.ddr_sig = APM_DDR_SIG;
 	table->ddr.ddr_blksize = pp->sectorsize;
-	table->ddr.ddr_blkcount = basetable->gpt_last + 1;
+	table->ddr.ddr_blkcount = last + 1;
 
 	table->self.ent_sig = APM_ENT_SIG;
 	table->self.ent_pmblkcnt = basetable->gpt_entries + 1;

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 05:44:53 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D9E7C106566C;
	Fri, 27 Mar 2009 05:44:53 +0000 (UTC)
	(envelope-from jmallett@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C75DD8FC19;
	Fri, 27 Mar 2009 05:44:53 +0000 (UTC)
	(envelope-from jmallett@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2R5irUJ049334;
	Fri, 27 Mar 2009 05:44:53 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2R5irsu049333;
	Fri, 27 Mar 2009 05:44:53 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <200903270544.n2R5irsu049333@svn.freebsd.org>
From: Juli Mallett 
Date: Fri, 27 Mar 2009 05:44:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190462 - head/sys/dev/wpi
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 05:44:54 -0000

Author: jmallett
Date: Fri Mar 27 05:44:53 2009
New Revision: 190462
URL: http://svn.freebsd.org/changeset/base/190462

Log:
  Put the "%d retries" debug message in the transmit path behind WPI_DEBUG_TX
  rather than behind a seemingly accidental constant likely left over from one of
  the related drivers which uses log levels rather than per-facility debugging
  flags.  This should get rid of contextless messages on the console for people
  who have not set (or cleared the default) debugging flags.

Modified:
  head/sys/dev/wpi/if_wpi.c

Modified: head/sys/dev/wpi/if_wpi.c
==============================================================================
--- head/sys/dev/wpi/if_wpi.c	Fri Mar 27 05:35:12 2009	(r190461)
+++ head/sys/dev/wpi/if_wpi.c	Fri Mar 27 05:44:53 2009	(r190462)
@@ -1587,7 +1587,7 @@ wpi_tx_intr(struct wpi_softc *sc, struct
 	 */
 	wn->amn.amn_txcnt++;
 	if (stat->ntries > 0) {
-		DPRINTFN(3, ("%d retries\n", stat->ntries));
+		DPRINTFN(WPI_DEBUG_TX, ("%d retries\n", stat->ntries));
 		wn->amn.amn_retrycnt++;
 	}
 

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 05:48:43 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 54B2F106564A;
	Fri, 27 Mar 2009 05:48:43 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 42EBB8FC0A;
	Fri, 27 Mar 2009 05:48:43 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2R5mgYl049437;
	Fri, 27 Mar 2009 05:48:42 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2R5mgmS049436;
	Fri, 27 Mar 2009 05:48:42 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <200903270548.n2R5mgmS049436@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Fri, 27 Mar 2009 05:48:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190463 - head/sys/geom/part
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 05:48:43 -0000

Author: marcel
Date: Fri Mar 27 05:48:42 2009
New Revision: 190463
URL: http://svn.freebsd.org/changeset/base/190463

Log:
  Sharpen the saw:
  o  BSD uses 32-bit block numbers. Limit the scheme to 2^32-1
     blocks when the media is larger.

Modified:
  head/sys/geom/part/g_part_bsd.c

Modified: head/sys/geom/part/g_part_bsd.c
==============================================================================
--- head/sys/geom/part/g_part_bsd.c	Fri Mar 27 05:44:53 2009	(r190462)
+++ head/sys/geom/part/g_part_bsd.c	Fri Mar 27 05:48:42 2009	(r190463)
@@ -192,8 +192,7 @@ g_part_bsd_create(struct g_part_table *b
 	struct g_part_bsd_entry *entry;
 	struct g_part_bsd_table *table;
 	u_char *ptr;
-	uint64_t msize;
-	uint32_t ncyls, secpercyl;
+	uint32_t msize, ncyls, secpercyl;
 
 	pp = gpp->gpp_provider;
 	cp = LIST_FIRST(&pp->consumers);
@@ -203,7 +202,7 @@ g_part_bsd_create(struct g_part_table *b
 	if (BBSIZE % pp->sectorsize)
 		return (ENOTBLK);
 
-	msize = pp->mediasize / pp->sectorsize;
+	msize = MIN(pp->mediasize / pp->sectorsize, 0xffffffff);
 	secpercyl = basetable->gpt_sectors * basetable->gpt_heads;
 	ncyls = msize / secpercyl;
 

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 06:06:50 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 06DC21065672;
	Fri, 27 Mar 2009 06:06:50 +0000 (UTC)
	(envelope-from dchagin@dchagin.static.corbina.ru)
Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5])
	by mx1.freebsd.org (Postfix) with ESMTP id 8E4B88FC15;
	Fri, 27 Mar 2009 06:06:48 +0000 (UTC)
	(envelope-from dchagin@dchagin.static.corbina.ru)
Received: from corbina.ru (mail.post.ru [195.14.50.16])
	by contrabass.post.ru (Postfix) with ESMTP id 4237777F70;
	Fri, 27 Mar 2009 09:06:47 +0300 (MSK)
X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9
Received: from [10.208.17.3] (HELO dchagin.static.corbina.ru)
	by corbina.ru (CommuniGate Pro SMTP 5.1.14)
	with ESMTPS id 1703542079; Fri, 27 Mar 2009 09:06:47 +0300
Received: from dchagin.static.corbina.ru (localhost.chd.net [127.0.0.1])
	by dchagin.static.corbina.ru (8.14.3/8.14.3) with ESMTP id
	n2R66kHR002053; Fri, 27 Mar 2009 09:06:46 +0300 (MSK)
	(envelope-from dchagin@dchagin.static.corbina.ru)
Received: (from dchagin@localhost)
	by dchagin.static.corbina.ru (8.14.3/8.14.3/Submit) id n2R66h3a002052; 
	Fri, 27 Mar 2009 09:06:43 +0300 (MSK) (envelope-from dchagin)
Date: Fri, 27 Mar 2009 09:06:43 +0300
From: Chagin Dmitry 
To: Doug Ambrisko 
Message-ID: <20090327060643.GA1937@dchagin.static.corbina.ru>
References: <200903262209.n2QM9NdZ078655@ambrisko.com>
	<200903270008.n2R08xBg085980@ambrisko.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="AqsLC8rIMeq19msA"
Content-Disposition: inline
In-Reply-To: <200903270008.n2R08xBg085980@ambrisko.com>
User-Agent: Mutt/1.5.19 (2009-01-05)
Cc: Doug Ambrisko , src-committers@freebsd.org,
	John Baldwin ,
	Roman Divacky , svn-src-head@freebsd.org,
	svn-src-all@freebsd.org
Subject: Re: svn commit: r190445 - in head/sys: amd64/linux32
	compat/linprocfs compat/linux conf dev/ipmi modules/ipmi
	modules/linprocfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 06:06:50 -0000


--AqsLC8rIMeq19msA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Mar 26, 2009 at 05:08:59PM -0700, Doug Ambrisko wrote:
> Doug Ambrisko writes:
> | John Baldwin writes:
> | | On Thursday 26 March 2009 5:29:42 pm Doug Ambrisko wrote:
> | 	[snip]
> | | > Maybe you have another suggestion to fix this.  The problem showed =
up
> | | > when doing a mmap of 0xcf79c000 into 0xffffffffcf79c000 also a mmap
> | | > of 0xf0000 ended up the same way.  This caused it to fail.  Note th=
is
> | | > is only on amd64 with a Linux.  It didn't happen with a FreeBSD i386
> | | > version on amd64.  Here is a sample test program:
> | |=20
> | | I'm sure this can be easily fixed in the Linux mmap() handlers instea=
d.  Do=20
> | | you know if your Linux binary is using mmap2() or the old mmap()?
> |=20
> | I think it uses linux_mmap then bouncing it to linux_mmap_common.
> | linux_mmap_common had it right but when it mmap picked it up then=20
> | it was wrong in my intrumentation.=20
> |=20
> | I'll flip the l_off_t type back and then instrument it more to find
> | out when things are going bad.  I missed the other usage of l_off_t
> | so I agree this is a bad change.  However, I wonder if the other
> | usage of l_off_t actually works right or there is a bug with that
> | as well?
> |=20
> | I should be able to get something put together pretty quick and
> | send it for review.
>=20
> Okay, I did some more instrumenting again and found that I was=20
> slightly wrong.  The mmap that was failing was 0xcf79c000 and not
> 0xf0000.  This probably makes since since the sign bit was set
> on 0xcf79c000.  However, it appear mmap doesn't really do negative
> seeks.  Looking at the freebsd32_mmap the structure it uses for
> args is:
>   struct freebsd6_freebsd32_mmap_args {
>         char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(ca=
ddr_t)];
>         char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)=
];
>         char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)];
>         char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
>         char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
>         char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
>         char poslo_l_[PADL_(u_int32_t)]; u_int32_t poslo; char poslo_r_[P=
ADR_(u_int32_t)];
>         char poshi_l_[PADL_(u_int32_t)]; u_int32_t poshi; char poshi_r_[P=
ADR_(u_int32_t)];
>   };
> with both the high and the lows being u_int32_t.
>=20
> So I wonder if in the linux32 the structure that is:
>   struct l_mmap_argv {
>         l_uintptr_t     addr;
>         l_size_t        len;
>         l_int           prot;
>         l_int           flags;
>         l_int           fd;
>         l_off_t         pgoff;
>   } __packed;
> should be uint32_t for pgoff?
>=20


yes, you are right. s/uint32_t/l_ulong/ :)
also remove __packed.
thnx!


> Using this patch things work okay:
>=20
> Index: linux.h
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> RCS file: /usr/local/cvsroot/freebsd/src/sys/amd64/linux32/linux.h,v
> retrieving revision 1.24
> diff -u -p -r1.24 linux.h
> --- linux.h	26 Mar 2009 17:14:22 -0000	1.24
> +++ linux.h	27 Mar 2009 00:01:07 -0000
> @@ -79,7 +79,7 @@ typedef l_ulong		l_ino_t;
>  typedef l_int		l_key_t;
>  typedef l_longlong	l_loff_t;
>  typedef l_ushort	l_mode_t;
> -typedef l_ulong		l_off_t;
> +typedef l_long		l_off_t;
>  typedef l_int		l_pid_t;
>  typedef l_uint		l_size_t;
>  typedef l_long		l_suseconds_t;
> Index: linux32_machdep.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> RCS file: /usr/local/cvsroot/freebsd/src/sys/amd64/linux32/linux32_machde=
p.c,v
> retrieving revision 1.52
> diff -u -p -r1.52 linux32_machdep.c
> --- linux32_machdep.c	18 Feb 2009 16:11:39 -0000	1.52
> +++ linux32_machdep.c	27 Mar 2009 00:01:07 -0000
> @@ -788,6 +788,7 @@ linux_mmap(struct thread *td, struct lin
>  {
>  	int error;
>  	struct l_mmap_argv linux_args;
> +	uint32_t pos;
> =20
>  	error =3D copyin(args->ptr, &linux_args, sizeof(linux_args));
>  	if (error)
> @@ -801,7 +802,10 @@ linux_mmap(struct thread *td, struct lin
>  #endif
>  	if ((linux_args.pgoff % PAGE_SIZE) !=3D 0)
>  		return (EINVAL);
> -	linux_args.pgoff /=3D PAGE_SIZE;
> +	pos =3D linux_args.pgoff;
> +	pos /=3D PAGE_SIZE;
> +	linux_args.pgoff =3D pos;
> +=09
> =20
>  	return (linux_mmap_common(td, &linux_args));
>  }
>=20
>=20
> So which should we do?  The uint32_t for the /=3D PAGE_SIZE or in
> the mmap structure?  FWIW, they are mmaping /dev/mem and grabbing
> the SMBIOS structure put at 0xcf79c000 and 0xcf7f0000 which are not
> negative offsets.  linux_mmap2 and linux_common don't really have
> this problem in this case since they are using the memory address=20
> / PAGE_SIZE.  So they don't run into this sign problem like this.
> I've confirmed that that above patch makes the Linux BMC firmware
> upgrade tool works.  On a real Linux machine it also mmaps these
> addresses and it works there otherwise the program goes into the
> weeds since it can't find the IPMI controller.  This change only
> mucks with linux_mmap.
>=20
> Thanks,
>=20
> Doug A.

--=20
Have fun!
chd

--AqsLC8rIMeq19msA
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (FreeBSD)

iEUEARECAAYFAknMbPEACgkQ0t2Tb3OO/O3PcQCdGYWbLBrPymis+DftwtGhoCsi
3C8Al2dkhYt+EPOksKnAjicQY5i+EJw=
=ENzP
-----END PGP SIGNATURE-----

--AqsLC8rIMeq19msA--

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 06:32:53 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2C8BE1065670;
	Fri, 27 Mar 2009 06:32:53 +0000 (UTC) (envelope-from vd@v5d.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
	[IPv6:2001:4f8:fff6::28])
	by mx1.freebsd.org (Postfix) with ESMTP id EAC798FC1A;
	Fri, 27 Mar 2009 06:32:52 +0000 (UTC) (envelope-from vd@v5d.org)
Received: from mail.v5d.org (root@localhost [127.0.0.1])
	by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n2R6WpGq050221;
	Fri, 27 Mar 2009 06:32:52 GMT (envelope-from vd@v5d.org)
Received: by mail.v5d.org (Postfix, from userid 1002)
	id 60B6540F8; Fri, 27 Mar 2009 08:32:51 +0200 (EET)
Date: Fri, 27 Mar 2009 08:32:51 +0200
From: Vasil Dimov 
To: Coleman Kane 
Message-ID: <20090327063251.GA95057@polejan.hw.v5d.org>
References: <200903142010.n2EKAESF006945@svn.freebsd.org>
	<20090320140015.GA17645@hub.freebsd.org>
	<20090320153405.GA62675@zim.MIT.EDU> <49C3BCD4.4030605@freebsd.org>
	<1237567495.1993.2.camel@localhost>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="fUYQa+Pmc3FrFX/N"
Content-Disposition: inline
In-Reply-To: <1237567495.1993.2.camel@localhost>
User-Agent: Mutt/1.5.19 (2009-01-05)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	Sam Leffler , src-committers@FreeBSD.org
Subject: Re: svn commit: r189828 - in head: include sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: vd@FreeBSD.org
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 06:32:53 -0000


--fUYQa+Pmc3FrFX/N
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Mar 20, 2009 at 12:44:55 -0400, Coleman Kane wrote:
[...]
> > > On Fri, Mar 20, 2009, Vasil Dimov wrote:
> > >  =20
> > >> On Sat, Mar 14, 2009 at 08:10:14PM +0000, David Schultz wrote:
> > >>    =20
> > >>> Author: das
> > >>> Date: Sat Mar 14 20:10:14 2009
> > >>> New Revision: 189828
> > >>> URL: http://svn.freebsd.org/changeset/base/189828
> > >>>
> > >>> Log:
> > >>>   Fix the visibility of several prototypes. Also move pthread_kill(=
) and
> > >>>   pthread_sigmask() to signal.h. In principle, this shouldn't break=
 anything,
> > >>>      =20
> > >> [...]
> > >>
> > >> But it did break, see http://www.freebsd.org/cgi/query-pr.cgi?pr=3D1=
32828
[...]
> I was able to solve the problem by removing the "#include "
> from the offending file (there is only one) in devel/pth. After that, it
> built fine and I am using it now.
[...]

Hi,

I do not have access to 8-current machine so I have some dump questions:

1. From which file did you remove "#include "? I am afraid
that if we remove it from pth_p.h.in then this problem could arise again
after the user has installed pth and is trying to use it and has
included signal.h for some other reason in his source. I.e. if pth's
pthread.h and the system's signal.h are included in one source file this
problem will resurface.

2. Hmm, why are the prototypes conflicting in the first place?
extern int pthread_kill(pthread_t, int);
int pthread_kill(__pthread_t, int);

3. /usr/include/signal.h defines pthread_kill() only if __POSIX_VISIBLE
or __XSI_VISIBLE is defined. Can someone try to inject
#undef __POSIX_VISIBLE or #undef __XSI_VISIBLE into pth's pthread.h.in
to see if this fixes the problem and does not cause other problems?

Thank you!

--=20
Vasil Dimov

--fUYQa+Pmc3FrFX/N
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----

iEYEARECAAYFAknMcxMACgkQFw6SP/bBpCB5rgCgxW3jDMDFt+4XJPosvM1fHXSW
814An1oLJkV8yrbJdy/DufnyCuBLqyxe
=furC
-----END PGP SIGNATURE-----

--fUYQa+Pmc3FrFX/N--

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 11:03:03 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0D07E106564A;
	Fri, 27 Mar 2009 11:03:03 +0000 (UTC) (envelope-from dds@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EFC0C8FC0A;
	Fri, 27 Mar 2009 11:03:02 +0000 (UTC) (envelope-from dds@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2RB32EV059448;
	Fri, 27 Mar 2009 11:03:02 GMT (envelope-from dds@svn.freebsd.org)
Received: (from dds@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2RB32Ki059447;
	Fri, 27 Mar 2009 11:03:02 GMT (envelope-from dds@svn.freebsd.org)
Message-Id: <200903271103.n2RB32Ki059447@svn.freebsd.org>
From: Diomidis Spinellis 
Date: Fri, 27 Mar 2009 11:03:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190464 - head/lib/libc/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 11:03:03 -0000

Author: dds
Date: Fri Mar 27 11:03:02 2009
New Revision: 190464
URL: http://svn.freebsd.org/changeset/base/190464

Log:
  Document missing requests.

Modified:
  head/lib/libc/sys/ptrace.2

Modified: head/lib/libc/sys/ptrace.2
==============================================================================
--- head/lib/libc/sys/ptrace.2	Fri Mar 27 05:48:42 2009	(r190463)
+++ head/lib/libc/sys/ptrace.2	Fri Mar 27 11:03:02 2009	(r190464)
@@ -2,7 +2,7 @@
 .\"	$NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $
 .\"
 .\" This file is in the public domain.
-.Dd April 9, 2007
+.Dd March 27, 2009
 .Dt PTRACE 2
 .Os
 .Sh NAME
@@ -77,7 +77,8 @@ special case noted below, all
 .Fn ptrace
 calls are made by the tracing process, and the
 .Fa pid
-argument specifies the process ID of the traced process.
+argument specifies the process ID of the traced process
+or a corresponding thread ID.
 The
 .Fa request
 argument
@@ -311,6 +312,21 @@ with the array size specified by
 The return value from
 .Fn ptrace
 is the count of array entries filled in.
+.It PT_SETSTEP
+This request will turn on single stepping of the specified process.
+.It PT_CLEARSTEP
+This request will turn off single stepping of the specified process.
+.It PT_SUSPEND
+This request will suspend the specified thread.
+.It PT_RESUME
+This request will resume the specified thread.
+.It PT_TO_SCE
+This request will trace the specified process on each system call entry.
+.It PT_TO_SCX
+This request will trace the specified process on each system call exit.
+.It PT_SYSCALL
+This request will trace the specified process
+on each system call entry and exit.
 .El
 .Pp
 Additionally, machine-specific requests can exist.

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 13:03:31 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 08C821065689;
	Fri, 27 Mar 2009 13:03:31 +0000 (UTC)
	(envelope-from r.c.ladan@gmail.com)
Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25])
	by mx1.freebsd.org (Postfix) with ESMTP id 4A49A8FC1C;
	Fri, 27 Mar 2009 13:03:29 +0000 (UTC)
	(envelope-from r.c.ladan@gmail.com)
Received: by ey-out-2122.google.com with SMTP id 4so205227eyf.7
	for ; Fri, 27 Mar 2009 06:03:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:sender:message-id:date:from
	:organization:user-agent:mime-version:to:cc:subject:references
	:in-reply-to:x-enigmail-version:content-type;
	bh=njpRCT5cF9qYDNiMIFJwx+NKCZ+EZUy1qXvnHufiVYs=;
	b=L56G9BmcpOWIEtOu0GJ806WdpRtC2Lt5fXc3Yofj3/WgWm3uitmEiiT+k9gTdok6x8
	Xeq76crc/vH4ePUl18jL6GMkvAO4UHNKTqAO9raUG4vfOchDKvohWYC0h6fB4tTcTyvX
	dbAmWpqua71k8UdCRRH/pLjkKAzAvMDVqGdec=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=sender:message-id:date:from:organization:user-agent:mime-version:to
	:cc:subject:references:in-reply-to:x-enigmail-version:content-type;
	b=em8Z7/ZdffPuw4+Zu5aWtTZl0gbTO1/VCilom/VP7C0dlWYMnm9XMv5cy+Z2++HkAb
	VmGq+4+kHPtiJVJsPdfzTcppzeIzG2fbr2rv67uexzaSGD2fmkLVSHnOyC1RmyxQJFlF
	3KjakSg9tYn5wB5ALOwo53k9C3pzpPa4mn7EU=
Received: by 10.216.28.207 with SMTP id g57mr778924wea.163.1238159008234;
	Fri, 27 Mar 2009 06:03:28 -0700 (PDT)
Received: from self.rene-ladan.nl ([77.163.174.49])
	by mx.google.com with ESMTPS id 23sm1893434eya.6.2009.03.27.06.03.26
	(version=TLSv1/SSLv3 cipher=RC4-MD5);
	Fri, 27 Mar 2009 06:03:27 -0700 (PDT)
Sender: Rene Ladan 
Message-ID: <49CCCE52.3000603@freebsd.org>
Date: Fri, 27 Mar 2009 14:02:10 +0100
From: Rene Ladan 
Organization: The FreeBSD Project
User-Agent: Thunderbird 2.0.0.21 (X11/20090321)
MIME-Version: 1.0
To: =?ISO-8859-1?Q?G=E1bor_K=F6vesd=E1n?= 
References: <200903131040.n2DAecSO061131@svn.freebsd.org>
	
	<49BB0DF0.3020907@FreeBSD.org>
	
	<49CBFC02.2000506@FreeBSD.org>
In-Reply-To: <49CBFC02.2000506@FreeBSD.org>
X-Enigmail-Version: 0.95.6
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature";
	boundary="------------enig2895A9050401B4689F52741E"
Cc: Tom Rhodes , doc@FreeBSD.org,
	Gabor Pali , Robert Watson ,
	Giorgos Keramidas ,
	Manolis Kiagias ,
	svn-src-head@freebsd.org, "Sean C. Farley" 
Subject: Re: NLS additions to I18N chapter of developers-handbook [Was: Re:
 svn commit: r189765 - in head: . lib/libc lib/libc/nls]
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 13:03:32 -0000

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig2895A9050401B4689F52741E
Content-Type: multipart/mixed; boundary="------------090604030101000804030602"

This is a multi-part message in MIME format.
--------------090604030101000804030602
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

G=E1bor K=F6vesd=E1n schreef:
> Robert Watson escribi=F3:
>> Do you have any advice on what to do for libraries that provide error =

>> strings in their own error spaces?  Is it intended that the library's =

>> init and destroy functions will open and close catalogues?  Will this =

>> work if the application the library is used by doesn't know about=20
>> catalogues?  Etc...
> I've made one more little addition, which can be useful to spare with=20
> error strings. :)
> http://kovesdan.org/patches/nls-doc2.diff
>=20

Looks nice.  I corrected a few minor mistakes in the attached patch.

On my 8.0 box with localized libc, I get the English message when
setting errno to ENOTDIR and calling err(1, NULL) in a test program.
Is this to be expected?

Regards,
Rene

--=20
http://www.rene-ladan.nl/

GPG fingerprint =3D ADBC ECCD EB5F A6B4 549F  600D 8C9E 647A E564 2BFC (s=
ubkeys.pgp.net)

--------------090604030101000804030602
Content-Type: text/plain;
 name="nls-doc2.rene.diff"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline;
 filename="nls-doc2.rene.diff"

--- nls-doc2.diff	2009-03-27 13:37:58.000000000 +0100
+++ rene-nls-doc2.diff	2009-03-27 13:48:11.000000000 +0100
@@ -11,16 +11,16 @@
  #endif
 +
 +	
-+	  Reducing strings to localize
++	  Reducing Strings to Localize
 +
 +	  There is a good way of reducing the strings that
-+	    needs to be localized by using libc
++	    need to be localized by using libc
 +	    error messages.  This is also useful to just avoid duplication
 +	    and provide consistent error messages for the common errors
 +	    that can be encountered by a great many of programs.
 +
-+	  First, here is an example that do not use
-+	    libc error messages.
++	  First, here is an example that does not use
++	    libc error messages:
 +
 +	  
 +#include <err.h>
@@ -48,7 +48,7 @@
 +	    and users will see the usual Not a directory
 +	    error message when they encounter this error.  This message
 +	    will probably seem more familiar to them.  Please note that
-+	    it was necessary to include errno.h in order to directly
 +	    access errno.
 +

--------------090604030101000804030602--

--------------enig2895A9050401B4689F52741E
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAknMzp0ACgkQjJ5keuVkK/xnjgCeN4kf4wV28N/Cb2PP1lCf/TUj
fEQAoLfyE0Sr/64/2kOuyW4yT8pztE6X
=sX/N
-----END PGP SIGNATURE-----

--------------enig2895A9050401B4689F52741E--

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 13:10:33 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2EA7D1065673;
	Fri, 27 Mar 2009 13:10:33 +0000 (UTC)
	(envelope-from gabor@FreeBSD.org)
Received: from server.mypc.hu (server.mypc.hu [87.229.73.95])
	by mx1.freebsd.org (Postfix) with ESMTP id C69878FC19;
	Fri, 27 Mar 2009 13:10:32 +0000 (UTC)
	(envelope-from gabor@FreeBSD.org)
Received: from localhost (localhost [127.0.0.1])
	by server.mypc.hu (Postfix) with ESMTP id B655A14D2BDB;
	Fri, 27 Mar 2009 14:10:30 +0100 (CET)
X-Virus-Scanned: amavisd-new at t-hosting.hu
Received: from server.mypc.hu ([127.0.0.1])
	by localhost (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id WFjLDIuEP0oE; Fri, 27 Mar 2009 14:10:30 +0100 (CET)
Received: from [192.168.1.105] (catv-80-98-231-64.catv.broadband.hu
	[80.98.231.64])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by server.mypc.hu (Postfix) with ESMTPSA id E52A814D2BD6;
	Fri, 27 Mar 2009 14:10:29 +0100 (CET)
Message-ID: <49CCD044.3010308@FreeBSD.org>
Date: Fri, 27 Mar 2009 14:10:28 +0100
From: =?ISO-8859-1?Q?G=E1bor_K=F6vesd=E1n?= 
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
To: Rene Ladan 
References: <200903131040.n2DAecSO061131@svn.freebsd.org>		<49BB0DF0.3020907@FreeBSD.org>		<49CBFC02.2000506@FreeBSD.org>
	<49CCCE52.3000603@freebsd.org>
In-Reply-To: <49CCCE52.3000603@freebsd.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Cc: Tom Rhodes , doc@FreeBSD.org,
	Gabor Pali , Robert Watson ,
	Giorgos Keramidas ,
	svn-src-head@freebsd.org, "Sean C. Farley" 
Subject: Re: NLS additions to I18N chapter of developers-handbook [Was: Re:
 svn commit: r189765 - in head: . lib/libc lib/libc/nls]
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 13:10:33 -0000

Rene Ladan escribió:
> Gábor Kövesdán schreef:
>> Robert Watson escribió:
>>> Do you have any advice on what to do for libraries that provide 
>>> error strings in their own error spaces?  Is it intended that the 
>>> library's init and destroy functions will open and close 
>>> catalogues?  Will this work if the application the library is used 
>>> by doesn't know about catalogues?  Etc...
>> I've made one more little addition, which can be useful to spare with 
>> error strings. :)
>> http://kovesdan.org/patches/nls-doc2.diff
>>
>
> Looks nice.  I corrected a few minor mistakes in the attached patch.
Thanks!
>
> On my 8.0 box with localized libc, I get the English message when
> setting errno to ENOTDIR and calling err(1, NULL) in a test program.
> Is this to be expected?
No, something's wrong there. Are you sure LC_MESSAGES or LC_ALL is set 
correctly? Here I get this:

 > ./sort -T fre
sort: Not a directory
 > env LC_ALL=hu_HU.ISO8859-2 ./sort -T fre
sort: Nem könyvtár
 > env LC_ALL=nl_NL.ISO8859-1 ./sort -T fre
sort: Dit is geen directory

-- 
Gabor Kovesdan
FreeBSD Volunteer

EMAIL: gabor@FreeBSD.org .:|:. gabor@kovesdan.org
WEB:   http://people.FreeBSD.org/~gabor .:|:. http://kovesdan.org


From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 13:14:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 31DCC106566C;
	Fri, 27 Mar 2009 13:14:00 +0000 (UTC)
	(envelope-from jamie@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1FE658FC1D;
	Fri, 27 Mar 2009 13:14:00 +0000 (UTC)
	(envelope-from jamie@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2RDE09Z061978;
	Fri, 27 Mar 2009 13:14:00 GMT (envelope-from jamie@svn.freebsd.org)
Received: (from jamie@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2RDDx36061975;
	Fri, 27 Mar 2009 13:13:59 GMT (envelope-from jamie@svn.freebsd.org)
Message-Id: <200903271313.n2RDDx36061975@svn.freebsd.org>
From: Jamie Gritton 
Date: Fri, 27 Mar 2009 13:13:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190466 - in head/sys: compat/freebsd32 kern sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 13:14:00 -0000

Author: jamie
Date: Fri Mar 27 13:13:59 2009
New Revision: 190466
URL: http://svn.freebsd.org/changeset/base/190466

Log:
  Whitespace/spelling fixes in advance of upcoming functional changes.
  
  Approved by:	bz (mentor)

Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/kern/kern_jail.c
  head/sys/sys/jail.h

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_misc.c	Fri Mar 27 13:05:29 2009	(r190465)
+++ head/sys/compat/freebsd32/freebsd32_misc.c	Fri Mar 27 13:13:59 2009	(r190466)
@@ -2043,8 +2043,9 @@ freebsd32_jail(struct thread *td, struct
 	error = copyin(uap->jail, &version, sizeof(uint32_t));
 	if (error)
 		return (error);
+
 	switch (version) {
-	case 0:	
+	case 0:
 	{
 		/* FreeBSD single IPv4 jails. */
 		struct jail32_v0 j32_v0;

Modified: head/sys/kern/kern_jail.c
==============================================================================
--- head/sys/kern/kern_jail.c	Fri Mar 27 13:05:29 2009	(r190465)
+++ head/sys/kern/kern_jail.c	Fri Mar 27 13:13:59 2009	(r190466)
@@ -2,7 +2,7 @@
  * Copyright (c) 1999 Poul-Henning Kamp.
  * Copyright (c) 2008 Bjoern A. Zeeb.
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -119,14 +119,14 @@ struct	sx allprison_lock;
 int	lastprid = 0;
 int	prisoncount = 0;
 
-static void		 init_prison(void *);
-static void		 prison_complete(void *context, int pending);
-static int		 sysctl_jail_list(SYSCTL_HANDLER_ARGS);
+static void init_prison(void *);
+static void prison_complete(void *context, int pending);
+static int sysctl_jail_list(SYSCTL_HANDLER_ARGS);
 #ifdef INET
-static int		_prison_check_ip4(struct prison *, struct in_addr *);
+static int _prison_check_ip4(struct prison *pr, struct in_addr *ia);
 #endif
 #ifdef INET6
-static int		_prison_check_ip6(struct prison *, struct in6_addr *);
+static int _prison_check_ip6(struct prison *pr, struct in6_addr *ia6);
 #endif
 
 static void
@@ -177,7 +177,7 @@ qcmp_v6(const void *ip1, const void *ip2
 	ia6b = (const struct in6_addr *)ip2;
 
 	rc = 0;
-	for (i=0; rc == 0 && i < sizeof(struct in6_addr); i++) {
+	for (i = 0; rc == 0 && i < sizeof(struct in6_addr); i++) {
 		if (ia6a->s6_addr[i] > ia6b->s6_addr[i])
 			rc = 1;
 		else if (ia6a->s6_addr[i] < ia6b->s6_addr[i])
@@ -240,7 +240,7 @@ static int
 jail_copyin_ips(struct jail *j)
 {
 #ifdef INET
-	struct in_addr  *ip4;
+	struct in_addr *ip4;
 #endif
 #ifdef INET6
 	struct in6_addr *ip6;
@@ -348,7 +348,7 @@ jail_handle_ips(struct jail *j)
 	 * Finish conversion for older versions, copyin and setup IPs.
 	 */
 	switch (j->version) {
-	case 0:	
+	case 0:
 	{
 #ifdef INET
 		/* FreeBSD single IPv4 jails. */
@@ -594,6 +594,7 @@ e_killmtx:
 	return (error);
 }
 
+
 /*
  * struct jail_attach_args {
  *	int jid;
@@ -807,7 +808,7 @@ prison_proc_free(struct prison *pr)
  * Pass back primary IPv4 address of this jail.
  *
  * If not jailed return success but do not alter the address.  Caller has to
- * make sure to intialize it correctly (e.g. INADDR_ANY).
+ * make sure to initialize it correctly (e.g. INADDR_ANY).
  *
  * Returns 0 on success, EAFNOSUPPORT if the jail doesn't allow IPv4.
  * Address returned in NBO.
@@ -822,7 +823,6 @@ prison_get_ip4(struct ucred *cred, struc
 	if (!jailed(cred))
 		/* Do not change address passed in. */
 		return (0);
-
 	if (cred->cr_prison->pr_ip4 == NULL)
 		return (EAFNOSUPPORT);
 
@@ -956,7 +956,7 @@ prison_check_ip4(struct ucred *cred, str
  * Pass back primary IPv6 address for this jail.
  *
  * If not jailed return success but do not alter the address.  Caller has to
- * make sure to intialize it correctly (e.g. IN6ADDR_ANY_INIT).
+ * make sure to initialize it correctly (e.g. IN6ADDR_ANY_INIT).
  *
  * Returns 0 on success, EAFNOSUPPORT if the jail doesn't allow IPv6.
  */

Modified: head/sys/sys/jail.h
==============================================================================
--- head/sys/sys/jail.h	Fri Mar 27 13:05:29 2009	(r190465)
+++ head/sys/sys/jail.h	Fri Mar 27 13:13:59 2009	(r190466)
@@ -7,7 +7,6 @@
  * ----------------------------------------------------------------------------
  *
  * $FreeBSD$
- *
  */
 
 #ifndef _SYS_JAIL_H_
@@ -32,7 +31,7 @@ struct jail {
 	struct in_addr	*ip4;
 	struct in6_addr	*ip6;
 };
-#define	JAIL_API_VERSION 2
+#define	JAIL_API_VERSION	2
 
 /*
  * For all xprison structs, always keep the pr_version an int and
@@ -54,8 +53,8 @@ struct xprison {
 	int		 pr_state;
 	cpusetid_t	 pr_cpusetid;
 	char		 pr_path[MAXPATHLEN];
-	char 		 pr_host[MAXHOSTNAMELEN];
-	char 		 pr_name[MAXHOSTNAMELEN];
+	char		 pr_host[MAXHOSTNAMELEN];
+	char		 pr_name[MAXHOSTNAMELEN];
 	uint32_t	 pr_ip4s;
 	uint32_t	 pr_ip6s;
 #if 0
@@ -128,8 +127,8 @@ struct prison {
 	char		 pr_path[MAXPATHLEN];		/* (c) chroot path */
 	struct cpuset	*pr_cpuset;			/* (p) cpuset */
 	struct vnode	*pr_root;			/* (c) vnode to rdir */
-	char 		 pr_host[MAXHOSTNAMELEN];	/* (p) jail hostname */
-	char 		 pr_name[MAXHOSTNAMELEN];	/* (c) admin jail name */
+	char		 pr_host[MAXHOSTNAMELEN];	/* (p) jail hostname */
+	char		 pr_name[MAXHOSTNAMELEN];	/* (c) admin jail name */
 	void		*pr_linux;			/* (p) linux abi */
 	int		 pr_securelevel;		/* (p) securelevel */
 	struct task	 pr_task;			/* (d) destroy task */

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 13:31:40 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 63FBB1065674;
	Fri, 27 Mar 2009 13:31:40 +0000 (UTC)
	(envelope-from r.c.ladan@gmail.com)
Received: from mail-ew0-f171.google.com (mail-ew0-f171.google.com
	[209.85.219.171])
	by mx1.freebsd.org (Postfix) with ESMTP id 635C88FC1C;
	Fri, 27 Mar 2009 13:31:37 +0000 (UTC)
	(envelope-from r.c.ladan@gmail.com)
Received: by ewy19 with SMTP id 19so984116ewy.43
	for ; Fri, 27 Mar 2009 06:31:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:sender:message-id:date:from
	:organization:user-agent:mime-version:to:cc:subject:references
	:in-reply-to:x-enigmail-version:content-type
	:content-transfer-encoding;
	bh=ddY8Gh8lsW0tUJWidnl7Oh2/A0Ga0M/nBMS/BLIhQ1c=;
	b=jWm2OSYke01T/FHh/GATXcSNZw+vXX2+oRPvJulRkZz/rWG/8xz/2pAh1GrNapZaEN
	5Lp7mK0MGOrd9NIG6qctRVTdQTYTB0kRE8v7Hne3IPfN+MPZcfjBMx5LWwAwuxwMQBzq
	WapI9VjmR9y2q3pYtG3EBhospWB9o6hHSilxY=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=sender:message-id:date:from:organization:user-agent:mime-version:to
	:cc:subject:references:in-reply-to:x-enigmail-version:content-type
	:content-transfer-encoding;
	b=aq24eFULzvU1Cgxobwr+bFjb2ar1e24d9nvhGYkuRuvn7koJstl+L78iB+f6xxwD5V
	+SNh4YFdctrQ9FcKQ0O8qqc8p1hgyYduEtKhQ2pkNfViSXldhA8opx2I76Ozb9kqWgyz
	boTcb0ef7QEFNssZwiiYifsPTnjBBkPjqmxjU=
Received: by 10.216.47.85 with SMTP id s63mr811144web.58.1238160697191;
	Fri, 27 Mar 2009 06:31:37 -0700 (PDT)
Received: from self.rene-ladan.nl ([77.163.174.49])
	by mx.google.com with ESMTPS id 7sm1899591eyg.47.2009.03.27.06.31.34
	(version=TLSv1/SSLv3 cipher=RC4-MD5);
	Fri, 27 Mar 2009 06:31:36 -0700 (PDT)
Sender: Rene Ladan 
Message-ID: <49CCD534.4000304@freebsd.org>
Date: Fri, 27 Mar 2009 14:31:32 +0100
From: Rene Ladan 
Organization: The FreeBSD Project
User-Agent: Thunderbird 2.0.0.21 (X11/20090321)
MIME-Version: 1.0
To: =?ISO-8859-1?Q?G=E1bor_K=F6vesd=E1n?= 
References: <200903131040.n2DAecSO061131@svn.freebsd.org>		<49BB0DF0.3020907@FreeBSD.org>		<49CBFC02.2000506@FreeBSD.org>
	<49CCCE52.3000603@freebsd.org> <49CCD044.3010308@FreeBSD.org>
In-Reply-To: <49CCD044.3010308@FreeBSD.org>
X-Enigmail-Version: 0.95.6
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Cc: Gabor Pali , doc@FreeBSD.org,
	Tom Rhodes , Robert Watson ,
	Giorgos Keramidas ,
	svn-src-head@freebsd.org, Rene Ladan ,
	"Sean C. Farley" 
Subject: Re: NLS additions to I18N chapter of developers-handbook [Was: Re:
 svn commit: r189765 - in head: . lib/libc lib/libc/nls]
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 13:31:41 -0000

Gábor Kövesdán schreef:
> Rene Ladan escribió:
>> Gábor Kövesdán schreef:
>>> Robert Watson escribió:
>>>> Do you have any advice on what to do for libraries that provide 
>>>> error strings in their own error spaces?  Is it intended that the 
>>>> library's init and destroy functions will open and close 
>>>> catalogues?  Will this work if the application the library is used 
>>>> by doesn't know about catalogues?  Etc...
>>> I've made one more little addition, which can be useful to spare with 
>>> error strings. :)
>>> http://kovesdan.org/patches/nls-doc2.diff
>>>
>>
>> Looks nice.  I corrected a few minor mistakes in the attached patch.
> Thanks!
>>
>> On my 8.0 box with localized libc, I get the English message when
>> setting errno to ENOTDIR and calling err(1, NULL) in a test program.
>> Is this to be expected?
> No, something's wrong there. Are you sure LC_MESSAGES or LC_ALL is set 
> correctly? Here I get this:
> 
>  > ./sort -T fre
> sort: Not a directory
>  > env LC_ALL=hu_HU.ISO8859-2 ./sort -T fre
> sort: Nem könyvtár
>  > env LC_ALL=nl_NL.ISO8859-1 ./sort -T fre
> sort: Dit is geen directory
> 
I sometimes still get English messages even when I set both LC_ALL and
LC_MESSAGES to nl_NL.ISO8859-1 :
 > echo $SHELL
/bin/tcsh
 > ls bla
ls: bla: Bestand of map niet gevonden
 > notacommand
notacommand: Command not found

output of { errno = ENOTDIR; err(1, NULL); } :
do-err: Not a directory

svn revision 189775

Any idea what could be wrong?

Regards,
Rene
-- 
http://www.rene-ladan.nl/

GPG fingerprint = ADBC ECCD EB5F A6B4 549F  600D 8C9E 647A E564 2BFC (subkeys.pgp.net)

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 15:46:03 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1558610656F1;
	Fri, 27 Mar 2009 15:46:03 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 02F298FC16;
	Fri, 27 Mar 2009 15:46:03 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2RFk2Jr064971;
	Fri, 27 Mar 2009 15:46:02 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2RFk27F064970;
	Fri, 27 Mar 2009 15:46:02 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200903271546.n2RFk27F064970@svn.freebsd.org>
From: Konstantin Belousov 
Date: Fri, 27 Mar 2009 15:46:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190469 - head/sys/ufs/ffs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 15:46:03 -0000

Author: kib
Date: Fri Mar 27 15:46:02 2009
New Revision: 190469
URL: http://svn.freebsd.org/changeset/base/190469

Log:
  Correct typo.
  
  Noted by:	kensmith

Modified:
  head/sys/ufs/ffs/ffs_vnops.c

Modified: head/sys/ufs/ffs/ffs_vnops.c
==============================================================================
--- head/sys/ufs/ffs/ffs_vnops.c	Fri Mar 27 15:45:52 2009	(r190468)
+++ head/sys/ufs/ffs/ffs_vnops.c	Fri Mar 27 15:46:02 2009	(r190469)
@@ -1456,7 +1456,7 @@ vop_deleteextattr {
 
 		/*
 		 * ffs_lock_ea is not needed there, because the vnode
-		 * must be exlusively locked.
+		 * must be exclusively locked.
 		 */
 		if (ip->i_ea_area != NULL && ip->i_ea_error == 0)
 			ip->i_ea_error = error;
@@ -1666,7 +1666,7 @@ vop_setextattr {
 
 		/*
 		 * ffs_lock_ea is not needed there, because the vnode
-		 * must be exlusively locked.
+		 * must be exclusively locked.
 		 */
 		if (ip->i_ea_area != NULL && ip->i_ea_error == 0)
 			ip->i_ea_error = error;

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 15:47:03 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0D25210656EB;
	Fri, 27 Mar 2009 15:47:03 +0000 (UTC)
	(envelope-from ambrisko@ambrisko.com)
Received: from mail.ambrisko.com (mail.ambrisko.com [64.174.51.43])
	by mx1.freebsd.org (Postfix) with ESMTP id ACED18FC13;
	Fri, 27 Mar 2009 15:47:02 +0000 (UTC)
	(envelope-from ambrisko@ambrisko.com)
X-Ambrisko-Me: Yes
Received: from server2.ambrisko.com (HELO www.ambrisko.com) ([192.168.1.2])
	by ironport.ambrisko.com with ESMTP; 27 Mar 2009 08:47:53 -0700
Received: from ambrisko.com (localhost [127.0.0.1])
	by www.ambrisko.com (8.14.3/8.14.1) with ESMTP id n2RFl1Q9044117;
	Fri, 27 Mar 2009 08:47:01 -0700 (PDT)
	(envelope-from ambrisko@ambrisko.com)
Received: (from ambrisko@localhost)
	by ambrisko.com (8.14.3/8.14.3/Submit) id n2RFl1qh044116;
	Fri, 27 Mar 2009 08:47:01 -0700 (PDT) (envelope-from ambrisko)
From: Doug Ambrisko 
Message-Id: <200903271547.n2RFl1qh044116@ambrisko.com>
In-Reply-To: <20090327060643.GA1937@dchagin.static.corbina.ru>
To: Chagin Dmitry 
Date: Fri, 27 Mar 2009 08:47:01 -0700 (PDT)
X-Mailer: ELM [version 2.4ME+ PL94b (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Cc: Doug Ambrisko , src-committers@freebsd.org,
	Doug Ambrisko , John Baldwin ,
	Roman Divacky , svn-src-head@freebsd.org,
	svn-src-all@freebsd.org
Subject: Re: svn commit: r190445 - in head/sys: amd64/linux32
 compat/linprocfs
 compat/linux conf dev/ipmi modules/ipmi modules/linprocfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 15:47:04 -0000

Chagin Dmitry writes:
| On Thu, Mar 26, 2009 at 05:08:59PM -0700, Doug Ambrisko wrote:
	[snip]
| > Okay, I did some more instrumenting again and found that I was 
| > slightly wrong.  The mmap that was failing was 0xcf79c000 and not
| > 0xf0000.  This probably makes since since the sign bit was set
| > on 0xcf79c000.  However, it appear mmap doesn't really do negative
| > seeks.  Looking at the freebsd32_mmap the structure it uses for
| > args is:
| >   struct freebsd6_freebsd32_mmap_args {
| >         char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)];
| >         char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
| >         char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)];
| >         char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
| >         char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
| >         char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
| >         char poslo_l_[PADL_(u_int32_t)]; u_int32_t poslo; char poslo_r_[PADR_(u_int32_t)];
| >         char poshi_l_[PADL_(u_int32_t)]; u_int32_t poshi; char poshi_r_[PADR_(u_int32_t)];
| >   };
| > with both the high and the lows being u_int32_t.
| > 
| > So I wonder if in the linux32 the structure that is:
| >   struct l_mmap_argv {
| >         l_uintptr_t     addr;
| >         l_size_t        len;
| >         l_int           prot;
| >         l_int           flags;
| >         l_int           fd;
| >         l_off_t         pgoff;
| >   } __packed;
| > should be uint32_t for pgoff?
| 
| yes, you are right. s/uint32_t/l_ulong/ :)
| also remove __packed.
| thnx!

Index: linux.h
===================================================================
RCS file: /usr/local/cvsroot/freebsd/src/sys/amd64/linux32/linux.h,v
retrieving revision 1.24
diff -u -p -r1.24 linux.h
--- linux.h	26 Mar 2009 17:14:22 -0000	1.24
+++ linux.h	27 Mar 2009 15:38:40 -0000
@@ -79,7 +79,7 @@ typedef l_ulong		l_ino_t;
 typedef l_int		l_key_t;
 typedef l_longlong	l_loff_t;
 typedef l_ushort	l_mode_t;
-typedef l_ulong		l_off_t;
+typedef l_long		l_off_t;
 typedef l_int		l_pid_t;
 typedef l_uint		l_size_t;
 typedef l_long		l_suseconds_t;
@@ -179,8 +179,8 @@ struct l_mmap_argv {
 	l_int		prot;
 	l_int		flags;
 	l_int		fd;
-	l_off_t		pgoff;
-} __packed;
+	l_ulong		pgoff;
+};
 
 /*
  * stat family of syscalls

Okay, then this is my proposed patch to fix this.  This version works
fine for the Linux tool.  If people are happy with it then I'll check it
in.  I thought that I had greped for usage of l_off_t but missed that seek
was using it :-(

Thanks,

Doug A.

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 16:01:17 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 172E0106566B;
	Fri, 27 Mar 2009 16:01:17 +0000 (UTC) (envelope-from sam@freebsd.org)
Received: from ebb.errno.com (ebb.errno.com [69.12.149.25])
	by mx1.freebsd.org (Postfix) with ESMTP id DDDDA8FC24;
	Fri, 27 Mar 2009 16:01:16 +0000 (UTC) (envelope-from sam@freebsd.org)
Received: from trouble.errno.com (trouble.errno.com [10.0.0.248])
	(authenticated bits=0)
	by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n2RG1GVC062516
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 27 Mar 2009 09:01:16 -0700 (PDT) (envelope-from sam@freebsd.org)
Message-ID: <49CCF84C.2030409@freebsd.org>
Date: Fri, 27 Mar 2009 09:01:16 -0700
From: Sam Leffler 
Organization: FreeBSD Project
User-Agent: Thunderbird 2.0.0.18 (X11/20081209)
MIME-Version: 1.0
To: Juli Mallett 
References: <200903270544.n2R5irsu049333@svn.freebsd.org>
In-Reply-To: <200903270544.n2R5irsu049333@svn.freebsd.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-DCC--Metrics: ebb.errno.com; whitelist
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r190462 - head/sys/dev/wpi
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 16:01:17 -0000

Juli Mallett wrote:
> Author: jmallett
> Date: Fri Mar 27 05:44:53 2009
> New Revision: 190462
> URL: http://svn.freebsd.org/changeset/base/190462
>
> Log:
>   Put the "%d retries" debug message in the transmit path behind WPI_DEBUG_TX
>   rather than behind a seemingly accidental constant likely left over from one of
>   the related drivers which uses log levels rather than per-facility debugging
>   flags.  This should get rid of contextless messages on the console for people
>   who have not set (or cleared the default) debugging flags.
>
> Modified:
>   head/sys/dev/wpi/if_wpi.c
>
> Modified: head/sys/dev/wpi/if_wpi.c
> ==============================================================================
> --- head/sys/dev/wpi/if_wpi.c	Fri Mar 27 05:35:12 2009	(r190461)
> +++ head/sys/dev/wpi/if_wpi.c	Fri Mar 27 05:44:53 2009	(r190462)
> @@ -1587,7 +1587,7 @@ wpi_tx_intr(struct wpi_softc *sc, struct
>  	 */
>  	wn->amn.amn_txcnt++;
>  	if (stat->ntries > 0) {
> -		DPRINTFN(3, ("%d retries\n", stat->ntries));
> +		DPRINTFN(WPI_DEBUG_TX, ("%d retries\n", stat->ntries));
>  		wn->amn.amn_retrycnt++;
>  	}
>  
>   

wlan_amrr has macros to replace all the direct frobbing of data 
structures and also it's own debug messages that are enabled with 
wlandebug rate.  Might be worth cleaning up the driver (and might also 
improve performance if my reading of the code is right).

    Sam


From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 16:31:16 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C2ED3106564A;
	Fri, 27 Mar 2009 16:31:16 +0000 (UTC)
	(envelope-from dchagin@dchagin.static.corbina.ru)
Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5])
	by mx1.freebsd.org (Postfix) with ESMTP id 3D94E8FC1B;
	Fri, 27 Mar 2009 16:31:15 +0000 (UTC)
	(envelope-from dchagin@dchagin.static.corbina.ru)
Received: from corbina.ru (mail.post.ru [195.14.50.16])
	by contrabass.post.ru (Postfix) with ESMTP id BD05A79DBE;
	Fri, 27 Mar 2009 19:31:13 +0300 (MSK)
X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9
Received: from [10.208.17.3] (HELO dchagin.static.corbina.ru)
	by corbina.ru (CommuniGate Pro SMTP 5.1.14)
	with ESMTPS id 1704617522; Fri, 27 Mar 2009 19:31:13 +0300
Received: from dchagin.static.corbina.ru (localhost.chd.net [127.0.0.1])
	by dchagin.static.corbina.ru (8.14.3/8.14.3) with ESMTP id
	n2RGVDMk007619; Fri, 27 Mar 2009 19:31:13 +0300 (MSK)
	(envelope-from dchagin@dchagin.static.corbina.ru)
Received: (from dchagin@localhost)
	by dchagin.static.corbina.ru (8.14.3/8.14.3/Submit) id n2RGV7fv007618; 
	Fri, 27 Mar 2009 19:31:07 +0300 (MSK) (envelope-from dchagin)
Date: Fri, 27 Mar 2009 19:31:07 +0300
From: Chagin Dmitry 
To: Doug Ambrisko 
Message-ID: <20090327163107.GA7564@dchagin.static.corbina.ru>
References: <20090327060643.GA1937@dchagin.static.corbina.ru>
	<200903271547.n2RFl1qh044116@ambrisko.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="LZvS9be/3tNcYl/X"
Content-Disposition: inline
In-Reply-To: <200903271547.n2RFl1qh044116@ambrisko.com>
User-Agent: Mutt/1.5.19 (2009-01-05)
Cc: Doug Ambrisko , src-committers@freebsd.org,
	John Baldwin ,
	Roman Divacky , svn-src-head@freebsd.org,
	svn-src-all@freebsd.org
Subject: Re: svn commit: r190445 - in head/sys: amd64/linux32
	compat/linprocfs compat/linux conf dev/ipmi modules/ipmi
	modules/linprocfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 16:31:17 -0000


--LZvS9be/3tNcYl/X
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Mar 27, 2009 at 08:47:01AM -0700, Doug Ambrisko wrote:
> Chagin Dmitry writes:
> | On Thu, Mar 26, 2009 at 05:08:59PM -0700, Doug Ambrisko wrote:
> 	[snip]
> | > Okay, I did some more instrumenting again and found that I was=20
> | > slightly wrong.  The mmap that was failing was 0xcf79c000 and not
> | > 0xf0000.  This probably makes since since the sign bit was set
> | > on 0xcf79c000.  However, it appear mmap doesn't really do negative
> | > seeks.  Looking at the freebsd32_mmap the structure it uses for
> | > args is:
> | >   struct freebsd6_freebsd32_mmap_args {
> | >         char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR=
_(caddr_t)];
> | >         char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(siz=
e_t)];
> | >         char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)];
> | >         char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int=
)];
> | >         char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
> | >         char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
> | >         char poslo_l_[PADL_(u_int32_t)]; u_int32_t poslo; char poslo_=
r_[PADR_(u_int32_t)];
> | >         char poshi_l_[PADL_(u_int32_t)]; u_int32_t poshi; char poshi_=
r_[PADR_(u_int32_t)];
> | >   };
> | > with both the high and the lows being u_int32_t.
> | >=20
> | > So I wonder if in the linux32 the structure that is:
> | >   struct l_mmap_argv {
> | >         l_uintptr_t     addr;
> | >         l_size_t        len;
> | >         l_int           prot;
> | >         l_int           flags;
> | >         l_int           fd;
> | >         l_off_t         pgoff;
> | >   } __packed;
> | > should be uint32_t for pgoff?
> |=20
> | yes, you are right. s/uint32_t/l_ulong/ :)
> | also remove __packed.
> | thnx!
>=20
> Index: linux.h
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> RCS file: /usr/local/cvsroot/freebsd/src/sys/amd64/linux32/linux.h,v
> retrieving revision 1.24
> diff -u -p -r1.24 linux.h
> --- linux.h	26 Mar 2009 17:14:22 -0000	1.24
> +++ linux.h	27 Mar 2009 15:38:40 -0000
> @@ -79,7 +79,7 @@ typedef l_ulong		l_ino_t;
>  typedef l_int		l_key_t;
>  typedef l_longlong	l_loff_t;
>  typedef l_ushort	l_mode_t;
> -typedef l_ulong		l_off_t;
> +typedef l_long		l_off_t;
>  typedef l_int		l_pid_t;
>  typedef l_uint		l_size_t;
>  typedef l_long		l_suseconds_t;
> @@ -179,8 +179,8 @@ struct l_mmap_argv {
>  	l_int		prot;
>  	l_int		flags;
>  	l_int		fd;
> -	l_off_t		pgoff;
> -} __packed;
> +	l_ulong		pgoff;
> +};
> =20
>  /*
>   * stat family of syscalls
>=20
> Okay, then this is my proposed patch to fix this.  This version works
> fine for the Linux tool.  If people are happy with it then I'll check it
> in.  I thought that I had greped for usage of l_off_t but missed that seek
> was using it :-(
>=20

commit please.
and. please, look to r185438. I suggest to use it in mfi


--=20
Have fun!
chd

--LZvS9be/3tNcYl/X
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (FreeBSD)

iEYEARECAAYFAknM/0sACgkQ0t2Tb3OO/O0hPgCaA6XN99uEXQcMujixOUxWIcn5
C/MAoJvbrmjA2o7VP8WLRpRz+bXE1lsI
=ybS3
-----END PGP SIGNATURE-----

--LZvS9be/3tNcYl/X--

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 16:45:39 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 285F110657A2;
	Fri, 27 Mar 2009 16:45:39 +0000 (UTC)
	(envelope-from ambrisko@ambrisko.com)
Received: from mail.ambrisko.com (mail.ambrisko.com [64.174.51.43])
	by mx1.freebsd.org (Postfix) with ESMTP id C5D8C8FC1A;
	Fri, 27 Mar 2009 16:45:38 +0000 (UTC)
	(envelope-from ambrisko@ambrisko.com)
X-Ambrisko-Me: Yes
Received: from server2.ambrisko.com (HELO www.ambrisko.com) ([192.168.1.2])
	by ironport.ambrisko.com with ESMTP; 27 Mar 2009 09:46:30 -0700
Received: from ambrisko.com (localhost [127.0.0.1])
	by www.ambrisko.com (8.14.3/8.14.1) with ESMTP id n2RGjcu8047794;
	Fri, 27 Mar 2009 09:45:38 -0700 (PDT)
	(envelope-from ambrisko@ambrisko.com)
Received: (from ambrisko@localhost)
	by ambrisko.com (8.14.3/8.14.3/Submit) id n2RGjcC7047793;
	Fri, 27 Mar 2009 09:45:38 -0700 (PDT) (envelope-from ambrisko)
From: Doug Ambrisko 
Message-Id: <200903271645.n2RGjcC7047793@ambrisko.com>
In-Reply-To: <20090327163107.GA7564@dchagin.static.corbina.ru>
To: Chagin Dmitry 
Date: Fri, 27 Mar 2009 09:45:38 -0700 (PDT)
X-Mailer: ELM [version 2.4ME+ PL94b (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Cc: Doug Ambrisko , src-committers@freebsd.org,
	Doug Ambrisko , John Baldwin ,
	Roman Divacky , svn-src-head@freebsd.org,
	svn-src-all@freebsd.org
Subject: Re: svn commit: r190445 - in head/sys: amd64/linux32
 compat/linprocfs
 compat/linux conf dev/ipmi modules/ipmi modules/linprocfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 16:45:39 -0000

Chagin Dmitry writes:
| On Fri, Mar 27, 2009 at 08:47:01AM -0700, Doug Ambrisko wrote:
| > Chagin Dmitry writes:
| > | On Thu, Mar 26, 2009 at 05:08:59PM -0700, Doug Ambrisko wrote:
| > 	[snip]
| > | > Okay, I did some more instrumenting again and found that I was 
| > | > slightly wrong.  The mmap that was failing was 0xcf79c000 and not
| > | > 0xf0000.  This probably makes since since the sign bit was set
| > | > on 0xcf79c000.  However, it appear mmap doesn't really do negative
| > | > seeks.  Looking at the freebsd32_mmap the structure it uses for
| > | > args is:
| > | >   struct freebsd6_freebsd32_mmap_args {
| > | >         char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)];
| > | >         char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
| > | >         char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)];
| > | >         char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
| > | >         char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
| > | >         char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
| > | >         char poslo_l_[PADL_(u_int32_t)]; u_int32_t poslo; char poslo_r_[PADR_(u_int32_t)];
| > | >         char poshi_l_[PADL_(u_int32_t)]; u_int32_t poshi; char poshi_r_[PADR_(u_int32_t)];
| > | >   };
| > | > with both the high and the lows being u_int32_t.
| > | > 
| > | > So I wonder if in the linux32 the structure that is:
| > | >   struct l_mmap_argv {
| > | >         l_uintptr_t     addr;
| > | >         l_size_t        len;
| > | >         l_int           prot;
| > | >         l_int           flags;
| > | >         l_int           fd;
| > | >         l_off_t         pgoff;
| > | >   } __packed;
| > | > should be uint32_t for pgoff?
| > | 
| > | yes, you are right. s/uint32_t/l_ulong/ :)
| > | also remove __packed.
| > | thnx!
| > 
| > Index: linux.h
| > ===================================================================
| > RCS file: /usr/local/cvsroot/freebsd/src/sys/amd64/linux32/linux.h,v
| > retrieving revision 1.24
| > diff -u -p -r1.24 linux.h
| > --- linux.h	26 Mar 2009 17:14:22 -0000	1.24
| > +++ linux.h	27 Mar 2009 15:38:40 -0000
| > @@ -79,7 +79,7 @@ typedef l_ulong		l_ino_t;
| >  typedef l_int		l_key_t;
| >  typedef l_longlong	l_loff_t;
| >  typedef l_ushort	l_mode_t;
| > -typedef l_ulong		l_off_t;
| > +typedef l_long		l_off_t;
| >  typedef l_int		l_pid_t;
| >  typedef l_uint		l_size_t;
| >  typedef l_long		l_suseconds_t;
| > @@ -179,8 +179,8 @@ struct l_mmap_argv {
| >  	l_int		prot;
| >  	l_int		flags;
| >  	l_int		fd;
| > -	l_off_t		pgoff;
| > -} __packed;
| > +	l_ulong		pgoff;
| > +};
| >  
| >  /*
| >   * stat family of syscalls
| > 
| > Okay, then this is my proposed patch to fix this.  This version works
| > fine for the Linux tool.  If people are happy with it then I'll check it
| > in.  I thought that I had greped for usage of l_off_t but missed that seek
| > was using it :-(
| > 
| 
| commit please.

Will do.

| and. please, look to r185438. I suggest to use it in mfi

Thanks for the pointer on that.  I should also grab iovec32 from
compat/freebsd32/freebsd32.h.

Doug A.

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 16:56:02 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3CDB1106566B;
	Fri, 27 Mar 2009 16:56:02 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2A4258FC08;
	Fri, 27 Mar 2009 16:56:02 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2RGu1Q3066501;
	Fri, 27 Mar 2009 16:56:01 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2RGu18p066500;
	Fri, 27 Mar 2009 16:56:01 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200903271656.n2RGu18p066500@svn.freebsd.org>
From: Andrew Thompson 
Date: Fri, 27 Mar 2009 16:56:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190471 - head/sys/dev/usb/controller
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 16:56:02 -0000

Author: thompsa
Date: Fri Mar 27 16:56:01 2009
New Revision: 190471
URL: http://svn.freebsd.org/changeset/base/190471

Log:
  The buffer start and end phys addresses should be 0x0 for an OHCI zero length
  packet, this fixes LS/FS devices on the Gateworks 2348 XScale board.
  
  Reviewed by:	HPS

Modified:
  head/sys/dev/usb/controller/ohci.c

Modified: head/sys/dev/usb/controller/ohci.c
==============================================================================
--- head/sys/dev/usb/controller/ohci.c	Fri Mar 27 15:57:52 2009	(r190470)
+++ head/sys/dev/usb/controller/ohci.c	Fri Mar 27 16:56:01 2009	(r190471)
@@ -1350,9 +1350,12 @@ restart:
 		temp->td_flags &= ~htole32(OHCI_TD_TOGGLE_MASK);
 
 		if (average == 0) {
-
+			/*
+			 * The buffer start and end phys addresses should be
+			 * 0x0 for a zero length packet.
+			 */
 			td->td_cbp = 0;
-			td->td_be = ~0;
+			td->td_be = 0;
 			td->len = 0;
 
 		} else {

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 17:00:50 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 141B81065670;
	Fri, 27 Mar 2009 17:00:50 +0000 (UTC)
	(envelope-from ambrisko@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0229B8FC17;
	Fri, 27 Mar 2009 17:00:50 +0000 (UTC)
	(envelope-from ambrisko@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2RH0nX5066649;
	Fri, 27 Mar 2009 17:00:49 GMT
	(envelope-from ambrisko@svn.freebsd.org)
Received: (from ambrisko@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2RH0nK3066648;
	Fri, 27 Mar 2009 17:00:49 GMT
	(envelope-from ambrisko@svn.freebsd.org)
Message-Id: <200903271700.n2RH0nK3066648@svn.freebsd.org>
From: Doug Ambrisko 
Date: Fri, 27 Mar 2009 17:00:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190472 - head/sys/amd64/linux32
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 17:00:50 -0000

Author: ambrisko
Date: Fri Mar 27 17:00:49 2009
New Revision: 190472
URL: http://svn.freebsd.org/changeset/base/190472

Log:
  Revert 190445 change to this file restoring:
  	typedef l_long          l_off_t;
  Change l_mmap_argv's to l_ulong for pgoff.  This restores prior behaviour
  to consumers of l_off_t but allows mmap to mmap a 32bit position which a
  Linux application requires to access SMBIOS data via /dev/mem.
  
  Reviewed by:	dchagin
  Prompted by:	rdivacky

Modified:
  head/sys/amd64/linux32/linux.h

Modified: head/sys/amd64/linux32/linux.h
==============================================================================
--- head/sys/amd64/linux32/linux.h	Fri Mar 27 16:56:01 2009	(r190471)
+++ head/sys/amd64/linux32/linux.h	Fri Mar 27 17:00:49 2009	(r190472)
@@ -79,7 +79,7 @@ typedef l_ulong		l_ino_t;
 typedef l_int		l_key_t;
 typedef l_longlong	l_loff_t;
 typedef l_ushort	l_mode_t;
-typedef l_ulong		l_off_t;
+typedef l_long		l_off_t;
 typedef l_int		l_pid_t;
 typedef l_uint		l_size_t;
 typedef l_long		l_suseconds_t;
@@ -179,8 +179,8 @@ struct l_mmap_argv {
 	l_int		prot;
 	l_int		flags;
 	l_int		fd;
-	l_off_t		pgoff;
-} __packed;
+	l_ulong		pgoff;
+};
 
 /*
  * stat family of syscalls

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 19:08:16 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5560E1065672;
	Fri, 27 Mar 2009 19:08:16 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4388A8FC08;
	Fri, 27 Mar 2009 19:08:16 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2RJ8G9o069082;
	Fri, 27 Mar 2009 19:08:16 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2RJ8GeR069081;
	Fri, 27 Mar 2009 19:08:16 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200903271908.n2RJ8GeR069081@svn.freebsd.org>
From: Warner Losh 
Date: Fri, 27 Mar 2009 19:08:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190473 - head/sys/dev/pccard
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 19:08:16 -0000

Author: imp
Date: Fri Mar 27 19:08:15 2009
New Revision: 190473
URL: http://svn.freebsd.org/changeset/base/190473

Log:
  Harvest a previously unknown Bromax design based on the AX88x90 from
  the Linux axnet driver.

Modified:
  head/sys/dev/pccard/pccarddevs

Modified: head/sys/dev/pccard/pccarddevs
==============================================================================
--- head/sys/dev/pccard/pccarddevs	Fri Mar 27 17:00:49 2009	(r190472)
+++ head/sys/dev/pccard/pccarddevs	Fri Mar 27 19:08:15 2009	(r190473)
@@ -266,6 +266,7 @@ product BREEZECOM BREEZENET	0x0102 Breez
 
 /* Bromax Communications, Inc (Linksys OEM) */
 product BROMAX IPORT		0x1103 iPort 10/100 Ethernet
+product BROMAX AXNET		0x1106 AXNET based 10/100 Ethernet
 product BROMAX IPORT2		0x1121 iPort 10Mbps Ethernet
 product BROMAX IWN		0x1612 Instant Wireless Network PC Card
 product BROMAX IWN3		0x1613 Instant Wireless Network PC Card, V3

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 19:13:36 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C5228106566B;
	Fri, 27 Mar 2009 19:13:36 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B33768FC17;
	Fri, 27 Mar 2009 19:13:36 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2RJDapb069215;
	Fri, 27 Mar 2009 19:13:36 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2RJDaSg069214;
	Fri, 27 Mar 2009 19:13:36 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200903271913.n2RJDaSg069214@svn.freebsd.org>
From: Ed Schouten 
Date: Fri, 27 Mar 2009 19:13:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190474 - head/usr.bin/login
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 19:13:37 -0000

Author: ed
Date: Fri Mar 27 19:13:36 2009
New Revision: 190474
URL: http://svn.freebsd.org/changeset/base/190474

Log:
  Don't strip TTY device name to the last '/'.
  
  We've seen this bug in other applications before: we have some
  applications that use strrchr(tty, '/') on the TTY device name. This
  isn't valid when using pts(4), because the device name will be stripped
  to "0" instead of "pts/0".
  
  This fixes issues with login(1) ignoring /etc/ttys and missing utmp
  records.
  
  Reported by:	Barney Cordoba 
  Reviewed by:	rwatson

Modified:
  head/usr.bin/login/login.c

Modified: head/usr.bin/login/login.c
==============================================================================
--- head/usr.bin/login/login.c	Fri Mar 27 19:08:15 2009	(r190473)
+++ head/usr.bin/login/login.c	Fri Mar 27 19:13:36 2009	(r190474)
@@ -245,8 +245,8 @@ main(int argc, char *argv[])
 		(void)snprintf(tname, sizeof(tname), "%s??", _PATH_TTY);
 		ttyn = tname;
 	}
-	if ((tty = strrchr(ttyn, '/')) != NULL)
-		++tty;
+	if (strncmp(ttyn, _PATH_DEV, sizeof _PATH_DEV - 1) == 0)
+		tty = ttyn + sizeof _PATH_DEV - 1;
 	else
 		tty = ttyn;
 

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 19:15:28 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DC0F61065698;
	Fri, 27 Mar 2009 19:15:28 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AEEED8FC0C;
	Fri, 27 Mar 2009 19:15:28 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2RJFSvq069293;
	Fri, 27 Mar 2009 19:15:28 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2RJFSBC069292;
	Fri, 27 Mar 2009 19:15:28 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200903271915.n2RJFSBC069292@svn.freebsd.org>
From: Warner Losh 
Date: Fri, 27 Mar 2009 19:15:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190475 - head/sys/dev/ed
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 19:15:30 -0000

Author: imp
Date: Fri Mar 27 19:15:28 2009
New Revision: 190475
URL: http://svn.freebsd.org/changeset/base/190475

Log:
  Add bromax axnet based cards to the mix.  This was harvested from the linux
  driver.  Not sure who sold it/rebadged it.
  
  Add stub entries for Mitsubishi B8895 and Toshiba LANCT00A to the
  driver with a comment that they don't work /* NG */.[*] These are
  DP83902A based cards, which should work, but don't seem to.  Likely
  they are from the days before the ne2000 roamed the earth and use a
  non-standard hookup (see if_ed_isa or if_ed_cbus for some examples).
  Unless I happen to stumble into the right one, these may never work,
  but I'm tired of omitting them from commits.
  
  [*] The Japanese adopted OK from English, but also use NG for its
  opposite.

Modified:
  head/sys/dev/ed/if_ed_pccard.c

Modified: head/sys/dev/ed/if_ed_pccard.c
==============================================================================
--- head/sys/dev/ed/if_ed_pccard.c	Fri Mar 27 19:13:36 2009	(r190474)
+++ head/sys/dev/ed/if_ed_pccard.c	Fri Mar 27 19:15:28 2009	(r190475)
@@ -138,6 +138,7 @@ static const struct ed_product {
 	{ PCMCIA_CARD(BILLIONTON, CFLT10N), 0},
 	{ PCMCIA_CARD(BILLIONTON, LNA100B), NE2000DVF_AX88X90},
 	{ PCMCIA_CARD(BILLIONTON, LNT10TN), 0},
+	{ PCMCIA_CARD(BROMAX, AXNET), NE2000DVF_AX88X90},
 	{ PCMCIA_CARD(BROMAX, IPORT), 0},
 	{ PCMCIA_CARD(BROMAX, IPORT2), 0},
 	{ PCMCIA_CARD(BUFFALO, LPC2_CLT), 0},
@@ -188,6 +189,7 @@ static const struct ed_product {
 	{ PCMCIA_CARD(MAGICRAM, ETHER), 0},
 	{ PCMCIA_CARD(MELCO, LPC3_CLX), NE2000DVF_AX88X90},
 	{ PCMCIA_CARD(MELCO, LPC3_TX), NE2000DVF_AX88X90},
+	{ PCMCIA_CARD(MITSUBISHI, B8895), NE2000DVF_ANYFUNC}, /* NG */
 	{ PCMCIA_CARD(MICRORESEARCH, MR10TPC), 0},
 	{ PCMCIA_CARD(NDC, ND5100_E), 0},
 	{ PCMCIA_CARD(NETGEAR, FA410TXC), NE2000DVF_DL100XX},
@@ -224,6 +226,7 @@ static const struct ed_product {
 	{ PCMCIA_CARD(TELECOMDEVICE, LM5LT), 0 },
 	{ PCMCIA_CARD(TELECOMDEVICE, TCD_HPC100), NE2000DVF_AX88X90},
 	{ PCMCIA_CARD(TJ, PTJ_LAN_T), 0 },
+	{ PCMCIA_CARD(TOSHIBA2, LANCT00A), NE2000DVF_ANYFUNC}, /* NG */
 	{ PCMCIA_CARD(ZONET, ZEN), 0},
 	{ { NULL } }
 };

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 20:40:18 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F2F01106564A;
	Fri, 27 Mar 2009 20:40:17 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E113D8FC12;
	Fri, 27 Mar 2009 20:40:17 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2RKeHqs070815;
	Fri, 27 Mar 2009 20:40:17 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2RKeHgp070814;
	Fri, 27 Mar 2009 20:40:17 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200903272040.n2RKeHgp070814@svn.freebsd.org>
From: Warner Losh 
Date: Fri, 27 Mar 2009 20:40:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190476 - head/sys/dev/pccard
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 20:40:18 -0000

Author: imp
Date: Fri Mar 27 20:40:17 2009
New Revision: 190476
URL: http://svn.freebsd.org/changeset/base/190476

Log:
  Sort NECINFORTIA correctly.

Modified:
  head/sys/dev/pccard/pccarddevs

Modified: head/sys/dev/pccard/pccarddevs
==============================================================================
--- head/sys/dev/pccard/pccarddevs	Fri Mar 27 19:15:28 2009	(r190475)
+++ head/sys/dev/pccard/pccarddevs	Fri Mar 27 20:40:17 2009	(r190476)
@@ -146,8 +146,8 @@ vendor ARTEM			0x0268	ARtem
 vendor SYMBOL			0x026c	Symbol
 vendor BUFFALO			0x026f	BUFFALO (Melco Corporation)
 vendor BROMAX			0x0274	Bromax communications, Inc
-vendor IODATA2			0x028a	I-O DATA
 vendor NECINFORTIA		0x0288	NEC Inforntia
+vendor IODATA2			0x028a	I-O DATA
 vendor ASUS			0x02aa	ASUS
 vendor SIEMENS			0x02ac	Siemens
 vendor UNGERMANN		0x02c0	Ungermann Bass

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 21:13:14 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 85A281065674;
	Fri, 27 Mar 2009 21:13:14 +0000 (UTC) (envelope-from ru@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 741FF8FC1C;
	Fri, 27 Mar 2009 21:13:14 +0000 (UTC) (envelope-from ru@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2RLDEdR071485;
	Fri, 27 Mar 2009 21:13:14 GMT (envelope-from ru@svn.freebsd.org)
Received: (from ru@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2RLDEPS071483;
	Fri, 27 Mar 2009 21:13:14 GMT (envelope-from ru@svn.freebsd.org)
Message-Id: <200903272113.n2RLDEPS071483@svn.freebsd.org>
From: Ruslan Ermilov 
Date: Fri, 27 Mar 2009 21:13:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190477 - head/share/skel
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 21:13:15 -0000

Author: ru
Date: Fri Mar 27 21:13:14 2009
New Revision: 190477
URL: http://svn.freebsd.org/changeset/base/190477

Log:
  Add explicit test so that non-existence of /usr/games/fortune
  doesn't affect command exit status.

Modified:
  head/share/skel/dot.login
  head/share/skel/dot.profile

Modified: head/share/skel/dot.login
==============================================================================
--- head/share/skel/dot.login	Fri Mar 27 20:40:17 2009	(r190476)
+++ head/share/skel/dot.login	Fri Mar 27 21:13:14 2009	(r190477)
@@ -5,4 +5,4 @@
 # see also csh(1), environ(7).
 #
 
-[ -x /usr/games/fortune ] && /usr/games/fortune freebsd-tips
+if ( -x /usr/games/fortune ) /usr/games/fortune freebsd-tips

Modified: head/share/skel/dot.profile
==============================================================================
--- head/share/skel/dot.profile	Fri Mar 27 20:40:17 2009	(r190476)
+++ head/share/skel/dot.profile	Fri Mar 27 21:13:14 2009	(r190477)
@@ -21,4 +21,4 @@ PAGER=more;  	export PAGER
 # set ENV to a file invoked each time sh is started for interactive use.
 ENV=$HOME/.shrc; export ENV
 
-[ -x /usr/games/fortune ] && /usr/games/fortune freebsd-tips
+if [ -x /usr/games/fortune ] ; then /usr/games/fortune freebsd-tips ; fi

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 27 21:47:57 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2CDDC106566B;
	Fri, 27 Mar 2009 21:47:57 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 005FD8FC08;
	Fri, 27 Mar 2009 21:47:57 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2RLlu9M072278;
	Fri, 27 Mar 2009 21:47:56 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2RLlu1o072277;
	Fri, 27 Mar 2009 21:47:56 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <200903272147.n2RLlu1o072277@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Fri, 27 Mar 2009 21:47:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190481 - head/sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 21:47:57 -0000

Author: trasz
Date: Fri Mar 27 21:47:56 2009
New Revision: 190481
URL: http://svn.freebsd.org/changeset/base/190481

Log:
  Add new V* constants, neccessary for granular permission checks
  in NFSv4 ACLs.  While here, get rid of VALLPERM; it wasn't used anyway.
  
  Approved by:	rwatson (mentor)

Modified:
  head/sys/sys/vnode.h

Modified: head/sys/sys/vnode.h
==============================================================================
--- head/sys/sys/vnode.h	Fri Mar 27 21:41:07 2009	(r190480)
+++ head/sys/sys/vnode.h	Fri Mar 27 21:47:56 2009	(r190481)
@@ -308,15 +308,49 @@ struct vattr {
 #define IO_SEQSHIFT	16		/* seq heuristic in upper 16 bits */
 
 /*
- *  Flags for accmode_t.
+ * Flags for accmode_t.
  */
-#define	VEXEC	000100		/* execute/search permission */
-#define	VWRITE	000200		/* write permission */
-#define	VREAD	000400		/* read permission */
-#define	VADMIN	010000		/* permission to administer */
-#define	VSTAT	020000		/* permission to retrieve attrs */
-#define	VAPPEND	040000		/* permission to write/append */
-#define	VALLPERM	(VEXEC | VWRITE | VREAD | VADMIN | VSTAT | VAPPEND)
+#define	VEXEC			000000000100 /* execute/search permission */
+#define	VWRITE			000000000200 /* write permission */
+#define	VREAD			000000000400 /* read permission */
+#define	VADMIN			000000010000 /* being the file owner */
+#define	VSTAT			000000020000 /* permission to retrieve attrs */
+#define	VAPPEND			000000040000 /* permission to write/append */
+/*
+ * VEXPLICIT_DENY makes VOP_ACCESS(9) return EPERM or EACCES only
+ * if permission was denied explicitly, by a "deny" rule in NFS4 ACL,
+ * and 0 otherwise.  This never happens with ordinary unix access rights
+ * or POSIX.1e ACLs.  Obviously, VEXPLICIT_DENY must be OR-ed with
+ * some other V* constant.
+ */
+#define	VEXPLICIT_DENY		000000100000
+#define	VREAD_NAMED_ATTRS 	000000200000 /* not used */
+#define	VWRITE_NAMED_ATTRS 	000000400000 /* not used */
+#define	VDELETE_CHILD	 	000001000000
+#define	VREAD_ATTRIBUTES 	000002000000 /* permission to stat(2) */
+#define	VWRITE_ATTRIBUTES 	000004000000 /* change {m,c,a}time */
+#define	VDELETE		 	000010000000
+#define	VREAD_ACL	 	000020000000 /* read ACL and file mode */
+#define	VWRITE_ACL	 	000040000000 /* change ACL and/or file mode */
+#define	VWRITE_OWNER	 	000100000000 /* change file owner */
+#define	VSYNCHRONIZE	 	000200000000 /* not used */
+
+/*
+ * Permissions that were traditionally granted only to the file owner.
+ */
+#define VADMIN_PERMS	(VADMIN | VWRITE_ATTRIBUTES | VWRITE_ACL | \
+    VWRITE_OWNER)
+
+/*
+ * Permissions that were traditionally granted to everyone.
+ */
+#define VSTAT_PERMS	(VSTAT | VREAD_ATTRIBUTES | VREAD_ACL | VSYNCHRONIZE)
+
+/*
+ * Permissions that allow to change the state of the file in any way.
+ */
+#define VMODIFY_PERMS	(VWRITE | VAPPEND | VADMIN_PERMS | VDELETE_CHILD | \
+    VDELETE)
 
 /*
  * Token indicating no attribute value yet assigned.

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 04:00:47 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1C314106564A;
	Sat, 28 Mar 2009 04:00:47 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 09D318FC1A;
	Sat, 28 Mar 2009 04:00:47 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2S40kuk083705;
	Sat, 28 Mar 2009 04:00:46 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2S40kW1083700;
	Sat, 28 Mar 2009 04:00:46 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200903280400.n2S40kW1083700@svn.freebsd.org>
From: Xin LI 
Date: Sat, 28 Mar 2009 04:00:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190482 - in head/lib/libc/db: . btree hash mpool
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 04:00:47 -0000

Author: delphij
Date: Sat Mar 28 04:00:46 2009
New Revision: 190482
URL: http://svn.freebsd.org/changeset/base/190482

Log:
  When allocating memory, zero out them if we don't intend to overwrite them
  all; before freeing memory, zero out them before we release it as free
  heap.  This will eliminate some potential information leak issue.
  
  While there, remove the PURIFY option.  There is a slight difference between
  the new behavior and the old -DPURIFY behavior, with the latter initializes
  memory with 0xff's.  The difference between old and new approach does not
  generate observable difference.
  
  Obtained from:	OpenBSD (partly).

Modified:
  head/lib/libc/db/README
  head/lib/libc/db/btree/bt_open.c
  head/lib/libc/db/btree/bt_split.c
  head/lib/libc/db/hash/hash_buf.c
  head/lib/libc/db/mpool/mpool.c

Modified: head/lib/libc/db/README
==============================================================================
--- head/lib/libc/db/README	Fri Mar 27 21:47:56 2009	(r190481)
+++ head/lib/libc/db/README	Sat Mar 28 04:00:46 2009	(r190482)
@@ -1,4 +1,5 @@
 #	@(#)README	8.27 (Berkeley) 9/1/94
+# $FreeBSD$
 
 This is version 1.85 of the Berkeley DB code.
 
@@ -31,10 +32,3 @@ mpool		The memory pool routines.
 recno		The fixed/variable length record routines.
 test		Test package.
 
-============================================
-Debugging:
-
-If you're running a memory checker (e.g. Purify) on DB, make sure that
-you recompile it with "-DPURIFY" in the CFLAGS, first.  By default,
-allocated pages are not initialized by the DB code, and they will show
-up as reads of uninitialized memory in the buffer write routines.

Modified: head/lib/libc/db/btree/bt_open.c
==============================================================================
--- head/lib/libc/db/btree/bt_open.c	Fri Mar 27 21:47:56 2009	(r190481)
+++ head/lib/libc/db/btree/bt_open.c	Sat Mar 28 04:00:46 2009	(r190482)
@@ -156,9 +156,8 @@ __bt_open(const char *fname, int flags, 
 		goto einval;
 
 	/* Allocate and initialize DB and BTREE structures. */
-	if ((t = (BTREE *)malloc(sizeof(BTREE))) == NULL)
+	if ((t = (BTREE *)calloc(1, sizeof(BTREE))) == NULL)
 		goto err;
-	memset(t, 0, sizeof(BTREE));
 	t->bt_fd = -1;			/* Don't close unopened fd on error. */
 	t->bt_lorder = b.lorder;
 	t->bt_order = NOT;
@@ -166,9 +165,8 @@ __bt_open(const char *fname, int flags, 
 	t->bt_pfx = b.prefix;
 	t->bt_rfd = -1;
 
-	if ((t->bt_dbp = dbp = (DB *)malloc(sizeof(DB))) == NULL)
+	if ((t->bt_dbp = dbp = (DB *)calloc(1, sizeof(DB))) == NULL)
 		goto err;
-	memset(t->bt_dbp, 0, sizeof(DB));
 	if (t->bt_lorder != machine_lorder)
 		F_SET(t, B_NEEDSWAP);
 

Modified: head/lib/libc/db/btree/bt_split.c
==============================================================================
--- head/lib/libc/db/btree/bt_split.c	Fri Mar 27 21:47:56 2009	(r190481)
+++ head/lib/libc/db/btree/bt_split.c	Sat Mar 28 04:00:46 2009	(r190482)
@@ -372,13 +372,10 @@ bt_page(BTREE *t, PAGE *h, PAGE **lp, PA
 	}
 
 	/* Put the new left page for the split into place. */
-	if ((l = (PAGE *)malloc(t->bt_psize)) == NULL) {
+	if ((l = (PAGE *)calloc(1, t->bt_psize)) == NULL) {
 		mpool_put(t->bt_mp, r, 0);
 		return (NULL);
 	}
-#ifdef PURIFY
-	memset(l, 0xff, t->bt_psize);
-#endif
 	l->pgno = h->pgno;
 	l->nextpg = r->pgno;
 	l->prevpg = h->prevpg;

Modified: head/lib/libc/db/hash/hash_buf.c
==============================================================================
--- head/lib/libc/db/hash/hash_buf.c	Fri Mar 27 21:47:56 2009	(r190481)
+++ head/lib/libc/db/hash/hash_buf.c	Sat Mar 28 04:00:46 2009	(r190482)
@@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #ifdef DEBUG
 #include 
@@ -169,18 +170,12 @@ newbuf(HTAB *hashp, u_int32_t addr, BUFH
 	 */
 	if (hashp->nbufs || (bp->flags & BUF_PIN)) {
 		/* Allocate a new one */
-		if ((bp = (BUFHEAD *)malloc(sizeof(BUFHEAD))) == NULL)
+		if ((bp = (BUFHEAD *)calloc(1, sizeof(BUFHEAD))) == NULL)
 			return (NULL);
-#ifdef PURIFY
-		memset(bp, 0xff, sizeof(BUFHEAD));
-#endif
-		if ((bp->page = (char *)malloc(hashp->BSIZE)) == NULL) {
+		if ((bp->page = (char *)calloc(1, hashp->BSIZE)) == NULL) {
 			free(bp);
 			return (NULL);
 		}
-#ifdef PURIFY
-		memset(bp->page, 0xff, hashp->BSIZE);
-#endif
 		if (hashp->nbufs)
 			hashp->nbufs--;
 	} else {
@@ -319,8 +314,10 @@ __buf_free(HTAB *hashp, int do_free, int
 		}
 		/* Check if we are freeing stuff */
 		if (do_free) {
-			if (bp->page)
+			if (bp->page) {
+				(void)memset(bp->page, 0, hashp->BSIZE);
 				free(bp->page);
+			}
 			BUF_REMOVE(bp);
 			free(bp);
 			bp = LRU;

Modified: head/lib/libc/db/mpool/mpool.c
==============================================================================
--- head/lib/libc/db/mpool/mpool.c	Fri Mar 27 21:47:56 2009	(r190481)
+++ head/lib/libc/db/mpool/mpool.c	Sat Mar 28 04:00:46 2009	(r190482)
@@ -332,14 +332,11 @@ mpool_bkt(MPOOL *mp)
 			return (bp);
 		}
 
-new:	if ((bp = (BKT *)malloc(sizeof(BKT) + mp->pagesize)) == NULL)
+new:	if ((bp = (BKT *)calloc(1, sizeof(BKT) + mp->pagesize)) == NULL)
 		return (NULL);
 #ifdef STATISTICS
 	++mp->pagealloc;
 #endif
-#if defined(DEBUG) || defined(PURIFY)
-	memset(bp, 0xff, sizeof(BKT) + mp->pagesize);
-#endif
 	bp->page = (char *)bp + sizeof(BKT);
 	++mp->curcache;
 	return (bp);

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 04:56:57 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 47BC0106564A;
	Sat, 28 Mar 2009 04:56:57 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 359F78FC12;
	Sat, 28 Mar 2009 04:56:57 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2S4uujZ084957;
	Sat, 28 Mar 2009 04:56:56 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2S4uugP084954;
	Sat, 28 Mar 2009 04:56:56 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200903280456.n2S4uugP084954@svn.freebsd.org>
From: Warner Losh 
Date: Sat, 28 Mar 2009 04:56:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190483 - head/sys/dev/ed
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 04:56:57 -0000

Author: imp
Date: Sat Mar 28 04:56:56 2009
New Revision: 190483
URL: http://svn.freebsd.org/changeset/base/190483

Log:
  It turns out that the Toshiba LANCT00A PC Card is really like the
  Toshiba PCETC ISA card, and even has the same board type code in the
  card ID (0x14).  So, for this card, call ed_probe_WD80x3_generic after
  setting things up apropriately.  This makes the card attach and kinda
  work (I'm seeing panics in sbdrop).  Since history has shown that the
  WD80x3 probe routine is dangerous, only do it for this card.  Also,
  disable the memory range check to make sure it is an valid ISA memory.
  I think that it is bogus, but I'm not 100% sure, for these cards.
  
  I removed probing for the WD80x3 in 2005 when I added support for the
  AX88x90 and DL100xx cards since none of my cards had ever matched it
  and PAO3 removed it and none of the cards in their database died.
  
  It is possible there are other quirks about this card too, since no
  other open source OS supports it, or even claims to support it.  But
  it was a fun half hour hack...

Modified:
  head/sys/dev/ed/if_ed_pccard.c
  head/sys/dev/ed/if_ed_wd80x3.c
  head/sys/dev/ed/if_edvar.h

Modified: head/sys/dev/ed/if_ed_pccard.c
==============================================================================
--- head/sys/dev/ed/if_ed_pccard.c	Sat Mar 28 04:00:46 2009	(r190482)
+++ head/sys/dev/ed/if_ed_pccard.c	Sat Mar 28 04:56:56 2009	(r190483)
@@ -126,6 +126,7 @@ static const struct ed_product {
 #define	NE2000DVF_DL100XX	0x0001		/* chip is D-Link DL10019/22 */
 #define	NE2000DVF_AX88X90	0x0002		/* chip is ASIX AX88[17]90 */
 #define NE2000DVF_TC5299J	0x0004		/* chip is Tamarack TC5299J */
+#define NE2000DVF_TOSHIBA	0x0008		/* Toshiba DP83902A */
 #define NE2000DVF_ENADDR	0x0100		/* Get MAC from attr mem */
 #define NE2000DVF_ANYFUNC	0x0200		/* Allow any function type */
 #define NE2000DVF_MODEM		0x0400		/* Has a modem/serial */
@@ -226,7 +227,7 @@ static const struct ed_product {
 	{ PCMCIA_CARD(TELECOMDEVICE, LM5LT), 0 },
 	{ PCMCIA_CARD(TELECOMDEVICE, TCD_HPC100), NE2000DVF_AX88X90},
 	{ PCMCIA_CARD(TJ, PTJ_LAN_T), 0 },
-	{ PCMCIA_CARD(TOSHIBA2, LANCT00A), NE2000DVF_ANYFUNC}, /* NG */
+	{ PCMCIA_CARD(TOSHIBA2, LANCT00A), NE2000DVF_ANYFUNC | NE2000DVF_TOSHIBA},
 	{ PCMCIA_CARD(ZONET, ZEN), 0},
 	{ { NULL } }
 };
@@ -434,9 +435,10 @@ ed_pccard_attach(device_t dev)
 	u_char sum;
 	u_char enaddr[ETHER_ADDR_LEN];
 	const struct ed_product *pp;
-	int	error, i;
+	int	error, i, flags;
 	struct ed_softc *sc = device_get_softc(dev);
 	u_long size;
+	static uint16_t *intr_vals[] = {NULL, NULL};
 
 	if ((pp = (const struct ed_product *) pccard_product_lookup(dev, 
 	    (const struct pccard_product *) ed_pccard_products,
@@ -474,6 +476,7 @@ ed_pccard_attach(device_t dev)
 	sc->asic_offset = ED_NOVELL_ASIC_OFFSET;
 	sc->nic_offset  = ED_NOVELL_NIC_OFFSET;
 	error = ENXIO;
+	flags = device_get_flags(dev);
 	if (error != 0)
 		error = ed_pccard_dl100xx(dev, pp);
 	if (error != 0)
@@ -481,7 +484,15 @@ ed_pccard_attach(device_t dev)
 	if (error != 0)
 		error = ed_pccard_tc5299j(dev, pp);
 	if (error != 0)
-		error = ed_probe_Novell_generic(dev, device_get_flags(dev));
+		error = ed_probe_Novell_generic(dev, flags);
+	if (error != 0) {
+		if (pp->flags & NE2000DVF_TOSHIBA)
+			flags |= ED_FLAGS_TOSH_ETHER;
+		flags |= ED_FLAGS_PCCARD;
+		sc->asic_offset = ED_WD_ASIC_OFFSET;
+		sc->nic_offset  = ED_WD_NIC_OFFSET;
+		error = ed_probe_WD80x3_generic(dev, flags, intr_vals);
+	}
 	if (error)
 		goto bad;
 
@@ -502,7 +513,9 @@ ed_pccard_attach(device_t dev)
 	 * default value.  In all fails, we should fail the attach,
 	 * but don't right now.
 	 */
-	if (sc->chip_type == ED_CHIP_TYPE_DP8390) {
+	for (i = 0, sum = 0; i < ETHER_ADDR_LEN; i++)
+		sum |= sc->enaddr[i];
+	if (sc->chip_type == ED_CHIP_TYPE_DP8390 && sum == 0) {
 		pccard_get_ether(dev, enaddr);
 		if (bootverbose)
 			device_printf(dev, "CIS MAC %6D\n", enaddr, ":");

Modified: head/sys/dev/ed/if_ed_wd80x3.c
==============================================================================
--- head/sys/dev/ed/if_ed_wd80x3.c	Sat Mar 28 04:00:46 2009	(r190482)
+++ head/sys/dev/ed/if_ed_wd80x3.c	Sat Mar 28 04:56:56 2009	(r190483)
@@ -119,7 +119,6 @@ ed_probe_WD80x3_generic(device_t dev, in
 		sum += ed_asic_inb(sc, ED_WD_PROM + i);
 
 	if (sum != totalsum) {
-
 		/*
 		 * Checksum is invalid. This often happens with cheap WD8003E
 		 * clones.  In this case, the checksum byte (the eighth byte)
@@ -268,9 +267,11 @@ ed_probe_WD80x3_generic(device_t dev, in
 		printf("%x -> %x\n", i, ed_asic_inb(sc, i));
 #endif
 	pmem = rman_get_start(sc->mem_res);
-	error = ed_isa_mem_ok(dev, pmem, memsize);
-	if (error)
-		return (error);
+	if (!(flags & ED_FLAGS_PCCARD)) {
+		error = ed_isa_mem_ok(dev, pmem, memsize);
+		if (error)
+			return (error);
+	}
 
 	/*
 	 * (note that if the user specifies both of the following flags that

Modified: head/sys/dev/ed/if_edvar.h
==============================================================================
--- head/sys/dev/ed/if_edvar.h	Sat Mar 28 04:00:46 2009	(r190482)
+++ head/sys/dev/ed/if_edvar.h	Sat Mar 28 04:56:56 2009	(r190483)
@@ -267,6 +267,11 @@ extern devclass_t ed_devclass;
 #define ED_FLAGS_FORCE_PIO		0x0010
 
 /*
+ * This forces a PC Card, and disables ISA memory range checks
+ */
+#define ED_FLAGS_PCCARD			0x0020
+
+/*
  * These are flags describing the chip type.
  */
 #define ED_FLAGS_TOSH_ETHER		0x10000

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 05:45:30 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 082E31065672;
	Sat, 28 Mar 2009 05:45:30 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E8AFF8FC19;
	Sat, 28 Mar 2009 05:45:29 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2S5jT0u085869;
	Sat, 28 Mar 2009 05:45:29 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2S5jTUA085861;
	Sat, 28 Mar 2009 05:45:29 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200903280545.n2S5jTUA085861@svn.freebsd.org>
From: Xin LI 
Date: Sat, 28 Mar 2009 05:45:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190484 - in head/lib/libc/db: btree hash recno
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 05:45:30 -0000

Author: delphij
Date: Sat Mar 28 05:45:29 2009
New Revision: 190484
URL: http://svn.freebsd.org/changeset/base/190484

Log:
  Several signed/unsigned warning fixes.

Modified:
  head/lib/libc/db/btree/bt_put.c
  head/lib/libc/db/btree/bt_split.c
  head/lib/libc/db/hash/hash.c
  head/lib/libc/db/hash/hash.h
  head/lib/libc/db/hash/hash_bigkey.c
  head/lib/libc/db/hash/hash_log2.c
  head/lib/libc/db/recno/rec_close.c
  head/lib/libc/db/recno/rec_put.c

Modified: head/lib/libc/db/btree/bt_put.c
==============================================================================
--- head/lib/libc/db/btree/bt_put.c	Sat Mar 28 04:56:56 2009	(r190483)
+++ head/lib/libc/db/btree/bt_put.c	Sat Mar 28 05:45:29 2009	(r190484)
@@ -197,7 +197,7 @@ delete:		if (__bt_dleaf(t, key, h, idx) 
 	 * into the offset array, shift the pointers up.
 	 */
 	nbytes = NBLEAFDBT(key->size, data->size);
-	if (h->upper - h->lower < nbytes + sizeof(indx_t)) {
+	if ((u_int32_t)(h->upper - h->lower) < nbytes + sizeof(indx_t)) {
 		if ((status = __bt_split(t, h, key,
 		    data, dflags, nbytes, idx)) != RET_SUCCESS)
 			return (status);
@@ -278,7 +278,7 @@ bt_fast(BTREE *t, const DBT *key, const 
 	 * have to search to get split stack.
 	 */
 	nbytes = NBLEAFDBT(key->size, data->size);
-	if (h->upper - h->lower < nbytes + sizeof(indx_t))
+	if ((u_int32_t)(h->upper - h->lower) < nbytes + sizeof(indx_t))
 		goto miss;
 
 	if (t->bt_order == FORWARD) {

Modified: head/lib/libc/db/btree/bt_split.c
==============================================================================
--- head/lib/libc/db/btree/bt_split.c	Sat Mar 28 04:56:56 2009	(r190483)
+++ head/lib/libc/db/btree/bt_split.c	Sat Mar 28 05:45:29 2009	(r190484)
@@ -205,7 +205,7 @@ __bt_split(BTREE *t, PAGE *sp, const DBT
 		}
 
 		/* Split the parent page if necessary or shift the indices. */
-		if (h->upper - h->lower < nbytes + sizeof(indx_t)) {
+		if ((u_int32_t)(h->upper - h->lower) < nbytes + sizeof(indx_t)) {
 			sp = h;
 			h = h->pgno == P_ROOT ?
 			    bt_root(t, h, &l, &r, &skip, nbytes) :

Modified: head/lib/libc/db/hash/hash.c
==============================================================================
--- head/lib/libc/db/hash/hash.c	Sat Mar 28 04:56:56 2009	(r190483)
+++ head/lib/libc/db/hash/hash.c	Sat Mar 28 05:45:29 2009	(r190484)
@@ -164,7 +164,7 @@ __hash_open(const char *file, int flags,
 		if (hashp->VERSION != HASHVERSION &&
 		    hashp->VERSION != OLDHASHVERSION)
 			RETURN_ERROR(EFTYPE, error1);
-		if (hashp->hash(CHARKEY, sizeof(CHARKEY)) != hashp->H_CHARKEY)
+		if ((int32_t)hashp->hash(CHARKEY, sizeof(CHARKEY)) != hashp->H_CHARKEY)
 			RETURN_ERROR(EFTYPE, error1);
 		/*
 		 * Figure out how many segments we need.  Max_Bucket is the
@@ -736,7 +736,7 @@ hash_seq(const DB *dbp, DBT *key, DBT *d
 					break;
 			}
 			hashp->cbucket = bucket;
-			if (hashp->cbucket > hashp->MAX_BUCKET) {
+			if ((u_int32_t)hashp->cbucket > hashp->MAX_BUCKET) {
 				hashp->cbucket = -1;
 				return (ABNORMAL);
 			}
@@ -858,7 +858,7 @@ hash_realloc(SEGMENT **p_ptr, int oldsiz
 u_int32_t
 __call_hash(HTAB *hashp, char *k, int len)
 {
-	int n, bucket;
+	unsigned int n, bucket;
 
 	n = hashp->hash(k, len);
 	bucket = n & hashp->HIGH_MASK;

Modified: head/lib/libc/db/hash/hash.h
==============================================================================
--- head/lib/libc/db/hash/hash.h	Sat Mar 28 04:56:56 2009	(r190483)
+++ head/lib/libc/db/hash/hash.h	Sat Mar 28 05:45:29 2009	(r190484)
@@ -71,11 +71,11 @@ typedef struct hashhdr {		/* Disk reside
 	int32_t		ovfl_point;	/* Where overflow pages are being 
 					 * allocated */
 	int32_t		last_freed;	/* Last overflow page freed */
-	int32_t		max_bucket;	/* ID of Maximum bucket in use */
-	int32_t		high_mask;	/* Mask to modulo into entire table */
-	int32_t		low_mask;	/* Mask to modulo into lower half of 
+	u_int32_t	max_bucket;	/* ID of Maximum bucket in use */
+	u_int32_t	high_mask;	/* Mask to modulo into entire table */
+	u_int32_t	low_mask;	/* Mask to modulo into lower half of 
 					 * table */
-	int32_t		ffactor;	/* Fill factor */
+	u_int32_t	ffactor;	/* Fill factor */
 	int32_t		nkeys;		/* Number of keys in hash table */
 	int32_t		hdrpages;	/* Size of table header */
 	int32_t		h_charkey;	/* value of hash(CHARKEY) */

Modified: head/lib/libc/db/hash/hash_bigkey.c
==============================================================================
--- head/lib/libc/db/hash/hash_bigkey.c	Sat Mar 28 04:56:56 2009	(r190483)
+++ head/lib/libc/db/hash/hash_bigkey.c	Sat Mar 28 05:45:29 2009	(r190484)
@@ -86,7 +86,8 @@ int
 __big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val)
 {
 	u_int16_t *p;
-	int key_size, n, val_size;
+	int key_size, n;
+	unsigned int val_size;
 	u_int16_t space, move_bytes, off;
 	char *cp, *key_data, *val_data;
 

Modified: head/lib/libc/db/hash/hash_log2.c
==============================================================================
--- head/lib/libc/db/hash/hash_log2.c	Sat Mar 28 04:56:56 2009	(r190483)
+++ head/lib/libc/db/hash/hash_log2.c	Sat Mar 28 05:45:29 2009	(r190484)
@@ -36,9 +36,10 @@ static char sccsid[] = "@(#)hash_log2.c	
 #include 
 __FBSDID("$FreeBSD$");
 
-#include 
-
 #include 
+#include "hash.h"
+#include "page.h"
+#include "extern.h"
 
 u_int32_t
 __log2(u_int32_t num)

Modified: head/lib/libc/db/recno/rec_close.c
==============================================================================
--- head/lib/libc/db/recno/rec_close.c	Sat Mar 28 04:56:56 2009	(r190483)
+++ head/lib/libc/db/recno/rec_close.c	Sat Mar 28 05:45:29 2009	(r190484)
@@ -150,7 +150,7 @@ __rec_sync(const DB *dbp, u_int flags)
 		status = (dbp->seq)(dbp, &key, &data, R_FIRST);
 		while (status == RET_SUCCESS) {
 			if (_write(t->bt_rfd, data.data, data.size) !=
-			    data.size)
+			    (ssize_t)data.size)
 				return (RET_ERROR);
 			status = (dbp->seq)(dbp, &key, &data, R_NEXT);
 		}
@@ -162,7 +162,7 @@ __rec_sync(const DB *dbp, u_int flags)
 		while (status == RET_SUCCESS) {
 			iov[0].iov_base = data.data;
 			iov[0].iov_len = data.size;
-			if (_writev(t->bt_rfd, iov, 2) != data.size + 1)
+			if (_writev(t->bt_rfd, iov, 2) != (ssize_t)(data.size + 1))
 				return (RET_ERROR);
 			status = (dbp->seq)(dbp, &key, &data, R_NEXT);
 		}

Modified: head/lib/libc/db/recno/rec_put.c
==============================================================================
--- head/lib/libc/db/recno/rec_put.c	Sat Mar 28 04:56:56 2009	(r190483)
+++ head/lib/libc/db/recno/rec_put.c	Sat Mar 28 05:45:29 2009	(r190484)
@@ -251,7 +251,7 @@ __rec_iput(BTREE *t, recno_t nrec, const
 	 * the offset array, shift the pointers up.
 	 */
 	nbytes = NRLEAFDBT(data->size);
-	if (h->upper - h->lower < nbytes + sizeof(indx_t)) {
+	if ((u_int32_t)(h->upper - h->lower) < nbytes + sizeof(indx_t)) {
 		status = __bt_split(t, h, NULL, data, dflags, nbytes, idx);
 		if (status == RET_SUCCESS)
 			++t->bt_nrecs;

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 05:57:27 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B22C81065672;
	Sat, 28 Mar 2009 05:57:27 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 85A678FC1A;
	Sat, 28 Mar 2009 05:57:27 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2S5vRdr086114;
	Sat, 28 Mar 2009 05:57:27 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2S5vR2c086112;
	Sat, 28 Mar 2009 05:57:27 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200903280557.n2S5vR2c086112@svn.freebsd.org>
From: Xin LI 
Date: Sat, 28 Mar 2009 05:57:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190485 - in head/lib/libc/db: btree hash
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 05:57:28 -0000

Author: delphij
Date: Sat Mar 28 05:57:27 2009
New Revision: 190485
URL: http://svn.freebsd.org/changeset/base/190485

Log:
  db/btree/bt_open.c: check return value of snprintf() and return value
  if the result is truncated.
  
  db/hash/hash_page.c: use the same way to create temporary file as
  bt_open.c; check snprintf() return value.
  
  Obtained from:	OpenBSD

Modified:
  head/lib/libc/db/btree/bt_open.c
  head/lib/libc/db/hash/hash_page.c

Modified: head/lib/libc/db/btree/bt_open.c
==============================================================================
--- head/lib/libc/db/btree/bt_open.c	Sat Mar 28 05:45:29 2009	(r190484)
+++ head/lib/libc/db/btree/bt_open.c	Sat Mar 28 05:57:27 2009	(r190485)
@@ -383,14 +383,18 @@ static int
 tmp(void)
 {
 	sigset_t set, oset;
-	int fd;
+	int fd, len;
 	char *envtmp = NULL;
 	char path[MAXPATHLEN];
 
 	if (issetugid() == 0)
 		envtmp = getenv("TMPDIR");
-	(void)snprintf(path,
+	len = snprintf(path,
 	    sizeof(path), "%s/bt.XXXXXXXXXX", envtmp ? envtmp : "/tmp");
+	if (len < 0 || len >= (int)sizeof(path)) {
+		errno = ENAMETOOLONG;
+		return(-1);
+	}
 
 	(void)sigfillset(&set);
 	(void)_sigprocmask(SIG_BLOCK, &set, &oset);

Modified: head/lib/libc/db/hash/hash_page.c
==============================================================================
--- head/lib/libc/db/hash/hash_page.c	Sat Mar 28 05:45:29 2009	(r190484)
+++ head/lib/libc/db/hash/hash_page.c	Sat Mar 28 05:57:27 2009	(r190485)
@@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$");
  */
 
 #include "namespace.h"
-#include 
+#include 
 
 #include 
 #include 
@@ -833,13 +833,24 @@ static int
 open_temp(HTAB *hashp)
 {
 	sigset_t set, oset;
-	static char namestr[] = "_hashXXXXXX";
+	int len;
+	char *envtmp = NULL;
+	char path[MAXPATHLEN];
+
+	if (issetugid() == 0)
+		envtmp = getenv("TMPDIR");
+	len = snprintf(path,
+	    sizeof(path), "%s/_hash.XXXXXX", envtmp ? envtmp : "/tmp");
+	if (len < 0 || len >= sizeof(path)) {
+		errno = ENAMETOOLONG;
+		return (-1);
+	}
 
 	/* Block signals; make sure file goes away at process exit. */
 	(void)sigfillset(&set);
 	(void)_sigprocmask(SIG_BLOCK, &set, &oset);
-	if ((hashp->fp = mkstemp(namestr)) != -1) {
-		(void)unlink(namestr);
+	if ((hashp->fp = mkstemp(path)) != -1) {
+		(void)unlink(path);
 		(void)_fcntl(hashp->fp, F_SETFD, 1);
 	}
 	(void)_sigprocmask(SIG_SETMASK, &oset, (sigset_t *)NULL);

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 06:05:54 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4F4A81065672;
	Sat, 28 Mar 2009 06:05:54 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3D6318FC0C;
	Sat, 28 Mar 2009 06:05:54 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2S65scL086322;
	Sat, 28 Mar 2009 06:05:54 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2S65sxf086320;
	Sat, 28 Mar 2009 06:05:54 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200903280605.n2S65sxf086320@svn.freebsd.org>
From: Xin LI 
Date: Sat, 28 Mar 2009 06:05:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190486 - head/lib/libc/db/hash
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 06:05:54 -0000

Author: delphij
Date: Sat Mar 28 06:05:53 2009
New Revision: 190486
URL: http://svn.freebsd.org/changeset/base/190486

Log:
  Use pread(2) and pwrite(2) instead of lseek(2) + read(2) / write(2).
  
  Obtained from:	NetBSD via OpenBSD

Modified:
  head/lib/libc/db/hash/hash.c
  head/lib/libc/db/hash/hash_page.c

Modified: head/lib/libc/db/hash/hash.c
==============================================================================
--- head/lib/libc/db/hash/hash.c	Sat Mar 28 05:57:27 2009	(r190485)
+++ head/lib/libc/db/hash/hash.c	Sat Mar 28 06:05:53 2009	(r190486)
@@ -495,8 +495,7 @@ flush_meta(HTAB *hashp)
 	whdrp = &whdr;
 	swap_header_copy(&hashp->hdr, whdrp);
 #endif
-	if ((lseek(fp, (off_t)0, SEEK_SET) == -1) ||
-	    ((wsize = _write(fp, whdrp, sizeof(HASHHDR))) == -1))
+	if ((wsize = pwrite(fp, whdrp, sizeof(HASHHDR), (off_t)0)) == -1)
 		return (-1);
 	else
 		if (wsize != sizeof(HASHHDR)) {

Modified: head/lib/libc/db/hash/hash_page.c
==============================================================================
--- head/lib/libc/db/hash/hash_page.c	Sat Mar 28 05:57:27 2009	(r190485)
+++ head/lib/libc/db/hash/hash_page.c	Sat Mar 28 06:05:53 2009	(r190486)
@@ -520,8 +520,7 @@ __get_page(HTAB *hashp, char *p, u_int32
 		page = BUCKET_TO_PAGE(bucket);
 	else
 		page = OADDR_TO_PAGE(bucket);
-	if ((lseek(fd, (off_t)page << hashp->BSHIFT, SEEK_SET) == -1) ||
-	    ((rsize = _read(fd, p, size)) == -1))
+	if ((rsize = pread(fd, p, size, (off_t)page << hashp->BSHIFT)) == -1)
 		return (-1);
 	bp = (u_int16_t *)p;
 	if (!rsize)
@@ -587,8 +586,7 @@ __put_page(HTAB *hashp, char *p, u_int32
 		page = BUCKET_TO_PAGE(bucket);
 	else
 		page = OADDR_TO_PAGE(bucket);
-	if ((lseek(fd, (off_t)page << hashp->BSHIFT, SEEK_SET) == -1) ||
-	    ((wsize = _write(fd, p, size)) == -1))
+	if ((wsize = pwrite(fd, p, size, (off_t)page << hashp->BSHIFT)) == -1)
 		/* Errno is set */
 		return (-1);
 	if (wsize != size) {

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 06:12:39 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 77D5F106566B;
	Sat, 28 Mar 2009 06:12:39 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 662388FC13;
	Sat, 28 Mar 2009 06:12:39 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2S6CdnY086498;
	Sat, 28 Mar 2009 06:12:39 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2S6CdrQ086497;
	Sat, 28 Mar 2009 06:12:39 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200903280612.n2S6CdrQ086497@svn.freebsd.org>
From: Xin LI 
Date: Sat, 28 Mar 2009 06:12:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190487 - head/lib/libc/db/hash
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 06:12:39 -0000

Author: delphij
Date: Sat Mar 28 06:12:39 2009
New Revision: 190487
URL: http://svn.freebsd.org/changeset/base/190487

Log:
  Return meaningful errno in overflow case; print error message to stderr
  in one more case.
  
  Obtained from:	NetBSD via OpenBSD

Modified:
  head/lib/libc/db/hash/hash_page.c

Modified: head/lib/libc/db/hash/hash_page.c
==============================================================================
--- head/lib/libc/db/hash/hash_page.c	Sat Mar 28 06:05:53 2009	(r190486)
+++ head/lib/libc/db/hash/hash_page.c	Sat Mar 28 06:12:39 2009	(r190487)
@@ -687,6 +687,7 @@ overflow_page(HTAB *hashp)
 	if (offset > SPLITMASK) {
 		if (++splitnum >= NCACHED) {
 			(void)_write(STDERR_FILENO, OVMSG, sizeof(OVMSG) - 1);
+			errno = EFBIG;
 			return (0);
 		}
 		hashp->OVFL_POINT = splitnum;
@@ -700,6 +701,7 @@ overflow_page(HTAB *hashp)
 		free_page++;
 		if (free_page >= NCACHED) {
 			(void)_write(STDERR_FILENO, OVMSG, sizeof(OVMSG) - 1);
+			errno = EFBIG;
 			return (0);
 		}
 		/*
@@ -725,6 +727,7 @@ overflow_page(HTAB *hashp)
 			if (++splitnum >= NCACHED) {
 				(void)_write(STDERR_FILENO, OVMSG,
 				    sizeof(OVMSG) - 1);
+				errno = EFBIG;
 				return (0);
 			}
 			hashp->OVFL_POINT = splitnum;
@@ -768,8 +771,11 @@ found:
 	/* Calculate the split number for this page */
 	for (i = 0; (i < splitnum) && (bit > hashp->SPARES[i]); i++);
 	offset = (i ? bit - hashp->SPARES[i - 1] : bit);
-	if (offset >= SPLITMASK)
+	if (offset >= SPLITMASK) {
+		(void)_write(STDERR_FILENO, OVMSG, sizeof(OVMSG) - 1);
+		errno = EFBIG;
 		return (0);	/* Out of overflow pages */
+	}
 	addr = OADDR_OF(i, offset);
 #ifdef DEBUG2
 	(void)fprintf(stderr, "OVERFLOW_PAGE: ADDR: %d BIT: %d PAGE %d\n",

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 06:22:11 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D7AE01065677;
	Sat, 28 Mar 2009 06:22:11 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C5E008FC1F;
	Sat, 28 Mar 2009 06:22:11 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2S6MBun086714;
	Sat, 28 Mar 2009 06:22:11 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2S6MBTE086713;
	Sat, 28 Mar 2009 06:22:11 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200903280622.n2S6MBTE086713@svn.freebsd.org>
From: Warner Losh 
Date: Sat, 28 Mar 2009 06:22:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190488 - head/sys/dev/ed
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 06:22:12 -0000

Author: imp
Date: Sat Mar 28 06:22:11 2009
New Revision: 190488
URL: http://svn.freebsd.org/changeset/base/190488

Log:
  When reading via memory, read in (amount + 1) / 2 (to properly round
  up) rather than amount + 1 / 2, which is the same as amount, or 2x too
  many words which leads to data corruption.
  
  # This fixes the sbdrop panics I was seeing with the Toshiba LANCT00A.

Modified:
  head/sys/dev/ed/if_ed.c

Modified: head/sys/dev/ed/if_ed.c
==============================================================================
--- head/sys/dev/ed/if_ed.c	Sat Mar 28 06:12:39 2009	(r190487)
+++ head/sys/dev/ed/if_ed.c	Sat Mar 28 06:22:11 2009	(r190488)
@@ -1311,7 +1311,7 @@ ed_shmem_readmem16(struct ed_softc *sc, 
     uint16_t amount)
 {
 	bus_space_read_region_2(sc->mem_bst, sc->mem_bsh, src, (uint16_t *)dst,
-	    amount + 1 / 2);
+	    (amount + 1) / 2);
 }
 
 /*

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 06:23:10 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9EE76106567D;
	Sat, 28 Mar 2009 06:23:10 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 722938FC1B;
	Sat, 28 Mar 2009 06:23:10 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2S6NA8e086774;
	Sat, 28 Mar 2009 06:23:10 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2S6NA1E086772;
	Sat, 28 Mar 2009 06:23:10 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200903280623.n2S6NA1E086772@svn.freebsd.org>
From: Xin LI 
Date: Sat, 28 Mar 2009 06:23:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190489 - head/lib/libc/db/hash
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 06:23:11 -0000

Author: delphij
Date: Sat Mar 28 06:23:10 2009
New Revision: 190489
URL: http://svn.freebsd.org/changeset/base/190489

Log:
  Diff reduce against OpenBSD, no functional change.

Modified:
  head/lib/libc/db/hash/hash.c
  head/lib/libc/db/hash/hash_page.c

Modified: head/lib/libc/db/hash/hash.c
==============================================================================
--- head/lib/libc/db/hash/hash.c	Sat Mar 28 06:22:11 2009	(r190488)
+++ head/lib/libc/db/hash/hash.c	Sat Mar 28 06:23:10 2009	(r190489)
@@ -347,8 +347,7 @@ init_hash(HTAB *hashp, const char *file,
 static int
 init_htab(HTAB *hashp, int nelem)
 {
-	int nbuckets, nsegs;
-	int l2;
+	int nbuckets, nsegs, l2;
 
 	/*
 	 * Divide number of elements by the fill factor and determine a

Modified: head/lib/libc/db/hash/hash_page.c
==============================================================================
--- head/lib/libc/db/hash/hash_page.c	Sat Mar 28 06:22:11 2009	(r190488)
+++ head/lib/libc/db/hash/hash_page.c	Sat Mar 28 06:23:10 2009	(r190489)
@@ -124,9 +124,8 @@ putpair(char *p, const DBT *key, const D
 int
 __delpair(HTAB *hashp, BUFHEAD *bufp, int ndx)
 {
-	u_int16_t *bp, newoff;
+	u_int16_t *bp, newoff, pairlen;
 	int n;
-	u_int16_t pairlen;
 
 	bp = (u_int16_t *)bufp->page;
 	n = bp[0];
@@ -453,8 +452,7 @@ __addel(HTAB *hashp, BUFHEAD *bufp, cons
 BUFHEAD *
 __add_ovflpage(HTAB *hashp, BUFHEAD *bufp)
 {
-	u_int16_t *sp;
-	u_int16_t ndx, ovfl_num;
+	u_int16_t *sp, ndx, ovfl_num;
 #ifdef DEBUG1
 	int tmp1, tmp2;
 #endif
@@ -505,8 +503,7 @@ int
 __get_page(HTAB *hashp, char *p, u_int32_t bucket, int is_bucket, int is_disk,
     int is_bitmap)
 {
-	int fd, page, size;
-	int rsize;
+	int fd, page, size, rsize;
 	u_int16_t *bp;
 
 	fd = hashp->fp;
@@ -560,8 +557,7 @@ __get_page(HTAB *hashp, char *p, u_int32
 int
 __put_page(HTAB *hashp, char *p, u_int32_t bucket, int is_bucket, int is_bitmap)
 {
-	int fd, page, size;
-	int wsize;
+	int fd, page, size, wsize;
 
 	size = hashp->BSIZE;
 	if ((hashp->fp == -1) && open_temp(hashp))
@@ -569,8 +565,7 @@ __put_page(HTAB *hashp, char *p, u_int32
 	fd = hashp->fp;
 
 	if (hashp->LORDER != BYTE_ORDER) {
-		int i;
-		int max;
+		int i, max;
 
 		if (is_bitmap) {
 			max = hashp->BSIZE >> 2;	/* divide by 4 */

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 06:25:33 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7684D1065670;
	Sat, 28 Mar 2009 06:25:33 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 64CEA8FC13;
	Sat, 28 Mar 2009 06:25:33 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2S6PXOM086854;
	Sat, 28 Mar 2009 06:25:33 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2S6PXKm086853;
	Sat, 28 Mar 2009 06:25:33 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200903280625.n2S6PXKm086853@svn.freebsd.org>
From: Xin LI 
Date: Sat, 28 Mar 2009 06:25:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190490 - head/lib/libc/db/hash
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 06:25:34 -0000

Author: delphij
Date: Sat Mar 28 06:25:33 2009
New Revision: 190490
URL: http://svn.freebsd.org/changeset/base/190490

Log:
  Only squeeze a short key/value pair onto a page with other complete key/value
  pairs, not onto a page containing the end of a big pair.
  
  Obtained from:	NetBSD via OpenBSD

Modified:
  head/lib/libc/db/hash/hash_page.c

Modified: head/lib/libc/db/hash/hash_page.c
==============================================================================
--- head/lib/libc/db/hash/hash_page.c	Sat Mar 28 06:23:10 2009	(r190489)
+++ head/lib/libc/db/hash/hash_page.c	Sat Mar 28 06:25:33 2009	(r190490)
@@ -404,17 +404,22 @@ __addel(HTAB *hashp, BUFHEAD *bufp, cons
 			if (!bufp)
 				return (-1);
 			bp = (u_int16_t *)bufp->page;
-		} else
+		} else if (bp[bp[0]] != OVFLPAGE) {
+			/* Short key/data pairs, no more pages */
+			break;
+		} else {
 			/* Try to squeeze key on this page */
-			if (FREESPACE(bp) > PAIRSIZE(key, val)) {
+			if (bp[2] >= REAL_KEY &&
+			    FREESPACE(bp) >= PAIRSIZE(key, val)) {
 				squeeze_key(bp, key, val);
-				return (0);
+				goto stats;
 			} else {
 				bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
 				if (!bufp)
 					return (-1);
 				bp = (u_int16_t *)bufp->page;
 			}
+		}
 
 	if (PAIRFITS(bp, key, val))
 		putpair(bufp->page, key, val);
@@ -431,6 +436,7 @@ __addel(HTAB *hashp, BUFHEAD *bufp, cons
 			if (__big_insert(hashp, bufp, key, val))
 				return (-1);
 	}
+stats:
 	bufp->flags |= BUF_MOD;
 	/*
 	 * If the average number of keys per bucket exceeds the fill factor,

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 06:30:43 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A65DF106566B;
	Sat, 28 Mar 2009 06:30:43 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7A4068FC0A;
	Sat, 28 Mar 2009 06:30:43 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2S6UhDb086989;
	Sat, 28 Mar 2009 06:30:43 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2S6Uhrr086987;
	Sat, 28 Mar 2009 06:30:43 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200903280630.n2S6Uhrr086987@svn.freebsd.org>
From: Xin LI 
Date: Sat, 28 Mar 2009 06:30:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190491 - head/lib/libc/db/hash
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 06:30:44 -0000

Author: delphij
Date: Sat Mar 28 06:30:43 2009
New Revision: 190491
URL: http://svn.freebsd.org/changeset/base/190491

Log:
  Fix a crash when iterating over a hash and removing its elements.
  
  Obtained from:	OpenBSD

Modified:
  head/lib/libc/db/hash/hash.c
  head/lib/libc/db/hash/hash_page.c

Modified: head/lib/libc/db/hash/hash.c
==============================================================================
--- head/lib/libc/db/hash/hash.c	Sat Mar 28 06:25:33 2009	(r190490)
+++ head/lib/libc/db/hash/hash.c	Sat Mar 28 06:30:43 2009	(r190491)
@@ -539,8 +539,7 @@ hash_put(const DB *dbp, DBT *key, const 
 
 	hashp = (HTAB *)dbp->internal;
 	if (flag && flag != R_NOOVERWRITE) {
-		hashp->error = EINVAL;
-		errno = EINVAL;
+		hashp->error = errno = EINVAL;
 		return (ERROR);
 	}
 	if ((hashp->flags & O_ACCMODE) == O_RDONLY) {
@@ -719,7 +718,7 @@ hash_seq(const DB *dbp, DBT *key, DBT *d
 		hashp->cndx = 1;
 		hashp->cpage = NULL;
 	}
-
+ next_bucket:
 	for (bp = NULL; !bp || !bp[0]; ) {
 		if (!(bufp = hashp->cpage)) {
 			for (bucket = hashp->cbucket;
@@ -738,8 +737,18 @@ hash_seq(const DB *dbp, DBT *key, DBT *d
 				hashp->cbucket = -1;
 				return (ABNORMAL);
 			}
-		} else
+		} else {
 			bp = (u_int16_t *)hashp->cpage->page;
+			if (flag == R_NEXT) {
+				hashp->cndx += 2;
+				if (hashp->cndx > bp[0]) {
+					hashp->cpage = NULL;
+					hashp->cbucket++;
+					hashp->cndx = 1;
+					goto next_bucket;
+				}
+			}
+		}
 
 #ifdef DEBUG
 		assert(bp);
@@ -767,13 +776,6 @@ hash_seq(const DB *dbp, DBT *key, DBT *d
 		key->size = (ndx > 1 ? bp[ndx - 1] : hashp->BSIZE) - bp[ndx];
 		data->data = (u_char *)hashp->cpage->page + bp[ndx + 1];
 		data->size = bp[ndx] - bp[ndx + 1];
-		ndx += 2;
-		if (ndx > bp[0]) {
-			hashp->cpage = NULL;
-			hashp->cbucket++;
-			hashp->cndx = 1;
-		} else
-			hashp->cndx = ndx;
 	}
 	return (SUCCESS);
 }

Modified: head/lib/libc/db/hash/hash_page.c
==============================================================================
--- head/lib/libc/db/hash/hash_page.c	Sat Mar 28 06:25:33 2009	(r190490)
+++ head/lib/libc/db/hash/hash_page.c	Sat Mar 28 06:30:43 2009	(r190491)
@@ -155,6 +155,14 @@ __delpair(HTAB *hashp, BUFHEAD *bufp, in
 				bp[i - 1] = bp[i + 1] + pairlen;
 			}
 		}
+		if (ndx == hashp->cndx) {
+			/*
+			 * We just removed pair we were "pointing" to.
+			 * By moving back the cndx we ensure subsequent
+			 * hash_seq() calls won't skip over any entries.
+			 */
+			hashp->cndx -= 2;
+		}
 	}
 	/* Finally adjust the page data */
 	bp[n] = OFFSET(bp) + pairlen;

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 06:38:32 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3FEEF106564A;
	Sat, 28 Mar 2009 06:38:32 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2DDD18FC0A;
	Sat, 28 Mar 2009 06:38:32 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2S6cW93087235;
	Sat, 28 Mar 2009 06:38:32 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2S6cWhu087234;
	Sat, 28 Mar 2009 06:38:32 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200903280638.n2S6cWhu087234@svn.freebsd.org>
From: Xin LI 
Date: Sat, 28 Mar 2009 06:38:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190492 - head/lib/libc/db/hash
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 06:38:32 -0000

Author: delphij
Date: Sat Mar 28 06:38:31 2009
New Revision: 190492
URL: http://svn.freebsd.org/changeset/base/190492

Log:
   - Avoid overwriting the cursor page when the cursor page becomes the
  LRU page.
   - Fix for sequential retrieval failure when using large key/data pairs.
  
  Obtained from:	OpenBSD

Modified:
  head/lib/libc/db/hash/hash_buf.c

Modified: head/lib/libc/db/hash/hash_buf.c
==============================================================================
--- head/lib/libc/db/hash/hash_buf.c	Sat Mar 28 06:30:43 2009	(r190491)
+++ head/lib/libc/db/hash/hash_buf.c	Sat Mar 28 06:38:31 2009	(r190492)
@@ -164,11 +164,31 @@ newbuf(HTAB *hashp, u_int32_t addr, BUFH
 
 	oaddr = 0;
 	bp = LRU;
+
+        /* It is bad to overwrite the page under the cursor. */
+        if (bp == hashp->cpage) {
+                BUF_REMOVE(bp);
+                MRU_INSERT(bp);
+                bp = LRU;
+        }
+
+	/* If prev_bp is part of bp overflow, create a new buffer. */
+	if (hashp->nbufs == 0 && prev_bp && bp->ovfl) {
+		BUFHEAD *ovfl;
+
+		for (ovfl = bp->ovfl; ovfl ; ovfl = ovfl->ovfl) {
+			if (ovfl == prev_bp) {
+				hashp->nbufs++;
+				break;
+			}
+		}
+	}
+
 	/*
 	 * If LRU buffer is pinned, the buffer pool is too small. We need to
 	 * allocate more buffers.
 	 */
-	if (hashp->nbufs || (bp->flags & BUF_PIN)) {
+	if (hashp->nbufs || (bp->flags & BUF_PIN) || bp == hashp->cpage) {
 		/* Allocate a new one */
 		if ((bp = (BUFHEAD *)calloc(1, sizeof(BUFHEAD))) == NULL)
 			return (NULL);

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 06:40:49 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0418C106566C;
	Sat, 28 Mar 2009 06:40:49 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E61BC8FC14;
	Sat, 28 Mar 2009 06:40:48 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2S6emRg087317;
	Sat, 28 Mar 2009 06:40:48 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2S6em4V087316;
	Sat, 28 Mar 2009 06:40:48 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200903280640.n2S6em4V087316@svn.freebsd.org>
From: Xin LI 
Date: Sat, 28 Mar 2009 06:40:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190493 - head/lib/libc/db/hash
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 06:40:49 -0000

Author: delphij
Date: Sat Mar 28 06:40:48 2009
New Revision: 190493
URL: http://svn.freebsd.org/changeset/base/190493

Log:
  Avoid NULL deference which causes DEBUG1 to crash, not to print useful
  information.
  
  Obtained from:	OpenBSD

Modified:
  head/lib/libc/db/hash/hash_buf.c

Modified: head/lib/libc/db/hash/hash_buf.c
==============================================================================
--- head/lib/libc/db/hash/hash_buf.c	Sat Mar 28 06:38:31 2009	(r190492)
+++ head/lib/libc/db/hash/hash_buf.c	Sat Mar 28 06:40:48 2009	(r190493)
@@ -282,7 +282,7 @@ newbuf(HTAB *hashp, u_int32_t addr, BUFH
 		 */
 #ifdef DEBUG1
 		(void)fprintf(stderr, "NEWBUF2: %d->ovfl was %d is now %d\n",
-		    prev_bp->addr, (prev_bp->ovfl ? bp->ovfl->addr : 0),
+		    prev_bp->addr, (prev_bp->ovfl ? prev_bp->ovfl->addr : 0),
 		    (bp ? bp->addr : 0));
 #endif
 		prev_bp->ovfl = bp;

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 06:47:05 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AD3D91065672;
	Sat, 28 Mar 2009 06:47:05 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 80EA78FC17;
	Sat, 28 Mar 2009 06:47:05 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2S6l5NC087481;
	Sat, 28 Mar 2009 06:47:05 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2S6l56R087480;
	Sat, 28 Mar 2009 06:47:05 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200903280647.n2S6l56R087480@svn.freebsd.org>
From: Xin LI 
Date: Sat, 28 Mar 2009 06:47:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190494 - head/lib/libc/db/hash
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 06:47:06 -0000

Author: delphij
Date: Sat Mar 28 06:47:05 2009
New Revision: 190494
URL: http://svn.freebsd.org/changeset/base/190494

Log:
   - If (keysize+datasize)%(bsize=14)==0, insertion of a `big key' would cause
     an invariant (actually, an ugly hack) to fail, and all Hell would break
     loose.
  
     When deleting a big key, the offset of an empty page should be bsize, not
     bsize-1; otherwise an insertion into the empty page will cause the new key to
     be elongated by 1 byte.
  
     Make the packing more dense in a couple of cases.
  
   - fix NULL dereference exposed on big bsize values;
  
  Obtained from:	NetBSD via OpenBSD

Modified:
  head/lib/libc/db/hash/hash_bigkey.c

Modified: head/lib/libc/db/hash/hash_bigkey.c
==============================================================================
--- head/lib/libc/db/hash/hash_bigkey.c	Sat Mar 28 06:40:48 2009	(r190493)
+++ head/lib/libc/db/hash/hash_bigkey.c	Sat Mar 28 06:47:05 2009	(r190494)
@@ -118,18 +118,30 @@ __big_insert(HTAB *hashp, BUFHEAD *bufp,
 			return (-1);
 		n = p[0];
 		if (!key_size) {
-			if (FREESPACE(p)) {
-				move_bytes = MIN(FREESPACE(p), val_size);
+			space = FREESPACE(p);
+			if (space) {
+				move_bytes = MIN(space, val_size);
+				/*
+				 * If the data would fit exactly in the
+				 * remaining space, we must overflow it to the
+				 * next page; otherwise the invariant that the
+				 * data must end on a page with FREESPACE
+				 * non-zero would fail.
+				 */
+				if (space == val_size && val_size == val->size)
+					goto toolarge;
 				off = OFFSET(p) - move_bytes;
-				p[n] = off;
 				memmove(cp + off, val_data, move_bytes);
 				val_data += move_bytes;
 				val_size -= move_bytes;
+				p[n] = off;
 				p[n - 2] = FULL_KEY_DATA;
 				FREESPACE(p) = FREESPACE(p) - move_bytes;
 				OFFSET(p) = off;
-			} else
+			} else {
+			toolarge:
 				p[n - 2] = FULL_KEY;
+			}
 		}
 		p = (u_int16_t *)bufp->page;
 		cp = bufp->page;
@@ -239,12 +251,12 @@ __big_delete(HTAB *hashp, BUFHEAD *bufp)
 	n -= 2;
 	bp[0] = n;
 	FREESPACE(bp) = hashp->BSIZE - PAGE_META(n);
-	OFFSET(bp) = hashp->BSIZE - 1;
+	OFFSET(bp) = hashp->BSIZE;
 
 	bufp->flags |= BUF_MOD;
 	if (rbufp)
 		__free_ovflpage(hashp, rbufp);
-	if (last_bfp != rbufp)
+	if (last_bfp && last_bfp != rbufp)
 		__free_ovflpage(hashp, last_bfp);
 
 	hashp->NKEYS--;

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 07:09:51 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B0AF3106564A;
	Sat, 28 Mar 2009 07:09:51 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9EBF28FC16;
	Sat, 28 Mar 2009 07:09:51 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2S79paB087941;
	Sat, 28 Mar 2009 07:09:51 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2S79pjn087940;
	Sat, 28 Mar 2009 07:09:51 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200903280709.n2S79pjn087940@svn.freebsd.org>
From: Xin LI 
Date: Sat, 28 Mar 2009 07:09:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190495 - head/lib/libc/db/hash
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 07:09:52 -0000

Author: delphij
Date: Sat Mar 28 07:09:51 2009
New Revision: 190495
URL: http://svn.freebsd.org/changeset/base/190495

Log:
  Simplify the logic when determining whether to zero out a db file to after
  open().  The previous logic only initializes the database when O_CREAT is
  set, but as long as we can open and write the database, and the database
  is empty, we should initialize it anyway.
  
  Obtained from:	OpenBSD

Modified:
  head/lib/libc/db/hash/hash.c

Modified: head/lib/libc/db/hash/hash.c
==============================================================================
--- head/lib/libc/db/hash/hash.c	Sat Mar 28 06:47:05 2009	(r190494)
+++ head/lib/libc/db/hash/hash.c	Sat Mar 28 07:09:51 2009	(r190495)
@@ -120,25 +120,15 @@ __hash_open(const char *file, int flags,
 	 */
 	hashp->flags = flags;
 
-	new_table = 0;
-	if (!file || (flags & O_TRUNC) ||
-	    (stat(file, &statbuf) && (errno == ENOENT))) {
-		if (errno == ENOENT)
-			errno = 0; /* Just in case someone looks at errno */
-		new_table = 1;
-	}
 	if (file) {
 		if ((hashp->fp = _open(file, flags, mode)) == -1)
 			RETURN_ERROR(errno, error0);
-
-		/* if the .db file is empty, and we had permission to create
-		   a new .db file, then reinitialize the database */
-		if ((flags & O_CREAT) &&
-		     _fstat(hashp->fp, &statbuf) == 0 && statbuf.st_size == 0)
-			new_table = 1;
-
 		(void)_fcntl(hashp->fp, F_SETFD, 1);
-	}
+		new_table = _fstat(hashp->fp, &statbuf) == 0 &&
+		    statbuf.st_size == 0 && (flags & O_ACCMODE) != O_RDONLY;
+	} else
+		new_table = 1;
+
 	if (new_table) {
 		if (!(hashp = init_hash(hashp, file, info)))
 			RETURN_ERROR(errno, error1);

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 07:20:39 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B1A0E106566C;
	Sat, 28 Mar 2009 07:20:39 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9FAF98FC0A;
	Sat, 28 Mar 2009 07:20:39 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2S7Kdqb088177;
	Sat, 28 Mar 2009 07:20:39 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2S7Kddd088176;
	Sat, 28 Mar 2009 07:20:39 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200903280720.n2S7Kddd088176@svn.freebsd.org>
From: Xin LI 
Date: Sat, 28 Mar 2009 07:20:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190496 - head/lib/libc/db/hash
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 07:20:40 -0000

Author: delphij
Date: Sat Mar 28 07:20:39 2009
New Revision: 190496
URL: http://svn.freebsd.org/changeset/base/190496

Log:
  Plug memory leaks and a potential NULL dereference.
  
  Obtained from:	OpenBSD

Modified:
  head/lib/libc/db/hash/hash.c

Modified: head/lib/libc/db/hash/hash.c
==============================================================================
--- head/lib/libc/db/hash/hash.c	Sat Mar 28 07:09:51 2009	(r190495)
+++ head/lib/libc/db/hash/hash.c	Sat Mar 28 07:20:39 2009	(r190496)
@@ -163,7 +163,6 @@ __hash_open(const char *file, int flags,
 		 */
 		nsegs = (hashp->MAX_BUCKET + 1 + hashp->SGSIZE - 1) /
 			 hashp->SGSIZE;
-		hashp->nsegs = 0;
 		if (alloc_segs(hashp, nsegs))
 			/*
 			 * If alloc_segs fails, table will have been destroyed
@@ -417,6 +416,10 @@ hdestroy(HTAB *hashp)
 	for (i = 0; i < hashp->nmaps; i++)
 		if (hashp->mapp[i])
 			free(hashp->mapp[i]);
+	if (hashp->tmp_key)
+		free(hashp->tmp_key);
+	if (hashp->tmp_buf)
+		free(hashp->tmp_buf);
 
 	if (hashp->fp != -1)
 		(void)_close(hashp->fp);
@@ -762,6 +765,8 @@ hash_seq(const DB *dbp, DBT *key, DBT *d
 		if (__big_keydata(hashp, bufp, key, data, 1))
 			return (ERROR);
 	} else {
+		if (hashp->cpage == 0)
+			return (ERROR);
 		key->data = (u_char *)hashp->cpage->page + bp[ndx];
 		key->size = (ndx > 1 ? bp[ndx - 1] : hashp->BSIZE) - bp[ndx];
 		data->data = (u_char *)hashp->cpage->page + bp[ndx + 1];
@@ -877,15 +882,18 @@ alloc_segs(HTAB *hashp, int nsegs)
 		errno = save_errno;
 		return (-1);
 	}
+	hashp->nsegs = nsegs;
+	if (nsegs == 0)
+		return (0);
 	/* Allocate segments */
-	if ((store =
-	    (SEGMENT)calloc(nsegs << hashp->SSHIFT, sizeof(SEGMENT))) == NULL) {
+	if ((store = (SEGMENT)calloc(nsegs << hashp->SSHIFT,
+	    sizeof(SEGMENT))) == NULL) {
 		save_errno = errno;
 		(void)hdestroy(hashp);
 		errno = save_errno;
 		return (-1);
 	}
-	for (i = 0; i < nsegs; i++, hashp->nsegs++)
+	for (i = 0; i < nsegs; i++)
 		hashp->dir[i] = &store[i << hashp->SSHIFT];
 	return (0);
 }

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 07:26:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C9FA2106566B;
	Sat, 28 Mar 2009 07:26:00 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B83FA8FC16;
	Sat, 28 Mar 2009 07:26:00 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2S7Q0h6088315;
	Sat, 28 Mar 2009 07:26:00 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2S7Q0MR088314;
	Sat, 28 Mar 2009 07:26:00 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200903280726.n2S7Q0MR088314@svn.freebsd.org>
From: Xin LI 
Date: Sat, 28 Mar 2009 07:26:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190497 - head/lib/libc/db/db
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 07:26:01 -0000

Author: delphij
Date: Sat Mar 28 07:26:00 2009
New Revision: 190497
URL: http://svn.freebsd.org/changeset/base/190497

Log:
  Allow O_SYNC and O_NOFOLLOW flags in dbopen().
  
  Obtained from:	OpenBSD

Modified:
  head/lib/libc/db/db/db.c

Modified: head/lib/libc/db/db/db.c
==============================================================================
--- head/lib/libc/db/db/db.c	Sat Mar 28 07:20:39 2009	(r190496)
+++ head/lib/libc/db/db/db.c	Sat Mar 28 07:26:00 2009	(r190497)
@@ -50,8 +50,8 @@ dbopen(const char *fname, int flags, int
 
 #define	DB_FLAGS	(DB_LOCK | DB_SHMEM | DB_TXN)
 #define	USE_OPEN_FLAGS							\
-	(O_CREAT | O_EXCL | O_EXLOCK | O_NONBLOCK | O_RDONLY |		\
-	 O_RDWR | O_SHLOCK | O_TRUNC)
+	(O_CREAT | O_EXCL | O_EXLOCK | O_NOFOLLOW | O_NONBLOCK | 	\
+	 O_RDONLY | O_RDWR | O_SHLOCK | O_SYNC | O_TRUNC)
 
 	if ((flags & ~(USE_OPEN_FLAGS | DB_FLAGS)) == 0)
 		switch (type) {

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 07:31:03 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5EAB8106566B;
	Sat, 28 Mar 2009 07:31:03 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4A06C8FC12;
	Sat, 28 Mar 2009 07:31:03 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2S7V339088498;
	Sat, 28 Mar 2009 07:31:03 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2S7V2HK088487;
	Sat, 28 Mar 2009 07:31:02 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200903280731.n2S7V2HK088487@svn.freebsd.org>
From: Xin LI 
Date: Sat, 28 Mar 2009 07:31:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190498 - in head: include lib/libc/db
	lib/libc/db/btree lib/libc/db/hash lib/libc/db/man lib/libc/db/mpool
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 07:31:03 -0000

Author: delphij
Date: Sat Mar 28 07:31:02 2009
New Revision: 190498
URL: http://svn.freebsd.org/changeset/base/190498

Log:
  Minor changes from Berkeley DB 1.86 and further improvements from OpenBSD.
  This does not include the new hash routines since they will cause problems
  when reading old hash files.
  
  Since mpool(3) has been changed, provide a compatibility shim for older
  binaries.
  
  Obtained from:	OpenBSD

Added:
  head/lib/libc/db/mpool/mpool-compat.c   (contents, props changed)
Modified:
  head/include/mpool.h
  head/lib/libc/db/Symbol.map
  head/lib/libc/db/btree/bt_debug.c
  head/lib/libc/db/btree/bt_open.c
  head/lib/libc/db/btree/bt_page.c
  head/lib/libc/db/hash/README
  head/lib/libc/db/hash/hash_func.c
  head/lib/libc/db/man/mpool.3
  head/lib/libc/db/mpool/Makefile.inc
  head/lib/libc/db/mpool/mpool.c

Modified: head/include/mpool.h
==============================================================================
--- head/include/mpool.h	Sat Mar 28 07:26:00 2009	(r190497)
+++ head/include/mpool.h	Sat Mar 28 07:31:02 2009	(r190498)
@@ -30,7 +30,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	@(#)mpool.h	8.2 (Berkeley) 7/14/94
+ *	@(#)mpool.h	8.4 (Berkeley) 11/2/95
  * $FreeBSD$
  */
 
@@ -47,7 +47,7 @@
  * pool is handed an opaque MPOOL cookie which stores all of this information.
  */
 #define	HASHSIZE	128
-#define	HASHKEY(pgno)	((pgno - 1) % HASHSIZE)
+#define	HASHKEY(pgno)	((pgno - 1 + HASHSIZE) % HASHSIZE)
 
 /* The BKT structures are the elements of the queues. */
 typedef struct _bkt {
@@ -58,6 +58,7 @@ typedef struct _bkt {
 
 #define	MPOOL_DIRTY	0x01		/* page needs to be written */
 #define	MPOOL_PINNED	0x02		/* page is pinned into memory */
+#define	MPOOL_INUSE	0x04		/* page address is valid */
 	u_int8_t flags;			/* flags */
 } BKT;
 
@@ -68,7 +69,7 @@ typedef struct MPOOL {
 	pgno_t	curcache;		/* current number of cached pages */
 	pgno_t	maxcache;		/* max number of cached pages */
 	pgno_t	npages;			/* number of pages in the file */
-	u_long	pagesize;		/* file page size */
+	unsigned long	pagesize;	/* file page size */
 	int	fd;			/* file descriptor */
 					/* page in conversion routine */
 	void    (*pgin)(void *, pgno_t, void *);
@@ -76,25 +77,32 @@ typedef struct MPOOL {
 	void    (*pgout)(void *, pgno_t, void *);
 	void	*pgcookie;		/* cookie for page in/out routines */
 #ifdef STATISTICS
-	u_long	cachehit;
-	u_long	cachemiss;
-	u_long	pagealloc;
-	u_long	pageflush;
-	u_long	pageget;
-	u_long	pagenew;
-	u_long	pageput;
-	u_long	pageread;
-	u_long	pagewrite;
+	unsigned long	cachehit;
+	unsigned long	cachemiss;
+	unsigned long	pagealloc;
+	unsigned long	pageflush;
+	unsigned long	pageget;
+	unsigned long	pagenew;
+	unsigned long	pageput;
+	unsigned long	pageread;
+	unsigned long	pagewrite;
 #endif
 } MPOOL;
 
+#define	MPOOL_IGNOREPIN	0x01		/* Ignore if the page is pinned. */
+#define	MPOOL_PAGE_REQUEST	0x01	/* Allocate a new page with a
+					   specific page number. */
+#define	MPOOL_PAGE_NEXT		0x02	/* Allocate a new page with the next
+					  page number. */
+
 __BEGIN_DECLS
 MPOOL	*mpool_open(void *, int, pgno_t, pgno_t);
 void	 mpool_filter(MPOOL *, void (*)(void *, pgno_t, void *),
 	    void (*)(void *, pgno_t, void *), void *);
-void	*mpool_new(MPOOL *, pgno_t *);
-void	*mpool_get(MPOOL *, pgno_t, u_int);
-int	 mpool_put(MPOOL *, void *, u_int);
+void	*mpool_new(MPOOL *, pgno_t *, unsigned int);
+void	*mpool_get(MPOOL *, pgno_t, unsigned int);
+int	 mpool_delete(MPOOL *, void *);
+int	 mpool_put(MPOOL *, void *, unsigned int);
 int	 mpool_sync(MPOOL *);
 int	 mpool_close(MPOOL *);
 #ifdef STATISTICS

Modified: head/lib/libc/db/Symbol.map
==============================================================================
--- head/lib/libc/db/Symbol.map	Sat Mar 28 07:26:00 2009	(r190497)
+++ head/lib/libc/db/Symbol.map	Sat Mar 28 07:31:02 2009	(r190498)
@@ -16,7 +16,6 @@ FBSD_1.0 {
 	dbm_dirfno;
 	mpool_open;
 	mpool_filter;
-	mpool_new;
 	mpool_get;
 	mpool_put;
 	mpool_close;
@@ -24,6 +23,11 @@ FBSD_1.0 {
 	mpool_stat;
 };
 
+FBSD_1.1 {
+	mpool_new;
+	mpool_delete;
+};
+
 FBSDprivate_1.0 {
 	__bt_open;
 	__dbpanic;

Modified: head/lib/libc/db/btree/bt_debug.c
==============================================================================
--- head/lib/libc/db/btree/bt_debug.c	Sat Mar 28 07:26:00 2009	(r190497)
+++ head/lib/libc/db/btree/bt_debug.c	Sat Mar 28 07:31:02 2009	(r190498)
@@ -83,10 +83,9 @@ __bt_dump(DB *dbp)
 	}
 #undef X
 
-	for (i = P_ROOT; (h = mpool_get(t->bt_mp, i, 0)) != NULL; ++i) {
+	for (i = P_ROOT;
+	    (h = mpool_get(t->bt_mp, i, MPOOL_IGNOREPIN)) != NULL; ++i)
 		__bt_dpage(h);
-		(void)mpool_put(t->bt_mp, h, 0);
-	}
 }
 
 /*
@@ -135,10 +134,8 @@ __bt_dnpage(DB *dbp, pgno_t pgno)
 	PAGE *h;
 
 	t = dbp->internal;
-	if ((h = mpool_get(t->bt_mp, pgno, 0)) != NULL) {
+	if ((h = mpool_get(t->bt_mp, pgno, MPOOL_IGNOREPIN)) != NULL)
 		__bt_dpage(h);
-		(void)mpool_put(t->bt_mp, h, 0);
-	}
 }
 
 /*
@@ -257,7 +254,8 @@ __bt_stat(DB *dbp)
 	t = dbp->internal;
 	pcont = pinternal = pleaf = 0;
 	nkeys = ifree = lfree = 0;
-	for (i = P_ROOT; (h = mpool_get(t->bt_mp, i, 0)) != NULL; ++i) {
+	for (i = P_ROOT;
+	    (h = mpool_get(t->bt_mp, i, MPOOL_IGNOREPIN)) != NULL; ++i)
 		switch (h->flags & P_TYPE) {
 		case P_BINTERNAL:
 		case P_RINTERNAL:
@@ -274,22 +272,18 @@ __bt_stat(DB *dbp)
 			++pcont;
 			break;
 		}
-		(void)mpool_put(t->bt_mp, h, 0);
-	}
 
 	/* Count the levels of the tree. */
 	for (i = P_ROOT, levels = 0 ;; ++levels) {
-		h = mpool_get(t->bt_mp, i, 0);
+		h = mpool_get(t->bt_mp, i, MPOOL_IGNOREPIN);
 		if (h->flags & (P_BLEAF|P_RLEAF)) {
 			if (levels == 0)
 				levels = 1;
-			(void)mpool_put(t->bt_mp, h, 0);
 			break;
 		}
 		i = F_ISSET(t, R_RECNO) ?
 		    GETRINTERNAL(h, 0)->pgno :
 		    GETBINTERNAL(h, 0)->pgno;
-		(void)mpool_put(t->bt_mp, h, 0);
 	}
 
 	(void)fprintf(stderr, "%d level%s with %lu keys",

Modified: head/lib/libc/db/btree/bt_open.c
==============================================================================
--- head/lib/libc/db/btree/bt_open.c	Sat Mar 28 07:26:00 2009	(r190497)
+++ head/lib/libc/db/btree/bt_open.c	Sat Mar 28 07:31:02 2009	(r190498)
@@ -352,18 +352,25 @@ nroot(BTREE *t)
 	PAGE *meta, *root;
 	pgno_t npg;
 
-	if ((meta = mpool_get(t->bt_mp, 0, 0)) != NULL) {
-		mpool_put(t->bt_mp, meta, 0);
-		return (RET_SUCCESS);
+	if ((root = mpool_get(t->bt_mp, 1, 0)) != NULL) {
+		if (root->lower == 0 &&
+		    root->pgno == 0 &&
+		    root->linp[0] == 0) {
+			mpool_delete(t->bt_mp, root);
+			errno = EINVAL;
+		} else {
+			mpool_put(t->bt_mp, root, 0);
+			return (RET_SUCCESS);
+		}
 	}
 	if (errno != EINVAL)		/* It's OK to not exist. */
 		return (RET_ERROR);
 	errno = 0;
 
-	if ((meta = mpool_new(t->bt_mp, &npg)) == NULL)
+	if ((meta = mpool_new(t->bt_mp, &npg, MPOOL_PAGE_NEXT)) == NULL)
 		return (RET_ERROR);
 
-	if ((root = mpool_new(t->bt_mp, &npg)) == NULL)
+	if ((root = mpool_new(t->bt_mp, &npg, MPOOL_PAGE_NEXT)) == NULL)
 		return (RET_ERROR);
 
 	if (npg != P_ROOT)

Modified: head/lib/libc/db/btree/bt_page.c
==============================================================================
--- head/lib/libc/db/btree/bt_page.c	Sat Mar 28 07:26:00 2009	(r190497)
+++ head/lib/libc/db/btree/bt_page.c	Sat Mar 28 07:31:02 2009	(r190498)
@@ -90,5 +90,5 @@ __bt_new(BTREE *t, pgno_t *npg)
 		F_SET(t, B_METADIRTY);
 		return (h);
 	}
-	return (mpool_new(t->bt_mp, npg));
+	return (mpool_new(t->bt_mp, npg, MPOOL_PAGE_NEXT));
 }

Modified: head/lib/libc/db/hash/README
==============================================================================
--- head/lib/libc/db/hash/README	Sat Mar 28 07:26:00 2009	(r190497)
+++ head/lib/libc/db/hash/README	Sat Mar 28 07:31:02 2009	(r190498)
@@ -1,4 +1,5 @@
 #	@(#)README	8.1 (Berkeley) 6/4/93
+# $FreeBSD$
 
 This package implements a superset of the hsearch and dbm/ndbm libraries.
 
@@ -44,10 +45,6 @@ Test Programs:
 
 NOTES:
 
-The file search.h is provided for using the hsearch compatible interface
-on BSD systems.  On System V derived systems, search.h should appear in 
-/usr/include.
-
 The man page ../man/db.3 explains the interface to the hashing system.
 The file hash.ps is a postscript copy of a paper explaining
 the history, implementation, and performance of the hash package.

Modified: head/lib/libc/db/hash/hash_func.c
==============================================================================
--- head/lib/libc/db/hash/hash_func.c	Sat Mar 28 07:26:00 2009	(r190497)
+++ head/lib/libc/db/hash/hash_func.c	Sat Mar 28 07:31:02 2009	(r190498)
@@ -43,60 +43,57 @@ __FBSDID("$FreeBSD$");
 #include "page.h"
 #include "extern.h"
 
+#ifdef notdef
 static u_int32_t hash1(const void *, size_t) __unused;
 static u_int32_t hash2(const void *, size_t) __unused;
 static u_int32_t hash3(const void *, size_t) __unused;
+#endif
 static u_int32_t hash4(const void *, size_t);
 
-/* Global default hash function */
+/* Default hash function. */
 u_int32_t (*__default_hash)(const void *, size_t) = hash4;
 
+#ifdef notdef
 /*
- * HASH FUNCTIONS
- *
  * Assume that we've already split the bucket to which this key hashes,
  * calculate that bucket, and check that in fact we did already split it.
  *
- * This came from ejb's hsearch.
+ * EJB's original hsearch hash.
  */
-
 #define PRIME1		37
 #define PRIME2		1048583
 
-static u_int32_t
-hash1(keyarg, len)
-	const void *keyarg;
-	size_t len;
+u_int32_t
+hash1(const void *key, size_t len)
 {
-	const u_char *key;
 	u_int32_t h;
+	u_int8_t *k;
 
+	h = 0;
+	k = (u_int8_t *)key;
 	/* Convert string to integer */
-	for (key = keyarg, h = 0; len--;)
-		h = h * PRIME1 ^ (*key++ - ' ');
+	while (len--)
+		h = h * PRIME1 ^ (*k++ - ' ');
 	h %= PRIME2;
 	return (h);
 }
 
 /*
- * Phong's linear congruential hash
+ * Phong Vo's linear congruential hash
  */
 #define dcharhash(h, c)	((h) = 0x63c63cd9*(h) + 0x9c39c33d + (c))
 
-static u_int32_t
-hash2(keyarg, len)
-	const void *keyarg;
-	size_t len;
+u_int32_t
+hash2(const void *key, size_t len)
 {
-	const u_char *e, *key;
 	u_int32_t h;
-	u_char c;
+	u_int8_t *e, c, *k;
 
-	key = keyarg;
-	e = key + len;
-	for (h = 0; key != e;) {
-		c = *key++;
-		if (!c && key > e)
+	k = (u_int8_t *)key;
+	e = k + len;
+	for (h = 0; k != e;) {
+		c = *k++;
+		if (!c && k > e)
 			break;
 		dcharhash(h, c);
 	}
@@ -110,101 +107,84 @@ hash2(keyarg, len)
  * all 8 bytes.  Essentially, this saves us 7 cmp & branch instructions.  If
  * this routine is heavily used enough, it's worth the ugly coding.
  *
- * OZ's original sdbm hash
+ * Ozan Yigit's original sdbm hash.
  */
-static u_int32_t
-hash3(keyarg, len)
-	const void *keyarg;
-	size_t len;
+u_int32_t
+hash3(const void *key, size_t len)
 {
-	const u_char *key;
-	size_t loop;
-	u_int32_t h;
+	u_int32_t n, loop;
+	u_int8_t *k;
 
-#define HASHC   h = *key++ + 65599 * h
+#define HASHC   n = *k++ + 65599 * n
 
-	h = 0;
-	key = keyarg;
+	n = 0;
+	k = (u_int8_t *)key;
 	if (len > 0) {
 		loop = (len + 8 - 1) >> 3;
 
 		switch (len & (8 - 1)) {
 		case 0:
-			do {
+			do {	/* All fall throughs */
 				HASHC;
-				/* FALLTHROUGH */
 		case 7:
 				HASHC;
-				/* FALLTHROUGH */
 		case 6:
 				HASHC;
-				/* FALLTHROUGH */
 		case 5:
 				HASHC;
-				/* FALLTHROUGH */
 		case 4:
 				HASHC;
-				/* FALLTHROUGH */
 		case 3:
 				HASHC;
-				/* FALLTHROUGH */
 		case 2:
 				HASHC;
-				/* FALLTHROUGH */
 		case 1:
 				HASHC;
 			} while (--loop);
 		}
+
 	}
-	return (h);
+	return (n);
 }
+#endif /* notdef */
 
-/* Hash function from Chris Torek. */
-static u_int32_t
-hash4(keyarg, len)
-	const void *keyarg;
-	size_t len;
+/* Chris Torek's hash function. */
+u_int32_t
+hash4(const void *key, size_t len)
 {
-	const u_char *key;
-	size_t loop;
-	u_int32_t h;
+	u_int32_t h, loop;
+	const u_int8_t *k;
 
-#define HASH4a   h = (h << 5) - h + *key++;
-#define HASH4b   h = (h << 5) + h + *key++;
+#define HASH4a   h = (h << 5) - h + *k++;
+#define HASH4b   h = (h << 5) + h + *k++;
 #define HASH4 HASH4b
 
 	h = 0;
-	key = keyarg;
+	k = key;
 	if (len > 0) {
 		loop = (len + 8 - 1) >> 3;
 
 		switch (len & (8 - 1)) {
 		case 0:
-			do {
+			do {	/* All fall throughs */
 				HASH4;
-				/* FALLTHROUGH */
 		case 7:
 				HASH4;
-				/* FALLTHROUGH */
 		case 6:
 				HASH4;
-				/* FALLTHROUGH */
 		case 5:
 				HASH4;
-				/* FALLTHROUGH */
 		case 4:
 				HASH4;
-				/* FALLTHROUGH */
 		case 3:
 				HASH4;
-				/* FALLTHROUGH */
 		case 2:
 				HASH4;
-				/* FALLTHROUGH */
 		case 1:
 				HASH4;
 			} while (--loop);
 		}
+
 	}
 	return (h);
 }

Modified: head/lib/libc/db/man/mpool.3
==============================================================================
--- head/lib/libc/db/man/mpool.3	Sat Mar 28 07:26:00 2009	(r190497)
+++ head/lib/libc/db/man/mpool.3	Sat Mar 28 07:31:02 2009	(r190498)
@@ -28,7 +28,7 @@
 .\"	@(#)mpool.3	8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd June 4, 1993
+.Dd February 25, 1999
 .Dt MPOOL 3
 .Os
 .Sh NAME
@@ -47,7 +47,9 @@
 .Fa "void *pgcookie"
 .Fc
 .Ft void *
-.Fn mpool_new "MPOOL *mp" "pgno_t *pgnoaddr"
+.Fn mpool_new "MPOOL *mp" "pgno_t *pgnoaddr" "u_int flags"
+.Ft int
+.Fn mpool_delete "MPOOL *mp" "void *page"
 .Ft void *
 .Fn mpool_get "MPOOL *mp" "pgno_t pgno" "u_int flags"
 .Ft int
@@ -99,11 +101,11 @@ Both functions are called with the
 .Fa pgcookie
 pointer, the page number and a pointer to the page to being read or written.
 .Pp
-The
+The function
 .Fn mpool_new
-function takes an
-.Ft MPOOL
-pointer and an address as arguments.
+takes an
+.Dv MPOOL
+pointer, an address, and a set of flags as arguments.
 If a new page can be allocated, a pointer to the page is returned and
 the page number is stored into the
 .Fa pgnoaddr
@@ -113,6 +115,24 @@ Otherwise,
 is returned and
 .Va errno
 is set.
+The flags value is formed by
+.Tn OR Ns 'ing
+the following values:
+.Bl -tag -width Ds
+.It Dv MPOOL_PAGE_REQUEST
+Allocate a new page with a specific page number.
+.It Dv MPOOL_PAGE_NEXT
+Allocate a new page with the next page number.
+.El
+.Pp
+The function
+.Fn mpool_delete
+deletes the specified page from a pool and frees the page.
+It takes an
+.Dv MPOOL
+pointer and a page as arguments.
+The page must have been generated by
+.Fn mpool_new .
 .Pp
 The
 .Fn mpool_get

Modified: head/lib/libc/db/mpool/Makefile.inc
==============================================================================
--- head/lib/libc/db/mpool/Makefile.inc	Sat Mar 28 07:26:00 2009	(r190497)
+++ head/lib/libc/db/mpool/Makefile.inc	Sat Mar 28 07:31:02 2009	(r190498)
@@ -3,4 +3,4 @@
 
 .PATH: ${.CURDIR}/db/mpool
 
-SRCS+=	mpool.c
+SRCS+=	mpool.c mpool-compat.c

Added: head/lib/libc/db/mpool/mpool-compat.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lib/libc/db/mpool/mpool-compat.c	Sat Mar 28 07:31:02 2009	(r190498)
@@ -0,0 +1,43 @@
+/*-
+ * Copyright (c) 2009 Xin LI 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+
+void *__mpool_new__44bsd(MPOOL *, pgno_t *);
+
+void *
+__mpool_new__44bsd(MPOOL *mp, pgno_t *pgnoaddr)
+{
+
+	return (mpool_new(mp, pgnoaddr, MPOOL_PAGE_NEXT));
+}
+
+__sym_compat(mpool_new, __mpool_new_44bsd, FBSD_1.0);

Modified: head/lib/libc/db/mpool/mpool.c
==============================================================================
--- head/lib/libc/db/mpool/mpool.c	Sat Mar 28 07:26:00 2009	(r190497)
+++ head/lib/libc/db/mpool/mpool.c	Sat Mar 28 07:31:02 2009	(r190498)
@@ -110,9 +110,7 @@ mpool_filter(MPOOL *mp, void (*pgin) (vo
  *	Get a new page of memory.
  */
 void *
-mpool_new(mp, pgnoaddr)
-	MPOOL *mp;
-	pgno_t *pgnoaddr;
+mpool_new(MPOOL *mp, pgno_t *pgnoaddr, u_int flags)
 {
 	struct _hqh *head;
 	BKT *bp;
@@ -131,8 +129,13 @@ mpool_new(mp, pgnoaddr)
 	 */
 	if ((bp = mpool_bkt(mp)) == NULL)
 		return (NULL);
-	*pgnoaddr = bp->pgno = mp->npages++;
-	bp->flags = MPOOL_PINNED;
+	if (flags == MPOOL_PAGE_REQUEST) {
+		mp->npages++;
+		bp->pgno = *pgnoaddr;
+	} else
+		bp->pgno = *pgnoaddr = mp->npages++;
+
+	bp->flags = MPOOL_PINNED | MPOOL_INUSE;
 
 	head = &mp->hqh[HASHKEY(bp->pgno)];
 	TAILQ_INSERT_HEAD(head, bp, hq);
@@ -140,6 +143,32 @@ mpool_new(mp, pgnoaddr)
 	return (bp->page);
 }
 
+int
+mpool_delete(MPOOL *mp, void *page)
+{
+	struct _hqh *head;
+	BKT *bp;
+
+	bp = (BKT *)((char *)page - sizeof(BKT));
+
+#ifdef DEBUG
+	if (!(bp->flags & MPOOL_PINNED)) {
+		(void)fprintf(stderr,
+		    "mpool_delete: page %d not pinned\n", bp->pgno);
+		abort();
+	}
+#endif
+
+	/* Remove from the hash and lru queues. */
+	head = &mp->hqh[HASHKEY(bp->pgno)];
+	TAILQ_REMOVE(head, bp, hq);
+	TAILQ_REMOVE(&mp->lqh, bp, q);
+
+	free(bp);
+	mp->curcache--;
+	return (RET_SUCCESS);
+}	
+	
 /*
  * mpool_get
  *	Get a page.
@@ -154,12 +183,6 @@ mpool_get(MPOOL *mp, pgno_t pgno,
 	off_t off;
 	int nr;
 
-	/* Check for attempt to retrieve a non-existent page. */
-	if (pgno >= mp->npages) {
-		errno = EINVAL;
-		return (NULL);
-	}
-
 #ifdef STATISTICS
 	++mp->pageget;
 #endif
@@ -167,7 +190,7 @@ mpool_get(MPOOL *mp, pgno_t pgno,
 	/* Check for a page that is cached. */
 	if ((bp = mpool_look(mp, pgno)) != NULL) {
 #ifdef DEBUG
-		if (bp->flags & MPOOL_PINNED) {
+		if (!(flags & MPOOL_IGNOREPIN) && bp->flags & MPOOL_PINNED) {
 			(void)fprintf(stderr,
 			    "mpool_get: page %d already pinned\n", bp->pgno);
 			abort();
@@ -193,20 +216,38 @@ mpool_get(MPOOL *mp, pgno_t pgno,
 		return (NULL);
 
 	/* Read in the contents. */
+	off = mp->pagesize * pgno;
+	if ((nr = pread(mp->fd, bp->page, mp->pagesize, off)) != mp->pagesize) {
+		switch (nr) {
+		case -1:
+			/* errno is set for us by pread(). */
+			free(bp);
+			mp->curcache--;
+			return (NULL);
+		case 0:
+			/*
+			 * A zero-length read means you need to create a
+			 * new page.
+			 */
+			memset(bp->page, 0, mp->pagesize);
+			break;
+		default:
+			/* A partial read is definitely bad. */
+			free(bp);
+			mp->curcache--;
+			errno = EINVAL;
+			return (NULL);
+		}
+	}
 #ifdef STATISTICS
 	++mp->pageread;
 #endif
-	off = mp->pagesize * pgno;
-	nr = pread(mp->fd, bp->page, mp->pagesize, off);
-	if (nr != mp->pagesize) {
-		if (nr >= 0)
-			errno = EFTYPE;
-		return (NULL);
-	}
 
 	/* Set the page number, pin the page. */
 	bp->pgno = pgno;
-	bp->flags = MPOOL_PINNED;
+	if (!(flags & MPOOL_IGNOREPIN))
+		bp->flags = MPOOL_PINNED;
+	bp->flags |= MPOOL_INUSE;
 
 	/*
 	 * Add the page to the head of the hash chain and the tail
@@ -245,7 +286,8 @@ mpool_put(MPOOL *mp, void *page, u_int f
 	}
 #endif
 	bp->flags &= ~MPOOL_PINNED;
-	bp->flags |= flags & MPOOL_DIRTY;
+	if (flags & MPOOL_DIRTY)
+		bp->flags |= flags & MPOOL_DIRTY;
 	return (RET_SUCCESS);
 }
 
@@ -329,6 +371,7 @@ mpool_bkt(MPOOL *mp)
 				bp->page = spage;
 			}
 #endif
+			bp->flags = 0;
 			return (bp);
 		}
 
@@ -338,6 +381,7 @@ new:	if ((bp = (BKT *)calloc(1, sizeof(B
 	++mp->pagealloc;
 #endif
 	bp->page = (char *)bp + sizeof(BKT);
+	bp->flags = 0;
 	++mp->curcache;
 	return (bp);
 }
@@ -363,6 +407,15 @@ mpool_write(MPOOL *mp, BKT *bp)
 	if (pwrite(mp->fd, bp->page, mp->pagesize, off) != mp->pagesize)
 		return (RET_ERROR);
 
+	/*
+	 * Re-run through the input filter since this page may soon be
+	 * accessed via the cache, and whatever the user's output filter
+	 * did may screw things up if we don't let the input filter
+	 * restore the in-core copy.
+	 */
+	if (mp->pgin)
+		(mp->pgin)(mp->pgcookie, bp->pgno, bp->page);
+
 	bp->flags &= ~MPOOL_DIRTY;
 	return (RET_SUCCESS);
 }
@@ -379,7 +432,8 @@ mpool_look(MPOOL *mp, pgno_t pgno)
 
 	head = &mp->hqh[HASHKEY(pgno)];
 	TAILQ_FOREACH(bp, head, hq)
-		if (bp->pgno == pgno) {
+		if ((bp->pgno == pgno) &&
+			((bp->flags & MPOOL_INUSE) == MPOOL_INUSE)) {
 #ifdef STATISTICS
 			++mp->cachehit;
 #endif

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 07:39:36 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4A0D1106566C;
	Sat, 28 Mar 2009 07:39:36 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3717B8FC0C;
	Sat, 28 Mar 2009 07:39:36 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2S7da4W088684;
	Sat, 28 Mar 2009 07:39:36 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2S7daGN088682;
	Sat, 28 Mar 2009 07:39:36 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <200903280739.n2S7daGN088682@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Sat, 28 Mar 2009 07:39:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190499 - head/sys/dev/age
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 07:39:36 -0000

Author: yongari
Date: Sat Mar 28 07:39:35 2009
New Revision: 190499
URL: http://svn.freebsd.org/changeset/base/190499

Log:
  o Don't access VPD even if hardware advertised the capability.
    It seems that some revision of controller hang while accessing
    the VPD. Because VPD access routine are unused, nuke it.
  o Let TWSI reload EEPROM if VPD capability is detected. Reloading
    EEPROM will also set ethernet address so age(4) now reads AGE_PAR0
    and AGE_PAR1 register to get ethernet address. This removes a lot
    of hack and enhance readability a lot.
  o Double PHY reset timeout as it takes more time to take PHY out of
    power-saving state.
  o Explicitly check power-saving state by checking undocumented PHY
    registers. If link is not up, poke undocumented registers to take
    PHY out of power-saving state. This is the same way what Linux
    does. On resume, make sure to wake up PHY.
  o Don't rely on auto-clearing feature of master reset bit, just wait
    1ms and check idle status of MAC.
  o Add PCI device revision information in bootverbose mode.
  This should fix occasional controller hang in device attach phase.
  
  Reported by:	barbara < barbara.xxx1975 at libero DOT it >
  Tested by:	barbara < barbara.xxx1975 at libero DOT it >

Modified:
  head/sys/dev/age/if_age.c
  head/sys/dev/age/if_agereg.h

Modified: head/sys/dev/age/if_age.c
==============================================================================
--- head/sys/dev/age/if_age.c	Sat Mar 28 07:31:02 2009	(r190498)
+++ head/sys/dev/age/if_age.c	Sat Mar 28 07:39:35 2009	(r190499)
@@ -106,8 +106,6 @@ static int age_miibus_writereg(device_t,
 static void age_miibus_statchg(device_t);
 static void age_mediastatus(struct ifnet *, struct ifmediareq *);
 static int age_mediachange(struct ifnet *);
-static int age_read_vpd_word(struct age_softc *, uint32_t, uint32_t,
-    uint32_t *);
 static int age_probe(device_t);
 static void age_get_macaddr(struct age_softc *);
 static void age_phy_reset(struct age_softc *);
@@ -321,29 +319,6 @@ age_mediachange(struct ifnet *ifp)
 }
 
 static int
-age_read_vpd_word(struct age_softc *sc, uint32_t vpdc, uint32_t offset,
-    uint32_t *word)
-{
-	int i;
-
-	pci_write_config(sc->age_dev, vpdc + PCIR_VPD_ADDR, offset, 2);
-	for (i = AGE_TIMEOUT; i > 0; i--) {
-		DELAY(10);
-		if ((pci_read_config(sc->age_dev, vpdc + PCIR_VPD_ADDR, 2) &
-		    0x8000) == 0x8000)
-			break;
-	}
-	if (i == 0) {
-		device_printf(sc->age_dev, "VPD read timeout!\n");
-		*word = 0;
-		return (ETIMEDOUT);
-	}
-
-	*word = pci_read_config(sc->age_dev, vpdc + PCIR_VPD_DATA, 4);
-	return (0);
-}
-
-static int
 age_probe(device_t dev)
 {
 	struct age_dev *sp;
@@ -368,8 +343,8 @@ age_probe(device_t dev)
 static void
 age_get_macaddr(struct age_softc *sc)
 {
-	uint32_t ea[2], off, reg, word;
-	int vpd_error, match, vpdc;
+	uint32_t ea[2], reg;
+	int i, vpdc;
 
 	reg = CSR_READ_4(sc, AGE_SPI_CTRL);
 	if ((reg & SPI_VPD_ENB) != 0) {
@@ -378,123 +353,114 @@ age_get_macaddr(struct age_softc *sc)
 		CSR_WRITE_4(sc, AGE_SPI_CTRL, reg);
 	}
 
-	vpd_error = 0;
-	ea[0] = ea[1] = 0;
-	if ((vpd_error = pci_find_extcap(sc->age_dev, PCIY_VPD, &vpdc)) == 0) {
+	if (pci_find_extcap(sc->age_dev, PCIY_VPD, &vpdc) == 0) {
 		/*
-		 * PCI VPD capability exists, but it seems that it's
-		 * not in the standard form as stated in PCI VPD
-		 * specification such that driver could not use
-		 * pci_get_vpd_readonly(9) with keyword 'NA'.
-		 * Search VPD data starting at address 0x0100. The data
-		 * should be used as initializers to set AGE_PAR0,
-		 * AGE_PAR1 register including other PCI configuration
-		 * registers.
+		 * PCI VPD capability found, let TWSI reload EEPROM.
+		 * This will set ethernet address of controller.
 		 */
-		word = 0;
-		match = 0;
-		reg = 0;
-		for (off = AGE_VPD_REG_CONF_START; off < AGE_VPD_REG_CONF_END;
-		    off += sizeof(uint32_t)) {
-			vpd_error = age_read_vpd_word(sc, vpdc, off, &word);
-			if (vpd_error != 0)
-				break;
-			if (match != 0) {
-				switch (reg) {
-				case AGE_PAR0:
-					ea[0] = word;
-					break;
-				case AGE_PAR1:
-					ea[1] = word;
-					break;
-				default:
-					break;
-				}
-				match = 0;
-			} else if ((word & 0xFF) == AGE_VPD_REG_CONF_SIG) {
-				match = 1;
-				reg = word >> 16;
-			} else
+		CSR_WRITE_4(sc, AGE_TWSI_CTRL, CSR_READ_4(sc, AGE_TWSI_CTRL) |
+		    TWSI_CTRL_SW_LD_START);
+		for (i = 100; i > 0; i--) {
+			DELAY(1000);
+			reg = CSR_READ_4(sc, AGE_TWSI_CTRL);
+			if ((reg & TWSI_CTRL_SW_LD_START) == 0)
 				break;
 		}
-		if (off >= AGE_VPD_REG_CONF_END)
-			vpd_error = ENOENT;
-		if (vpd_error == 0) {
-			/*
-			 * Don't blindly trust ethernet address obtained
-			 * from VPD. Check whether ethernet address is
-			 * valid one. Otherwise fall-back to reading
-			 * PAR register.
-			 */
-			ea[1] &= 0xFFFF;
-			if ((ea[0] == 0 && ea[1] == 0) ||
-			    (ea[0] == 0xFFFFFFFF && ea[1] == 0xFFFF)) {
-				if (bootverbose)
-					device_printf(sc->age_dev,
-					    "invalid ethernet address "
-					    "returned from VPD.\n");
-				vpd_error = EINVAL;
-			}
-		}
-		if (vpd_error != 0 && (bootverbose))
-			device_printf(sc->age_dev, "VPD access failure!\n");
+		if (i == 0)
+			device_printf(sc->age_dev,
+			    "reloading EEPROM timeout!\n");
 	} else {
 		if (bootverbose)
 			device_printf(sc->age_dev,
 			    "PCI VPD capability not found!\n");
 	}
 
-	/*
-	 * It seems that L1 also provides a way to extract ethernet
-	 * address via SPI flash interface. Because SPI flash memory
-	 * device of different vendors vary in their instruction
-	 * codes for read ID instruction, it's very hard to get
-	 * instructions codes without detailed information for the
-	 * flash memory device used on ethernet controller. To simplify
-	 * code, just read AGE_PAR0/AGE_PAR1 register to get ethernet
-	 * address which is supposed to be set by hardware during
-	 * power on reset.
-	 */
-	if (vpd_error != 0) {
-		/*
-		 * VPD is mapped to SPI flash memory or BIOS set it.
-		 */
-		ea[0] = CSR_READ_4(sc, AGE_PAR0);
-		ea[1] = CSR_READ_4(sc, AGE_PAR1);
-	}
-
-	ea[1] &= 0xFFFF;
-	if ((ea[0] == 0 && ea[1]  == 0) ||
-	    (ea[0] == 0xFFFFFFFF && ea[1] == 0xFFFF)) {
-		device_printf(sc->age_dev,
-		    "generating fake ethernet address.\n");
-		ea[0] = arc4random();
-		/* Set OUI to ASUSTek COMPUTER INC. */
-		sc->age_eaddr[0] = 0x00;
-		sc->age_eaddr[1] = 0x1B;
-		sc->age_eaddr[2] = 0xFC;
-		sc->age_eaddr[3] = (ea[0] >> 16) & 0xFF;
-		sc->age_eaddr[4] = (ea[0] >> 8) & 0xFF;
-		sc->age_eaddr[5] = (ea[0] >> 0) & 0xFF;
-	} else {
-		sc->age_eaddr[0] = (ea[1] >> 8) & 0xFF;
-		sc->age_eaddr[1] = (ea[1] >> 0) & 0xFF;
-		sc->age_eaddr[2] = (ea[0] >> 24) & 0xFF;
-		sc->age_eaddr[3] = (ea[0] >> 16) & 0xFF;
-		sc->age_eaddr[4] = (ea[0] >> 8) & 0xFF;
-		sc->age_eaddr[5] = (ea[0] >> 0) & 0xFF;
-	}
+	ea[0] = CSR_READ_4(sc, AGE_PAR0);
+	ea[1] = CSR_READ_4(sc, AGE_PAR1);
+	sc->age_eaddr[0] = (ea[1] >> 8) & 0xFF;
+	sc->age_eaddr[1] = (ea[1] >> 0) & 0xFF;
+	sc->age_eaddr[2] = (ea[0] >> 24) & 0xFF;
+	sc->age_eaddr[3] = (ea[0] >> 16) & 0xFF;
+	sc->age_eaddr[4] = (ea[0] >> 8) & 0xFF;
+	sc->age_eaddr[5] = (ea[0] >> 0) & 0xFF;
 }
 
 static void
 age_phy_reset(struct age_softc *sc)
 {
+	uint16_t reg, pn;
+	int i, linkup;
 
 	/* Reset PHY. */
 	CSR_WRITE_4(sc, AGE_GPHY_CTRL, GPHY_CTRL_RST);
-	DELAY(1000);
+	DELAY(2000);
 	CSR_WRITE_4(sc, AGE_GPHY_CTRL, GPHY_CTRL_CLR);
-	DELAY(1000);
+	DELAY(2000);
+
+#define	ATPHY_DBG_ADDR		0x1D
+#define	ATPHY_DBG_DATA		0x1E
+#define	ATPHY_CDTC		0x16
+#define	PHY_CDTC_ENB		0x0001
+#define	PHY_CDTC_POFF		8
+#define	ATPHY_CDTS		0x1C
+#define	PHY_CDTS_STAT_OK	0x0000
+#define	PHY_CDTS_STAT_SHORT	0x0100
+#define	PHY_CDTS_STAT_OPEN	0x0200
+#define	PHY_CDTS_STAT_INVAL	0x0300
+#define	PHY_CDTS_STAT_MASK	0x0300
+
+	/* Check power saving mode. Magic from Linux. */
+	age_miibus_writereg(sc->age_dev, sc->age_phyaddr, MII_BMCR, BMCR_RESET);
+	for (linkup = 0, pn = 0; pn < 4; pn++) {
+		age_miibus_writereg(sc->age_dev, sc->age_phyaddr, ATPHY_CDTC,
+		    (pn << PHY_CDTC_POFF) | PHY_CDTC_ENB);
+		for (i = 200; i > 0; i--) {
+			DELAY(1000);
+			reg = age_miibus_readreg(sc->age_dev, sc->age_phyaddr,
+			    ATPHY_CDTC);
+			if ((reg & PHY_CDTC_ENB) == 0)
+				break;
+		}
+		DELAY(1000);
+		reg = age_miibus_readreg(sc->age_dev, sc->age_phyaddr,
+		    ATPHY_CDTS);
+		if ((reg & PHY_CDTS_STAT_MASK) != PHY_CDTS_STAT_OPEN) {
+			linkup++;
+			break;
+		}
+	}
+	age_miibus_writereg(sc->age_dev, sc->age_phyaddr, MII_BMCR,
+	    BMCR_RESET | BMCR_AUTOEN | BMCR_STARTNEG);
+	if (linkup == 0) {
+		age_miibus_writereg(sc->age_dev, sc->age_phyaddr,
+		    ATPHY_DBG_ADDR, 0);
+		age_miibus_writereg(sc->age_dev, sc->age_phyaddr,
+		    ATPHY_DBG_DATA, 0x124E);
+		age_miibus_writereg(sc->age_dev, sc->age_phyaddr,
+		    ATPHY_DBG_ADDR, 1);
+		reg = age_miibus_readreg(sc->age_dev, sc->age_phyaddr,
+		    ATPHY_DBG_DATA);
+		age_miibus_writereg(sc->age_dev, sc->age_phyaddr,
+		    ATPHY_DBG_DATA, reg | 0x03);
+		/* XXX */
+		DELAY(1500 * 1000);
+		age_miibus_writereg(sc->age_dev, sc->age_phyaddr,
+		    ATPHY_DBG_ADDR, 0);
+		age_miibus_writereg(sc->age_dev, sc->age_phyaddr,
+		    ATPHY_DBG_DATA, 0x024E);
+    }
+
+#undef	ATPHY_DBG_ADDR
+#undef	ATPHY_DBG_DATA
+#undef	ATPHY_CDTC
+#undef	PHY_CDTC_ENB
+#undef	PHY_CDTC_POFF
+#undef	ATPHY_CDTS
+#undef	PHY_CDTS_STAT_OK
+#undef	PHY_CDTS_STAT_SHORT
+#undef	PHY_CDTS_STAT_OPEN
+#undef	PHY_CDTS_STAT_INVAL
+#undef	PHY_CDTS_STAT_MASK
 }
 
 static int
@@ -539,7 +505,8 @@ age_attach(device_t dev)
 	sc->age_chip_rev = CSR_READ_4(sc, AGE_MASTER_CFG) >>
 	    MASTER_CHIP_REV_SHIFT;
 	if (bootverbose) {
-		device_printf(dev, "PCI device revision : 0x%04x\n", sc->age_rev);
+		device_printf(dev, "PCI device revision : 0x%04x\n",
+		    sc->age_rev);
 		device_printf(dev, "Chip id/revision : 0x%04x\n",
 		    sc->age_chip_rev);
 	}
@@ -1524,6 +1491,9 @@ age_resume(device_t dev)
 		cmd &= ~0x0400;
 		pci_write_config(sc->age_dev, PCIR_COMMAND, cmd, 2);
 	}
+	AGE_UNLOCK(sc);
+	age_phy_reset(sc);
+	AGE_LOCK(sc);
 	ifp = sc->age_ifp;
 	if ((ifp->if_flags & IFF_UP) != 0)
 		age_init_locked(sc);
@@ -2544,14 +2514,8 @@ age_reset(struct age_softc *sc)
 	int i;
 
 	CSR_WRITE_4(sc, AGE_MASTER_CFG, MASTER_RESET);
-	for (i = AGE_RESET_TIMEOUT; i > 0; i--) {
-		DELAY(1);
-		if ((CSR_READ_4(sc, AGE_MASTER_CFG) & MASTER_RESET) == 0)
-			break;
-	}
-	if (i == 0)
-		device_printf(sc->age_dev, "master reset timeout!\n");
-
+	CSR_READ_4(sc, AGE_MASTER_CFG);
+	DELAY(1000);
 	for (i = AGE_RESET_TIMEOUT; i > 0; i--) {
 		if ((reg = CSR_READ_4(sc, AGE_IDLE_STATUS)) == 0)
 			break;

Modified: head/sys/dev/age/if_agereg.h
==============================================================================
--- head/sys/dev/age/if_agereg.h	Sat Mar 28 07:31:02 2009	(r190498)
+++ head/sys/dev/age/if_agereg.h	Sat Mar 28 07:39:35 2009	(r190499)
@@ -91,6 +91,9 @@
 #define	AGE_SPI_OP_READ			0x217	/* 8bits */
 
 #define	AGE_TWSI_CTRL			0x218
+#define	TWSI_CTRL_SW_LD_START		0x00000800
+#define	TWSI_CTRL_HW_LD_START		0x00001000
+#define	TWSI_CTRL_LD_EXIST		0x00400000
 
 #define AGE_DEV_MISC_CTRL		0x21C
 

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 07:44:08 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B7D5E1065670;
	Sat, 28 Mar 2009 07:44:08 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A5ACB8FC0A;
	Sat, 28 Mar 2009 07:44:08 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2S7i823088810;
	Sat, 28 Mar 2009 07:44:08 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2S7i8CY088808;
	Sat, 28 Mar 2009 07:44:08 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200903280744.n2S7i8CY088808@svn.freebsd.org>
From: Xin LI 
Date: Sat, 28 Mar 2009 07:44:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190500 - in head/lib/libc/db: hash mpool
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 07:44:09 -0000

Author: delphij
Date: Sat Mar 28 07:44:08 2009
New Revision: 190500
URL: http://svn.freebsd.org/changeset/base/190500

Log:
  Add some casts to silence compiler warning about signedness.

Modified:
  head/lib/libc/db/hash/hash_page.c
  head/lib/libc/db/mpool/mpool.c

Modified: head/lib/libc/db/hash/hash_page.c
==============================================================================
--- head/lib/libc/db/hash/hash_page.c	Sat Mar 28 07:39:35 2009	(r190499)
+++ head/lib/libc/db/hash/hash_page.c	Sat Mar 28 07:44:08 2009	(r190500)
@@ -854,7 +854,7 @@ open_temp(HTAB *hashp)
 		envtmp = getenv("TMPDIR");
 	len = snprintf(path,
 	    sizeof(path), "%s/_hash.XXXXXX", envtmp ? envtmp : "/tmp");
-	if (len < 0 || len >= sizeof(path)) {
+	if (len < 0 || len >= (int)sizeof(path)) {
 		errno = ENAMETOOLONG;
 		return (-1);
 	}

Modified: head/lib/libc/db/mpool/mpool.c
==============================================================================
--- head/lib/libc/db/mpool/mpool.c	Sat Mar 28 07:39:35 2009	(r190499)
+++ head/lib/libc/db/mpool/mpool.c	Sat Mar 28 07:44:08 2009	(r190500)
@@ -217,7 +217,7 @@ mpool_get(MPOOL *mp, pgno_t pgno,
 
 	/* Read in the contents. */
 	off = mp->pagesize * pgno;
-	if ((nr = pread(mp->fd, bp->page, mp->pagesize, off)) != mp->pagesize) {
+	if ((nr = pread(mp->fd, bp->page, mp->pagesize, off)) != (ssize_t)mp->pagesize) {
 		switch (nr) {
 		case -1:
 			/* errno is set for us by pread(). */
@@ -404,7 +404,7 @@ mpool_write(MPOOL *mp, BKT *bp)
 		(mp->pgout)(mp->pgcookie, bp->pgno, bp->page);
 
 	off = mp->pagesize * bp->pgno;
-	if (pwrite(mp->fd, bp->page, mp->pagesize, off) != mp->pagesize)
+	if (pwrite(mp->fd, bp->page, mp->pagesize, off) != (ssize_t)mp->pagesize)
 		return (RET_ERROR);
 
 	/*

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 08:54:48 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DFE921065673;
	Sat, 28 Mar 2009 08:54:47 +0000 (UTC) (envelope-from mr@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CC2258FC08;
	Sat, 28 Mar 2009 08:54:47 +0000 (UTC) (envelope-from mr@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2S8slwq090249;
	Sat, 28 Mar 2009 08:54:47 GMT (envelope-from mr@svn.freebsd.org)
Received: (from mr@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2S8slQ2090245;
	Sat, 28 Mar 2009 08:54:47 GMT (envelope-from mr@svn.freebsd.org)
Message-Id: <200903280854.n2S8slQ2090245@svn.freebsd.org>
From: Michael Reifenberger 
Date: Sat, 28 Mar 2009 08:54:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190501 - in head/sys: conf i386/cpufreq modules/cpufreq
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 08:54:48 -0000

Author: mr
Date: Sat Mar 28 08:54:47 2009
New Revision: 190501
URL: http://svn.freebsd.org/changeset/base/190501

Log:
  Add support for Phenom (Family 10h) to cpufreq.
  Its a newer version provided by the author than in the PR.
  
  PR:		kern/128575
  Submitted by:	Gen Otsuji annona2 [at] gmail.com

Added:
  head/sys/i386/cpufreq/hwpstate.c   (contents, props changed)
Modified:
  head/sys/conf/files.amd64
  head/sys/conf/files.i386
  head/sys/modules/cpufreq/Makefile

Modified: head/sys/conf/files.amd64
==============================================================================
--- head/sys/conf/files.amd64	Sat Mar 28 07:44:08 2009	(r190500)
+++ head/sys/conf/files.amd64	Sat Mar 28 08:54:47 2009	(r190501)
@@ -283,6 +283,7 @@ i386/bios/smbios.c		optional	smbios
 i386/bios/vpd.c			optional	vpd
 i386/cpufreq/powernow.c		optional	cpufreq
 i386/cpufreq/est.c		optional	cpufreq
+i386/cpufreq/hwpstate.c		optional	cpufreq
 i386/cpufreq/p4tcc.c		optional	cpufreq
 #
 libkern/memmove.c		standard

Modified: head/sys/conf/files.i386
==============================================================================
--- head/sys/conf/files.i386	Sat Mar 28 07:44:08 2009	(r190500)
+++ head/sys/conf/files.i386	Sat Mar 28 08:54:47 2009	(r190501)
@@ -242,6 +242,7 @@ i386/bios/smapi_bios.S		optional smapi
 i386/bios/smbios.c		optional smbios
 i386/bios/vpd.c			optional vpd
 i386/cpufreq/est.c		optional cpufreq
+i386/cpufreq/hwpstate.c		optional cpufreq
 i386/cpufreq/p4tcc.c		optional cpufreq
 i386/cpufreq/powernow.c		optional cpufreq
 i386/cpufreq/smist.c		optional cpufreq

Added: head/sys/i386/cpufreq/hwpstate.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/i386/cpufreq/hwpstate.c	Sat Mar 28 08:54:47 2009	(r190501)
@@ -0,0 +1,515 @@
+/*-
+ * Copyright (c) 2005 Nate Lawson
+ * Copyright (c) 2004 Colin Percival
+ * Copyright (c) 2004-2005 Bruno Durcot
+ * Copyright (c) 2004 FUKUDA Nobuhiko
+ * Copyright (c) 2009 Michael Reifenberger
+ * Copyright (c) 2009 Norikatsu Shigemura
+ * Copyright (c) 2008-2009 Gen Otsuji
+ *
+ * This code is depending on kern_cpu.c, est.c, powernow.c, p4tcc.c, smist.c
+ * in various parts. The authors of these files are
+ * Colin Percival, Bruno Durcot, and FUKUDA Nobuhiko.
+ * This code contains patches by Michael Reifenberger and Norikatsu Shigemura.
+ * Thank you.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted providing that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * For more info:
+ * BIOS and Kernel Developer's Guide(BKDG) for AMD Family 10h Processors
+ * 31116 Rev 3.20  February 04, 2009
+ * BIOS and Kernel Developer's Guide(BKDG) for AMD Family 11h Processors
+ * 41256 Rev 3.00 - July 07, 2008
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include "acpi_if.h"
+#include "cpufreq_if.h"
+
+#define	MSR_AMD_10H_11H_LIMIT	0xc0010061
+#define	MSR_AMD_10H_11H_CONTROL	0xc0010062
+#define	MSR_AMD_10H_11H_STATUS	0xc0010063
+#define	MSR_AMD_10H_11H_CONFIG	0xc0010064
+
+#define	AMD_10H_11H_MAX_STATES	16
+
+/* for MSR_AMD_10H_11H_LIMIT C001_0061 */
+#define	AMD_10H_11H_GET_PSTATE_MAX_VAL(msr)	(((msr) >> 4) & 0x7)
+#define	AMD_10H_11H_GET_PSTATE_LIMIT(msr)	(((msr)) & 0x7)
+/* for MSR_AMD_10H_11H_CONFIG 10h:C001_0064:68 / 11h:C001_0064:6B */
+#define	AMD_10H_11H_CUR_VID(msr)		(((msr) >> 9) & 0x7F)
+#define	AMD_10H_11H_CUR_DID(msr)		(((msr) >> 6) & 0x07)
+#define	AMD_10H_11H_CUR_FID(msr)		((msr) & 0x3F)
+
+#if defined(__amd64__)
+#define CPU_FAMILY(id)	AMD64_CPU_FAMILY(id)
+#elif defined(__i386__)
+#define CPU_FAMILY(id)	I386_CPU_FAMILY(id)
+#endif
+
+#define	HWPSTATE_DEBUG(dev, msg...)			\
+	do{						\
+		if(hwpstate_verbose)			\
+			device_printf(dev, msg);	\
+	}while(0)
+
+struct hwpstate_setting {
+	int	freq;		/* CPU clock in Mhz or 100ths of a percent. */
+	int	volts;		/* Voltage in mV. */
+	int	power;		/* Power consumed in mW. */
+	int	lat;		/* Transition latency in us. */
+	int	pstate_id;	/* P-State id */
+};
+
+struct hwpstate_softc {
+	device_t		dev;
+	struct hwpstate_setting	hwpstate_settings[AMD_10H_11H_MAX_STATES];
+	int			cfnum;
+};
+
+static void	hwpstate_identify(driver_t *driver, device_t parent);
+static int	hwpstate_probe(device_t dev);
+static int	hwpstate_attach(device_t dev);
+static int	hwpstate_detach(device_t dev);
+static int	hwpstate_set(device_t dev, const struct cf_setting *cf);
+static int	hwpstate_get(device_t dev, struct cf_setting *cf);
+static int	hwpstate_settings(device_t dev, struct cf_setting *sets, int *count);
+static int	hwpstate_type(device_t dev, int *type);
+static int	hwpstate_shutdown(device_t dev);
+static int	hwpstate_features(driver_t *driver, u_int *features);
+static int	hwpstate_get_info_from_acpi_perf(device_t dev, device_t perf_dev);
+static int	hwpstate_get_info_from_msr(device_t dev);
+static int	hwpstate_goto_pstate(device_t dev, int pstate_id);
+
+static int	hwpstate_verbose = 0;
+SYSCTL_INT(_debug, OID_AUTO, hwpstate_verbose, CTLFLAG_RDTUN,
+       &hwpstate_verbose, 0, "Debug hwpstate");
+
+static device_method_t hwpstate_methods[] = {
+	/* Device interface */
+	DEVMETHOD(device_identify,	hwpstate_identify),
+	DEVMETHOD(device_probe,		hwpstate_probe),
+	DEVMETHOD(device_attach,	hwpstate_attach),
+	DEVMETHOD(device_detach,	hwpstate_detach),
+	DEVMETHOD(device_shutdown,	hwpstate_shutdown),
+
+	/* cpufreq interface */
+	DEVMETHOD(cpufreq_drv_set,	hwpstate_set),
+	DEVMETHOD(cpufreq_drv_get,	hwpstate_get),
+	DEVMETHOD(cpufreq_drv_settings,	hwpstate_settings),
+	DEVMETHOD(cpufreq_drv_type,	hwpstate_type),
+
+	/* ACPI interface */
+	DEVMETHOD(acpi_get_features,	hwpstate_features),
+
+	{0, 0}
+};
+
+static devclass_t hwpstate_devclass;
+static driver_t hwpstate_driver = {
+	"hwpstate",
+	hwpstate_methods,
+	sizeof(struct hwpstate_softc),
+};
+
+DRIVER_MODULE(hwpstate, cpu, hwpstate_driver, hwpstate_devclass, 0, 0);
+
+/*
+ * Go to Px-state on all cpus considering the limit.
+ */
+static int
+hwpstate_goto_pstate(device_t dev, int pstate)
+{
+	struct hwpstate_softc *sc;
+	struct pcpu *pc;
+	int i;
+	uint64_t msr;
+	int j;
+	int limit;
+	int id = pstate;
+	int error;
+	
+	sc = device_get_softc(dev);
+	/* get the current pstate limit */
+	msr = rdmsr(MSR_AMD_10H_11H_LIMIT);
+	limit = AMD_10H_11H_GET_PSTATE_LIMIT(msr);
+	if(limit > id)
+		id = limit;
+
+	error = 0;
+	/*
+	 * We are going to the same Px-state on all cpus.
+	 */
+	for (i = 0; i < mp_ncpus; i++) {
+		/* Find each cpu. */
+		pc = pcpu_find(i);
+		if (pc == NULL)
+			return (ENXIO);
+		thread_lock(curthread);
+		/* Bind to each cpu. */
+		sched_bind(curthread, pc->pc_cpuid);
+		thread_unlock(curthread);
+		HWPSTATE_DEBUG(dev, "setting P%d-state on cpu%d\n",
+			id, PCPU_GET(cpuid));
+		/* Go To Px-state */
+		wrmsr(MSR_AMD_10H_11H_CONTROL, id);
+		/* wait loop (100*100 usec is enough ?) */
+		for(j = 0; j < 100; j++){
+			msr = rdmsr(MSR_AMD_10H_11H_STATUS);
+			if(msr == id){
+				break;
+			}
+			DELAY(100);
+		}
+		/* get the result. not assure msr=id */
+		msr = rdmsr(MSR_AMD_10H_11H_STATUS);
+		HWPSTATE_DEBUG(dev, "result  P%d-state on cpu%d\n",
+		    (int)msr, PCPU_GET(cpuid));
+		if (msr != id) {
+			HWPSTATE_DEBUG(dev, "error: loop is not enough.\n");
+			error = ENXIO;
+		}
+		thread_lock(curthread);
+		sched_unbind(curthread);
+		thread_unlock(curthread);
+	}
+	return (error);
+}
+
+static int
+hwpstate_set(device_t dev, const struct cf_setting *cf)
+{
+	struct hwpstate_softc *sc;
+	struct hwpstate_setting *set;
+	int i;
+
+	if (cf == NULL)
+		return (EINVAL);
+	sc = device_get_softc(dev);
+	set = sc->hwpstate_settings;
+	for (i = 0; i < sc->cfnum; i++)
+		if (CPUFREQ_CMP(cf->freq, set[i].freq))
+			break;
+	if (i == sc->cfnum)
+		return (EINVAL);
+
+	return (hwpstate_goto_pstate(dev, set[i].pstate_id));
+}
+
+static int
+hwpstate_get(device_t dev, struct cf_setting *cf)
+{
+	struct hwpstate_softc *sc;
+	struct hwpstate_setting set;
+	uint64_t msr;
+
+	sc = device_get_softc(dev);
+	if (cf == NULL)
+		return (EINVAL);
+	msr = rdmsr(MSR_AMD_10H_11H_STATUS);
+	if(msr >= sc->cfnum)
+		return (EINVAL);
+	set = sc->hwpstate_settings[msr];
+
+	cf->freq = set.freq;
+	cf->volts = set.volts;
+	cf->power = set.power;
+	cf->lat = set.lat;
+	cf->dev = dev;
+	return (0);
+}
+
+static int
+hwpstate_settings(device_t dev, struct cf_setting *sets, int *count)
+{
+	struct hwpstate_softc *sc;
+	struct hwpstate_setting set;
+	int i;
+
+	if (sets == NULL || count == NULL)
+		return (EINVAL);
+	sc = device_get_softc(dev);
+	if (*count < sc->cfnum)
+		return (E2BIG);
+	for (i = 0; i < sc->cfnum; i++, sets++) {
+		set = sc->hwpstate_settings[i];
+		sets->freq = set.freq;
+		sets->volts = set.volts;
+		sets->power = set.power;
+		sets->lat = set.lat;
+		sets->dev = dev;
+	}
+	*count = sc->cfnum;
+
+	return (0);
+}
+
+static int
+hwpstate_type(device_t dev, int *type)
+{
+
+	if (type == NULL)
+		return (EINVAL);
+
+	*type = CPUFREQ_TYPE_ABSOLUTE;
+	return (0);
+}
+
+static void
+hwpstate_identify(driver_t *driver, device_t parent)
+{
+	device_t child;
+
+	if (device_find_child(parent, "hwpstate", -1) != NULL)
+		return;
+
+	if (cpu_vendor_id != CPU_VENDOR_AMD || CPU_FAMILY(cpu_id) < 0x10)
+		return;
+
+	/*
+	 * Check if hardware pstate enable bit is set.
+	 */
+	if ((amd_pminfo & AMDPM_HW_PSTATE) == 0) {
+		HWPSTATE_DEBUG(parent, "hwpstate enable bit is not set.\n");
+		return;
+	}
+
+	if (resource_disabled("hwpstate", 0))
+		return;
+
+	if ((child = BUS_ADD_CHILD(parent, 10, "hwpstate", -1)) == NULL)
+		device_printf(parent, "hwpstate: add child failed\n");
+}
+
+static int
+hwpstate_probe(device_t dev)
+{
+	struct hwpstate_softc *sc;
+	device_t perf_dev;
+	uint64_t msr;
+	int error, type;
+
+	/*
+	 * Only hwpstate0.
+	 * It goes well with acpi_throttle.
+	 */
+	if (device_get_unit(dev) != 0)
+		return (ENXIO);
+
+	sc = device_get_softc(dev);
+	sc->dev = dev;
+
+	/*
+	 * Check if acpi_perf has INFO only flag.
+	 */
+	perf_dev = device_find_child(device_get_parent(dev), "acpi_perf", -1);
+	error = TRUE;
+	if (perf_dev && device_is_attached(perf_dev)) {
+		error = CPUFREQ_DRV_TYPE(perf_dev, &type);
+		if (error == 0) {
+			if ((type & CPUFREQ_FLAG_INFO_ONLY) == 0) {
+				/*
+				 * If acpi_perf doesn't have INFO_ONLY flag,
+				 * it will take care of pstate transitions.
+				 */
+				HWPSTATE_DEBUG(dev, "acpi_perf will take care of pstate transitions.\n");
+				return (ENXIO);
+			} else {
+				/*
+				 * If acpi_perf has INFO_ONLY flag, (_PCT has FFixedHW)
+				 * we can get _PSS info from acpi_perf
+				 * without going into ACPI.
+				 */
+				HWPSTATE_DEBUG(dev, "going to fetch info from acpi_perf\n");
+				error = hwpstate_get_info_from_acpi_perf(dev, perf_dev);
+			}
+		}
+	}
+
+	if (error == 0) {
+		/*
+		 * Now we get _PSS info from acpi_perf without error.
+		 * Let's check it.
+		 */
+		msr = rdmsr(MSR_AMD_10H_11H_LIMIT);
+		if (sc->cfnum != 1 + AMD_10H_11H_GET_PSTATE_MAX_VAL(msr)) {
+			HWPSTATE_DEBUG(dev, "msr and acpi _PSS count mismatch.\n");
+			error = TRUE;
+		}
+	}
+
+	/*
+	 * If we cannot get info from acpi_perf,
+	 * Let's get info from MSRs.
+	 */
+	if (error)
+		error = hwpstate_get_info_from_msr(dev);
+	if (error)
+		return (error);
+
+	device_set_desc(dev, "Cool`n'Quiet 2.0");
+	return (0);
+}
+
+static int
+hwpstate_attach(device_t dev)
+{
+
+	return (cpufreq_register(dev));
+}
+
+static int
+hwpstate_get_info_from_msr(device_t dev)
+{
+	struct hwpstate_softc *sc;
+	struct hwpstate_setting *hwpstate_set;
+	uint64_t msr;
+	int family, i, fid, did;
+
+	family = CPU_FAMILY(cpu_id);
+	sc = device_get_softc(dev);
+	/* Get pstate count */
+	msr = rdmsr(MSR_AMD_10H_11H_LIMIT);
+	sc->cfnum = 1 + AMD_10H_11H_GET_PSTATE_MAX_VAL(msr);
+	hwpstate_set = sc->hwpstate_settings;
+	for (i = 0; i < sc->cfnum; i++) {
+		msr = rdmsr(MSR_AMD_10H_11H_CONFIG + i);
+		if ((msr & ((uint64_t)1 << 63)) != ((uint64_t)1 << 63)) {
+			HWPSTATE_DEBUG(dev, "msr is not valid.\n");
+			return (ENXIO);
+		}
+		did = AMD_10H_11H_CUR_DID(msr);
+		fid = AMD_10H_11H_CUR_FID(msr);
+		switch(family) {
+		case 0x11:
+			/* fid/did to frequency */
+			hwpstate_set[i].freq = 100 * (fid + 0x08) / (1 << did);
+			break;
+		case 0x10:
+			/* fid/did to frequency */
+			hwpstate_set[i].freq = 100 * (fid + 0x10) / (1 << did);
+			break;
+		default:
+			HWPSTATE_DEBUG(dev, "get_info_from_msr: AMD family %d CPU's are not implemented yet. sorry.\n", family);
+			return (ENXIO);
+			break;
+		}
+		hwpstate_set[i].pstate_id = i;
+		/* There was volts calculation, but deleted it. */
+		hwpstate_set[i].volts = CPUFREQ_VAL_UNKNOWN;
+		hwpstate_set[i].power = CPUFREQ_VAL_UNKNOWN;
+		hwpstate_set[i].lat = CPUFREQ_VAL_UNKNOWN;
+	}
+	return (0);
+}
+
+static int
+hwpstate_get_info_from_acpi_perf(device_t dev, device_t perf_dev)
+{
+	struct hwpstate_softc *sc;
+	struct cf_setting *perf_set;
+	struct hwpstate_setting *hwpstate_set;
+	int count, error, i;
+
+	perf_set = malloc(MAX_SETTINGS * sizeof(*perf_set), M_TEMP, M_NOWAIT);
+	if (perf_set == NULL) {
+		HWPSTATE_DEBUG(dev, "nomem\n");
+		return (ENOMEM);
+	}
+	/*
+	 * Fetch settings from acpi_perf.
+	 * Now it is attached, and has info only flag.
+	 */
+	count = MAX_SETTINGS;
+	error = CPUFREQ_DRV_SETTINGS(perf_dev, perf_set, &count);
+	if (error) {
+		HWPSTATE_DEBUG(dev, "error: CPUFREQ_DRV_SETTINGS.\n");
+		goto out;
+	}
+	sc = device_get_softc(dev);
+	sc->cfnum = count;
+	hwpstate_set = sc->hwpstate_settings;
+	for (i = 0; i < count; i++) {
+		if (i == perf_set[i].spec[0]) {
+			hwpstate_set[i].pstate_id = i;
+			hwpstate_set[i].freq = perf_set[i].freq;
+			hwpstate_set[i].volts = perf_set[i].volts;
+			hwpstate_set[i].power = perf_set[i].power;
+			hwpstate_set[i].lat = perf_set[i].lat;
+		} else {
+			HWPSTATE_DEBUG(dev, "ACPI _PSS object mismatch.\n");
+			error = ENXIO;
+			goto out;
+		}
+	}
+out:
+	if (perf_set)
+		free(perf_set, M_TEMP);
+	return (error);
+}
+
+static int
+hwpstate_detach(device_t dev)
+{
+
+	hwpstate_goto_pstate(dev, 0);
+	return (cpufreq_unregister(dev));
+}
+
+static int
+hwpstate_shutdown(device_t dev)
+{
+
+	/* hwpstate_goto_pstate(dev, 0); */
+	return (0);
+}
+
+static int
+hwpstate_features(driver_t *driver, u_int *features)
+{
+
+	/* Notify the ACPI CPU that we support direct access to MSRs */
+	*features = ACPI_CAP_PERF_MSRS;
+	return (0);
+}

Modified: head/sys/modules/cpufreq/Makefile
==============================================================================
--- head/sys/modules/cpufreq/Makefile	Sat Mar 28 07:44:08 2009	(r190500)
+++ head/sys/modules/cpufreq/Makefile	Sat Mar 28 08:54:47 2009	(r190501)
@@ -12,7 +12,7 @@ SRCS+=	bus_if.h cpufreq_if.h device_if.h
 CFLAGS+= -I${.CURDIR}/../../contrib/dev/acpica
 
 SRCS+=	acpi_if.h opt_acpi.h
-SRCS+=	est.c p4tcc.c powernow.c
+SRCS+=	est.c hwpstate.c p4tcc.c powernow.c
 .endif
 
 .if ${MACHINE} == "i386"

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 09:56:05 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2B9801065672;
	Sat, 28 Mar 2009 09:56:04 +0000 (UTC)
	(envelope-from gabor@FreeBSD.org)
Received: from server.mypc.hu (server.mypc.hu [87.229.73.95])
	by mx1.freebsd.org (Postfix) with ESMTP id CB7E98FC19;
	Sat, 28 Mar 2009 09:56:03 +0000 (UTC)
	(envelope-from gabor@FreeBSD.org)
Received: from localhost (localhost [127.0.0.1])
	by server.mypc.hu (Postfix) with ESMTP id A318314D4CBD;
	Sat, 28 Mar 2009 10:56:01 +0100 (CET)
X-Virus-Scanned: amavisd-new at t-hosting.hu
Received: from server.mypc.hu ([127.0.0.1])
	by localhost (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id MSW-VYv+tZIk; Sat, 28 Mar 2009 10:56:01 +0100 (CET)
Received: from [192.168.1.105] (catv-80-98-231-64.catv.broadband.hu
	[80.98.231.64])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by server.mypc.hu (Postfix) with ESMTPSA id 237EF14D2BDB;
	Sat, 28 Mar 2009 10:56:01 +0100 (CET)
Message-ID: <49CDF42E.8070308@FreeBSD.org>
Date: Sat, 28 Mar 2009 10:55:58 +0100
From: =?ISO-8859-1?Q?G=E1bor_K=F6vesd=E1n?= 
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
To: Rene Ladan 
References: <200903131040.n2DAecSO061131@svn.freebsd.org>		<49BB0DF0.3020907@FreeBSD.org>		<49CBFC02.2000506@FreeBSD.org>
	<49CCCE52.3000603@freebsd.org> <49CCD044.3010308@FreeBSD.org>
	<49CCD534.4000304@freebsd.org>
In-Reply-To: <49CCD534.4000304@freebsd.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Cc: Tom Rhodes , doc@FreeBSD.org,
	Gabor Pali , Robert Watson ,
	Giorgos Keramidas ,
	svn-src-head@freebsd.org, "Sean C. Farley" 
Subject: Re: NLS additions to I18N chapter of developers-handbook [Was: Re:
 svn commit: r189765 - in head: . lib/libc lib/libc/nls]
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 09:56:06 -0000

Rene Ladan escribió:
> Gábor Kövesdán schreef:
>> Rene Ladan escribió:
>>> Gábor Kövesdán schreef:
>>>> Robert Watson escribió:
>>>>> Do you have any advice on what to do for libraries that provide 
>>>>> error strings in their own error spaces?  Is it intended that the 
>>>>> library's init and destroy functions will open and close 
>>>>> catalogues?  Will this work if the application the library is used 
>>>>> by doesn't know about catalogues?  Etc...
>>>> I've made one more little addition, which can be useful to spare 
>>>> with error strings. :)
>>>> http://kovesdan.org/patches/nls-doc2.diff
>>>>
>>>
>>> Looks nice.  I corrected a few minor mistakes in the attached patch.
>> Thanks!
>>>
>>> On my 8.0 box with localized libc, I get the English message when
>>> setting errno to ENOTDIR and calling err(1, NULL) in a test program.
>>> Is this to be expected?
>> No, something's wrong there. Are you sure LC_MESSAGES or LC_ALL is 
>> set correctly? Here I get this:
>>
>>  > ./sort -T fre
>> sort: Not a directory
>>  > env LC_ALL=hu_HU.ISO8859-2 ./sort -T fre
>> sort: Nem könyvtár
>>  > env LC_ALL=nl_NL.ISO8859-1 ./sort -T fre
>> sort: Dit is geen directory
>>
> I sometimes still get English messages even when I set both LC_ALL and
> LC_MESSAGES to nl_NL.ISO8859-1 :
> > echo $SHELL
> /bin/tcsh
> > ls bla
> ls: bla: Bestand of map niet gevonden
> > notacommand
> notacommand: Command not found
>
> output of { errno = ENOTDIR; err(1, NULL); } :
> do-err: Not a directory
>
> svn revision 189775
>
That's strange. Could you please paste your complete env so that I can 
try to reproduce?

-- 
Gabor Kovesdan
FreeBSD Volunteer

EMAIL: gabor@FreeBSD.org .:|:. gabor@kovesdan.org
WEB:   http://people.FreeBSD.org/~gabor .:|:. http://kovesdan.org


From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 15:54:09 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 64A5F10656ED;
	Sat, 28 Mar 2009 15:54:09 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 47C2E8FC20;
	Sat, 28 Mar 2009 15:54:09 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2SFs9eT006337;
	Sat, 28 Mar 2009 15:54:09 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2SFs9Uf006336;
	Sat, 28 Mar 2009 15:54:09 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200903281554.n2SFs9Uf006336@svn.freebsd.org>
From: Konstantin Belousov 
Date: Sat, 28 Mar 2009 15:54:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190505 - head/libexec/rtld-elf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 15:54:10 -0000

Author: kib
Date: Sat Mar 28 15:54:08 2009
New Revision: 190505
URL: http://svn.freebsd.org/changeset/base/190505

Log:
  Do not dereference NULL pointer. refobj is NULL for the objects that are
  preloaded.
  
  Reported and tested by:	ed

Modified:
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld.c
==============================================================================
--- head/libexec/rtld-elf/rtld.c	Sat Mar 28 11:29:07 2009	(r190504)
+++ head/libexec/rtld-elf/rtld.c	Sat Mar 28 15:54:08 2009	(r190505)
@@ -1125,7 +1125,7 @@ find_library(const char *xname, const Ob
 	      xname);
 	    return NULL;
 	}
-	if (refobj->z_origin)
+	if (refobj != NULL && refobj->z_origin)
 	    return origin_subst(xname, refobj->origin_path);
 	else
 	    return xstrdup(xname);

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 17:20:08 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BB38B106566C;
	Sat, 28 Mar 2009 17:20:08 +0000 (UTC)
	(envelope-from lulf@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A6CB78FC16;
	Sat, 28 Mar 2009 17:20:08 +0000 (UTC)
	(envelope-from lulf@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2SHK8qD008089;
	Sat, 28 Mar 2009 17:20:08 GMT (envelope-from lulf@svn.freebsd.org)
Received: (from lulf@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2SHK8Ub008086;
	Sat, 28 Mar 2009 17:20:08 GMT (envelope-from lulf@svn.freebsd.org)
Message-Id: <200903281720.n2SHK8Ub008086@svn.freebsd.org>
From: Ulf Lilleengen 
Date: Sat, 28 Mar 2009 17:20:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190507 - in head: sbin/gvinum sys/geom/vinum
	sys/modules/geom/geom_vinum
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 17:20:09 -0000

Author: lulf
Date: Sat Mar 28 17:20:08 2009
New Revision: 190507
URL: http://svn.freebsd.org/changeset/base/190507

Log:
  Import the gvinum work that have been done during and after Summer of Code 2007.
  The work have been under testing and fixing since then, and it is mature enough
  to be put into HEAD for further testing.
  
  A lot have changed in this time, and here are the most important:
  - Gvinum now uses one single workerthread instead of one thread for each
    volume and each plex. The reason for this is that the previous scheme was
    very complex, and was the cause of many of the bugs discovered in gvinum.
    Instead, gvinum now uses one worker thread with an event queue, quite
    similar to what used in gmirror.
  - The rebuild/grow/initialize/parity check routines no longer runs in
    separate threads, but are run as regular I/O requests with special flags.
    This made it easier to support mounted growing and parity rebuild.
  - Support for growing striped and raid5-plexes, meaning that one can extend the
    volumes for these plex types in addition to the concat type. Also works while
    the volume is mounted.
  - Implementation of many of the missing commands from the old vinum:
    attach/detach, start (was partially implemented), stop (was partially
    implemented), concat, mirror, stripe, raid5 (shortcuts for creating volumes
    with one plex of these organizations).
  - The parity check and rebuild no longer goes between userland/kernel, meaning
    that the gvinum command will not stay and wait forever for the rebuild to
    finish. You can instead watch the status with the list command.
  - Many problems with gvinum have been reported since 5.x, and some has been hard
    to fix due to the complicated architecture. Hopefully, it should be more
    stable and better handle edge cases that previously made gvinum crash.
  - Failed drives no longer disappears entirely, but now leave behind a dummy
    drive that makes sure the original state is not forgotten in case the system
    is rebooted between drive failures/swaps.
  - Update manpage to reflect new commands and extend it with some examples.
  
  Sponsored by:   Google Summer of Code 2007
  Mentored by:    le
  Tested by:      Rick C. Petty 

Modified:
  head/sbin/gvinum/gvinum.8
  head/sbin/gvinum/gvinum.c
  head/sys/geom/vinum/geom_vinum.c
  head/sys/geom/vinum/geom_vinum.h
  head/sys/geom/vinum/geom_vinum_drive.c
  head/sys/geom/vinum/geom_vinum_init.c
  head/sys/geom/vinum/geom_vinum_list.c
  head/sys/geom/vinum/geom_vinum_move.c
  head/sys/geom/vinum/geom_vinum_plex.c
  head/sys/geom/vinum/geom_vinum_raid5.c
  head/sys/geom/vinum/geom_vinum_raid5.h
  head/sys/geom/vinum/geom_vinum_rename.c
  head/sys/geom/vinum/geom_vinum_rm.c
  head/sys/geom/vinum/geom_vinum_share.c
  head/sys/geom/vinum/geom_vinum_share.h
  head/sys/geom/vinum/geom_vinum_state.c
  head/sys/geom/vinum/geom_vinum_subr.c
  head/sys/geom/vinum/geom_vinum_var.h
  head/sys/geom/vinum/geom_vinum_volume.c
  head/sys/modules/geom/geom_vinum/Makefile

Modified: head/sbin/gvinum/gvinum.8
==============================================================================
--- head/sbin/gvinum/gvinum.8	Sat Mar 28 16:12:32 2009	(r190506)
+++ head/sbin/gvinum/gvinum.8	Sat Mar 28 17:20:08 2009	(r190507)
@@ -40,6 +40,13 @@
 .Op Fl options
 .Sh COMMANDS
 .Bl -tag -width indent
+.It Ic attach Ar plex volume Op Cm rename
+.It Ic attach Ar subdisk plex Oo Ar offset Oc Op Cm rename
+Attach a plex to a volume, or a subdisk to a plex. 
+If offset is specified, the subdisk will be attached to the given offset within
+the plex.
+If rename is specified, the subdisk or plex will change name according to the
+object it attaches to.
 .It Ic checkparity Oo Fl f Oc Ar plex
 Check the parity blocks of a RAID-5 plex.
 The parity check will start at the
@@ -49,7 +56,10 @@ flag is specified, or otherwise at the l
 the first location at which plex's parity is incorrect.
 All subdisks in the
 plex must be up for a parity check.
-.It Ic create Op Ar description-file
+.It Ic concat Oo Fl fv Oc Oo Fl n Ar name Oc Ar drives
+Create a concatenated volume from the specified drives.
+If no name is specified, a unique name will be set by gvinum.
+.It Ic create Oo Fl f Oc Op Ar description-file
 Create a volume as described in
 .Ar description-file .
 If no
@@ -57,6 +67,18 @@ If no
 provided, opens an editor and provides the current
 .Nm
 configuration for editing.
+The
+.Fl f
+flag will make gvinum ignore any errors regarding creating objects that already
+exists.
+However, in contrast to vinum, objects that are not properly named in the
+.Ar description-file
+will not be created when the
+.Fl f
+flag is given.
+.It Ic detach Oo Fl f Oc Op Ar plex | subdisk
+Detach a plex or subdisk from the volume or plex to which it is
+attached.
 .It Ic help
 Provides a synopsis of
 .Nm
@@ -76,6 +98,14 @@ The
 and
 .Fl V
 flags provide progressively more detailed output.
+.It Ic mirror Oo Fl fsv Oc Oo Fl n Ar name Oc Ar drives
+Create a mirrored volume from the specified drives. 
+It requires at least a multiple of 2 drives.
+If no name is specified, a unique name will be set by gvinum.
+If the 
+.Fl s
+flag is specified, a striped mirror will be created, and thus requires a
+multiple of 4 drives.
 .It Ic move | mv Fl f Ar drive subdisk Op Ar ...
 Move the subdisk(s) to the specified drive.
 The
@@ -85,12 +115,19 @@ part of the move.
 This can currently only be done when the subdisk is
 not being accessed.
 .Pp
-If the subdisk(s) form part of a RAID-5 plex, the disk(s) will need to be set
-to the
+If a single subdisk is moved, and it forms a part of a RAID-5 plex, the moved
+subdisks will need to be set to the
+.Dq stale
+state, and the plex will require a
+.Ic start
+command.
+If multiple subdisk(s) is moved, and form part of a RAID-5 plex, the
+moved disk(s) will need to be set to the
 .Dq up
 state and the plex will require a
 .Ic rebuildparity
-command; if the subdisk(s) form part of a plex that is mirrored with other
+command.
+If the subdisk(s) form part of a plex that is mirrored with other
 plexes, the plex will require restarting and will sync once restarted.
 Moving
 more than one subdisk in a RAID-5 plex or subdisks from both sides of a
@@ -105,6 +142,11 @@ Exit
 when running in interactive mode.
 Normally this would be done by entering the
 EOF character.
+.It Ic raid5 Oo Fl fv Oc Oo Fl s Ar stripesize Oc Oo Fl n Ar name Oc Ar drives
+Create a RAID-5 volume from the specified drives.
+If no name is specified,a unique name will be set by
+.Ic gvinum. 
+This organization requires at least three drives.
 .It Ic rename Oo Fl r Oc Ar drive | subdisk | plex | volume newname
 Change the name of the specified object.
 The
@@ -143,9 +185,21 @@ flag forces state changes regardless of 
 Read configuration from all vinum drives.
 .It Ic start Oo Fl S Ar size Oc Ar volume | plex | subdisk
 Allow the system to access the objects.
+If necessary, plexes will be synced and rebuilt.
+If a subdisk was added to a running RAID-5 or striped plex, gvinum will
+expand into this subdisk and grow the whole RAID-5 array.
+This can be done without unmounting your filesystem.
 The
 .Fl S
 flag is currently ignored.
+.It Ic stop Oo Fl f Oc Op Ar volume | plex | subdisk
+Terminate access to the objects, or stop
+.Nm
+if no parameters are specified.
+.It Ic stripe Oo Fl fv Oc Oo Fl n Ar name Oc Ar drives
+Create a striped volume from the specified drives. If no name is specified,
+a unique name will be set by Ic gvinum. This organization requires at least two
+drives.
 .El
 .Sh DESCRIPTION
 The
@@ -217,15 +271,90 @@ is invoked.
 directory with device nodes for
 .Nm
 objects
-.It Pa /dev/gvinum/plex
-directory containing device nodes for
-.Nm
-plexes
-.It Pa /dev/gvinum/sd
-directory containing device nodes for
-.Nm
-subdisks
 .El
+.Sh EXAMPLES
+To create a mirror on disks /dev/ad1 and /dev/ad2, create a filesystem, mount,
+unmount and then stop Ic gvinum:
+.Pp
+.Dl "gvinum mirror /dev/ad1 /dev/ad2"
+.Dl "newfs /dev/gvinum/gvinumvolume0"
+.Dl "mount /dev/gvinum/gvinumvolume0 /mnt" 
+.Dl "..."
+.Dl "unmount /mnt"
+.Dl "gvinum stop"
+.Pp
+To create a striped mirror on disks /dev/ad1 /dev/ad2 /dev/ad3 and /dev/ad4
+named "data" and create a filesystem:
+.Pp
+.Dl "gvinum mirror -s -n data /dev/ad1 /dev/ad2 /dev/ad3 /dev/ad4"
+.Dl "newfs /dev/gvinum/data"
+.Pp
+To create a raid5 array on disks /dev/ad1 /dev/ad2 and /dev/ad3, with stripesize
+493k you can use the raid5 command:
+.Pp
+.Dl "gvinum raid5 -s 493k /dev/ad1 /dev/ad2 /dev/ad3"
+.Pp
+Then the volume will be created automatically.
+Afterwards, you have to initialize the volume:
+.Pp
+.Dl "gvinum start myraid5vol"
+.Pp
+The initialization will start, and the states will be updated when it's
+finished.
+The list command will give you information about its progress.
+.Pp
+Imagine that one of the drives fails, and the output of 'printconfig' looks
+something like this:
+.Pp
+.Dl "drive gvinumdrive1 device /dev/ad2"
+.Dl "drive gvinumdrive2 device /dev/???"
+.Dl "drive gvinumdrive0 device /dev/ad1"
+.Dl "volume myraid5vol"
+.Dl "plex name myraid5vol.p0 org raid5 986s vol myraid5vol"
+.Dl "sd name myraid5vol.p0.s2 drive gvinumdrive2 len 32538s driveoffset 265s"
+.Dl "plex myraid5vol.p0 plexoffset 1972s"
+.Dl "sd name myraid5vol.p0.s1 drive gvinumdrive1 len 32538s driveoffset 265s"
+.Dl "plex myraid5vol.p0 plexoffset 986s"
+.Dl "sd name myraid5vol.p0.s0 drive gvinumdrive0 len 32538s driveoffset 265s"
+.Dl "plex myraid5vol.p0 plexoffset 0s"
+.Pp
+Create a new drive with this configuration:
+.Pp
+.Dl "drive gdrive4 device /dev/ad4"
+.Pp
+Then move the stale subdisk to the new drive:
+.Pp
+.Dl "gvinum move gdrive4 myraid5vol.p0.s2"
+.Pp
+Then, initiate the rebuild:
+.Pp
+.Dl "gvinum start myraid5vol.p0"
+.Pp
+The plex will go up form degraded mode after the rebuild is finished.
+The plex can still be used while the rebuild is in progress, although requests
+might be delayed.
+For a more advanced usage and detailed explanation of gvinum, the
+handbook is recommended.
+.Pp
+Given the configuration as in the previous example, growing a RAID-5 or STRIPED
+array is accomplished by adding a new subdisk to the plex with a
+.Ar description-file
+similar to this:
+.Pp
+.Dl "drive newdrive device /dev/ad4"
+.Dl "sd drive newdrive plex myraid5vol.p0"
+.Pp
+If everything went ok, the plex state should now be set to growable.
+You can then start the growing with the
+.Ic start
+command:
+.Pp
+.Dl "gvinum start myraid5vol.p0"
+.Pp
+As with rebuilding, you can watch the progress using the
+.Ic list
+command.
+.Pp
 .Sh SEE ALSO
 .Xr geom 4 ,
 .Xr geom 8
@@ -255,9 +384,13 @@ documentation were added by
 .An "Chris Jones"
 through the 2005 Google Summer
 of Code program.
+.Ic a partial rewrite of gvinum was done by "Lukas Ertl" and "Ulf Lilleengen"
+through the 2007 Google Summer of Code program.
+The documentation have been updated to reflect the new functionality.
 .Sh AUTHORS
 .An Lukas Ertl Aq le@FreeBSD.org
 .An Chris Jones Aq soc-cjones@FreeBSD.org
+.An Ulf Lilleengen Aq lulf@FreeBSD.org
 .Sh BUGS
 Currently,
 .Nm
@@ -271,10 +404,6 @@ initsize flag to
 .Ic start
 is ignored.
 .Pp
-The
-.Ic stop
-command does not work.
-.Pp
 Moving subdisks that are not part of a mirrored or RAID-5 volume will
 destroy data.
 It is perhaps a bug to permit this.
@@ -291,18 +420,10 @@ Specifically, the following commands fro
 .Xr vinum 4
 are not supported:
 .Bl -tag -width indent
-.It Ic attach Ar plex volume Op Cm rename
-.It Ic attach Ar subdisk plex Oo Ar offset Oc Op Cm rename
-Attach a plex to a volume, or a subdisk to a plex.
-.It Ic concat Oo Fl fv Oc Oo Fl n Ar name Oc Ar drives
-Create a concatenated volume from the specified drives.
 .It Ic debug
 Cause the volume manager to enter the kernel debugger.
 .It Ic debug Ar flags
 Set debugging flags.
-.It Ic detach Oo Fl f Oc Op Ar plex | subdisk
-Detach a plex or subdisk from the volume or plex to which it is
-attached.
 .It Ic dumpconfig Op Ar drive ...
 List the configuration information stored on the specified drives, or all
 drives in the system if no drive names are specified.
@@ -310,17 +431,9 @@ drives in the system if no drive names a
 List information about volume manager state.
 .It Ic label Ar volume
 Create a volume label.
-.It Ic mirror Oo Fl fsv Oc Oo Fl n Ar name Oc Ar drives
-Create a mirrored volume from the specified drives.
 .It Ic resetstats Oo Fl r Oc Op Ar volume | plex | subdisk
 Reset statistics counters for the specified objects, or for all objects if none
 are specified.
 .It Ic setdaemon Op Ar value
 Set daemon configuration.
-.It Ic stop Oo Fl f Oc Op Ar volume | plex | subdisk
-Terminate access to the objects, or stop
-.Nm
-if no parameters are specified.
-.It Ic stripe Oo Fl fv Oc Oo Fl n Ar name Oc Ar drives
-Create a striped volume from the specified drives.
 .El

Modified: head/sbin/gvinum/gvinum.c
==============================================================================
--- head/sbin/gvinum/gvinum.c	Sat Mar 28 16:12:32 2009	(r190506)
+++ head/sbin/gvinum/gvinum.c	Sat Mar 28 17:20:08 2009	(r190507)
@@ -1,5 +1,7 @@
 /*
- *  Copyright (c) 2004 Lukas Ertl, 2005 Chris Jones
+ *  Copyright (c) 2004 Lukas Ertl
+ *  Copyright (c) 2005 Chris Jones
+ *  Copyright (c) 2007 Ulf Lilleengen
  *  All rights reserved.
  *
  * Portions of this software were developed for the FreeBSD Project
@@ -43,6 +45,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -54,12 +57,17 @@
 
 #include "gvinum.h"
 
+void	gvinum_attach(int, char **);
+void	gvinum_concat(int, char **);
 void	gvinum_create(int, char **);
+void	gvinum_detach(int, char **);
 void	gvinum_help(void);
 void	gvinum_list(int, char **);
 void	gvinum_move(int, char **);
+void	gvinum_mirror(int, char **);
 void	gvinum_parityop(int, char **, int);
 void	gvinum_printconfig(int, char **);
+void	gvinum_raid5(int, char **);
 void	gvinum_rename(int, char **);
 void	gvinum_resetconfig(void);
 void	gvinum_rm(int, char **);
@@ -67,9 +75,15 @@ void	gvinum_saveconfig(void);
 void	gvinum_setstate(int, char **);
 void	gvinum_start(int, char **);
 void	gvinum_stop(int, char **);
+void	gvinum_stripe(int, char **);
 void	parseline(int, char **);
 void	printconfig(FILE *, char *);
 
+char	*create_drive(char *);
+void	 create_volume(int, char **, char *);
+char	*find_name(const char *, int, int);
+char	*find_pattern(char *, char *);
+
 int
 main(int argc, char **argv)
 {
@@ -111,6 +125,44 @@ main(int argc, char **argv)
 	exit(0);
 }
 
+/* Attach a plex to a volume or a subdisk to a plex. */
+void
+gvinum_attach(int argc, char **argv)
+{
+	struct gctl_req *req;
+	const char *errstr;
+	int rename;
+	off_t offset;
+
+	rename = 0;
+	offset = -1;
+	if (argc < 3) {
+		warnx("usage:\tattach   [rename] "
+		    "[]\n"
+		    "\tattach   [rename]");
+		return;
+	}
+	if (argc > 3) {
+		if (!strcmp(argv[3], "rename")) {
+			rename = 1;
+			if (argc == 5)
+				offset = strtol(argv[4], NULL, 0);
+		} else
+			offset = strtol(argv[3], NULL, 0);
+	}
+	req = gctl_get_handle();
+	gctl_ro_param(req, "class", -1, "VINUM");
+	gctl_ro_param(req, "verb", -1, "attach");
+	gctl_ro_param(req, "child", -1, argv[1]);
+	gctl_ro_param(req, "parent", -1, argv[2]);
+	gctl_ro_param(req, "offset", sizeof(off_t), &offset);
+	gctl_ro_param(req, "rename", sizeof(int), &rename);
+	errstr = gctl_issue(req);
+	if (errstr != NULL)
+		warnx("attach failed: %s", errstr);
+	gctl_free(req);
+}
+
 void
 gvinum_create(int argc, char **argv)
 {
@@ -120,19 +172,30 @@ gvinum_create(int argc, char **argv)
 	struct gv_sd *s;
 	struct gv_volume *v;
 	FILE *tmp;
-	int drives, errors, fd, line, plexes, plex_in_volume;
-	int sd_in_plex, status, subdisks, tokens, volumes;
+	int drives, errors, fd, flags, i, line, plexes, plex_in_volume;
+	int sd_in_plex, status, subdisks, tokens, undeffd, volumes;
 	const char *errstr;
-	char buf[BUFSIZ], buf1[BUFSIZ], commandline[BUFSIZ], *ed;
+	char buf[BUFSIZ], buf1[BUFSIZ], commandline[BUFSIZ], *ed, *sdname;
 	char original[BUFSIZ], tmpfile[20], *token[GV_MAXARGS];
 	char plex[GV_MAXPLEXNAME], volume[GV_MAXVOLNAME];
 
-	if (argc == 2) {
-		if ((tmp = fopen(argv[1], "r")) == NULL) {
-			warn("can't open '%s' for reading", argv[1]);
-			return;
-		}
-	} else {
+	tmp = NULL;
+	flags = 0;
+	for (i = 1; i < argc; i++) {
+		/* Force flag used to ignore already created drives. */
+		if (!strcmp(argv[i], "-f")) {
+			flags |= GV_FLAG_F;
+		/* Else it must be a file. */
+		} else {
+			if ((tmp = fopen(argv[1], "r")) == NULL) {
+				warn("can't open '%s' for reading", argv[1]);
+				return;
+			}
+		}	
+	}
+
+	/* We didn't get a file. */
+	if (tmp == NULL) {
 		snprintf(tmpfile, sizeof(tmpfile), "/tmp/gvinum.XXXXXX");
 		
 		if ((fd = mkstemp(tmpfile)) == -1) {
@@ -167,9 +230,11 @@ gvinum_create(int argc, char **argv)
 	req = gctl_get_handle();
 	gctl_ro_param(req, "class", -1, "VINUM");
 	gctl_ro_param(req, "verb", -1, "create");
+	gctl_ro_param(req, "flags", sizeof(int), &flags);
 
 	drives = volumes = plexes = subdisks = 0;
-	plex_in_volume = sd_in_plex = 0;
+	plex_in_volume = sd_in_plex = undeffd = 0;
+	plex[0] = '\0';
 	errors = 0;
 	line = 1;
 	while ((fgets(buf, BUFSIZ, tmp)) != NULL) {
@@ -187,7 +252,7 @@ gvinum_create(int argc, char **argv)
 		 * Copy the original input line in case we need it for error
 		 * output.
 		 */
-		strncpy(original, buf, sizeof(buf));
+		strlcpy(original, buf, sizeof(original));
 
 		tokens = gv_tokenize(buf, token, GV_MAXARGS);
 		if (tokens <= 0) {
@@ -214,7 +279,7 @@ gvinum_create(int argc, char **argv)
 			 * Set default volume name for following plex
 			 * definitions.
 			 */
-			strncpy(volume, v->name, sizeof(volume));
+			strlcpy(volume, v->name, sizeof(volume));
 
 			snprintf(buf1, sizeof(buf1), "volume%d", volumes);
 			gctl_ro_param(req, buf1, sizeof(*v), v);
@@ -236,13 +301,13 @@ gvinum_create(int argc, char **argv)
 
 			/* Default name. */
 			if (strlen(p->name) == 0) {
-				snprintf(p->name, GV_MAXPLEXNAME, "%s.p%d",
+				snprintf(p->name, sizeof(p->name), "%s.p%d",
 				    volume, plex_in_volume++);
 			}
 
 			/* Default volume. */
 			if (strlen(p->volume) == 0) {
-				snprintf(p->volume, GV_MAXVOLNAME, "%s",
+				snprintf(p->volume, sizeof(p->volume), "%s",
 				    volume);
 			}
 
@@ -250,7 +315,7 @@ gvinum_create(int argc, char **argv)
 			 * Set default plex name for following subdisk
 			 * definitions.
 			 */
-			strncpy(plex, p->name, GV_MAXPLEXNAME);
+			strlcpy(plex, p->name, sizeof(plex));
 
 			snprintf(buf1, sizeof(buf1), "plex%d", plexes);
 			gctl_ro_param(req, buf1, sizeof(*p), p);
@@ -270,13 +335,21 @@ gvinum_create(int argc, char **argv)
 
 			/* Default name. */
 			if (strlen(s->name) == 0) {
-				snprintf(s->name, GV_MAXSDNAME, "%s.s%d",
-				    plex, sd_in_plex++);
+				if (strlen(plex) == 0) {
+					sdname = find_name("gvinumsubdisk.p",
+					    GV_TYPE_SD, GV_MAXSDNAME);
+					snprintf(s->name, sizeof(s->name),
+					    "%s.s%d", sdname, undeffd++);
+					free(sdname);
+				} else {
+					snprintf(s->name, sizeof(s->name),
+					    "%s.s%d",plex, sd_in_plex++);
+				}
 			}
 
 			/* Default plex. */
 			if (strlen(s->plex) == 0)
-				snprintf(s->plex, GV_MAXPLEXNAME, "%s", plex);
+				snprintf(s->plex, sizeof(s->plex), "%s", plex);
 
 			snprintf(buf1, sizeof(buf1), "sd%d", subdisks);
 			gctl_ro_param(req, buf1, sizeof(*s), s);
@@ -320,7 +393,279 @@ gvinum_create(int argc, char **argv)
 			warnx("create failed: %s", errstr);
 	}
 	gctl_free(req);
-	gvinum_list(0, NULL);
+}
+
+/* Create a concatenated volume. */
+void
+gvinum_concat(int argc, char **argv)
+{
+
+	if (argc < 2) {
+		warnx("usage:\tconcat [-fv] [-n name] drives\n");
+		return;
+	}
+	create_volume(argc, argv, "concat");
+}
+
+
+/* Create a drive quick and dirty. */
+char *
+create_drive(char *device)
+{
+	struct gv_drive *d;
+	struct gctl_req *req;
+	const char *errstr;
+	char *drivename, *dname;
+	int drives, i, flags, volumes, subdisks, plexes;
+
+	flags = plexes = subdisks = volumes = 0;
+	drives = 1;
+	dname = NULL;
+
+	/* Strip away eventual /dev/ in front. */
+	if (strncmp(device, "/dev/", 5) == 0)
+		device += 5;
+
+	drivename = find_name("gvinumdrive", GV_TYPE_DRIVE, GV_MAXDRIVENAME);
+	if (drivename == NULL)
+		return (NULL);
+
+	req = gctl_get_handle();
+	gctl_ro_param(req, "class", -1, "VINUM");
+	gctl_ro_param(req, "verb", -1, "create");
+	d = malloc(sizeof(struct gv_drive));
+	if (d == NULL)
+		err(1, "unable to allocate for gv_drive object");
+	memset(d, 0, sizeof(struct gv_drive));
+
+	strlcpy(d->name, drivename, sizeof(d->name));
+	strlcpy(d->device, device, sizeof(d->device));
+	gctl_ro_param(req, "drive0", sizeof(*d), d);
+	gctl_ro_param(req, "flags", sizeof(int), &flags);
+	gctl_ro_param(req, "drives", sizeof(int), &drives);
+	gctl_ro_param(req, "volumes", sizeof(int), &volumes);
+	gctl_ro_param(req, "plexes", sizeof(int), &plexes);
+	gctl_ro_param(req, "subdisks", sizeof(int), &subdisks);
+	errstr = gctl_issue(req);
+	if (errstr != NULL) {
+		warnx("error creating drive: %s", errstr);
+		gctl_free(req);
+		return (NULL);
+	} else {
+		gctl_free(req);
+		/* XXX: This is needed because we have to make sure the drives
+		 * are created before we return. */
+		/* Loop until it's in the config. */
+		for (i = 0; i < 100000; i++) {
+			dname = find_name("gvinumdrive", GV_TYPE_DRIVE,
+			    GV_MAXDRIVENAME);
+			/* If we got a different name, quit. */
+			if (dname == NULL)
+				continue;
+			if (strcmp(dname, drivename)) {
+				free(dname);
+				return (drivename);
+			}
+			free(dname);
+			dname = NULL;
+			usleep(100000); /* Sleep for 0.1s */
+		}
+	}
+	gctl_free(req);
+	return (drivename);
+}
+
+/* 
+ * General routine for creating a volume. Mainly for use by concat, mirror,
+ * raid5 and stripe commands.
+ */
+void
+create_volume(int argc, char **argv, char *verb)
+{
+	struct gctl_req *req;
+	const char *errstr;
+	char buf[BUFSIZ], *drivename, *volname;
+	int drives, flags, i;
+	off_t stripesize;
+
+	flags = 0;
+	drives = 0;
+	volname = NULL;
+	stripesize = 262144;
+
+	/* XXX: Should we check for argument length? */
+
+	req = gctl_get_handle();
+	gctl_ro_param(req, "class", -1, "VINUM");
+
+	for (i = 1; i < argc; i++) {
+		if (!strcmp(argv[i], "-f")) {
+			flags |= GV_FLAG_F;
+		} else if (!strcmp(argv[i], "-n")) {
+			volname = argv[++i];
+		} else if (!strcmp(argv[i], "-v")) {
+			flags |= GV_FLAG_V;
+		} else if (!strcmp(argv[i], "-s")) {
+			flags |= GV_FLAG_S;
+			if (!strcmp(verb, "raid5"))
+				stripesize = gv_sizespec(argv[++i]);
+		} else {
+			/* Assume it's a drive. */
+			snprintf(buf, sizeof(buf), "drive%d", drives++);
+
+			/* First we create the drive. */
+			drivename = create_drive(argv[i]); 
+			if (drivename == NULL)
+				goto bad;
+			/* Then we add it to the request. */
+			gctl_ro_param(req, buf, -1, drivename);
+		}
+	}
+
+	gctl_ro_param(req, "stripesize", sizeof(off_t), &stripesize);
+
+	/* Find a free volume name. */
+	if (volname == NULL)
+		volname = find_name("gvinumvolume", GV_TYPE_VOL, GV_MAXVOLNAME);
+
+	/* Then we send a request to actually create the volumes. */
+	gctl_ro_param(req, "verb", -1, verb);
+	gctl_ro_param(req, "flags", sizeof(int), &flags); 
+	gctl_ro_param(req, "drives", sizeof(int), &drives);
+	gctl_ro_param(req, "name", -1, volname);
+	errstr = gctl_issue(req);
+	if (errstr != NULL)
+		warnx("creating %s volume failed: %s", verb, errstr);
+bad:
+	gctl_free(req);
+}
+
+/* Parse a line of the config, return the word after . */
+char *
+find_pattern(char *line, char *pattern)
+{
+	char *ptr;
+
+	ptr = strsep(&line, " ");
+	while (ptr != NULL) {
+		if (!strcmp(ptr, pattern)) {
+			/* Return the next. */
+			ptr = strsep(&line, " ");
+			return (ptr);
+		}
+		ptr = strsep(&line, " ");
+	}
+	return (NULL);
+}
+
+/* Find a free name for an object given a a prefix. */
+char *
+find_name(const char *prefix, int type, int namelen)
+{
+	struct gctl_req *req;
+	char comment[1], buf[GV_CFG_LEN - 1], *name, *sname, *ptr;
+	const char *errstr;
+	int i, n, begin, len, conflict;
+	char line[1024];
+
+	comment[0] = '\0';
+
+	/* Find a name. Fetch out configuration first. */
+	req = gctl_get_handle();
+	gctl_ro_param(req, "class", -1, "VINUM");
+	gctl_ro_param(req, "verb", -1, "getconfig");
+	gctl_ro_param(req, "comment", -1, comment);
+	gctl_rw_param(req, "config", sizeof(buf), buf);
+	errstr = gctl_issue(req);
+	if (errstr != NULL) {
+		warnx("can't get configuration: %s", errstr);
+		return (NULL);
+	}
+	gctl_free(req);
+
+	begin = 0;
+	len = strlen(buf);
+	i = 0;
+	sname = malloc(namelen + 1);
+
+	/* XXX: Max object setting? */
+	for (n = 0; n < 10000; n++) {
+		snprintf(sname, namelen, "%s%d", prefix, n);
+		conflict = 0;
+		begin = 0;
+		/* Loop through the configuration line by line. */
+		for (i = 0; i < len; i++) {
+			if (buf[i] == '\n' || buf[i] == '\0') {
+				ptr = buf + begin;
+				strlcpy(line, ptr, (i - begin) + 1);
+				begin = i + 1;
+				switch (type) {
+				case GV_TYPE_DRIVE:
+					name = find_pattern(line, "drive");
+					break;
+				case GV_TYPE_VOL:
+					name = find_pattern(line, "volume");
+					break;
+				case GV_TYPE_PLEX:
+				case GV_TYPE_SD:
+					name = find_pattern(line, "name");
+					break;
+				default:
+					printf("Invalid type given\n");
+					continue;
+				}
+				if (name == NULL)
+					continue;
+				if (!strcmp(sname, name)) {
+					conflict = 1;
+					/* XXX: Could quit the loop earlier. */
+				}
+			}
+		}
+		if (!conflict)
+			return (sname);
+	}
+	free(sname);
+	return (NULL);
+}
+
+/* Detach a plex or subdisk from its parent. */
+void
+gvinum_detach(int argc, char **argv)
+{
+	const char *errstr;
+	struct gctl_req *req;
+	int flags, i;
+
+	optreset = 1;
+	optind = 1;
+	while ((i = getopt(argc, argv, "f")) != -1) {
+		switch(i) {
+		case 'f':
+			flags |= GV_FLAG_F;
+			break;
+		default:
+			warn("invalid flag: %c", i);
+			return;
+		}
+	}
+	argc -= optind;
+	argv += optind;
+	if (argc != 1) {
+		warnx("usage: detach [-f]  | ");
+		return;
+	}
+
+	req = gctl_get_handle();
+	gctl_ro_param(req, "class", -1, "VINUM");
+	gctl_ro_param(req, "verb", -1, "detach");
+	gctl_ro_param(req, "object", -1, argv[0]);
+	gctl_ro_param(req, "flags", sizeof(int), &flags);
+
+	errstr = gctl_issue(req);
+	if (errstr != NULL)
+		warnx("detach failed: %s", errstr);
+	gctl_free(req);
 }
 
 void
@@ -329,8 +674,16 @@ gvinum_help(void)
 	printf("COMMANDS\n"
 	    "checkparity [-f] plex\n"
 	    "        Check the parity blocks of a RAID-5 plex.\n"
-	    "create description-file\n"
+	    "create [-f] description-file\n"
 	    "        Create as per description-file or open editor.\n"
+	    "attach plex volume [rename]\n"
+	    "attach subdisk plex [offset] [rename]\n"
+	    "        Attach a plex to a volume, or a subdisk to a plex\n"
+	    "concat [-fv] [-n name] drives\n"
+	    "        Create a concatenated volume from the specified drives.\n"
+	    "detach [-f] [plex | subdisk]\n"
+	    "        Detach a plex or a subdisk from the volume or plex to\n"
+	    "        which it is attached.\n"
 	    "l | list [-r] [-v] [-V] [volume | plex | subdisk]\n"
 	    "        List information about specified objects.\n"
 	    "ld [-r] [-v] [-V] [volume]\n"
@@ -341,18 +694,22 @@ gvinum_help(void)
 	    "        List information about plexes.\n"
 	    "lv [-r] [-v] [-V] [volume]\n"
 	    "        List information about volumes.\n"
+	    "mirror [-fsv] [-n name] drives\n"
+	    "        Create a mirrored volume from the specified drives.\n"
 	    "move | mv -f drive object ...\n"
 	    "        Move the object(s) to the specified drive.\n"
 	    "quit    Exit the vinum program when running in interactive mode."
 	    "  Nor-\n"
 	    "        mally this would be done by entering the EOF character.\n"
+	    "raid5 [-fv] [-s stripesize] [-n name] drives\n"
+	    "        Create a RAID-5 volume from the specified drives.\n"
 	    "rename [-r] [drive | subdisk | plex | volume] newname\n"
 	    "        Change the name of the specified object.\n"
 	    "rebuildparity plex [-f]\n"
 	    "        Rebuild the parity blocks of a RAID-5 plex.\n"
 	    "resetconfig\n"
 	    "        Reset the complete gvinum configuration\n"
-	    "rm [-r] volume | plex | subdisk | drive\n"
+	    "rm [-r] [-f] volume | plex | subdisk | drive\n"
 	    "        Remove an object.\n"
 	    "saveconfig\n"
 	    "        Save vinum configuration to disk after configuration"
@@ -363,6 +720,8 @@ gvinum_help(void)
 	    "        poses only.\n"
 	    "start [-S size] volume | plex | subdisk\n"
 	    "        Allow the system to access the objects.\n"
+	    "stripe [-fv] [-n name] drives\n"
+	    "        Create a striped volume from the specified drives.\n"
 	);
 
 	return;
@@ -488,6 +847,18 @@ gvinum_list(int argc, char **argv)
 	return;
 }
 
+/* Create a mirrored volume. */
+void
+gvinum_mirror(int argc, char **argv)
+{
+
+	if (argc < 2) {
+		warnx("usage\tmirror [-fsv] [-n name] drives\n");
+		return;
+	}
+	create_volume(argc, argv, "mirror");
+}
+
 /* Note that move is currently of form '[-r] target object [...]' */
 void
 gvinum_move(int argc, char **argv)
@@ -553,8 +924,7 @@ void
 gvinum_parityop(int argc, char **argv, int rebuild)
 {
 	struct gctl_req *req;
-	int flags, i, rv;
-	off_t offset;
+	int flags, i;
 	const char *errstr;
 	char *op, *msg;
 
@@ -591,47 +961,32 @@ gvinum_parityop(int argc, char **argv, i
 		return;
 	}
 
-	do {
-		rv = 0;
-		req = gctl_get_handle();
-		gctl_ro_param(req, "class", -1, "VINUM");
-		gctl_ro_param(req, "verb", -1, "parityop");
-		gctl_ro_param(req, "flags", sizeof(int), &flags);
-		gctl_ro_param(req, "rebuild", sizeof(int), &rebuild);
-		gctl_rw_param(req, "rv", sizeof(int), &rv);
-		gctl_rw_param(req, "offset", sizeof(off_t), &offset);
-		gctl_ro_param(req, "plex", -1, argv[0]);
-		errstr = gctl_issue(req);
-		if (errstr) {
-			warnx("%s\n", errstr);
-			gctl_free(req);
-			break;
-		}
-		gctl_free(req);
-		if (flags & GV_FLAG_V) {
-			printf("\r%s at %s ... ", msg,
-			    gv_roughlength(offset, 1));
-		}
-		if (rv == 1) {
-			printf("Parity incorrect at offset 0x%jx\n",
-			    (intmax_t)offset);
-			if (!rebuild)
-				break;
-		}
-		fflush(stdout);
+	req = gctl_get_handle();
+	gctl_ro_param(req, "class", -1, "VINUM");
+	gctl_ro_param(req, "verb", -1, op);
+	gctl_ro_param(req, "rebuild", sizeof(int), &rebuild);
+	gctl_ro_param(req, "flags", sizeof(int), &flags);
+	gctl_ro_param(req, "plex", -1, argv[0]);
 
-		/* Clear the -f flag. */
-		flags &= ~GV_FLAG_F;
-	} while (rv >= 0);
-
-	if ((rv == 2) && (flags & GV_FLAG_V)) {
-		if (rebuild)
-			printf("Rebuilt parity on %s\n", argv[0]);
-		else
-			printf("%s has correct parity\n", argv[0]);
+	errstr = gctl_issue(req);
+	if (errstr)
+		warnx("%s\n", errstr);
+	gctl_free(req);
+}
+
+/* Create a RAID-5 volume. */
+void
+gvinum_raid5(int argc, char **argv)
+{
+
+	if (argc < 2) {
+		warnx("usage:\traid5 [-fv] [-s stripesize] [-n name] drives\n");
+		return;
 	}
+	create_volume(argc, argv, "raid5");
 }
 
+
 void
 gvinum_rename(int argc, char **argv)
 {
@@ -697,8 +1052,11 @@ gvinum_rm(int argc, char **argv)
 	flags = 0;
 	optreset = 1;
 	optind = 1;
-	while ((j = getopt(argc, argv, "r")) != -1) {
+	while ((j = getopt(argc, argv, "rf")) != -1) {
 		switch (j) {
+		case 'f':
+			flags |= GV_FLAG_F;
+			break;
 		case 'r':
 			flags |= GV_FLAG_R;
 			break;
@@ -728,7 +1086,6 @@ gvinum_rm(int argc, char **argv)
 		return;
 	}
 	gctl_free(req);
-	gvinum_list(0, NULL);
 }
 
 void
@@ -763,7 +1120,6 @@ gvinum_resetconfig(void)
 		return;
 	}
 	gctl_free(req);
-	gvinum_list(0, NULL);
 	printf("gvinum configuration obliterated\n");
 }
 
@@ -833,28 +1189,53 @@ gvinum_start(int argc, char **argv)
 	}
 
 	gctl_free(req);
-	gvinum_list(0, NULL);
 }
 
 void
 gvinum_stop(int argc, char **argv)
 {
-	int fileid;
+	int err, fileid;
 
 	fileid = kldfind(GVINUMMOD);
 	if (fileid == -1) {
 		warn("cannot find " GVINUMMOD);
 		return;
 	}
-	if (kldunload(fileid) != 0) {
+
+	/*
+	 * This little hack prevents that we end up in an infinite loop in
+	 * g_unload_class().  gv_unload() will return EAGAIN so that the GEOM
+	 * event thread will be free for the g_wither_geom() call from
+	 * gv_unload().  It's silly, but it works.
+	 */
+	printf("unloading " GVINUMMOD " kernel module... ");
+	fflush(stdout);
+	if ((err = kldunload(fileid)) != 0 && (errno == EAGAIN)) {
+		sleep(1);
+		err = kldunload(fileid);
+	}
+	if (err != 0) {
+		printf(" failed!\n");
 		warn("cannot unload " GVINUMMOD);
 		return;
 	}
 
-	warnx(GVINUMMOD " unloaded");
+	printf("done\n");
 	exit(0);

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 17:36:56 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C14731065677;
	Sat, 28 Mar 2009 17:36:56 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 94F7C8FC15;
	Sat, 28 Mar 2009 17:36:56 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2SHaunp008443;
	Sat, 28 Mar 2009 17:36:56 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2SHauPE008442;
	Sat, 28 Mar 2009 17:36:56 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200903281736.n2SHauPE008442@svn.freebsd.org>
From: Sam Leffler 
Date: Sat, 28 Mar 2009 17:36:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190508 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 17:36:57 -0000

Author: sam
Date: Sat Mar 28 17:36:56 2009
New Revision: 190508
URL: http://svn.freebsd.org/changeset/base/190508

Log:
  enable setting the mac address of 802.11 devices

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Sat Mar 28 17:20:08 2009	(r190507)
+++ head/sys/net/if.c	Sat Mar 28 17:36:56 2009	(r190508)
@@ -2749,6 +2749,7 @@ if_setlladdr(struct ifnet *ifp, const u_
 	case IFT_BRIDGE:
 	case IFT_ARCNET:
 	case IFT_IEEE8023ADLAG:
+	case IFT_IEEE80211:
 		bcopy(lladdr, LLADDR(sdl), len);
 		break;
 	default:

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 19:17:39 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D85371065679
	for ; Sat, 28 Mar 2009 19:17:39 +0000 (UTC)
	(envelope-from christoph.mallon@gmx.de)
Received: from mail.gmx.net (mail.gmx.net [213.165.64.20])
	by mx1.freebsd.org (Postfix) with SMTP id 26F878FC2B
	for ; Sat, 28 Mar 2009 19:17:38 +0000 (UTC)
	(envelope-from christoph.mallon@gmx.de)
Received: (qmail invoked by alias); 28 Mar 2009 19:17:37 -0000
Received: from p54A3EDAD.dip.t-dialin.net (EHLO tron.homeunix.org)
	[84.163.237.173]
	by mail.gmx.net (mp041) with SMTP; 28 Mar 2009 20:17:37 +0100
X-Authenticated: #1673122
X-Provags-ID: V01U2FsdGVkX18JgwchpFoJd7IFFL6aaY9bRRzdo1dQQjVIJNYWXE
	d4IQySN0FQi0QV
Message-ID: <49CE77CE.3040801@gmx.de>
Date: Sat, 28 Mar 2009 20:17:34 +0100
From: Christoph Mallon 
User-Agent: Thunderbird 2.0.0.19 (X11/20090103)
MIME-Version: 1.0
To: Julian Elischer 
References: <49C5737F.1050902@gmx.de>	<20090321.175756.-434257642.imp@bsdimp.com>	<49C5F88C.3070600@freebsd.org>
	<20090322.070349.195750067.imp@bsdimp.com>
	<49C68197.1060204@elischer.org>
In-Reply-To: <49C68197.1060204@elischer.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
X-FuHaFi: 0.66
Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, avg@FreeBSD.org,
	marius@alchemy.franken.de, svn-src-head@FreeBSD.org,
	"M. Warner Losh" 
Subject: Re: svn commit: r190098 - in head/sys/sparc64: fhc sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 19:17:40 -0000

Julian Elischer schrieb:
> M. Warner Losh wrote:
>> In message: <49C5F88C.3070600@freebsd.org>
>>             Andriy Gapon  writes:
>> : E.g. you can have a simple 3 line block where you need a local variable
>> : but that block is located 50 lines from start of an enclosing function.
>> : Very convenient when you need to quickly glance the variable's type 
>> (not).
>>
>> No you don't.  There's absolutely nothing wrong with putting them at
>> the top.  In fact, it is simpler, really, than having to go hunting
>> for dozens of different declarations.  As someone who has spent a lot
>> of time looking at code, the time wasted looking for these damn-fool
>> things really adds up.
> 
> and in a complicated function, if you have them all over the place you 
> have no idea as to what the potential stack usage of the function is..
> This matters in the kernel.

The declared local variables are neither a lower *nor* an upper bound 
for stack usage.

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 20:59:26 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4E298106564A;
	Sat, 28 Mar 2009 20:59:26 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3C7098FC16;
	Sat, 28 Mar 2009 20:59:26 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2SKxQhE012532;
	Sat, 28 Mar 2009 20:59:26 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2SKxQmh012531;
	Sat, 28 Mar 2009 20:59:26 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200903282059.n2SKxQmh012531@svn.freebsd.org>
From: Warner Losh 
Date: Sat, 28 Mar 2009 20:59:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190512 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 20:59:26 -0000

Author: imp
Date: Sat Mar 28 20:59:25 2009
New Revision: 190512
URL: http://svn.freebsd.org/changeset/base/190512

Log:
  Update to include Toshiba LANCT00A card being supported, as well as a
  caution that while the Mitsubishi M8895 has a DP83902, its ASIC is
  undocumented and doens't work with either the NE2000 or the WD80x3
  drivers.

Modified:
  head/share/man/man4/ed.4

Modified: head/share/man/man4/ed.4
==============================================================================
--- head/share/man/man4/ed.4	Sat Mar 28 19:47:46 2009	(r190511)
+++ head/share/man/man4/ed.4	Sat Mar 28 20:59:25 2009	(r190512)
@@ -30,7 +30,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 27, 2008
+.Dd March 28, 2009
 .Dt ED 4
 .Os
 .Sh NAME
@@ -299,6 +299,8 @@ TDK DFL5610WS Ethernet/Modem PC Card
 .It
 Telecom Device SuperSocket RE450T
 .It
+Toshiba LANCT00A PC Card
+.It
 VIA VT86C926
 .It
 Winbond W89C940
@@ -307,6 +309,15 @@ Winbond W89C940F
 .El
 .Pp
 C-Bus, ISA, PCI and PC Card devices are supported.
+.Pp
+The
+.Nm
+driver does not support the following Ethernet NICs:
+.Pp
+.Bl -bullet -compact
+.It
+Mitsubishi LAN Adapter B8895
+.El
 .Sh DIAGNOSTICS
 .Bl -diag
 .It "ed%d: failed to clear shared memory at %x - check configuration."
@@ -390,6 +401,10 @@ work in 8bit mode, much higher performan
 In addition, you should also specify
 .Cd "iosiz 16384"
 to take advantage of the extra 8K of shared memory that 16bit mode provides.
+.Pp
+The Mitsubishi B8895 PC Card uses a DP83902, but its ASIC part is
+undocumented.
+Neither the NE2000 nor the WD83x0 drivers work with this card.
 .Sh SEE ALSO
 .Xr altq 4 ,
 .Xr arp 4 ,

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 21:06:59 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DAC31106564A;
	Sat, 28 Mar 2009 21:06:59 +0000 (UTC)
	(envelope-from lulf@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C74938FC19;
	Sat, 28 Mar 2009 21:06:59 +0000 (UTC)
	(envelope-from lulf@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2SL6xwO012750;
	Sat, 28 Mar 2009 21:06:59 GMT (envelope-from lulf@svn.freebsd.org)
Received: (from lulf@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2SL6xqF012748;
	Sat, 28 Mar 2009 21:06:59 GMT (envelope-from lulf@svn.freebsd.org)
Message-Id: <200903282106.n2SL6xqF012748@svn.freebsd.org>
From: Ulf Lilleengen 
Date: Sat, 28 Mar 2009 21:06:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190513 - head/sys/geom/vinum
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 21:07:00 -0000

Author: lulf
Date: Sat Mar 28 21:06:59 2009
New Revision: 190513
URL: http://svn.freebsd.org/changeset/base/190513

Log:
  - Add files that should have been added in r190507.

Added:
  head/sys/geom/vinum/geom_vinum_create.c   (contents, props changed)
  head/sys/geom/vinum/geom_vinum_events.c   (contents, props changed)

Added: head/sys/geom/vinum/geom_vinum_create.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/geom/vinum/geom_vinum_create.c	Sat Mar 28 21:06:59 2009	(r190513)
@@ -0,0 +1,614 @@
+/*-
+ * Copyright (c) 2007 Lukas Ertl
+ * Copyright (c) 2007, 2009 Ulf Lilleengen
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#define DEFAULT_STRIPESIZE	262144
+
+/*
+ * Create a new drive object, either by user request, during taste of the drive
+ * itself, or because it was referenced by a subdisk during taste.
+ */
+int
+gv_create_drive(struct gv_softc *sc, struct gv_drive *d)
+{
+	struct g_geom *gp;
+	struct g_provider *pp;
+	struct g_consumer *cp, *cp2;
+	struct gv_drive *d2;
+	struct gv_hdr *hdr;
+	struct gv_freelist *fl;
+
+	KASSERT(d != NULL, ("gv_create_drive: NULL d"));
+
+	gp = sc->geom;
+
+	pp = NULL;
+	cp = cp2 = NULL;
+
+	/* The drive already has a consumer if it was tasted before. */
+	if (d->consumer != NULL) {
+		cp = d->consumer;
+		cp->private = d;
+		pp = cp->provider;
+	} else if (!(d->flags & GV_DRIVE_REFERENCED)) {
+		if (gv_find_drive(sc, d->name) != NULL) {
+			G_VINUM_DEBUG(0, "drive '%s' already exists", d->name);
+			g_free(d);
+			return (GV_ERR_CREATE);
+		}
+
+		if (gv_find_drive_device(sc, d->device) != NULL) {
+			G_VINUM_DEBUG(0, "provider '%s' already in use by "
+			    "gvinum", d->device);
+			return (GV_ERR_CREATE);
+		}
+
+		pp = g_provider_by_name(d->device);
+		if (pp == NULL) {
+			G_VINUM_DEBUG(0, "create '%s': device '%s' disappeared",
+			    d->name, d->device);
+			g_free(d);
+			return (GV_ERR_CREATE);
+		}
+
+		g_topology_lock();
+		cp = g_new_consumer(gp);
+		if (g_attach(cp, pp) != 0) {
+			g_destroy_consumer(cp);
+			g_topology_unlock();
+			G_VINUM_DEBUG(0, "create drive '%s': couldn't attach",
+			    d->name);
+			g_free(d);
+			return (GV_ERR_CREATE);
+		}
+		g_topology_unlock();
+
+		d->consumer = cp;
+		cp->private = d;
+	}
+
+	/*
+	 * If this was just a "referenced" drive, we're almost finished, but
+	 * insert this drive not on the head of the drives list, as
+	 * gv_drive_is_newer() expects a "real" drive from LIST_FIRST().
+	 */
+	if (d->flags & GV_DRIVE_REFERENCED) {
+		snprintf(d->device, sizeof(d->device), "???");
+		d2 = LIST_FIRST(&sc->drives);
+		if (d2 == NULL)
+			LIST_INSERT_HEAD(&sc->drives, d, drive);
+		else
+			LIST_INSERT_AFTER(d2, d, drive);
+		return (0);
+	}
+
+	/*
+	 * Update access counts of the new drive to those of an already
+	 * existing drive.
+	 */
+	LIST_FOREACH(d2, &sc->drives, drive) {
+		if ((d == d2) || (d2->consumer == NULL))
+			continue;
+
+		cp2 = d2->consumer;
+		g_topology_lock();
+		if ((cp2->acr || cp2->acw || cp2->ace) &&
+		    (g_access(cp, cp2->acr, cp2->acw, cp2->ace) != 0)) {
+			g_detach(cp);
+			g_destroy_consumer(cp);
+			g_topology_unlock();
+			G_VINUM_DEBUG(0, "create drive '%s': couldn't update "
+			    "access counts", d->name);
+			if (d->hdr != NULL)
+				g_free(d->hdr);
+			g_free(d);
+			return (GV_ERR_CREATE);
+		}
+		g_topology_unlock();
+		break;
+	}
+
+	d->size = pp->mediasize - GV_DATA_START;
+	d->avail = d->size;
+	d->vinumconf = sc;
+	LIST_INIT(&d->subdisks);
+	LIST_INIT(&d->freelist);
+
+	/* The header might have been set during taste. */
+	if (d->hdr == NULL) {
+		hdr = g_malloc(sizeof(*hdr), M_WAITOK | M_ZERO);
+		hdr->magic = GV_MAGIC;
+		hdr->config_length = GV_CFG_LEN;
+		mtx_lock(&hostname_mtx);
+		bcopy(G_hostname, hdr->label.sysname, GV_HOSTNAME_LEN);
+		mtx_unlock(&hostname_mtx);
+		strlcpy(hdr->label.name, d->name, sizeof(hdr->label.name));
+		microtime(&hdr->label.date_of_birth);
+		d->hdr = hdr;
+	}
+
+	/* We also need a freelist entry. */
+	fl = g_malloc(sizeof(struct gv_freelist), M_WAITOK | M_ZERO);
+	fl->offset = GV_DATA_START;
+	fl->size = d->avail;
+	LIST_INSERT_HEAD(&d->freelist, fl, freelist);
+	d->freelist_entries = 1;
+
+	if (gv_find_drive(sc, d->name) == NULL)
+		LIST_INSERT_HEAD(&sc->drives, d, drive);
+
+	gv_set_drive_state(d, GV_DRIVE_UP, 0);
+	return (0);
+}
+
+int
+gv_create_volume(struct gv_softc *sc, struct gv_volume *v)
+{
+	KASSERT(v != NULL, ("gv_create_volume: NULL v"));
+
+	v->vinumconf = sc;
+	v->flags |= GV_VOL_NEWBORN;
+	LIST_INIT(&v->plexes);
+	LIST_INSERT_HEAD(&sc->volumes, v, volume);
+	v->wqueue = g_malloc(sizeof(struct bio_queue_head), M_WAITOK | M_ZERO);
+	bioq_init(v->wqueue);
+	return (0);
+}
+
+int
+gv_create_plex(struct gv_softc *sc, struct gv_plex *p)
+{
+	struct gv_volume *v;
+
+	KASSERT(p != NULL, ("gv_create_plex: NULL p"));
+
+	/* Find the volume this plex should be attached to. */
+	v = gv_find_vol(sc, p->volume);
+	if (v == NULL) {
+		G_VINUM_DEBUG(0, "create plex '%s': volume '%s' not found",
+		    p->name, p->volume);
+		g_free(p);
+		return (GV_ERR_CREATE);
+	}
+	if (!(v->flags & GV_VOL_NEWBORN))
+		p->flags |= GV_PLEX_ADDED;
+	p->vol_sc = v;
+	v->plexcount++;
+	p->vinumconf = sc;
+	p->synced = 0;
+	p->flags |= GV_PLEX_NEWBORN;
+	LIST_INSERT_HEAD(&v->plexes, p, in_volume);
+	LIST_INIT(&p->subdisks);
+	TAILQ_INIT(&p->packets);
+	LIST_INSERT_HEAD(&sc->plexes, p, plex);
+	p->bqueue = g_malloc(sizeof(struct bio_queue_head), M_WAITOK | M_ZERO);
+	bioq_init(p->bqueue);
+	p->wqueue = g_malloc(sizeof(struct bio_queue_head), M_WAITOK | M_ZERO);
+	bioq_init(p->wqueue);
+	p->rqueue = g_malloc(sizeof(struct bio_queue_head), M_WAITOK | M_ZERO);
+	bioq_init(p->rqueue);
+	return (0);
+}
+
+int
+gv_create_sd(struct gv_softc *sc, struct gv_sd *s)
+{
+	struct gv_plex *p;
+	struct gv_drive *d;
+
+	KASSERT(s != NULL, ("gv_create_sd: NULL s"));
+
+	/* Find the drive where this subdisk should be put on. */
+	d = gv_find_drive(sc, s->drive);
+	if (d == NULL) {
+		/*
+		 * It's possible that the subdisk references a drive that
+		 * doesn't exist yet (during the taste process), so create a
+		 * practically empty "referenced" drive.
+		 */
+		if (s->flags & GV_SD_TASTED) {
+			d = g_malloc(sizeof(struct gv_drive),
+			    M_WAITOK | M_ZERO);
+			d->flags |= GV_DRIVE_REFERENCED;
+			strlcpy(d->name, s->drive, sizeof(d->name));
+			gv_create_drive(sc, d);
+		} else {
+			G_VINUM_DEBUG(0, "create sd '%s': drive '%s' not found",
+			    s->name, s->drive);
+			g_free(s);
+			return (GV_ERR_CREATE);
+		}
+	}
+
+	/* Find the plex where this subdisk belongs to. */
+	p = gv_find_plex(sc, s->plex);
+	if (p == NULL) {
+		G_VINUM_DEBUG(0, "create sd '%s': plex '%s' not found",
+		    s->name, s->plex);
+		g_free(s);
+		return (GV_ERR_CREATE);
+	}
+
+	/*
+	 * First we give the subdisk to the drive, to handle autosized
+	 * values ...
+	 */
+	if (gv_sd_to_drive(s, d) != 0) {
+		g_free(s);
+		return (GV_ERR_CREATE);
+	}
+
+	/*
+	 * Then, we give the subdisk to the plex; we check if the
+	 * given values are correct and maybe adjust them.
+	 */
+	if (gv_sd_to_plex(s, p) != 0) {
+		G_VINUM_DEBUG(0, "unable to give sd '%s' to plex '%s'",
+		    s->name, p->name);
+		if (s->drive_sc && !(s->drive_sc->flags & GV_DRIVE_REFERENCED))
+			LIST_REMOVE(s, from_drive);
+		gv_free_sd(s);
+		g_free(s);
+		/*
+		 * If this subdisk can't be created, we won't create
+		 * the attached plex either, if it is also a new one.
+		 */
+		if (!(p->flags & GV_PLEX_NEWBORN))
+			return (GV_ERR_CREATE);
+		gv_rm_plex(sc, p);
+		return (GV_ERR_CREATE);
+	}
+	s->flags |= GV_SD_NEWBORN;
+
+	s->vinumconf = sc;
+	LIST_INSERT_HEAD(&sc->subdisks, s, sd);
+
+	return (0);
+}
+
+/*
+ * Create a concatenated volume from specified drives or drivegroups.
+ */
+void
+gv_concat(struct g_geom *gp, struct gctl_req *req)
+{
+	struct gv_drive *d;
+	struct gv_sd *s;
+	struct gv_volume *v;
+	struct gv_plex *p;
+	struct gv_softc *sc;
+	char *drive, buf[30], *vol;
+	int *drives, *flags, dcount;
+
+	sc = gp->softc;
+	dcount = 0;
+	vol = gctl_get_param(req, "name", NULL);
+	if (vol == NULL) {
+		gctl_error(req, "volume names not given");	
+		return;
+	}
+
+	flags = gctl_get_paraml(req, "flags", sizeof(*flags));
+	drives = gctl_get_paraml(req, "drives", sizeof(*drives));
+
+	if (drives == NULL) { 
+		gctl_error(req, "drive names not given");
+		return;
+	}
+
+	/* First we create the volume. */
+	v = g_malloc(sizeof(*v), M_WAITOK | M_ZERO);
+	strlcpy(v->name, vol, sizeof(v->name));
+	v->state = GV_VOL_UP;
+	gv_post_event(sc, GV_EVENT_CREATE_VOLUME, v, NULL, 0, 0);
+
+	/* Then we create the plex. */
+	p = g_malloc(sizeof(*p), M_WAITOK | M_ZERO);
+	snprintf(p->name, sizeof(p->name), "%s.p%d", v->name, v->plexcount);
+	strlcpy(p->volume, v->name, sizeof(p->volume));
+	p->org = GV_PLEX_CONCAT;
+	p->stripesize = 0;
+	gv_post_event(sc, GV_EVENT_CREATE_PLEX, p, NULL, 0, 0);
+
+	/* Drives are first (right now) priority */
+	for (dcount = 0; dcount < *drives; dcount++) {
+		snprintf(buf, sizeof(buf), "drive%d", dcount);
+		drive = gctl_get_param(req, buf, NULL);
+		d = gv_find_drive(sc, drive);
+		if (d == NULL) {
+			gctl_error(req, "No such drive '%s'", drive);
+			continue;
+		}
+		s = g_malloc(sizeof(*s), M_WAITOK | M_ZERO);
+		snprintf(s->name, sizeof(s->name), "%s.s%d", p->name, dcount);
+		strlcpy(s->plex, p->name, sizeof(s->plex));
+		strlcpy(s->drive, drive, sizeof(s->drive));
+		s->plex_offset = -1;
+		s->drive_offset = -1;
+		s->size = -1;
+		gv_post_event(sc, GV_EVENT_CREATE_SD, s, NULL, 0, 0);
+	}
+	gv_post_event(sc, GV_EVENT_SETUP_OBJECTS, sc, NULL, 0, 0);
+	gv_post_event(sc, GV_EVENT_SAVE_CONFIG, sc, NULL, 0, 0);
+}
+
+/*
+ * Create a mirrored volume from specified drives or drivegroups.
+ */
+void
+gv_mirror(struct g_geom *gp, struct gctl_req *req)
+{
+	struct gv_drive *d;
+	struct gv_sd *s;
+	struct gv_volume *v;
+	struct gv_plex *p;
+	struct gv_softc *sc;
+	char *drive, buf[30], *vol;
+	int *drives, *flags, dcount, pcount, scount;
+
+	sc = gp->softc;
+	dcount = 0;
+	scount = 0;
+	pcount = 0;
+	vol = gctl_get_param(req, "name", NULL);
+	if (vol == NULL) {
+		gctl_error(req, "volume's not given");	
+		return;
+	}
+
+	flags = gctl_get_paraml(req, "flags", sizeof(*flags));
+	drives = gctl_get_paraml(req, "drives", sizeof(*drives));
+
+	if (drives == NULL) { 
+		gctl_error(req, "drives not given");
+		return;
+	}
+
+	/* We must have an even number of drives. */
+	if (*drives % 2 != 0) {
+		gctl_error(req, "mirror organization must have an even number "
+		    "of drives");
+		return;
+	}
+	if (*flags & GV_FLAG_S && *drives < 4) {
+		gctl_error(req, "must have at least 4 drives for striped plex");
+		return;
+	}
+
+	/* First we create the volume. */
+	v = g_malloc(sizeof(*v), M_WAITOK | M_ZERO);
+	strlcpy(v->name, vol, sizeof(v->name));
+	v->state = GV_VOL_UP;
+	gv_post_event(sc, GV_EVENT_CREATE_VOLUME, v, NULL, 0, 0);
+
+	/* Then we create the plexes. */
+	for (pcount = 0; pcount < 2; pcount++) {
+		p = g_malloc(sizeof(*p), M_WAITOK | M_ZERO);
+		snprintf(p->name, sizeof(p->name), "%s.p%d", v->name,
+		    pcount);
+		strlcpy(p->volume, v->name, sizeof(p->volume));
+		if (*flags & GV_FLAG_S) {
+			p->org = GV_PLEX_STRIPED;
+			p->stripesize = DEFAULT_STRIPESIZE;
+		} else {
+			p->org = GV_PLEX_CONCAT;
+			p->stripesize = -1;
+		}
+		gv_post_event(sc, GV_EVENT_CREATE_PLEX, p, NULL, 0, 0);
+
+		/*
+		 * We just gives each even drive to plex one, and each odd to
+		 * plex two.
+		 */
+		scount = 0;
+		for (dcount = pcount; dcount < *drives; dcount += 2) {
+			snprintf(buf, sizeof(buf), "drive%d", dcount);
+			drive = gctl_get_param(req, buf, NULL);
+			d = gv_find_drive(sc, drive);
+			if (d == NULL) {
+				gctl_error(req, "No such drive '%s', aborting",
+				    drive);
+				scount++;
+				break;
+			}
+			s = g_malloc(sizeof(*s), M_WAITOK | M_ZERO);
+			snprintf(s->name, sizeof(s->name), "%s.s%d", p->name,
+			    scount);
+			strlcpy(s->plex, p->name, sizeof(s->plex));
+			strlcpy(s->drive, drive, sizeof(s->drive));
+			s->plex_offset = -1;
+			s->drive_offset = -1;
+			s->size = -1;
+			gv_post_event(sc, GV_EVENT_CREATE_SD, s, NULL, 0, 0);
+			scount++;
+		}
+	}
+	gv_post_event(sc, GV_EVENT_SETUP_OBJECTS, sc, NULL, 0, 0);
+	gv_post_event(sc, GV_EVENT_SAVE_CONFIG, sc, NULL, 0, 0);
+}
+
+void
+gv_raid5(struct g_geom *gp, struct gctl_req *req)
+{
+	struct gv_softc *sc;
+	struct gv_drive *d;
+	struct gv_volume *v;
+	struct gv_plex *p;
+	struct gv_sd *s;
+	int *drives, *flags, dcount;
+	char *vol, *drive, buf[30];
+	off_t *stripesize;
+
+	dcount = 0;
+	sc = gp->softc;
+
+	vol = gctl_get_param(req, "name", NULL);
+	if (vol == NULL) {
+		gctl_error(req, "volume's not given");
+		return;
+	}
+	flags = gctl_get_paraml(req, "flags", sizeof(*flags));
+	drives = gctl_get_paraml(req, "drives", sizeof(*drives));
+	stripesize = gctl_get_paraml(req, "stripesize", sizeof(*stripesize));
+
+	if (stripesize == NULL) {
+		gctl_error(req, "no stripesize given");
+		return;
+	}
+
+	if (drives == NULL) {
+		gctl_error(req, "drives not given");
+		return;
+	}
+
+	/* We must have at least three drives. */
+	if (*drives < 3) {
+		gctl_error(req, "must have at least three drives for this "
+		    "plex organisation");
+		return;
+	}
+	/* First we create the volume. */
+	v = g_malloc(sizeof(*v), M_WAITOK | M_ZERO);
+	strlcpy(v->name, vol, sizeof(v->name));
+	v->state = GV_VOL_UP;
+	gv_post_event(sc, GV_EVENT_CREATE_VOLUME, v, NULL, 0, 0);
+
+	/* Then we create the plex. */
+	p = g_malloc(sizeof(*p), M_WAITOK | M_ZERO);
+	snprintf(p->name, sizeof(p->name), "%s.p%d", v->name, v->plexcount);
+	strlcpy(p->volume, v->name, sizeof(p->volume));
+	p->org = GV_PLEX_RAID5;
+	p->stripesize = *stripesize;
+	gv_post_event(sc, GV_EVENT_CREATE_PLEX, p, NULL, 0, 0);
+
+	/* Create subdisks on drives. */
+	for (dcount = 0; dcount < *drives; dcount++) {
+		snprintf(buf, sizeof(buf), "drive%d", dcount);
+		drive = gctl_get_param(req, buf, NULL);
+		d = gv_find_drive(sc, drive);
+		if (d == NULL) {
+			gctl_error(req, "No such drive '%s'", drive);
+			continue;
+		}
+		s = g_malloc(sizeof(*s), M_WAITOK | M_ZERO);
+		snprintf(s->name, sizeof(s->name), "%s.s%d", p->name, dcount);
+		strlcpy(s->plex, p->name, sizeof(s->plex));
+		strlcpy(s->drive, drive, sizeof(s->drive));
+		s->plex_offset = -1;
+		s->drive_offset = -1;
+		s->size = -1;
+		gv_post_event(sc, GV_EVENT_CREATE_SD, s, NULL, 0, 0);
+	}
+	gv_post_event(sc, GV_EVENT_SETUP_OBJECTS, sc, NULL, 0, 0);
+	gv_post_event(sc, GV_EVENT_SAVE_CONFIG, sc, NULL, 0, 0);
+}
+
+/*
+ * Create a striped volume from specified drives or drivegroups.
+ */
+void
+gv_stripe(struct g_geom *gp, struct gctl_req *req)
+{
+	struct gv_drive *d;
+	struct gv_sd *s;
+	struct gv_volume *v;
+	struct gv_plex *p;
+	struct gv_softc *sc;
+	char *drive, buf[30], *vol;
+	int *drives, *flags, dcount, pcount;
+
+	sc = gp->softc;
+	dcount = 0;
+	pcount = 0;
+	vol = gctl_get_param(req, "name", NULL);
+	if (vol == NULL) {
+		gctl_error(req, "volume's not given");	
+		return;
+	}
+	flags = gctl_get_paraml(req, "flags", sizeof(*flags));
+	drives = gctl_get_paraml(req, "drives", sizeof(*drives));
+
+	if (drives == NULL) { 
+		gctl_error(req, "drives not given");
+		return;
+	}
+
+	/* We must have at least two drives. */
+	if (*drives < 2) {
+		gctl_error(req, "must have at least 2 drives");
+		return;
+	}
+
+	/* First we create the volume. */
+	v = g_malloc(sizeof(*v), M_WAITOK | M_ZERO);
+	strlcpy(v->name, vol, sizeof(v->name));
+	v->state = GV_VOL_UP;
+	gv_post_event(sc, GV_EVENT_CREATE_VOLUME, v, NULL, 0, 0);
+
+	/* Then we create the plex. */
+	p = g_malloc(sizeof(*p), M_WAITOK | M_ZERO);
+	snprintf(p->name, sizeof(p->name), "%s.p%d", v->name, v->plexcount);
+	strlcpy(p->volume, v->name, sizeof(p->volume));
+	p->org = GV_PLEX_STRIPED;
+	p->stripesize = 262144;
+	gv_post_event(sc, GV_EVENT_CREATE_PLEX, p, NULL, 0, 0);
+
+	/* Create subdisks on drives. */
+	for (dcount = 0; dcount < *drives; dcount++) {
+		snprintf(buf, sizeof(buf), "drive%d", dcount);
+		drive = gctl_get_param(req, buf, NULL);
+		d = gv_find_drive(sc, drive);
+		if (d == NULL) {
+			gctl_error(req, "No such drive '%s'", drive);
+			continue;
+		}
+		s = g_malloc(sizeof(*s), M_WAITOK | M_ZERO);
+		snprintf(s->name, sizeof(s->name), "%s.s%d", p->name, dcount);
+		strlcpy(s->plex, p->name, sizeof(s->plex));
+		strlcpy(s->drive, drive, sizeof(s->drive));
+		s->plex_offset = -1;
+		s->drive_offset = -1;
+		s->size = -1;
+		gv_post_event(sc, GV_EVENT_CREATE_SD, s, NULL, 0, 0);
+	}
+	gv_post_event(sc, GV_EVENT_SETUP_OBJECTS, sc, NULL, 0, 0);
+	gv_post_event(sc, GV_EVENT_SAVE_CONFIG, sc, NULL, 0, 0);
+}

Added: head/sys/geom/vinum/geom_vinum_events.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/geom/vinum/geom_vinum_events.c	Sat Mar 28 21:06:59 2009	(r190513)
@@ -0,0 +1,217 @@
+/*-
+ *  Copyright (c) 2007 Lukas Ertl
+ *  All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+void
+gv_post_event(struct gv_softc *sc, int event, void *arg1, void *arg2,
+    intmax_t arg3, intmax_t arg4)
+{
+	struct gv_event *ev;
+
+	ev = g_malloc(sizeof(*ev), M_WAITOK | M_ZERO);
+	ev->type = event;
+	ev->arg1 = arg1;
+	ev->arg2 = arg2;
+	ev->arg3 = arg3;
+	ev->arg4 = arg4;
+
+	mtx_lock(&sc->queue_mtx);
+	TAILQ_INSERT_TAIL(&sc->equeue, ev, events);
+	wakeup(sc);
+	mtx_unlock(&sc->queue_mtx);
+}
+
+void
+gv_drive_tasted(struct gv_softc *sc, struct g_provider *pp)
+{
+	struct g_geom *gp;
+	struct g_consumer *cp;
+	struct gv_hdr *hdr;
+	struct gv_drive *d;
+	char *buf;
+	int error;
+
+	hdr = NULL;
+	buf = NULL;
+
+	G_VINUM_DEBUG(2, "tasted drive on '%s'", pp->name);
+
+	gp = sc->geom;
+	g_topology_lock();
+	cp = g_new_consumer(gp);
+	if (g_attach(cp, pp) != 0) {
+		g_destroy_consumer(cp);
+		g_topology_unlock();
+		G_VINUM_DEBUG(0, "failed to attach to provider on taste event");
+		return;
+	}
+	if (g_access(cp, 1, 0, 0) != 0) {
+		g_detach(cp);
+		g_destroy_consumer(cp);
+		g_topology_unlock();
+		G_VINUM_DEBUG(0, "failed to access consumer on taste event");
+		return;
+	}
+	g_topology_unlock();
+
+	hdr = g_malloc(GV_HDR_LEN, M_WAITOK | M_ZERO);
+	/* Read header and on-disk configuration. */
+	error = gv_read_header(cp, hdr);
+	if (error) {
+		G_VINUM_DEBUG(0, "failed to read header during taste");
+		goto failed;
+	}
+
+	/*
+	 * Setup the drive before we parse the on-disk configuration, so that
+	 * we already know about the drive then.
+	 */
+	d = gv_find_drive(sc, hdr->label.name);
+	if (d == NULL) {
+		d = g_malloc(sizeof(*d), M_WAITOK | M_ZERO);
+		strlcpy(d->name, hdr->label.name, sizeof(d->name));
+		strlcpy(d->device, pp->name, sizeof(d->device));
+	} else if (d->flags & GV_DRIVE_REFERENCED) {
+		strlcpy(d->device, pp->name, sizeof(d->device));
+		d->flags &= ~GV_DRIVE_REFERENCED;
+	} else {
+		G_VINUM_DEBUG(2, "drive '%s' is already known", d->name);
+		goto failed;
+	}
+
+	/* Add the consumer and header to the new drive. */
+	d->consumer = cp;
+	d->hdr = hdr;
+	gv_create_drive(sc, d);
+
+	buf = g_read_data(cp, GV_CFG_OFFSET, GV_CFG_LEN, NULL);
+	if (buf == NULL) {
+		G_VINUM_DEBUG(0, "failed to read config during taste");
+		goto failed;
+	}
+	gv_parse_config(sc, buf, d);
+	g_free(buf);
+
+	g_topology_lock();
+	g_access(cp, -1, 0, 0);
+	g_topology_unlock();
+
+	gv_setup_objects(sc);
+	gv_set_drive_state(d, GV_DRIVE_UP, 0);
+
+	return;
+
+failed:
+	if (hdr != NULL)
+		g_free(hdr);
+	g_topology_lock();
+	g_access(cp, -1, 0, 0);
+	g_detach(cp);
+	g_destroy_consumer(cp);
+	g_topology_unlock();
+}
+
+/*
+ * When losing a drive (e.g. hardware failure), we cut down the consumer
+ * attached to the underlying device and bring the drive itself to a
+ * "referenced" state so that normal tasting could bring it up cleanly if it
+ * possibly arrives again.
+ */
+void
+gv_drive_lost(struct gv_softc *sc, struct gv_drive *d)
+{
+	struct g_consumer *cp;
+	struct gv_drive *d2;
+	struct gv_sd *s, *s2;
+	struct gv_freelist *fl, *fl2;
+
+	gv_set_drive_state(d, GV_DRIVE_DOWN,
+	    GV_SETSTATE_FORCE | GV_SETSTATE_CONFIG);
+
+	cp = d->consumer;
+
+	if (cp != NULL) {
+		if (cp->nstart != cp->nend) {
+			G_VINUM_DEBUG(0, "dead drive '%s' has still active "
+			    "requests, can't detach consumer", d->name);
+			gv_post_event(sc, GV_EVENT_DRIVE_LOST, d, NULL, 0, 0);
+			return;
+		}
+		g_topology_lock();
+		if (cp->acr != 0 || cp->acw != 0 || cp->ace != 0)
+			g_access(cp, -cp->acr, -cp->acw, -cp->ace);
+		g_detach(cp);
+		g_destroy_consumer(cp);
+		g_topology_unlock();
+	}
+
+	LIST_FOREACH_SAFE(fl, &d->freelist, freelist, fl2) {
+		LIST_REMOVE(fl, freelist);
+		g_free(fl);
+	}
+
+	d->consumer = NULL;
+	g_free(d->hdr);
+	d->hdr = NULL;
+	d->flags |= GV_DRIVE_REFERENCED;
+	snprintf(d->device, sizeof(d->device), "???");
+	d->size = 0;
+	d->avail = 0;
+	d->freelist_entries = 0;
+	d->sdcount = 0;
+
+	/* Put the subdisk in tasted mode, and remove from drive list. */
+	LIST_FOREACH_SAFE(s, &d->subdisks, from_drive, s2) {
+		LIST_REMOVE(s, from_drive);
+		s->flags |= GV_SD_TASTED;
+	}
+
+	/*
+	 * Don't forget that gv_is_newer wants a "real" drive at the beginning
+	 * of the list, so, just to be safe, we shuffle around.
+	 */
+	LIST_REMOVE(d, drive);
+	d2 = LIST_FIRST(&sc->drives);
+	if (d2 == NULL)
+		LIST_INSERT_HEAD(&sc->drives, d, drive);
+	else
+		LIST_INSERT_AFTER(d2, d, drive);
+	gv_save_config(sc);
+}

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 23:17:21 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 414A310656C4;
	Sat, 28 Mar 2009 23:17:21 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AC07B8FC14;
	Sat, 28 Mar 2009 23:17:18 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2SNHIXP015203;
	Sat, 28 Mar 2009 23:17:18 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2SNHIjI015202;
	Sat, 28 Mar 2009 23:17:18 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200903282317.n2SNHIjI015202@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 28 Mar 2009 23:17:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190514 - head/sys/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 23:17:22 -0000

Author: bz
Date: Sat Mar 28 23:17:18 2009
New Revision: 190514
URL: http://svn.freebsd.org/changeset/base/190514

Log:
  For kernel builds reduce the impact of svnversion, just scanning
  src/sys and not the entire src/ tree.
  
  An earlier solution by peter had been comitted in r183528 and backed out
  in r183566 due to problems with newvers.sh also called from other places
  during world build. With the extra test this survived a make universe.

Modified:
  head/sys/conf/newvers.sh

Modified: head/sys/conf/newvers.sh
==============================================================================
--- head/sys/conf/newvers.sh	Sat Mar 28 21:06:59 2009	(r190513)
+++ head/sys/conf/newvers.sh	Sat Mar 28 23:17:18 2009	(r190514)
@@ -100,7 +100,13 @@ for dir in /bin /usr/bin /usr/local/bin;
 done
 
 if [ -n "$svnversion" -a -d "${SRCDIR}/.svn" ] ; then
-	svn=" r`cd $SRCDIR && $svnversion`"
+	# If we are called from the kernel build, limit
+	# the scope of svnversion to sys/ .
+	if [ -e "${SRCDIR}/sys/conf/newvers.sh" ] ; then
+		svn=" r`cd $SRCDIR/sys && $svnversion`"
+	else
+		svn=" r`cd $SRCDIR && $svnversion`"
+	fi
 else
 	svn=""
 fi

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 28 23:24:34 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 80730106566B;
	Sat, 28 Mar 2009 23:24:34 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6F40B8FC08;
	Sat, 28 Mar 2009 23:24:34 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2SNOY8x015383;
	Sat, 28 Mar 2009 23:24:34 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2SNOYmJ015382;
	Sat, 28 Mar 2009 23:24:34 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200903282324.n2SNOYmJ015382@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 28 Mar 2009 23:24:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190515 - head/sys/mips/include
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 23:24:34 -0000

Author: bz
Date: Sat Mar 28 23:24:34 2009
New Revision: 190515
URL: http://svn.freebsd.org/changeset/base/190515

Log:
  Mark the declaration of bus_space_map 'static' as the implementation is.
  Follow one of the two most common indent schemes in this file.
  This unbreaks a few mips kernel builds.

Modified:
  head/sys/mips/include/bus.h

Modified: head/sys/mips/include/bus.h
==============================================================================
--- head/sys/mips/include/bus.h	Sat Mar 28 23:17:18 2009	(r190514)
+++ head/sys/mips/include/bus.h	Sat Mar 28 23:24:34 2009	(r190515)
@@ -101,8 +101,9 @@
  * Map a region of device bus space into CPU virtual address space.
  */
 
-__inline int	bus_space_map(bus_space_tag_t t, bus_addr_t addr,
-		    bus_size_t size, int flags, bus_space_handle_t *bshp);
+static __inline int bus_space_map(bus_space_tag_t t, bus_addr_t addr,
+				  bus_size_t size, int flags,
+				  bus_space_handle_t *bshp);
 
 static __inline int
 bus_space_map(bus_space_tag_t t __unused, bus_addr_t addr,