From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 00:18:49 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 00:29:49 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 00:45:48 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 00:47:42 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 01:06:39 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 01:24:32 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 02:33:49 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 04:19:36 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 04:32:06 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 05:44:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 199E41065673; Sun, 22 Mar 2009 05:44:57 +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 05D838FC15; Sun, 22 Mar 2009 05:44:57 +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 n2M5iuie058243; Sun, 22 Mar 2009 05:44:56 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2M5iuAT058241; Sun, 22 Mar 2009 05:44:56 GMT (envelope-from das@svn.freebsd.org) Message-Id: <200903220544.n2M5iuAT058241@svn.freebsd.org> From: David Schultz Date: Sun, 22 Mar 2009 05:44:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190240 - stable/7/usr.bin/ncal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 05:44:57 -0000 Author: das Date: Sun Mar 22 05:44:56 2009 New Revision: 190240 URL: http://svn.freebsd.org/changeset/base/190240 Log: MFC r189804: Multibyte character support for cal(1). PR: 131578 Modified: stable/7/usr.bin/ncal/ (props changed) stable/7/usr.bin/ncal/ncal.1 stable/7/usr.bin/ncal/ncal.c Modified: stable/7/usr.bin/ncal/ncal.1 ============================================================================== --- stable/7/usr.bin/ncal/ncal.1 Sun Mar 22 04:32:05 2009 (r190239) +++ stable/7/usr.bin/ncal/ncal.1 Sun Mar 22 05:44:56 2009 (r190240) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 23, 2005 +.Dd March 14, 2009 .Dt CAL 1 .Os .Sh NAME @@ -134,7 +134,3 @@ command and manual were written by .Sh BUGS The assignment of Julian\(emGregorian switching dates to country codes is historically naive for many countries. -.Pp -The -.Nm -utility does not recognize multibyte characters. Modified: stable/7/usr.bin/ncal/ncal.c ============================================================================== --- stable/7/usr.bin/ncal/ncal.c Sun Mar 22 04:32:05 2009 (r190239) +++ stable/7/usr.bin/ncal/ncal.c Sun Mar 22 05:44:56 2009 (r190240) @@ -40,6 +40,8 @@ static const char rcsid[] = #include #include #include +#include +#include /* Width of one month with backward compatibility */ #define MONTH_WIDTH_B_J 27 @@ -53,13 +55,13 @@ static const char rcsid[] = typedef struct date date; struct monthlines { - char name[MAX_WIDTH + 1]; + wchar_t name[MAX_WIDTH + 1]; char lines[7][MAX_WIDTH + 1]; char weeks[MAX_WIDTH + 1]; }; struct weekdays { - char names[7][4]; + wchar_t names[7][4]; }; /* The switches from Julian to Gregorian in some countries */ @@ -159,6 +161,7 @@ int nswitch; /* user defined switch int nswitchb; /* switch date for backward compatibility */ char *center(char *s, char *t, int w); +wchar_t *wcenter(wchar_t *s, wchar_t *t, int w); void mkmonth(int year, int month, int jd_flag, struct monthlines * monthl); void mkmonthb(int year, int month, int jd_flag, struct monthlines * monthl); void mkweekdays(struct weekdays * wds); @@ -418,9 +421,9 @@ printmonth(int y, int m, int jd_flag) mkmonth(y, m - 1, jd_flag, &month); mkweekdays(&wds); - printf(" %s %d\n", month.name, y); + printf(" %ls %d\n", month.name, y); for (i = 0; i != 7; i++) - printf("%.2s%s\n", wds.names[i], month.lines[i]); + printf("%.2ls%s\n", wds.names[i], month.lines[i]); if (flag_weeks) printf(" %s\n", month.weeks); } @@ -430,7 +433,7 @@ printmonthb(int y, int m, int jd_flag) { struct monthlines month; struct weekdays wds; - char s[MAX_WIDTH], t[MAX_WIDTH]; + wchar_t s[MAX_WIDTH], t[MAX_WIDTH]; int i; int mw; @@ -439,16 +442,17 @@ printmonthb(int y, int m, int jd_flag) mw = jd_flag ? MONTH_WIDTH_B_J : MONTH_WIDTH_B; - sprintf(s, "%s %d", month.name, y); - printf("%s\n", center(t, s, mw)); + swprintf(s, MAX_WIDTH, L"%ls %d", month.name, y); + wprintf(L"%ls\n", wcenter(t, s, mw)); if (jd_flag) - printf(" %s %s %s %s %s %s %.2s\n", wds.names[6], wds.names[0], + wprintf(L" %ls %ls %ls %ls %ls %ls %.2ls\n", + wds.names[6], wds.names[0], wds.names[1], wds.names[2], wds.names[3], wds.names[4], wds.names[5]); else - printf("%s%s%s%s%s%s%.2s\n", wds.names[6], wds.names[0], - wds.names[1], wds.names[2], wds.names[3], + wprintf(L"%ls%ls%ls%ls%ls%ls%.2ls\n", wds.names[6], + wds.names[0], wds.names[1], wds.names[2], wds.names[3], wds.names[4], wds.names[5]); for (i = 0; i != 6; i++) @@ -475,17 +479,17 @@ printyear(int y, int jd_flag) printf("%s\n", center(t, s, mpl * mw)); for (j = 0; j != 12; j += mpl) { - printf(" %-*s%-*s", + printf(" %-*ls%-*ls", mw, year[j].name, mw, year[j + 1].name); if (mpl == 3) - printf("%s\n", year[j + 2].name); + printf("%ls\n", year[j + 2].name); else - printf("%-*s%s\n", + printf("%-*ls%ls\n", mw, year[j + 2].name, year[j + 3].name); for (i = 0; i != 7; i++) { - printf("%.2s%-*s%-*s", + printf("%.2ls%-*s%-*s", wds.names[i], mw, year[j].lines[i], mw, year[j + 1].lines[i]); @@ -518,6 +522,7 @@ printyearb(int y, int jd_flag) struct monthlines year[12]; struct weekdays wds; char s[80], t[80]; + wchar_t ws[80], wt[80]; int i, j; int mpl; int mw; @@ -532,17 +537,17 @@ printyearb(int y, int jd_flag) printf("%s\n\n", center(t, s, mw * mpl + mpl)); for (j = 0; j != 12; j += mpl) { - printf("%-*s ", mw, center(s, year[j].name, mw)); + printf("%-*ls ", mw, wcenter(ws, year[j].name, mw)); if (mpl == 2) - printf("%s\n", center(s, year[j + 1].name, mw)); + printf("%ls\n", wcenter(ws, year[j + 1].name, mw)); else - printf("%-*s %s\n", mw, - center(s, year[j + 1].name, mw), - center(t, year[j + 2].name, mw)); + printf("%-*ls %ls\n", mw, + wcenter(ws, year[j + 1].name, mw), + wcenter(wt, year[j + 2].name, mw)); if (mpl == 2) - printf(" %s %s %s %s %s %s %s " - " %s %s %s %s %s %s %.2s\n", + wprintf(L" %ls %ls %ls %ls %ls %ls %ls " + " %ls %ls %ls %ls %ls %ls %.2ls\n", wds.names[6], wds.names[0], wds.names[1], wds.names[2], wds.names[3], wds.names[4], wds.names[5], @@ -550,9 +555,9 @@ printyearb(int y, int jd_flag) wds.names[2], wds.names[3], wds.names[4], wds.names[5]); else - printf("%s%s%s%s%s%s%s " - "%s%s%s%s%s%s%s " - "%s%s%s%s%s%s%.2s\n", + wprintf(L"%ls%ls%ls%ls%ls%ls%ls " + "%ls%ls%ls%ls%ls%ls%ls " + "%ls%ls%ls%ls%ls%ls%.2ls\n", wds.names[6], wds.names[0], wds.names[1], wds.names[2], wds.names[3], wds.names[4], wds.names[5], @@ -596,8 +601,9 @@ mkmonth(int y, int m, int jd_flag, struc /* Set name of month. */ memset(&tm, 0, sizeof(tm)); tm.tm_mon = m; - strftime(mlines->name, sizeof(mlines->name), "%OB", &tm); - mlines->name[0] = toupper((unsigned char)mlines->name[0]); + wcsftime(mlines->name, sizeof(mlines->name) / sizeof(mlines->name[0]), + L"%OB", &tm); + mlines->name[0] = towupper(mlines->name[0]); /* * Set first and last to the day number of the first day of this @@ -688,8 +694,9 @@ mkmonthb(int y, int m, int jd_flag, stru /* Set name of month centered */ memset(&tm, 0, sizeof(tm)); tm.tm_mon = m; - strftime(mlines->name, sizeof(mlines->name), "%OB", &tm); - mlines->name[0] = toupper((unsigned char)mlines->name[0]); + wcsftime(mlines->name, sizeof(mlines->name) / sizeof(mlines->name[0]), + L"%OB", &tm); + mlines->name[0] = towupper(mlines->name[0]); /* * Set first and last to the day number of the first day of this @@ -754,18 +761,18 @@ mkweekdays(struct weekdays *wds) { int i, len; struct tm tm; - char buf[20]; + wchar_t buf[20]; memset(&tm, 0, sizeof(tm)); for (i = 0; i != 7; i++) { tm.tm_wday = (i+1) % 7; - strftime(buf, sizeof(buf), "%a", &tm); - len = strlen(buf); + wcsftime(buf, sizeof(buf), L"%a", &tm); + len = wcslen(buf); if (len > 2) len = 2; - strcpy(wds->names[i], " "); - strncpy(wds->names[i] + 2 - len, buf, len); + wcscpy(wds->names[i], L" "); + wcsncpy(wds->names[i] + 2 - len, buf, len); } } @@ -858,6 +865,17 @@ center(char *s, char *t, int w) return (s); } +/* Center string t in string s of length w by putting enough leading blanks */ +wchar_t * +wcenter(wchar_t *s, wchar_t *t, int w) +{ + char blanks[80]; + + memset(blanks, ' ', sizeof(blanks)); + swprintf(s, MAX_WIDTH, L"%.*s%ls", (int)(w - wcslen(t)) / 2, blanks, t); + return (s); +} + int parsemonth(const char *s) { From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 06:01:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E3891065690; Sun, 22 Mar 2009 06:01:33 +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 70DCC8FC1D; Sun, 22 Mar 2009 06:01:33 +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 n2M61XGI058614; Sun, 22 Mar 2009 06:01:33 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2M61XwC058613; Sun, 22 Mar 2009 06:01:33 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903220601.n2M61XwC058613@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 22 Mar 2009 06:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190241 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/txp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 06:01:34 -0000 Author: yongari Date: Sun Mar 22 06:01:33 2009 New Revision: 190241 URL: http://svn.freebsd.org/changeset/base/190241 Log: MFC r189685: K&R -> ANSI C function definitions. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/txp/if_txp.c Modified: stable/7/sys/dev/txp/if_txp.c ============================================================================== --- stable/7/sys/dev/txp/if_txp.c Sun Mar 22 05:44:56 2009 (r190240) +++ stable/7/sys/dev/txp/if_txp.c Sun Mar 22 06:01:33 2009 (r190241) @@ -186,8 +186,7 @@ MODULE_DEPEND(txp, pci, 1, 1, 1); MODULE_DEPEND(txp, ether, 1, 1, 1); static int -txp_probe(dev) - device_t dev; +txp_probe(device_t dev) { struct txp_type *t; @@ -206,8 +205,7 @@ txp_probe(dev) } static int -txp_attach(dev) - device_t dev; +txp_attach(device_t dev) { struct txp_softc *sc; struct ifnet *ifp; @@ -363,8 +361,7 @@ fail: } static int -txp_detach(dev) - device_t dev; +txp_detach(device_t dev) { struct txp_softc *sc; struct ifnet *ifp; @@ -392,8 +389,7 @@ txp_detach(dev) } static void -txp_release_resources(sc) - struct txp_softc *sc; +txp_release_resources(struct txp_softc *sc) { device_t dev; @@ -418,8 +414,7 @@ txp_release_resources(sc) } static int -txp_chip_init(sc) - struct txp_softc *sc; +txp_chip_init(struct txp_softc *sc) { /* disable interrupts */ WRITE_REG(sc, TXP_IER, 0); @@ -456,8 +451,7 @@ txp_chip_init(sc) } static int -txp_reset_adapter(sc) - struct txp_softc *sc; +txp_reset_adapter(struct txp_softc *sc) { u_int32_t r; int i; @@ -484,8 +478,7 @@ txp_reset_adapter(sc) } static int -txp_download_fw(sc) - struct txp_softc *sc; +txp_download_fw(struct txp_softc *sc) { struct txp_fw_file_header *fileheader; struct txp_fw_section_header *secthead; @@ -573,8 +566,7 @@ fail: } static int -txp_download_fw_wait(sc) - struct txp_softc *sc; +txp_download_fw_wait(struct txp_softc *sc) { u_int32_t i, r; @@ -602,10 +594,8 @@ txp_download_fw_wait(sc) } static int -txp_download_fw_section(sc, sect, sectnum) - struct txp_softc *sc; - struct txp_fw_section_header *sect; - int sectnum; +txp_download_fw_section(struct txp_softc *sc, + struct txp_fw_section_header *sect, int sectnum) { vm_offset_t dma; int rseg, err = 0; @@ -670,8 +660,7 @@ bail: } static void -txp_intr(vsc) - void *vsc; +txp_intr(void *vsc) { struct txp_softc *sc = vsc; struct txp_hostvar *hv = sc->sc_hostvar; @@ -718,9 +707,7 @@ txp_intr(vsc) } static void -txp_rx_reclaim(sc, r) - struct txp_softc *sc; - struct txp_rx_ring *r; +txp_rx_reclaim(struct txp_softc *sc, struct txp_rx_ring *r) { struct ifnet *ifp = sc->sc_ifp; struct txp_rx_desc *rxd; @@ -810,8 +797,7 @@ next: } static void -txp_rxbuf_reclaim(sc) - struct txp_softc *sc; +txp_rxbuf_reclaim(struct txp_softc *sc) { struct ifnet *ifp = sc->sc_ifp; struct txp_hostvar *hv = sc->sc_hostvar; @@ -859,9 +845,7 @@ txp_rxbuf_reclaim(sc) * Reclaim mbufs and entries from a transmit ring. */ static void -txp_tx_reclaim(sc, r) - struct txp_softc *sc; - struct txp_tx_ring *r; +txp_tx_reclaim(struct txp_softc *sc, struct txp_tx_ring *r) { struct ifnet *ifp = sc->sc_ifp; u_int32_t idx = TXP_OFFSET2IDX(*(r->r_off)); @@ -906,8 +890,7 @@ txp_tx_reclaim(sc, r) } static int -txp_shutdown(dev) - device_t dev; +txp_shutdown(device_t dev) { struct txp_softc *sc; @@ -930,8 +913,7 @@ txp_shutdown(dev) } static int -txp_alloc_rings(sc) - struct txp_softc *sc; +txp_alloc_rings(struct txp_softc *sc) { struct txp_boot_record *boot; struct txp_ldata *ld; @@ -1066,10 +1048,7 @@ txp_alloc_rings(sc) } static int -txp_ioctl(ifp, command, data) - struct ifnet *ifp; - u_long command; - caddr_t data; +txp_ioctl(struct ifnet *ifp, u_long command, caddr_t data) { struct txp_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; @@ -1110,8 +1089,7 @@ txp_ioctl(ifp, command, data) } static int -txp_rxring_fill(sc) - struct txp_softc *sc; +txp_rxring_fill(struct txp_softc *sc) { int i; struct ifnet *ifp; @@ -1141,8 +1119,7 @@ txp_rxring_fill(sc) } static void -txp_rxring_empty(sc) - struct txp_softc *sc; +txp_rxring_empty(struct txp_softc *sc) { int i; struct txp_swdesc *sd; @@ -1167,8 +1144,7 @@ txp_rxring_empty(sc) } static void -txp_init(xsc) - void *xsc; +txp_init(void *xsc) { struct txp_softc *sc; @@ -1179,8 +1155,7 @@ txp_init(xsc) } static void -txp_init_locked(sc) - struct txp_softc *sc; +txp_init_locked(struct txp_softc *sc) { struct ifnet *ifp; u_int16_t p1; @@ -1229,8 +1204,7 @@ txp_init_locked(sc) } static void -txp_tick(vsc) - void *vsc; +txp_tick(void *vsc) { struct txp_softc *sc = vsc; struct ifnet *ifp = sc->sc_ifp; @@ -1269,8 +1243,7 @@ out: } static void -txp_start(ifp) - struct ifnet *ifp; +txp_start(struct ifnet *ifp) { struct txp_softc *sc; @@ -1281,8 +1254,7 @@ txp_start(ifp) } static void -txp_start_locked(ifp) - struct ifnet *ifp; +txp_start_locked(struct ifnet *ifp) { struct txp_softc *sc = ifp->if_softc; struct txp_tx_ring *r = &sc->sc_txhir; @@ -1527,9 +1499,8 @@ txp_response(struct txp_softc *sc, u_int } static void -txp_rsp_fixup(sc, rsp, dst) - struct txp_softc *sc; - struct txp_rsp_desc *rsp, *dst; +txp_rsp_fixup(struct txp_softc *sc, struct txp_rsp_desc *rsp, + struct txp_rsp_desc *dst) { struct txp_rsp_desc *src = rsp; struct txp_hostvar *hv = sc->sc_hostvar; @@ -1553,8 +1524,7 @@ txp_rsp_fixup(sc, rsp, dst) } static int -txp_cmd_desc_numfree(sc) - struct txp_softc *sc; +txp_cmd_desc_numfree(struct txp_softc *sc) { struct txp_hostvar *hv = sc->sc_hostvar; struct txp_boot_record *br = sc->sc_boot; @@ -1578,8 +1548,7 @@ txp_cmd_desc_numfree(sc) } static void -txp_stop(sc) - struct txp_softc *sc; +txp_stop(struct txp_softc *sc) { struct ifnet *ifp; @@ -1599,15 +1568,13 @@ txp_stop(sc) } static void -txp_watchdog(ifp) - struct ifnet *ifp; +txp_watchdog(struct ifnet *ifp) { return; } static int -txp_ifmedia_upd(ifp) - struct ifnet *ifp; +txp_ifmedia_upd(struct ifnet *ifp) { struct txp_softc *sc = ifp->if_softc; struct ifmedia *ifm = &sc->sc_ifmedia; @@ -1651,9 +1618,7 @@ txp_ifmedia_upd(ifp) } static void -txp_ifmedia_sts(ifp, ifmr) - struct ifnet *ifp; - struct ifmediareq *ifmr; +txp_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) { struct txp_softc *sc = ifp->if_softc; struct ifmedia *ifm = &sc->sc_ifmedia; @@ -1726,8 +1691,7 @@ bail: #ifdef TXP_DEBUG static void -txp_show_descriptor(d) - void *d; +txp_show_descriptor(void *d) { struct txp_cmd_desc *cmd = d; struct txp_rsp_desc *rsp = d; @@ -1770,8 +1734,7 @@ txp_show_descriptor(d) #endif static void -txp_set_filter(sc) - struct txp_softc *sc; +txp_set_filter(struct txp_softc *sc) { struct ifnet *ifp = sc->sc_ifp; u_int32_t crc, carry, hashbit, hash[2]; @@ -1838,8 +1801,7 @@ setit: } static void -txp_capabilities(sc) - struct txp_softc *sc; +txp_capabilities(struct txp_softc *sc) { struct ifnet *ifp = sc->sc_ifp; struct txp_rsp_desc *rsp = NULL; From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 06:04:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D16D1106566B; Sun, 22 Mar 2009 06:04:16 +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 BE3818FC17; Sun, 22 Mar 2009 06:04:16 +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 n2M64GZ2058713; Sun, 22 Mar 2009 06:04:16 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2M64Gbd058712; Sun, 22 Mar 2009 06:04:16 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903220604.n2M64Gbd058712@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 22 Mar 2009 06:04:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190242 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/txp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 06:04:17 -0000 Author: yongari Date: Sun Mar 22 06:04:16 2009 New Revision: 190242 URL: http://svn.freebsd.org/changeset/base/190242 Log: MFC r189686: Remove extra tab characters. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/txp/if_txp.c Modified: stable/7/sys/dev/txp/if_txp.c ============================================================================== --- stable/7/sys/dev/txp/if_txp.c Sun Mar 22 06:01:33 2009 (r190241) +++ stable/7/sys/dev/txp/if_txp.c Sun Mar 22 06:04:16 2009 (r190242) @@ -534,7 +534,7 @@ txp_download_fw(struct txp_softc *sc) sizeof(struct txp_fw_file_header)); for (sect = 0; sect < fileheader->nsections; sect++) { - + if (txp_download_fw_section(sc, secthead, sect)) { error = -1; goto fail; @@ -659,7 +659,7 @@ bail: return (err); } -static void +static void txp_intr(void *vsc) { struct txp_softc *sc = vsc; @@ -1519,7 +1519,7 @@ txp_rsp_fixup(struct txp_softc *sc, stru src++; sc->sc_rspring.lastwrite = hv->hv_resp_read_idx = ridx; } - + hv->hv_resp_read_idx = ridx; } From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 06:07:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 076321065676; Sun, 22 Mar 2009 06:07:04 +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 CE1D18FC17; Sun, 22 Mar 2009 06:07:03 +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 n2M6733c058813; Sun, 22 Mar 2009 06:07:03 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2M673s7058812; Sun, 22 Mar 2009 06:07:03 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903220607.n2M673s7058812@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 22 Mar 2009 06:07:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190243 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/txp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 06:07:04 -0000 Author: yongari Date: Sun Mar 22 06:07:03 2009 New Revision: 190243 URL: http://svn.freebsd.org/changeset/base/190243 Log: MFC r189687: Remove return statement at the end of function that returns void. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/txp/if_txp.c Modified: stable/7/sys/dev/txp/if_txp.c ============================================================================== --- stable/7/sys/dev/txp/if_txp.c Sun Mar 22 06:04:16 2009 (r190242) +++ stable/7/sys/dev/txp/if_txp.c Sun Mar 22 06:07:03 2009 (r190243) @@ -409,8 +409,6 @@ txp_release_resources(struct txp_softc * if (sc->sc_ifp) if_free(sc->sc_ifp); - - return; } static int @@ -702,8 +700,6 @@ txp_intr(void *vsc) txp_start_locked(sc->sc_ifp); TXP_UNLOCK(sc); - - return; } static void @@ -792,8 +788,6 @@ next: } *r->r_roff = woff; - - return; } static void @@ -837,8 +831,6 @@ txp_rxbuf_reclaim(struct txp_softc *sc) } sc->sc_rxbufprod = i; - - return; } /* @@ -1139,8 +1131,6 @@ txp_rxring_empty(struct txp_softc *sc) sd->sd_mbuf = NULL; } } - - return; } static void @@ -1238,8 +1228,6 @@ out: free(rsp, M_DEVBUF); callout_reset(&sc->sc_tick, hz, txp_tick, sc); - - return; } static void @@ -1355,7 +1343,6 @@ oactive: r->r_prod = firstprod; r->r_cnt = firstcnt; IF_PREPEND(&ifp->if_snd, m); - return; } /* @@ -1563,14 +1550,12 @@ txp_stop(struct txp_softc *sc) txp_command(sc, TXP_CMD_RX_DISABLE, 0, 0, 0, NULL, NULL, NULL, 1); txp_rxring_empty(sc); - - return; } static void txp_watchdog(struct ifnet *ifp) { - return; + } static int @@ -1796,8 +1781,6 @@ setit: txp_command(sc, TXP_CMD_RX_FILTER_WRITE, filter, 0, 0, NULL, NULL, NULL, 1); - - return; } static void @@ -1864,6 +1847,4 @@ txp_capabilities(struct txp_softc *sc) out: if (rsp != NULL) free(rsp, M_DEVBUF); - - return; } From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 06:11:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7081B106564A; Sun, 22 Mar 2009 06:11:35 +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 52CE08FC17; Sun, 22 Mar 2009 06:11:35 +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 n2M6BZA6058951; Sun, 22 Mar 2009 06:11:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2M6BZDV058950; Sun, 22 Mar 2009 06:11:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903220611.n2M6BZDV058950@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 22 Mar 2009 06:11:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190244 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/txp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 06:11:36 -0000 Author: yongari Date: Sun Mar 22 06:11:35 2009 New Revision: 190244 URL: http://svn.freebsd.org/changeset/base/190244 Log: MFC r189688: style(9) - space after keywords. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/txp/if_txp.c Modified: stable/7/sys/dev/txp/if_txp.c ============================================================================== --- stable/7/sys/dev/txp/if_txp.c Sun Mar 22 06:07:03 2009 (r190243) +++ stable/7/sys/dev/txp/if_txp.c Sun Mar 22 06:11:35 2009 (r190244) @@ -192,16 +192,16 @@ txp_probe(device_t dev) t = txp_devs; - while(t->txp_name != NULL) { + while (t->txp_name != NULL) { if ((pci_get_vendor(dev) == t->txp_vid) && (pci_get_device(dev) == t->txp_did)) { device_set_desc(dev, t->txp_name); - return(BUS_PROBE_DEFAULT); + return (BUS_PROBE_DEFAULT); } t++; } - return(ENXIO); + return (ENXIO); } static int @@ -352,12 +352,12 @@ txp_attach(device_t dev) goto fail; } - return(0); + return (0); fail: txp_release_resources(sc); mtx_destroy(&sc->sc_mtx); - return(error); + return (error); } static int @@ -385,7 +385,7 @@ txp_detach(device_t dev) txp_release_resources(sc); mtx_destroy(&sc->sc_mtx); - return(0); + return (0); } static void @@ -901,7 +901,7 @@ txp_shutdown(device_t dev) txp_command(sc, TXP_CMD_HALT, 0, 0, 0, NULL, NULL, NULL, 0); TXP_UNLOCK(sc); - return(0); + return (0); } static int @@ -990,7 +990,7 @@ txp_alloc_rings(struct txp_softc *sc) sc->sc_rxbufs[i].rb_sd = malloc(sizeof(struct txp_swdesc), M_DEVBUF, M_NOWAIT); if (sc->sc_rxbufs[i].rb_sd == NULL) - return(ENOBUFS); + return (ENOBUFS); sd = sc->sc_rxbufs[i].rb_sd; sd->sd_mbuf = NULL; } @@ -1011,7 +1011,7 @@ txp_alloc_rings(struct txp_softc *sc) if (r != STAT_WAITING_FOR_BOOT) { device_printf(sc->sc_dev, "not waiting for boot\n"); - return(ENXIO); + return (ENXIO); } WRITE_REG(sc, TXP_H2A_2, 0); @@ -1027,7 +1027,7 @@ txp_alloc_rings(struct txp_softc *sc) } if (r != STAT_RUNNING) { device_printf(sc->sc_dev, "fw not running\n"); - return(ENXIO); + return (ENXIO); } /* Clear TX and CMD ring write registers */ @@ -1046,7 +1046,7 @@ txp_ioctl(struct ifnet *ifp, u_long comm struct ifreq *ifr = (struct ifreq *)data; int error = 0; - switch(command) { + switch (command) { case SIOCSIFFLAGS: TXP_LOCK(sc); if (ifp->if_flags & IFF_UP) { @@ -1077,7 +1077,7 @@ txp_ioctl(struct ifnet *ifp, u_long comm break; } - return(error); + return (error); } static int @@ -1094,7 +1094,7 @@ txp_rxring_fill(struct txp_softc *sc) sd = sc->sc_rxbufs[i].rb_sd; sd->sd_mbuf = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); if (sd->sd_mbuf == NULL) - return(ENOBUFS); + return (ENOBUFS); sd->sd_mbuf->m_pkthdr.len = sd->sd_mbuf->m_len = MCLBYTES; sd->sd_mbuf->m_pkthdr.rcvif = ifp; @@ -1107,7 +1107,7 @@ txp_rxring_fill(struct txp_softc *sc) sc->sc_hostvar->hv_rx_buf_write_idx = (RXBUF_ENTRIES - 1) * sizeof(struct txp_rxbuf_desc); - return(0); + return (0); } static void From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 06:16:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4816A106564A; Sun, 22 Mar 2009 06:16:45 +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 33A6D8FC08; Sun, 22 Mar 2009 06:16:45 +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 n2M6GjZY059094; Sun, 22 Mar 2009 06:16:45 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2M6GjaE059092; Sun, 22 Mar 2009 06:16:45 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903220616.n2M6GjaE059092@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 22 Mar 2009 06:16:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190245 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/txp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 06:16:45 -0000 Author: yongari Date: Sun Mar 22 06:16:44 2009 New Revision: 190245 URL: http://svn.freebsd.org/changeset/base/190245 Log: MFC r189689: s/u_int8_t/uint8_t/g s/u_int16_t/uint16_t/g s/u_int32_t/uint32_t/g s/u_int64_t/uint64_t/g Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/txp/if_txp.c stable/7/sys/dev/txp/if_txpreg.h Modified: stable/7/sys/dev/txp/if_txp.c ============================================================================== --- stable/7/sys/dev/txp/if_txp.c Sun Mar 22 06:11:35 2009 (r190244) +++ stable/7/sys/dev/txp/if_txp.c Sun Mar 22 06:16:44 2009 (r190245) @@ -136,12 +136,12 @@ static void txp_rxring_empty(struct txp_ static void txp_set_filter(struct txp_softc *); static int txp_cmd_desc_numfree(struct txp_softc *); -static int txp_command(struct txp_softc *, u_int16_t, u_int16_t, u_int32_t, - u_int32_t, u_int16_t *, u_int32_t *, u_int32_t *, int); -static int txp_command2(struct txp_softc *, u_int16_t, u_int16_t, - u_int32_t, u_int32_t, struct txp_ext_desc *, u_int8_t, +static int txp_command(struct txp_softc *, uint16_t, uint16_t, uint32_t, + uint32_t, uint16_t *, uint32_t *, uint32_t *, int); +static int txp_command2(struct txp_softc *, uint16_t, uint16_t, + uint32_t, uint32_t, struct txp_ext_desc *, uint8_t, struct txp_rsp_desc **, int); -static int txp_response(struct txp_softc *, u_int32_t, u_int16_t, u_int16_t, +static int txp_response(struct txp_softc *, uint32_t, uint16_t, uint16_t, struct txp_rsp_desc **); static void txp_rsp_fixup(struct txp_softc *, struct txp_rsp_desc *, struct txp_rsp_desc *); @@ -209,8 +209,8 @@ txp_attach(device_t dev) { struct txp_softc *sc; struct ifnet *ifp; - u_int16_t p1; - u_int32_t p2; + uint16_t p1; + uint32_t p2; int error = 0, rid; u_char eaddr[6]; @@ -296,12 +296,12 @@ txp_attach(device_t dev) goto fail; } - eaddr[0] = ((u_int8_t *)&p1)[1]; - eaddr[1] = ((u_int8_t *)&p1)[0]; - eaddr[2] = ((u_int8_t *)&p2)[3]; - eaddr[3] = ((u_int8_t *)&p2)[2]; - eaddr[4] = ((u_int8_t *)&p2)[1]; - eaddr[5] = ((u_int8_t *)&p2)[0]; + eaddr[0] = ((uint8_t *)&p1)[1]; + eaddr[1] = ((uint8_t *)&p1)[0]; + eaddr[2] = ((uint8_t *)&p2)[3]; + eaddr[3] = ((uint8_t *)&p2)[2]; + eaddr[4] = ((uint8_t *)&p2)[1]; + eaddr[5] = ((uint8_t *)&p2)[0]; sc->sc_cold = 0; @@ -451,7 +451,7 @@ txp_chip_init(struct txp_softc *sc) static int txp_reset_adapter(struct txp_softc *sc) { - u_int32_t r; + uint32_t r; int i; r = 0; @@ -481,7 +481,7 @@ txp_download_fw(struct txp_softc *sc) struct txp_fw_file_header *fileheader; struct txp_fw_section_header *secthead; int error, sect; - u_int32_t r, i, ier, imr; + uint32_t r, i, ier, imr; r = 0; error = 0; @@ -528,7 +528,7 @@ txp_download_fw(struct txp_softc *sc) goto fail; } - secthead = (struct txp_fw_section_header *)(((u_int8_t *)tc990image) + + secthead = (struct txp_fw_section_header *)(((uint8_t *)tc990image) + sizeof(struct txp_fw_file_header)); for (sect = 0; sect < fileheader->nsections; sect++) { @@ -538,7 +538,7 @@ txp_download_fw(struct txp_softc *sc) goto fail; } secthead = (struct txp_fw_section_header *) - (((u_int8_t *)secthead) + secthead->nbytes + + (((uint8_t *)secthead) + secthead->nbytes + sizeof(*secthead)); } @@ -566,7 +566,7 @@ fail: static int txp_download_fw_wait(struct txp_softc *sc) { - u_int32_t i, r; + uint32_t i, r; r = 0; for (i = 0; i < 10000; i++) { @@ -598,14 +598,14 @@ txp_download_fw_section(struct txp_softc vm_offset_t dma; int rseg, err = 0; struct mbuf m; - u_int16_t csum; + uint16_t csum; /* Skip zero length sections */ if (sect->nbytes == 0) return (0); /* Make sure we aren't past the end of the image */ - rseg = ((u_int8_t *)sect) - ((u_int8_t *)tc990image); + rseg = ((uint8_t *)sect) - ((uint8_t *)tc990image); if (rseg >= sizeof(tc990image)) { device_printf(sc->sc_dev, "fw invalid section address, " "section %d\n", sectnum); @@ -620,7 +620,7 @@ txp_download_fw_section(struct txp_softc return (-1); } - bcopy(((u_int8_t *)sect) + sizeof(*sect), sc->sc_fwbuf, sect->nbytes); + bcopy(((uint8_t *)sect) + sizeof(*sect), sc->sc_fwbuf, sect->nbytes); dma = vtophys(sc->sc_fwbuf); /* @@ -662,7 +662,7 @@ txp_intr(void *vsc) { struct txp_softc *sc = vsc; struct txp_hostvar *hv = sc->sc_hostvar; - u_int32_t isr; + uint32_t isr; /* mask all interrupts */ TXP_LOCK(sc); @@ -709,7 +709,7 @@ txp_rx_reclaim(struct txp_softc *sc, str struct txp_rx_desc *rxd; struct mbuf *m; struct txp_swdesc *sd = NULL; - u_int32_t roff, woff; + uint32_t roff, woff; TXP_LOCK_ASSERT(sc); roff = *r->r_roff; @@ -797,7 +797,7 @@ txp_rxbuf_reclaim(struct txp_softc *sc) struct txp_hostvar *hv = sc->sc_hostvar; struct txp_rxbuf_desc *rbd; struct txp_swdesc *sd; - u_int32_t i; + uint32_t i; TXP_LOCK_ASSERT(sc); if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) @@ -840,8 +840,8 @@ static void txp_tx_reclaim(struct txp_softc *sc, struct txp_tx_ring *r) { struct ifnet *ifp = sc->sc_ifp; - u_int32_t idx = TXP_OFFSET2IDX(*(r->r_off)); - u_int32_t cons = r->r_cons, cnt = r->r_cnt; + uint32_t idx = TXP_OFFSET2IDX(*(r->r_off)); + uint32_t cons = r->r_cons, cnt = r->r_cnt; struct txp_tx_desc *txd = r->r_desc + cons; struct txp_swdesc *sd = sc->sc_txd + cons; struct mbuf *m; @@ -909,7 +909,7 @@ txp_alloc_rings(struct txp_softc *sc) { struct txp_boot_record *boot; struct txp_ldata *ld; - u_int32_t r; + uint32_t r; int i; r = 0; @@ -997,7 +997,7 @@ txp_alloc_rings(struct txp_softc *sc) sc->sc_rxbufprod = 0; /* zero dma */ - bzero(&ld->txp_zero, sizeof(u_int32_t)); + bzero(&ld->txp_zero, sizeof(uint32_t)); boot->br_zero_lo = vtophys(&ld->txp_zero); boot->br_zero_hi = 0; @@ -1148,8 +1148,8 @@ static void txp_init_locked(struct txp_softc *sc) { struct ifnet *ifp; - u_int16_t p1; - u_int32_t p2; + uint16_t p1; + uint32_t p2; TXP_LOCK_ASSERT(sc); ifp = sc->sc_ifp; @@ -1163,12 +1163,12 @@ txp_init_locked(struct txp_softc *sc) NULL, NULL, NULL, 1); /* Set station address. */ - ((u_int8_t *)&p1)[1] = IF_LLADDR(sc->sc_ifp)[0]; - ((u_int8_t *)&p1)[0] = IF_LLADDR(sc->sc_ifp)[1]; - ((u_int8_t *)&p2)[3] = IF_LLADDR(sc->sc_ifp)[2]; - ((u_int8_t *)&p2)[2] = IF_LLADDR(sc->sc_ifp)[3]; - ((u_int8_t *)&p2)[1] = IF_LLADDR(sc->sc_ifp)[4]; - ((u_int8_t *)&p2)[0] = IF_LLADDR(sc->sc_ifp)[5]; + ((uint8_t *)&p1)[1] = IF_LLADDR(sc->sc_ifp)[0]; + ((uint8_t *)&p1)[0] = IF_LLADDR(sc->sc_ifp)[1]; + ((uint8_t *)&p2)[3] = IF_LLADDR(sc->sc_ifp)[2]; + ((uint8_t *)&p2)[2] = IF_LLADDR(sc->sc_ifp)[3]; + ((uint8_t *)&p2)[1] = IF_LLADDR(sc->sc_ifp)[4]; + ((uint8_t *)&p2)[0] = IF_LLADDR(sc->sc_ifp)[5]; txp_command(sc, TXP_CMD_STATION_ADDRESS_WRITE, p1, p2, 0, NULL, NULL, NULL, 1); @@ -1250,7 +1250,7 @@ txp_start_locked(struct ifnet *ifp) struct txp_frag_desc *fxd; struct mbuf *m, *m0; struct txp_swdesc *sd; - u_int32_t firstprod, firstcnt, prod, cnt; + uint32_t firstprod, firstcnt, prod, cnt; TXP_LOCK_ASSERT(sc); if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != @@ -1349,8 +1349,8 @@ oactive: * Handle simple commands sent to the typhoon */ static int -txp_command(struct txp_softc *sc, u_int16_t id, u_int16_t in1, u_int32_t in2, - u_int32_t in3, u_int16_t *out1, u_int32_t *out2, u_int32_t *out3, int wait) +txp_command(struct txp_softc *sc, uint16_t id, uint16_t in1, uint32_t in2, + uint32_t in3, uint16_t *out1, uint32_t *out2, uint32_t *out3, int wait) { struct txp_rsp_desc *rsp = NULL; @@ -1371,15 +1371,15 @@ txp_command(struct txp_softc *sc, u_int1 } static int -txp_command2(struct txp_softc *sc, u_int16_t id, u_int16_t in1, u_int32_t in2, - u_int32_t in3, struct txp_ext_desc *in_extp, u_int8_t in_extn, +txp_command2(struct txp_softc *sc, uint16_t id, uint16_t in1, uint32_t in2, + uint32_t in3, struct txp_ext_desc *in_extp, uint8_t in_extn, struct txp_rsp_desc **rspp, int wait) { struct txp_hostvar *hv = sc->sc_hostvar; struct txp_cmd_desc *cmd; struct txp_ext_desc *ext; - u_int32_t idx, i; - u_int16_t seq; + uint32_t idx, i; + uint16_t seq; if (txp_cmd_desc_numfree(sc) < (in_extn + 1)) { device_printf(sc->sc_dev, "no free cmd descriptors\n"); @@ -1387,7 +1387,7 @@ txp_command2(struct txp_softc *sc, u_int } idx = sc->sc_cmdring.lastwrite; - cmd = (struct txp_cmd_desc *)(((u_int8_t *)sc->sc_cmdring.base) + idx); + cmd = (struct txp_cmd_desc *)(((uint8_t *)sc->sc_cmdring.base) + idx); bzero(cmd, sizeof(*cmd)); cmd->cmd_numdesc = in_extn; @@ -1404,7 +1404,7 @@ txp_command2(struct txp_softc *sc, u_int idx = 0; for (i = 0; i < in_extn; i++) { - ext = (struct txp_ext_desc *)(((u_int8_t *)sc->sc_cmdring.base) + idx); + ext = (struct txp_ext_desc *)(((uint8_t *)sc->sc_cmdring.base) + idx); bcopy(in_extp, ext, sizeof(struct txp_ext_desc)); in_extp++; idx += sizeof(struct txp_cmd_desc); @@ -1439,14 +1439,14 @@ txp_command2(struct txp_softc *sc, u_int } static int -txp_response(struct txp_softc *sc, u_int32_t ridx, u_int16_t id, u_int16_t seq, +txp_response(struct txp_softc *sc, uint32_t ridx, uint16_t id, uint16_t seq, struct txp_rsp_desc **rspp) { struct txp_hostvar *hv = sc->sc_hostvar; struct txp_rsp_desc *rsp; while (ridx != hv->hv_resp_write_idx) { - rsp = (struct txp_rsp_desc *)(((u_int8_t *)sc->sc_rspring.base) + ridx); + rsp = (struct txp_rsp_desc *)(((uint8_t *)sc->sc_rspring.base) + ridx); if (id == rsp->rsp_id && rsp->rsp_seq == seq) { *rspp = (struct txp_rsp_desc *)malloc( @@ -1491,7 +1491,7 @@ txp_rsp_fixup(struct txp_softc *sc, stru { struct txp_rsp_desc *src = rsp; struct txp_hostvar *hv = sc->sc_hostvar; - u_int32_t i, ridx; + uint32_t i, ridx; ridx = hv->hv_resp_read_idx; @@ -1515,7 +1515,7 @@ txp_cmd_desc_numfree(struct txp_softc *s { struct txp_hostvar *hv = sc->sc_hostvar; struct txp_boot_record *br = sc->sc_boot; - u_int32_t widx, ridx, nfree; + uint32_t widx, ridx, nfree; widx = sc->sc_cmdring.lastwrite; ridx = hv->hv_cmd_read_idx; @@ -1563,7 +1563,7 @@ txp_ifmedia_upd(struct ifnet *ifp) { struct txp_softc *sc = ifp->if_softc; struct ifmedia *ifm = &sc->sc_ifmedia; - u_int16_t new_xcvr; + uint16_t new_xcvr; TXP_LOCK(sc); if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER) { @@ -1607,7 +1607,7 @@ txp_ifmedia_sts(struct ifnet *ifp, struc { struct txp_softc *sc = ifp->if_softc; struct ifmedia *ifm = &sc->sc_ifmedia; - u_int16_t bmsr, bmcr, anar, anlpar; + uint16_t bmsr, bmcr, anar, anlpar; ifmr->ifm_status = IFM_AVALID; ifmr->ifm_active = IFM_ETHER; @@ -1722,9 +1722,9 @@ static void txp_set_filter(struct txp_softc *sc) { struct ifnet *ifp = sc->sc_ifp; - u_int32_t crc, carry, hashbit, hash[2]; - u_int16_t filter; - u_int8_t octet; + uint32_t crc, carry, hashbit, hash[2]; + uint16_t filter; + uint8_t octet; int i, j, mcnt = 0; struct ifmultiaddr *ifma; char *enm; @@ -1765,7 +1765,7 @@ txp_set_filter(struct txp_softc *sc) carry; } } - hashbit = (u_int16_t)(crc & (64 - 1)); + hashbit = (uint16_t)(crc & (64 - 1)); hash[hashbit / 32] |= (1 << hashbit % 32); } IF_ADDR_UNLOCK(ifp); Modified: stable/7/sys/dev/txp/if_txpreg.h ============================================================================== --- stable/7/sys/dev/txp/if_txpreg.h Sun Mar 22 06:11:35 2009 (r190244) +++ stable/7/sys/dev/txp/if_txpreg.h Sun Mar 22 06:16:44 2009 (r190245) @@ -225,12 +225,12 @@ #define TXP_STAT_UDPCKSUMGOOD 0x0200 struct txp_tx_desc { - volatile u_int8_t tx_flags; /* type/descriptor flags */ - volatile u_int8_t tx_numdesc; /* number of descriptors */ - volatile u_int16_t tx_totlen; /* total packet length */ - volatile u_int32_t tx_addrlo; /* virt addr low word */ - volatile u_int32_t tx_addrhi; /* virt addr high word */ - volatile u_int32_t tx_pflags; /* processing flags */ + volatile uint8_t tx_flags; /* type/descriptor flags */ + volatile uint8_t tx_numdesc; /* number of descriptors */ + volatile uint16_t tx_totlen; /* total packet length */ + volatile uint32_t tx_addrlo; /* virt addr low word */ + volatile uint32_t tx_addrhi; /* virt addr high word */ + volatile uint32_t tx_pflags; /* processing flags */ }; #define TX_FLAGS_TYPE_M 0x07 /* type mask */ #define TX_FLAGS_TYPE_FRAG 0x00 /* type: fragment */ @@ -256,21 +256,21 @@ struct txp_tx_desc { #define TX_PFLAGS_VLANTAG_S 12 /* amount to shift tag */ struct txp_rx_desc { - volatile u_int8_t rx_flags; /* type/descriptor flags */ - volatile u_int8_t rx_numdesc; /* number of descriptors */ - volatile u_int16_t rx_len; /* frame length */ + volatile uint8_t rx_flags; /* type/descriptor flags */ + volatile uint8_t rx_numdesc; /* number of descriptors */ + volatile uint16_t rx_len; /* frame length */ #ifdef notdef - volatile u_int32_t rx_vaddrlo; /* virtual address, lo word */ - volatile u_int32_t rx_vaddrhi; /* virtual address, hi word */ + volatile uint32_t rx_vaddrlo; /* virtual address, lo word */ + volatile uint32_t rx_vaddrhi; /* virtual address, hi word */ #endif union { struct txp_swdesc *rx_sd; - u_int64_t rx_dummy; + uint64_t rx_dummy; } txp_rx_u; - volatile u_int32_t rx_stat; /* status */ - volatile u_int16_t rx_filter; /* filter status */ - volatile u_int16_t rx_hash; /* hash status */ - volatile u_int32_t rx_vlan; /* vlan tag/priority */ + volatile uint32_t rx_stat; /* status */ + volatile uint16_t rx_filter; /* filter status */ + volatile uint16_t rx_hash; /* hash status */ + volatile uint32_t rx_vlan; /* vlan tag/priority */ }; #define rx_sd txp_rx_u.rx_sd @@ -316,15 +316,15 @@ struct txp_rx_desc { struct txp_rxbuf_desc { - volatile u_int32_t rb_paddrlo; - volatile u_int32_t rb_paddrhi; + volatile uint32_t rb_paddrlo; + volatile uint32_t rb_paddrhi; #ifdef notdef - volatile u_int32_t rb_vaddrlo; - volatile u_int32_t rb_vaddrhi; + volatile uint32_t rb_vaddrlo; + volatile uint32_t rb_vaddrhi; #endif union { struct txp_swdesc *rb_sd; - u_int64_t rb_dummy; + uint64_t rb_dummy; } txp_rb_u; }; @@ -332,20 +332,20 @@ struct txp_rxbuf_desc { /* Extension descriptor */ struct txp_ext_desc { - volatile u_int32_t ext_1; - volatile u_int32_t ext_2; - volatile u_int32_t ext_3; - volatile u_int32_t ext_4; + volatile uint32_t ext_1; + volatile uint32_t ext_2; + volatile uint32_t ext_3; + volatile uint32_t ext_4; }; struct txp_cmd_desc { - volatile u_int8_t cmd_flags; - volatile u_int8_t cmd_numdesc; - volatile u_int16_t cmd_id; - volatile u_int16_t cmd_seq; - volatile u_int16_t cmd_par1; - volatile u_int32_t cmd_par2; - volatile u_int32_t cmd_par3; + volatile uint8_t cmd_flags; + volatile uint8_t cmd_numdesc; + volatile uint16_t cmd_id; + volatile uint16_t cmd_seq; + volatile uint16_t cmd_par1; + volatile uint32_t cmd_par2; + volatile uint32_t cmd_par3; }; #define CMD_FLAGS_TYPE_M 0x07 /* type mask */ #define CMD_FLAGS_TYPE_FRAG 0x00 /* type: fragment */ @@ -358,13 +358,13 @@ struct txp_cmd_desc { #define CMD_FLAGS_VALID 0x80 /* valid descriptor */ struct txp_rsp_desc { - volatile u_int8_t rsp_flags; - volatile u_int8_t rsp_numdesc; - volatile u_int16_t rsp_id; - volatile u_int16_t rsp_seq; - volatile u_int16_t rsp_par1; - volatile u_int32_t rsp_par2; - volatile u_int32_t rsp_par3; + volatile uint8_t rsp_flags; + volatile uint8_t rsp_numdesc; + volatile uint16_t rsp_id; + volatile uint16_t rsp_seq; + volatile uint16_t rsp_par1; + volatile uint32_t rsp_par2; + volatile uint32_t rsp_par3; }; #define RSP_FLAGS_TYPE_M 0x07 /* type mask */ #define RSP_FLAGS_TYPE_FRAG 0x00 /* type: fragment */ @@ -376,12 +376,12 @@ struct txp_rsp_desc { #define RSP_FLAGS_ERROR 0x40 /* response error */ struct txp_frag_desc { - volatile u_int8_t frag_flags; /* type/descriptor flags */ - volatile u_int8_t frag_rsvd1; - volatile u_int16_t frag_len; /* bytes in this fragment */ - volatile u_int32_t frag_addrlo; /* phys addr low word */ - volatile u_int32_t frag_addrhi; /* phys addr high word */ - volatile u_int32_t frag_rsvd2; + volatile uint8_t frag_flags; /* type/descriptor flags */ + volatile uint8_t frag_rsvd1; + volatile uint16_t frag_len; /* bytes in this fragment */ + volatile uint32_t frag_addrlo; /* phys addr low word */ + volatile uint32_t frag_addrhi; /* phys addr high word */ + volatile uint32_t frag_rsvd2; }; #define FRAG_FLAGS_TYPE_M 0x07 /* type mask */ #define FRAG_FLAGS_TYPE_FRAG 0x00 /* type: fragment */ @@ -392,44 +392,44 @@ struct txp_frag_desc { #define FRAG_FLAGS_TYPE_RESP 0x05 /* type: response */ struct txp_opt_desc { - u_int8_t opt_desctype:3, + uint8_t opt_desctype:3, opt_rsvd:1, opt_type:4; - u_int8_t opt_num; - u_int16_t opt_dep1; - u_int32_t opt_dep2; - u_int32_t opt_dep3; - u_int32_t opt_dep4; + uint8_t opt_num; + uint16_t opt_dep1; + uint32_t opt_dep2; + uint32_t opt_dep3; + uint32_t opt_dep4; }; struct txp_ipsec_desc { - u_int8_t ipsec_desctpe:3, + uint8_t ipsec_desctpe:3, ipsec_rsvd:1, ipsec_type:4; - u_int8_t ipsec_num; - u_int16_t ipsec_flags; - u_int16_t ipsec_ah1; - u_int16_t ipsec_esp1; - u_int16_t ipsec_ah2; - u_int16_t ipsec_esp2; - u_int32_t ipsec_rsvd1; + uint8_t ipsec_num; + uint16_t ipsec_flags; + uint16_t ipsec_ah1; + uint16_t ipsec_esp1; + uint16_t ipsec_ah2; + uint16_t ipsec_esp2; + uint32_t ipsec_rsvd1; }; struct txp_tcpseg_desc { - u_int8_t tcpseg_desctype:3, + uint8_t tcpseg_desctype:3, tcpseg_rsvd:1, tcpseg_type:4; - u_int8_t tcpseg_num; + uint8_t tcpseg_num; - u_int16_t tcpseg_mss:12, + uint16_t tcpseg_mss:12, tcpseg_misc:4; - u_int32_t tcpseg_respaddr; - u_int32_t tcpseg_txbytes; - u_int32_t tcpseg_lss; + uint32_t tcpseg_respaddr; + uint32_t tcpseg_txbytes; + uint32_t tcpseg_lss; }; /* @@ -463,48 +463,48 @@ struct txp_tcpseg_desc { * boot record (pointers to rings) */ struct txp_boot_record { - volatile u_int32_t br_hostvar_lo; /* host ring pointer */ - volatile u_int32_t br_hostvar_hi; - volatile u_int32_t br_txlopri_lo; /* tx low pri ring */ - volatile u_int32_t br_txlopri_hi; - volatile u_int32_t br_txlopri_siz; - volatile u_int32_t br_txhipri_lo; /* tx high pri ring */ - volatile u_int32_t br_txhipri_hi; - volatile u_int32_t br_txhipri_siz; - volatile u_int32_t br_rxlopri_lo; /* rx low pri ring */ - volatile u_int32_t br_rxlopri_hi; - volatile u_int32_t br_rxlopri_siz; - volatile u_int32_t br_rxbuf_lo; /* rx buffer ring */ - volatile u_int32_t br_rxbuf_hi; - volatile u_int32_t br_rxbuf_siz; - volatile u_int32_t br_cmd_lo; /* command ring */ - volatile u_int32_t br_cmd_hi; - volatile u_int32_t br_cmd_siz; - volatile u_int32_t br_resp_lo; /* response ring */ - volatile u_int32_t br_resp_hi; - volatile u_int32_t br_resp_siz; - volatile u_int32_t br_zero_lo; /* zero word */ - volatile u_int32_t br_zero_hi; - volatile u_int32_t br_rxhipri_lo; /* rx high pri ring */ - volatile u_int32_t br_rxhipri_hi; - volatile u_int32_t br_rxhipri_siz; + volatile uint32_t br_hostvar_lo; /* host ring pointer */ + volatile uint32_t br_hostvar_hi; + volatile uint32_t br_txlopri_lo; /* tx low pri ring */ + volatile uint32_t br_txlopri_hi; + volatile uint32_t br_txlopri_siz; + volatile uint32_t br_txhipri_lo; /* tx high pri ring */ + volatile uint32_t br_txhipri_hi; + volatile uint32_t br_txhipri_siz; + volatile uint32_t br_rxlopri_lo; /* rx low pri ring */ + volatile uint32_t br_rxlopri_hi; + volatile uint32_t br_rxlopri_siz; + volatile uint32_t br_rxbuf_lo; /* rx buffer ring */ + volatile uint32_t br_rxbuf_hi; + volatile uint32_t br_rxbuf_siz; + volatile uint32_t br_cmd_lo; /* command ring */ + volatile uint32_t br_cmd_hi; + volatile uint32_t br_cmd_siz; + volatile uint32_t br_resp_lo; /* response ring */ + volatile uint32_t br_resp_hi; + volatile uint32_t br_resp_siz; + volatile uint32_t br_zero_lo; /* zero word */ + volatile uint32_t br_zero_hi; + volatile uint32_t br_rxhipri_lo; /* rx high pri ring */ + volatile uint32_t br_rxhipri_hi; + volatile uint32_t br_rxhipri_siz; }; /* * hostvar structure (shared with typhoon) */ struct txp_hostvar { - volatile u_int32_t hv_rx_hi_read_idx; /* host->arm */ - volatile u_int32_t hv_rx_lo_read_idx; /* host->arm */ - volatile u_int32_t hv_rx_buf_write_idx; /* host->arm */ - volatile u_int32_t hv_resp_read_idx; /* host->arm */ - volatile u_int32_t hv_tx_lo_desc_read_idx; /* arm->host */ - volatile u_int32_t hv_tx_hi_desc_read_idx; /* arm->host */ - volatile u_int32_t hv_rx_lo_write_idx; /* arm->host */ - volatile u_int32_t hv_rx_buf_read_idx; /* arm->host */ - volatile u_int32_t hv_cmd_read_idx; /* arm->host */ - volatile u_int32_t hv_resp_write_idx; /* arm->host */ - volatile u_int32_t hv_rx_hi_write_idx; /* arm->host */ + volatile uint32_t hv_rx_hi_read_idx; /* host->arm */ + volatile uint32_t hv_rx_lo_read_idx; /* host->arm */ + volatile uint32_t hv_rx_buf_write_idx; /* host->arm */ + volatile uint32_t hv_resp_read_idx; /* host->arm */ + volatile uint32_t hv_tx_lo_desc_read_idx; /* arm->host */ + volatile uint32_t hv_tx_hi_desc_read_idx; /* arm->host */ + volatile uint32_t hv_rx_lo_write_idx; /* arm->host */ + volatile uint32_t hv_rx_buf_read_idx; /* arm->host */ + volatile uint32_t hv_cmd_read_idx; /* arm->host */ + volatile uint32_t hv_resp_write_idx; /* arm->host */ + volatile uint32_t hv_rx_hi_write_idx; /* arm->host */ }; /* @@ -546,23 +546,23 @@ struct txp_hostvar { struct txp_cmd_ring { struct txp_cmd_desc *base; - u_int32_t lastwrite; - u_int32_t size; + uint32_t lastwrite; + uint32_t size; }; struct txp_rsp_ring { struct txp_rsp_desc *base; - u_int32_t lastwrite; - u_int32_t size; + uint32_t lastwrite; + uint32_t size; }; struct txp_tx_ring { struct txp_tx_desc *r_desc; /* base address of descs */ - u_int32_t r_reg; /* register to activate */ - u_int32_t r_prod; /* producer */ - u_int32_t r_cons; /* consumer */ - u_int32_t r_cnt; /* # descs in use */ - volatile u_int32_t *r_off; /* hostvar index pointer */ + uint32_t r_reg; /* register to activate */ + uint32_t r_prod; /* producer */ + uint32_t r_cons; /* consumer */ + uint32_t r_cnt; /* # descs in use */ + volatile uint32_t *r_off; /* hostvar index pointer */ }; struct txp_swdesc { @@ -572,8 +572,8 @@ struct txp_swdesc { struct txp_rx_ring { struct txp_rx_desc *r_desc; /* base address of descs */ - volatile u_int32_t *r_roff; /* hv read offset ptr */ - volatile u_int32_t *r_woff; /* hv write offset ptr */ + volatile uint32_t *r_roff; /* hv read offset ptr */ + volatile uint32_t *r_woff; /* hv write offset ptr */ }; struct txp_ldata { @@ -586,7 +586,7 @@ struct txp_ldata { struct txp_rx_desc txp_rxloring[RX_ENTRIES]; struct txp_cmd_desc txp_cmdring[CMD_ENTRIES]; struct txp_rsp_desc txp_rspring[RSP_ENTRIES]; - u_int32_t txp_zero; + uint32_t txp_zero; }; struct txp_softc { @@ -611,25 +611,25 @@ struct txp_softc { struct txp_tx_ring sc_txhir, sc_txlor; struct txp_rxbuf_desc *sc_rxbufs; struct txp_rx_ring sc_rxhir, sc_rxlor; - u_int16_t sc_xcvr; - u_int16_t sc_seq; + uint16_t sc_xcvr; + uint16_t sc_seq; int sc_cold; - u_int32_t sc_rx_capability, sc_tx_capability; + uint32_t sc_rx_capability, sc_tx_capability; }; struct txp_fw_file_header { - u_int8_t magicid[8]; /* TYPHOON\0 */ - u_int32_t version; - u_int32_t nsections; - u_int32_t addr; - u_int32_t hmac[5]; + uint8_t magicid[8]; /* TYPHOON\0 */ + uint32_t version; + uint32_t nsections; + uint32_t addr; + uint32_t hmac[5]; }; struct txp_fw_section_header { - u_int32_t nbytes; - u_int16_t cksum; - u_int16_t reserved; - u_int32_t addr; + uint32_t nbytes; + uint16_t cksum; + uint16_t reserved; + uint32_t addr; }; #define TXP_MAX_SEGLEN 0xffff @@ -660,7 +660,7 @@ struct txp_fw_section_header { #define TXP_DEVICEID_3CR990B_SRV 0x990A struct txp_type { - u_int16_t txp_vid; - u_int16_t txp_did; + uint16_t txp_vid; + uint16_t txp_did; char *txp_name; }; From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 06:21:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12F70106564A; Sun, 22 Mar 2009 06:21: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 F38648FC08; Sun, 22 Mar 2009 06:21:35 +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 n2M6LZa0059229; Sun, 22 Mar 2009 06:21:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2M6LZHe059227; Sun, 22 Mar 2009 06:21:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903220621.n2M6LZHe059227@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 22 Mar 2009 06:21:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190246 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/txp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 06:21:36 -0000 Author: yongari Date: Sun Mar 22 06:21:35 2009 New Revision: 190246 URL: http://svn.freebsd.org/changeset/base/190246 Log: MFC r189690: Replace local CRC32 routine with ether_crc32_be(). This should have happened long time ago. Also simplify Rx filter logic. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/txp/if_txp.c stable/7/sys/dev/txp/if_txpreg.h Modified: stable/7/sys/dev/txp/if_txp.c ============================================================================== --- stable/7/sys/dev/txp/if_txp.c Sun Mar 22 06:16:44 2009 (r190245) +++ stable/7/sys/dev/txp/if_txp.c Sun Mar 22 06:21:35 2009 (r190246) @@ -1721,60 +1721,44 @@ txp_show_descriptor(void *d) static void txp_set_filter(struct txp_softc *sc) { - struct ifnet *ifp = sc->sc_ifp; - uint32_t crc, carry, hashbit, hash[2]; + struct ifnet *ifp; + uint32_t crc, mchash[2]; uint16_t filter; - uint8_t octet; - int i, j, mcnt = 0; struct ifmultiaddr *ifma; - char *enm; + int mcnt; - if (ifp->if_flags & IFF_PROMISC) { - filter = TXP_RXFILT_PROMISC; - goto setit; - } + TXP_LOCK_ASSERT(sc); + ifp = sc->sc_ifp; filter = TXP_RXFILT_DIRECT; - - if (ifp->if_flags & IFF_BROADCAST) + if ((ifp->if_flags & IFF_BROADCAST) != 0) filter |= TXP_RXFILT_BROADCAST; + if ((ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) != 0) { + if ((ifp->if_flags & IFF_ALLMULTI) != 0) + filter |= TXP_RXFILT_ALLMULTI; + if ((ifp->if_flags & IFF_PROMISC) != 0) + filter = TXP_RXFILT_PROMISC; + goto setit; + } - if (ifp->if_flags & IFF_ALLMULTI) - filter |= TXP_RXFILT_ALLMULTI; - else { - hash[0] = hash[1] = 0; - - IF_ADDR_LOCK(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) - continue; - - enm = LLADDR((struct sockaddr_dl *)ifma->ifma_addr); - mcnt++; - crc = 0xffffffff; - - for (i = 0; i < ETHER_ADDR_LEN; i++) { - octet = enm[i]; - for (j = 0; j < 8; j++) { - carry = ((crc & 0x80000000) ? 1 : 0) ^ - (octet & 1); - crc <<= 1; - octet >>= 1; - if (carry) - crc = (crc ^ TXP_POLYNOMIAL) | - carry; - } - } - hashbit = (uint16_t)(crc & (64 - 1)); - hash[hashbit / 32] |= (1 << hashbit % 32); - } - IF_ADDR_UNLOCK(ifp); - - if (mcnt > 0) { - filter |= TXP_RXFILT_HASHMULTI; - txp_command(sc, TXP_CMD_MCAST_HASH_MASK_WRITE, - 2, hash[0], hash[1], NULL, NULL, NULL, 0); - } + mchash[0] = mchash[1] = 0; + mcnt = 0; + IF_ADDR_LOCK(ifp); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + crc = ether_crc32_be(LLADDR((struct sockaddr_dl *) + ifma->ifma_addr), ETHER_ADDR_LEN); + crc &= 0x3f; + mchash[crc >> 5] |= 1 << (crc & 0x1f); + mcnt++; + } + IF_ADDR_UNLOCK(ifp); + + if (mcnt > 0) { + filter |= TXP_RXFILT_HASHMULTI; + txp_command(sc, TXP_CMD_MCAST_HASH_MASK_WRITE, 2, mchash[0], + mchash[1], NULL, NULL, NULL, 0); } setit: Modified: stable/7/sys/dev/txp/if_txpreg.h ============================================================================== --- stable/7/sys/dev/txp/if_txpreg.h Sun Mar 22 06:16:44 2009 (r190245) +++ stable/7/sys/dev/txp/if_txpreg.h Sun Mar 22 06:21:35 2009 (r190246) @@ -456,9 +456,6 @@ struct txp_tcpseg_desc { #define TXP_RXFILT_PROMISC 0x0008 /* promiscuous mode */ #define TXP_RXFILT_HASHMULTI 0x0010 /* use multicast filter */ -/* multicast polynomial */ -#define TXP_POLYNOMIAL 0x04c11db7 - /* * boot record (pointers to rings) */ From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 06:26:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D40C106566C; Sun, 22 Mar 2009 06:26:48 +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 083E28FC16; Sun, 22 Mar 2009 06:26:48 +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 n2M6QlRx059390; Sun, 22 Mar 2009 06:26:47 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2M6Qlq4059388; Sun, 22 Mar 2009 06:26:47 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903220626.n2M6Qlq4059388@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 22 Mar 2009 06:26:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190247 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/txp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 06:26:48 -0000 Author: yongari Date: Sun Mar 22 06:26:47 2009 New Revision: 190247 URL: http://svn.freebsd.org/changeset/base/190247 Log: MFC r189714: bus_dma(9) conversion and make txp(4) work on all architectures. o Header file cleanup. o bus_dma(9) conversion. - Removed all consumers of vtophys(9) and converted to use bus_dma(9). - Typhoon2 functional specification says the controller supports 64bit DMA addressing. However all Typhoon controllers are known to lack of DAC support so 64bit DMA support was disabled. - The hardware can't handle more 16 fragmented Tx DMA segments so teach txp(4) to collapse these segments to be less than 16. - Added Rx buffer alignment requirements(4 bytes alignment) and implemented fixup code to align receive frame. Previously txp(4) always copied Rx frame to align it on 2 byte boundary but its copy overhead is much higher than unaligned access on i386/amd64. Alignment fixup code is now applied only for strict-alignment architectures. With this change i386 and amd64 will get instant Rx performance boost. Typhoon2 datasheet mentions a command that pads arbitrary bytes in Rx buffer but that command does not work. - Nuked pointer trick in descriptor ring. This does not work on sparc64 and replaced it with bcopy. Alternatively txp(4) can embed a 32 bits index value into the descriptor and compute real buffer address but it may make code complicated. - Added endianness support code in various Tx/Rx/command/response descriptor access. With this change txp(4) should work on all architectures. o Added comments for known firmware bugs(Tx checksum offloading, TSO, VLAN stripping and Rx buffer padding control). o Prefer faster memory space register access to I/O space access. Added fall-back mechanism to use alternative I/O space access. The hardware supports both memory and I/O mapped access. Users can still force to use old I/O space access by setting hw.txp.prefer_iomap tunable to 1 in /boot/loader.conf. o Added experimental suspend/resume methods. o Nuke error prone Rx buffer handling code and implemented local buffer management with TAILQ. Be definition the controller can't pass the last received frame to host if no Rx free buffers are available to use as head and tail pointer of Rx descriptor ring can't have the same value. In that case the Rx buffer pointer in Rx buffer ring still holds a valid buffer and txp_rxbuf_reclaim() can't fill Rx buffers as the first buffer is still valid. Instead of relying on the value of Rx buffer ring, introduce local buffer management code to handle empty buffer situation. This should fix a long standing bug which completely hangs the controller under high network load. I could easily trigger the issue by sending 64 bytes UDP frames with netperf. I have no idea how this bugs was not fixed for a long time. o Converted ithread interrupt handler to filter based one. o Rearranged txp_detach routine such that it's now used for general clean-up routine. o Show sleep image version on device attach time. This will help to know what action should be taken depending on sleep image version. The version information in datasheet was wrong for newer NV images so I followed Linux which seems to correctly extract version numbers from response descriptors. o Firmware image is no longer downloaded in device attach time. Now it is reloaded whenever if_init is invoked. This is to ensure correct operation of hardware when something goes wrong. Previously the controller always run without regard to running state of firmware. This change will add additional controller initialization time but it give more robust operation as txp(4) always start off from a known state. The controller is put into sleep state until administrator explicitly up the interface. o As firmware is loaded in if_init handler, it's now possible to implement real watchdog timeout handler. When watchdog timer is expired, full-reset the controller and initialize the hardware again as most other drivers do. While I'm here use our own timer for watchdog instead of using if_watchdog/if_timer interface. o Instead of masking specific interrupts with TXP_IMR register, program TXP_IER register with the interrupts to be raised and use TXP_IMR to toggle interrupt generation. o Implemented txp_wait() to wait a specific state of a controller. o Separate boot related code from txp_download_fw() and name it txp_boot() to handle boot process. o Added bus_barrier(9) to host to ARM communication. o Added endianness to all typhoon command processing. The ARM93C always expects little-endian format of command/data. o Removed __STRICT_ALIGNMENT which is not valid on FreeBSD. __NO_STRICT_ALIGNMENT is provided for that purpose on FreeBSD. Previously __STRICT_ALIGNMENT was unconditionally defined for all architectures. o Rewrote SIOCSIFCAP ioctl handler such that each capability can be controlled by ifconfig(8). Note, disabling VLAN hardware tagging has no effect due to the bug of firmware. o Don't send TXP_CMD_CLEAR_STATISTICS to clear MAC statistics in txp_tick(). The command is not atomic. Instead, just read the statistics and reflect saved statistics to the statistics. dev.txp.%d.stats sysctl node provides detailed MAC statistics. This also reduces a lot of waste of CPU cycles as processing a command ring takes a very long time on ARM93C. Note, Rx multicast and broadcast statistics does not seem to right. It might be another bug of firmware. o Implemented link state change handling in txp_tick(). Now sending packets is allowed only after establishing a valid link. Also invoke link state change notification whenever its state is changed so pseudo drivers like lagg(4) that relies on link state can work with failover or link aggregation without hacks. if_baudrate is updated to resolved speed so SNMP agents can get correct bandwidth parameters. o Overhauled Tx routine such that it now honors number of allowable DMA segments and checks for 4 free descriptors before trying to send a frame. A frame may require 4 descriptors(1 frame descriptor, 1 or more frame descriptors, 1 TSO option descriptor, one free descriptor to prevent descriptor wrap-around) at least so it's necessary to check available free descriptors prior to setting up DMA operation. o Added a sysctl variable dev.txp.%d.process_limit to control how many received frames should be served in Rx handler. Valid ranges are 16 to 128(default 64) in unit of frames. o Added ALTQ(4) support. o Added missing IFCAP_VLAN_HWCSUM as txp(4) can offload checksum calculation as well as VLAN tag insertion/stripping. o Fixed media header length for VLAN. o Don't set if_mtu in device attach, it's already set in ether_ifattach(). o Enabled MWI. o Fixed module unload panic when bpf listeners are active. o Rearranged ethernet address programming logic such that it works on strict-alignment architectures. o Removed unused member variables in softc. o Added support for WOL. o Removed now unused TXP_PCI_LOMEM/TXP_PCI_LOIO. o Added wakeup command TXP_BOOTCMD_WAKEUP definition. o Added a new firmware version query command, TXP_CMD_READ_VERSION. o Removed volatile keyword in softc as bus_dmamap_sync(9) should take care of this. o Removed embedded union trick of a structure used to to access a pointer on LP64 systems. o Added a few TSO related definitions for struct txp_tcpseg_desc. However TSO is not used at all due to the limitation of hardware. o Redefined PKT_MAX_PKTLEN to theoretical maximum size of a frame. o Switched from bus_space_{read|write}_4 to bus_{read|write}_4. o Added a new macro TXP_DESC_INC to compute next descriptor index. Tested by: don.nasco <> gmail dot com Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/txp/if_txp.c stable/7/sys/dev/txp/if_txpreg.h Modified: stable/7/sys/dev/txp/if_txp.c ============================================================================== --- stable/7/sys/dev/txp/if_txp.c Sun Mar 22 06:21:35 2009 (r190246) +++ stable/7/sys/dev/txp/if_txp.c Sun Mar 22 06:26:47 2009 (r190247) @@ -42,53 +42,82 @@ __FBSDID("$FreeBSD$"); */ #include #include -#include -#include -#include +#include +#include #include +#include +#include +#include #include +#include +#include +#include #include +#include +#include +#include +#include #include #include #include #include +#include #include #include #include #include -#include #include -#include -#include - -#include - -#include - -#include /* for vtophys */ -#include /* for vtophys */ -#include -#include -#include -#include #include -#include + #include #include -#define TXP_USEIOSPACE -#define __STRICT_ALIGNMENT +#include +#include #include #include -#ifndef lint -static const char rcsid[] = - "$FreeBSD$"; -#endif +MODULE_DEPEND(txp, pci, 1, 1, 1); +MODULE_DEPEND(txp, ether, 1, 1, 1); + +/* + * XXX Known Typhoon firmware issues. + * + * 1. It seems that firmware has Tx TCP/UDP checksum offloading bug. + * The firmware hangs when it's told to compute TCP/UDP checksum. + * I'm not sure whether the firmware requires special alignment to + * do checksum offloading but datasheet says nothing about that. + * 2. Datasheet says nothing for maximum number of fragmented + * descriptors supported. Experimentation shows up to 16 fragment + * descriptors are supported in the firmware. For TSO case, upper + * stack can send 64KB sized IP datagram plus link header size( + * ethernet header + VLAN tag) frame but controller can handle up + * to 64KB frame given that PAGE_SIZE is 4KB(i.e. 16 * PAGE_SIZE). + * Because frames that need TSO operation of hardware can be + * larger than 64KB I disabled TSO capability. TSO operation for + * less than or equal to 16 fragment descriptors works without + * problems, though. + * 3. VLAN hardware tag stripping is always enabled in the firmware + * even if it's explicitly told to not strip the tag. It's + * possible to add the tag back in Rx handler if VLAN hardware + * tag is not active but I didn't try that as it would be + * layering violation. + * 4. TXP_CMD_RECV_BUFFER_CONTROL does not work as expected in + * datasheet such that driver should handle the alignment + * restriction by copying received frame to align the frame on + * 32bit boundary on strict-alignment architectures. This adds a + * lot of CPU burden and it effectively reduce Rx performance on + * strict-alignment architectures(e.g. sparc64, arm, mips and ia64). + * + * Unfortunately it seems that 3Com have no longer interests in + * releasing fixed firmware so we may have to live with these bugs. + */ + +#define TXP_CSUM_FEATURES (CSUM_IP) /* * Various supported device vendors/types and their names. @@ -112,25 +141,36 @@ static struct txp_type txp_devs[] = { static int txp_probe(device_t); static int txp_attach(device_t); static int txp_detach(device_t); -static void txp_intr(void *); -static void txp_tick(void *); static int txp_shutdown(device_t); +static int txp_suspend(device_t); +static int txp_resume(device_t); +static int txp_intr(void *); +static void txp_int_task(void *, int); +static void txp_tick(void *); static int txp_ioctl(struct ifnet *, u_long, caddr_t); static void txp_start(struct ifnet *); static void txp_start_locked(struct ifnet *); +static int txp_encap(struct txp_softc *, struct txp_tx_ring *, struct mbuf **); static void txp_stop(struct txp_softc *); static void txp_init(void *); static void txp_init_locked(struct txp_softc *); -static void txp_watchdog(struct ifnet *); +static void txp_watchdog(struct txp_softc *); -static void txp_release_resources(struct txp_softc *); -static int txp_chip_init(struct txp_softc *); -static int txp_reset_adapter(struct txp_softc *); +static int txp_reset(struct txp_softc *); +static int txp_boot(struct txp_softc *, uint32_t); +static int txp_sleep(struct txp_softc *, int); +static int txp_wait(struct txp_softc *, uint32_t); static int txp_download_fw(struct txp_softc *); static int txp_download_fw_wait(struct txp_softc *); static int txp_download_fw_section(struct txp_softc *, struct txp_fw_section_header *, int); static int txp_alloc_rings(struct txp_softc *); +static void txp_init_rings(struct txp_softc *); +static int txp_dma_alloc(struct txp_softc *, char *, bus_dma_tag_t *, + bus_size_t, bus_size_t, bus_dmamap_t *, void **, bus_size_t, bus_addr_t *); +static void txp_dma_free(struct txp_softc *, bus_dma_tag_t *, bus_dmamap_t *, + void **); +static void txp_free_rings(struct txp_softc *); static int txp_rxring_fill(struct txp_softc *); static void txp_rxring_empty(struct txp_softc *); static void txp_set_filter(struct txp_softc *); @@ -138,14 +178,14 @@ static void txp_set_filter(struct txp_so static int txp_cmd_desc_numfree(struct txp_softc *); static int txp_command(struct txp_softc *, uint16_t, uint16_t, uint32_t, uint32_t, uint16_t *, uint32_t *, uint32_t *, int); -static int txp_command2(struct txp_softc *, uint16_t, uint16_t, +static int txp_ext_command(struct txp_softc *, uint16_t, uint16_t, uint32_t, uint32_t, struct txp_ext_desc *, uint8_t, struct txp_rsp_desc **, int); -static int txp_response(struct txp_softc *, uint32_t, uint16_t, uint16_t, +static int txp_response(struct txp_softc *, uint16_t, uint16_t, struct txp_rsp_desc **); static void txp_rsp_fixup(struct txp_softc *, struct txp_rsp_desc *, struct txp_rsp_desc *); -static void txp_capabilities(struct txp_softc *); +static int txp_set_capabilities(struct txp_softc *); static void txp_ifmedia_sts(struct ifnet *, struct ifmediareq *); static int txp_ifmedia_upd(struct ifnet *); @@ -154,15 +194,18 @@ static void txp_show_descriptor(void *); #endif static void txp_tx_reclaim(struct txp_softc *, struct txp_tx_ring *); static void txp_rxbuf_reclaim(struct txp_softc *); -static void txp_rx_reclaim(struct txp_softc *, struct txp_rx_ring *); - -#ifdef TXP_USEIOSPACE -#define TXP_RES SYS_RES_IOPORT -#define TXP_RID TXP_PCI_LOIO -#else -#define TXP_RES SYS_RES_MEMORY -#define TXP_RID TXP_PCI_LOMEM +#ifndef __NO_STRICT_ALIGNMENT +static __inline void txp_fixup_rx(struct mbuf *); #endif +static int txp_rx_reclaim(struct txp_softc *, struct txp_rx_ring *, int); +static void txp_stats_save(struct txp_softc *); +static void txp_stats_update(struct txp_softc *, struct txp_rsp_desc *); +static void txp_sysctl_node(struct txp_softc *); +static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int); +static int sysctl_hw_txp_proc_limit(SYSCTL_HANDLER_ARGS); + +static int prefer_iomap = 0; +TUNABLE_INT("hw.txp.prefer_iomap", &prefer_iomap); static device_method_t txp_methods[] = { /* Device interface */ @@ -170,7 +213,10 @@ static device_method_t txp_methods[] = { DEVMETHOD(device_attach, txp_attach), DEVMETHOD(device_detach, txp_detach), DEVMETHOD(device_shutdown, txp_shutdown), - { 0, 0 } + DEVMETHOD(device_suspend, txp_suspend), + DEVMETHOD(device_resume, txp_resume), + + { NULL, NULL } }; static driver_t txp_driver = { @@ -182,8 +228,6 @@ static driver_t txp_driver = { static devclass_t txp_devclass; DRIVER_MODULE(txp, pci, txp_driver, txp_devclass, 0, 0); -MODULE_DEPEND(txp, pci, 1, 1, 1); -MODULE_DEPEND(txp, ether, 1, 1, 1); static int txp_probe(device_t dev) @@ -209,36 +253,65 @@ txp_attach(device_t dev) { struct txp_softc *sc; struct ifnet *ifp; + struct txp_rsp_desc *rsp; uint16_t p1; - uint32_t p2; - int error = 0, rid; - u_char eaddr[6]; + uint32_t p2, reg; + int error = 0, pmc, rid; + uint8_t eaddr[ETHER_ADDR_LEN], *ver; sc = device_get_softc(dev); sc->sc_dev = dev; - sc->sc_cold = 1; mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); callout_init_mtx(&sc->sc_tick, &sc->sc_mtx, 0); + TASK_INIT(&sc->sc_int_task, 0, txp_int_task, sc); + TAILQ_INIT(&sc->sc_busy_list); + TAILQ_INIT(&sc->sc_free_list); - /* - * Map control/status registers. - */ - pci_enable_busmaster(dev); - - rid = TXP_RID; - sc->sc_res = bus_alloc_resource_any(dev, TXP_RES, &rid, - RF_ACTIVE); + ifmedia_init(&sc->sc_ifmedia, 0, txp_ifmedia_upd, txp_ifmedia_sts); + ifmedia_add(&sc->sc_ifmedia, IFM_ETHER | IFM_10_T, 0, NULL); + ifmedia_add(&sc->sc_ifmedia, IFM_ETHER | IFM_10_T | IFM_HDX, 0, NULL); + ifmedia_add(&sc->sc_ifmedia, IFM_ETHER | IFM_10_T | IFM_FDX, 0, NULL); + ifmedia_add(&sc->sc_ifmedia, IFM_ETHER | IFM_100_TX, 0, NULL); + ifmedia_add(&sc->sc_ifmedia, IFM_ETHER | IFM_100_TX | IFM_HDX, 0, NULL); + ifmedia_add(&sc->sc_ifmedia, IFM_ETHER | IFM_100_TX | IFM_FDX, 0, NULL); + ifmedia_add(&sc->sc_ifmedia, IFM_ETHER | IFM_AUTO, 0, NULL); + pci_enable_busmaster(dev); + /* Prefer memory space register mapping over IO space. */ + if (prefer_iomap == 0) { + sc->sc_res_id = PCIR_BAR(1); + sc->sc_res_type = SYS_RES_MEMORY; + } else { + sc->sc_res_id = PCIR_BAR(0); + sc->sc_res_type = SYS_RES_IOPORT; + } + sc->sc_res = bus_alloc_resource_any(dev, sc->sc_res_type, + &sc->sc_res_id, RF_ACTIVE); + if (sc->sc_res == NULL && prefer_iomap == 0) { + sc->sc_res_id = PCIR_BAR(0); + sc->sc_res_type = SYS_RES_IOPORT; + sc->sc_res = bus_alloc_resource_any(dev, sc->sc_res_type, + &sc->sc_res_id, RF_ACTIVE); + } if (sc->sc_res == NULL) { device_printf(dev, "couldn't map ports/memory\n"); - error = ENXIO; - goto fail; + ifmedia_removeall(&sc->sc_ifmedia); + mtx_destroy(&sc->sc_mtx); + return (ENXIO); } - sc->sc_bt = rman_get_bustag(sc->sc_res); - sc->sc_bh = rman_get_bushandle(sc->sc_res); + /* Enable MWI. */ + reg = pci_read_config(dev, PCIR_COMMAND, 2); + reg |= PCIM_CMD_MWRICEN; + pci_write_config(dev, PCIR_COMMAND, reg, 2); + /* Check cache line size. */ + reg = pci_read_config(dev, PCIR_CACHELNSZ, 1); + reg <<= 4; + if (reg == 0 || (reg % 16) != 0) + device_printf(sc->sc_dev, + "invalid cache line size : %u\n", reg); /* Allocate interrupt */ rid = 0; @@ -251,112 +324,155 @@ txp_attach(device_t dev) goto fail; } - if (txp_chip_init(sc)) { - error = ENXIO; - goto fail; - } - - sc->sc_fwbuf = contigmalloc(32768, M_DEVBUF, - M_NOWAIT, 0, 0xffffffff, PAGE_SIZE, 0); - if (sc->sc_fwbuf == NULL) { - device_printf(dev, "no memory for firmware\n"); - error = ENXIO; - goto fail; - } - error = txp_download_fw(sc); - contigfree(sc->sc_fwbuf, 32768, M_DEVBUF); - sc->sc_fwbuf = NULL; - - if (error) + if ((error = txp_alloc_rings(sc)) != 0) goto fail; - - sc->sc_ldata = contigmalloc(sizeof(struct txp_ldata), M_DEVBUF, - M_NOWAIT, 0, 0xffffffff, PAGE_SIZE, 0); - if (sc->sc_ldata == NULL) { - device_printf(dev, "no memory for descriptor ring\n"); - error = ENXIO; - goto fail; - } - bzero(sc->sc_ldata, sizeof(struct txp_ldata)); - - if (txp_alloc_rings(sc)) { + txp_init_rings(sc); + txp_sysctl_node(sc); + /* Reset controller and make it reload sleep image. */ + if (txp_reset(sc) != 0) { error = ENXIO; goto fail; } - if (txp_command(sc, TXP_CMD_MAX_PKT_SIZE_WRITE, TXP_MAX_PKTLEN, 0, 0, - NULL, NULL, NULL, 1)) { + /* Let controller boot from sleep image. */ + if (txp_boot(sc, STAT_WAITING_FOR_HOST_REQUEST) != 0) { + device_printf(sc->sc_dev, "could not boot sleep image\n"); error = ENXIO; goto fail; } + /* Get station address. */ if (txp_command(sc, TXP_CMD_STATION_ADDRESS_READ, 0, 0, 0, - &p1, &p2, NULL, 1)) { + &p1, &p2, NULL, TXP_CMD_WAIT)) { error = ENXIO; goto fail; } + p1 = le16toh(p1); eaddr[0] = ((uint8_t *)&p1)[1]; eaddr[1] = ((uint8_t *)&p1)[0]; + p2 = le32toh(p2); eaddr[2] = ((uint8_t *)&p2)[3]; eaddr[3] = ((uint8_t *)&p2)[2]; eaddr[4] = ((uint8_t *)&p2)[1]; eaddr[5] = ((uint8_t *)&p2)[0]; - sc->sc_cold = 0; - - ifmedia_init(&sc->sc_ifmedia, 0, txp_ifmedia_upd, txp_ifmedia_sts); - ifmedia_add(&sc->sc_ifmedia, IFM_ETHER|IFM_10_T, 0, NULL); - ifmedia_add(&sc->sc_ifmedia, IFM_ETHER|IFM_10_T|IFM_HDX, 0, NULL); - ifmedia_add(&sc->sc_ifmedia, IFM_ETHER|IFM_10_T|IFM_FDX, 0, NULL); - ifmedia_add(&sc->sc_ifmedia, IFM_ETHER|IFM_100_TX, 0, NULL); - ifmedia_add(&sc->sc_ifmedia, IFM_ETHER|IFM_100_TX|IFM_HDX, 0, NULL); - ifmedia_add(&sc->sc_ifmedia, IFM_ETHER|IFM_100_TX|IFM_FDX, 0, NULL); - ifmedia_add(&sc->sc_ifmedia, IFM_ETHER|IFM_AUTO, 0, NULL); - - sc->sc_xcvr = TXP_XCVR_AUTO; - txp_command(sc, TXP_CMD_XCVR_SELECT, TXP_XCVR_AUTO, 0, 0, - NULL, NULL, NULL, 0); - ifmedia_set(&sc->sc_ifmedia, IFM_ETHER|IFM_AUTO); - ifp = sc->sc_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { - device_printf(dev, "can not if_alloc()\n"); + device_printf(dev, "can not allocate ifnet structure\n"); error = ENOSPC; goto fail; } + + /* + * Show sleep image version information which may help to + * diagnose sleep image specific issues. + */ + rsp = NULL; + if (txp_ext_command(sc, TXP_CMD_READ_VERSION, 0, 0, 0, NULL, 0, + &rsp, TXP_CMD_WAIT)) { + device_printf(dev, "can not read sleep image version\n"); + error = ENXIO; + goto fail; + } + if (rsp->rsp_numdesc == 0) { + p2 = le32toh(rsp->rsp_par2) & 0xFFFF; + device_printf(dev, "Typhoon 1.0 sleep image (2000/%02u/%02u)\n", + p2 >> 8, p2 & 0xFF); + } else if (rsp->rsp_numdesc == 2) { + p2 = le32toh(rsp->rsp_par2); + ver = (uint8_t *)(rsp + 1); + /* + * Even if datasheet says the command returns a NULL + * terminated version string, explicitly terminate + * the string. Given that several bugs of firmware + * I can't trust this simple one. + */ + ver[25] = '\0'; + device_printf(dev, + "Typhoon 1.1+ sleep image %02u.%03u.%03u %s\n", + p2 >> 24, (p2 >> 12) & 0xFFF, p2 & 0xFFF, ver); + } else { + p2 = le32toh(rsp->rsp_par2); + device_printf(dev, + "Unknown Typhoon sleep image version: %u:0x%08x\n", + rsp->rsp_numdesc, p2); + } + if (rsp != NULL) + free(rsp, M_DEVBUF); + + sc->sc_xcvr = TXP_XCVR_AUTO; + txp_command(sc, TXP_CMD_XCVR_SELECT, TXP_XCVR_AUTO, 0, 0, + NULL, NULL, NULL, TXP_CMD_NOWAIT); + ifmedia_set(&sc->sc_ifmedia, IFM_ETHER | IFM_AUTO); + ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = txp_ioctl; ifp->if_start = txp_start; - ifp->if_watchdog = txp_watchdog; ifp->if_init = txp_init; - ifp->if_baudrate = 100000000; - ifp->if_snd.ifq_maxlen = TX_ENTRIES; - ifp->if_hwassist = 0; - txp_capabilities(sc); - + ifp->if_snd.ifq_drv_maxlen = TX_ENTRIES - 1; + IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); + IFQ_SET_READY(&ifp->if_snd); /* - * Attach us everywhere + * It's possible to read firmware's offload capability but + * we have not downloaded the firmware yet so announce + * working capability here. We're not interested in IPSec + * capability and due to the lots of firmware bug we can't + * advertise the whole capability anyway. */ + ifp->if_capabilities = IFCAP_RXCSUM | IFCAP_TXCSUM; + if (pci_find_extcap(dev, PCIY_PMG, &pmc) == 0) + ifp->if_capabilities |= IFCAP_WOL_MAGIC; + /* Enable all capabilities. */ + ifp->if_capenable = ifp->if_capabilities; + ether_ifattach(ifp, eaddr); + /* VLAN capability setup. */ + ifp->if_capabilities |= IFCAP_VLAN_MTU; + ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM; + ifp->if_capenable = ifp->if_capabilities; + /* Tell the upper layer(s) we support long frames. */ + ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); + + WRITE_REG(sc, TXP_IER, TXP_INTR_NONE); + WRITE_REG(sc, TXP_IMR, TXP_INTR_ALL); + + /* Create local taskq. */ + sc->sc_tq = taskqueue_create_fast("txp_taskq", M_WAITOK, + taskqueue_thread_enqueue, &sc->sc_tq); + if (sc->sc_tq == NULL) { + device_printf(dev, "could not create taskqueue.\n"); + ether_ifdetach(ifp); + error = ENXIO; + goto fail; + } + taskqueue_start_threads(&sc->sc_tq, 1, PI_NET, "%s taskq", + device_get_nameunit(sc->sc_dev)); + + /* Put controller into sleep. */ + if (txp_sleep(sc, 0) != 0) { + ether_ifdetach(ifp); + error = ENXIO; + goto fail; + } + error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_NET | INTR_MPSAFE, - NULL, txp_intr, sc, &sc->sc_intrhand); + txp_intr, NULL, sc, &sc->sc_intrhand); - if (error) { + if (error != 0) { ether_ifdetach(ifp); - device_printf(dev, "couldn't set up irq\n"); + device_printf(dev, "couldn't set up interrupt handler.\n"); goto fail; } return (0); fail: - txp_release_resources(sc); - mtx_destroy(&sc->sc_mtx); + if (error != 0) + txp_detach(dev); return (error); } @@ -365,101 +481,57 @@ txp_detach(device_t dev) { struct txp_softc *sc; struct ifnet *ifp; - int i; sc = device_get_softc(dev); - ifp = sc->sc_ifp; - TXP_LOCK(sc); - txp_stop(sc); - TXP_UNLOCK(sc); - txp_shutdown(dev); - callout_drain(&sc->sc_tick); + ifp = sc->sc_ifp; + if (device_is_attached(dev)) { + TXP_LOCK(sc); + sc->sc_flags |= TXP_FLAG_DETACH; + txp_stop(sc); + TXP_UNLOCK(sc); + callout_drain(&sc->sc_tick); + taskqueue_drain(sc->sc_tq, &sc->sc_int_task); + ether_ifdetach(ifp); + } + WRITE_REG(sc, TXP_IMR, TXP_INTR_ALL); ifmedia_removeall(&sc->sc_ifmedia); - ether_ifdetach(ifp); - - for (i = 0; i < RXBUF_ENTRIES; i++) - free(sc->sc_rxbufs[i].rb_sd, M_DEVBUF); - - txp_release_resources(sc); - - mtx_destroy(&sc->sc_mtx); - return (0); -} - -static void -txp_release_resources(struct txp_softc *sc) -{ - device_t dev; - - dev = sc->sc_dev; - if (sc->sc_intrhand != NULL) bus_teardown_intr(dev, sc->sc_irq, sc->sc_intrhand); - if (sc->sc_irq != NULL) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq); - if (sc->sc_res != NULL) - bus_release_resource(dev, TXP_RES, TXP_RID, sc->sc_res); - - if (sc->sc_ldata != NULL) - contigfree(sc->sc_ldata, sizeof(struct txp_ldata), M_DEVBUF); - - if (sc->sc_ifp) + bus_release_resource(dev, sc->sc_res_type, sc->sc_res_id, + sc->sc_res); + if (sc->sc_ifp != NULL) { if_free(sc->sc_ifp); -} - -static int -txp_chip_init(struct txp_softc *sc) -{ - /* disable interrupts */ - WRITE_REG(sc, TXP_IER, 0); - WRITE_REG(sc, TXP_IMR, - TXP_INT_SELF | TXP_INT_PCI_TABORT | TXP_INT_PCI_MABORT | - TXP_INT_DMA3 | TXP_INT_DMA2 | TXP_INT_DMA1 | TXP_INT_DMA0 | - TXP_INT_LATCH); - - /* ack all interrupts */ - WRITE_REG(sc, TXP_ISR, TXP_INT_RESERVED | TXP_INT_LATCH | - TXP_INT_A2H_7 | TXP_INT_A2H_6 | TXP_INT_A2H_5 | TXP_INT_A2H_4 | - TXP_INT_SELF | TXP_INT_PCI_TABORT | TXP_INT_PCI_MABORT | - TXP_INT_DMA3 | TXP_INT_DMA2 | TXP_INT_DMA1 | TXP_INT_DMA0 | - TXP_INT_A2H_3 | TXP_INT_A2H_2 | TXP_INT_A2H_1 | TXP_INT_A2H_0); - - if (txp_reset_adapter(sc)) - return (-1); - - /* disable interrupts */ - WRITE_REG(sc, TXP_IER, 0); - WRITE_REG(sc, TXP_IMR, - TXP_INT_SELF | TXP_INT_PCI_TABORT | TXP_INT_PCI_MABORT | - TXP_INT_DMA3 | TXP_INT_DMA2 | TXP_INT_DMA1 | TXP_INT_DMA0 | - TXP_INT_LATCH); - - /* ack all interrupts */ - WRITE_REG(sc, TXP_ISR, TXP_INT_RESERVED | TXP_INT_LATCH | - TXP_INT_A2H_7 | TXP_INT_A2H_6 | TXP_INT_A2H_5 | TXP_INT_A2H_4 | - TXP_INT_SELF | TXP_INT_PCI_TABORT | TXP_INT_PCI_MABORT | - TXP_INT_DMA3 | TXP_INT_DMA2 | TXP_INT_DMA1 | TXP_INT_DMA0 | - TXP_INT_A2H_3 | TXP_INT_A2H_2 | TXP_INT_A2H_1 | TXP_INT_A2H_0); + sc->sc_ifp = NULL; + } + txp_free_rings(sc); + mtx_destroy(&sc->sc_mtx); return (0); } static int -txp_reset_adapter(struct txp_softc *sc) +txp_reset(struct txp_softc *sc) { uint32_t r; int i; + /* Disable interrupts. */ + WRITE_REG(sc, TXP_IER, TXP_INTR_NONE); + WRITE_REG(sc, TXP_IMR, TXP_INTR_ALL); + /* Ack all pending interrupts. */ + WRITE_REG(sc, TXP_ISR, TXP_INTR_ALL); + r = 0; WRITE_REG(sc, TXP_SRR, TXP_SRR_ALL); DELAY(1000); WRITE_REG(sc, TXP_SRR, 0); - /* Should wait max 6 seconds */ + /* Should wait max 6 seconds. */ for (i = 0; i < 6000; i++) { r = READ_REG(sc, TXP_A2H_0); if (r == STAT_WAITING_FOR_HOST_REQUEST) @@ -467,11 +539,55 @@ txp_reset_adapter(struct txp_softc *sc) DELAY(1000); } - if (r != STAT_WAITING_FOR_HOST_REQUEST) { + if (r != STAT_WAITING_FOR_HOST_REQUEST) device_printf(sc->sc_dev, "reset hung\n"); - return (-1); + + WRITE_REG(sc, TXP_IER, TXP_INTR_NONE); + WRITE_REG(sc, TXP_IMR, TXP_INTR_ALL); + WRITE_REG(sc, TXP_ISR, TXP_INTR_ALL); + + /* + * Give more time to complete loading sleep image before + * trying to boot from sleep image. + */ + DELAY(5000); + + return (0); +} + +static int +txp_boot(struct txp_softc *sc, uint32_t state) +{ + + /* See if it's waiting for boot, and try to boot it. */ + if (txp_wait(sc, state) != 0) { + device_printf(sc->sc_dev, "not waiting for boot\n"); + return (ENXIO); + } + + WRITE_REG(sc, TXP_H2A_2, TXP_ADDR_HI(sc->sc_ldata.txp_boot_paddr)); + TXP_BARRIER(sc, TXP_H2A_2, 4, BUS_SPACE_BARRIER_WRITE); + WRITE_REG(sc, TXP_H2A_1, TXP_ADDR_LO(sc->sc_ldata.txp_boot_paddr)); + TXP_BARRIER(sc, TXP_H2A_1, 4, BUS_SPACE_BARRIER_WRITE); + WRITE_REG(sc, TXP_H2A_0, TXP_BOOTCMD_REGISTER_BOOT_RECORD); + TXP_BARRIER(sc, TXP_H2A_0, 4, BUS_SPACE_BARRIER_WRITE); + + /* See if it booted. */ + if (txp_wait(sc, STAT_RUNNING) != 0) { + device_printf(sc->sc_dev, "firmware not running\n"); + return (ENXIO); } + /* Clear TX and CMD ring write registers. */ + WRITE_REG(sc, TXP_H2A_1, TXP_BOOTCMD_NULL); + TXP_BARRIER(sc, TXP_H2A_1, 4, BUS_SPACE_BARRIER_WRITE); + WRITE_REG(sc, TXP_H2A_2, TXP_BOOTCMD_NULL); + TXP_BARRIER(sc, TXP_H2A_2, 4, BUS_SPACE_BARRIER_WRITE); + WRITE_REG(sc, TXP_H2A_3, TXP_BOOTCMD_NULL); + TXP_BARRIER(sc, TXP_H2A_3, 4, BUS_SPACE_BARRIER_WRITE); + WRITE_REG(sc, TXP_H2A_0, TXP_BOOTCMD_NULL); + TXP_BARRIER(sc, TXP_H2A_0, 4, BUS_SPACE_BARRIER_WRITE); + return (0); } @@ -480,10 +596,11 @@ txp_download_fw(struct txp_softc *sc) { struct txp_fw_file_header *fileheader; struct txp_fw_section_header *secthead; - int error, sect; - uint32_t r, i, ier, imr; + int sect; + uint32_t error, ier, imr; + + TXP_LOCK_ASSERT(sc); - r = 0; error = 0; ier = READ_REG(sc, TXP_IER); WRITE_REG(sc, TXP_IER, ier | TXP_INT_A2H_0); @@ -491,68 +608,60 @@ txp_download_fw(struct txp_softc *sc) imr = READ_REG(sc, TXP_IMR); WRITE_REG(sc, TXP_IMR, imr | TXP_INT_A2H_0); - for (i = 0; i < 10000; i++) { - r = READ_REG(sc, TXP_A2H_0); - if (r == STAT_WAITING_FOR_HOST_REQUEST) - break; - DELAY(50); - } - if (r != STAT_WAITING_FOR_HOST_REQUEST) { + if (txp_wait(sc, STAT_WAITING_FOR_HOST_REQUEST) != 0) { device_printf(sc->sc_dev, "not waiting for host request\n"); - error = -1; + error = ETIMEDOUT; goto fail; } - /* Ack the status */ + /* Ack the status. */ WRITE_REG(sc, TXP_ISR, TXP_INT_A2H_0); fileheader = (struct txp_fw_file_header *)tc990image; if (bcmp("TYPHOON", fileheader->magicid, sizeof(fileheader->magicid))) { - device_printf(sc->sc_dev, "fw invalid magic\n"); - error = -1; + device_printf(sc->sc_dev, "firmware invalid magic\n"); goto fail; } - /* Tell boot firmware to get ready for image */ - WRITE_REG(sc, TXP_H2A_1, fileheader->addr); - WRITE_REG(sc, TXP_H2A_2, fileheader->hmac[0]); - WRITE_REG(sc, TXP_H2A_3, fileheader->hmac[1]); - WRITE_REG(sc, TXP_H2A_4, fileheader->hmac[2]); - WRITE_REG(sc, TXP_H2A_5, fileheader->hmac[3]); - WRITE_REG(sc, TXP_H2A_6, fileheader->hmac[4]); + /* Tell boot firmware to get ready for image. */ + WRITE_REG(sc, TXP_H2A_1, le32toh(fileheader->addr)); + TXP_BARRIER(sc, TXP_H2A_1, 4, BUS_SPACE_BARRIER_WRITE); + WRITE_REG(sc, TXP_H2A_2, le32toh(fileheader->hmac[0])); + TXP_BARRIER(sc, TXP_H2A_2, 4, BUS_SPACE_BARRIER_WRITE); + WRITE_REG(sc, TXP_H2A_3, le32toh(fileheader->hmac[1])); + TXP_BARRIER(sc, TXP_H2A_3, 4, BUS_SPACE_BARRIER_WRITE); + WRITE_REG(sc, TXP_H2A_4, le32toh(fileheader->hmac[2])); + TXP_BARRIER(sc, TXP_H2A_4, 4, BUS_SPACE_BARRIER_WRITE); + WRITE_REG(sc, TXP_H2A_5, le32toh(fileheader->hmac[3])); + TXP_BARRIER(sc, TXP_H2A_5, 4, BUS_SPACE_BARRIER_WRITE); + WRITE_REG(sc, TXP_H2A_6, le32toh(fileheader->hmac[4])); + TXP_BARRIER(sc, TXP_H2A_6, 4, BUS_SPACE_BARRIER_WRITE); WRITE_REG(sc, TXP_H2A_0, TXP_BOOTCMD_RUNTIME_IMAGE); + TXP_BARRIER(sc, TXP_H2A_0, 4, BUS_SPACE_BARRIER_WRITE); if (txp_download_fw_wait(sc)) { - device_printf(sc->sc_dev, "fw wait failed, initial\n"); - error = -1; + device_printf(sc->sc_dev, "firmware wait failed, initial\n"); + error = ETIMEDOUT; goto fail; } secthead = (struct txp_fw_section_header *)(((uint8_t *)tc990image) + sizeof(struct txp_fw_file_header)); - for (sect = 0; sect < fileheader->nsections; sect++) { - - if (txp_download_fw_section(sc, secthead, sect)) { - error = -1; + for (sect = 0; sect < le32toh(fileheader->nsections); sect++) { + if ((error = txp_download_fw_section(sc, secthead, sect)) != 0) goto fail; - } secthead = (struct txp_fw_section_header *) - (((uint8_t *)secthead) + secthead->nbytes + + (((uint8_t *)secthead) + le32toh(secthead->nbytes) + sizeof(*secthead)); } WRITE_REG(sc, TXP_H2A_0, TXP_BOOTCMD_DOWNLOAD_COMPLETE); + TXP_BARRIER(sc, TXP_H2A_0, 4, BUS_SPACE_BARRIER_WRITE); - for (i = 0; i < 10000; i++) { - r = READ_REG(sc, TXP_A2H_0); - if (r == STAT_WAITING_FOR_BOOT) - break; - DELAY(50); - } - if (r != STAT_WAITING_FOR_BOOT) { + if (txp_wait(sc, STAT_WAITING_FOR_BOOT) != 0) { device_printf(sc->sc_dev, "not waiting for boot\n"); - error = -1; + error = ETIMEDOUT; goto fail; } @@ -566,27 +675,26 @@ fail: static int txp_download_fw_wait(struct txp_softc *sc) { - uint32_t i, r; + uint32_t i; - r = 0; - for (i = 0; i < 10000; i++) { - r = READ_REG(sc, TXP_ISR); - if (r & TXP_INT_A2H_0) + TXP_LOCK_ASSERT(sc); + + for (i = 0; i < TXP_TIMEOUT; i++) { + if ((READ_REG(sc, TXP_ISR) & TXP_INT_A2H_0) != 0) break; DELAY(50); } - if (!(r & TXP_INT_A2H_0)) { - device_printf(sc->sc_dev, "fw wait failed comm0\n"); - return (-1); + if (i == TXP_TIMEOUT) { + device_printf(sc->sc_dev, "firmware wait failed comm0\n"); + return (ETIMEDOUT); } WRITE_REG(sc, TXP_ISR, TXP_INT_A2H_0); - r = READ_REG(sc, TXP_A2H_0); - if (r != STAT_WAITING_FOR_SEGMENT) { - device_printf(sc->sc_dev, "fw not waiting for segment\n"); - return (-1); + if (READ_REG(sc, TXP_A2H_0) != STAT_WAITING_FOR_SEGMENT) { + device_printf(sc->sc_dev, "firmware not waiting for segment\n"); + return (ETIMEDOUT); } return (0); } @@ -595,180 +703,262 @@ static int txp_download_fw_section(struct txp_softc *sc, struct txp_fw_section_header *sect, int sectnum) { - vm_offset_t dma; + bus_dma_tag_t sec_tag; + bus_dmamap_t sec_map; + bus_addr_t sec_paddr; + uint8_t *sec_buf; int rseg, err = 0; struct mbuf m; uint16_t csum; - /* Skip zero length sections */ - if (sect->nbytes == 0) + TXP_LOCK_ASSERT(sc); + + /* Skip zero length sections. */ + if (le32toh(sect->nbytes) == 0) return (0); - /* Make sure we aren't past the end of the image */ + /* Make sure we aren't past the end of the image. */ rseg = ((uint8_t *)sect) - ((uint8_t *)tc990image); if (rseg >= sizeof(tc990image)) { - device_printf(sc->sc_dev, "fw invalid section address, " - "section %d\n", sectnum); - return (-1); + device_printf(sc->sc_dev, + "firmware invalid section address, section %d\n", sectnum); + return (EIO); } - /* Make sure this section doesn't go past the end */ - rseg += sect->nbytes; + /* Make sure this section doesn't go past the end. */ + rseg += le32toh(sect->nbytes); if (rseg >= sizeof(tc990image)) { - device_printf(sc->sc_dev, "fw truncated section %d\n", + device_printf(sc->sc_dev, "firmware truncated section %d\n", sectnum); - return (-1); + return (EIO); } - bcopy(((uint8_t *)sect) + sizeof(*sect), sc->sc_fwbuf, sect->nbytes); - dma = vtophys(sc->sc_fwbuf); + sec_tag = NULL; + sec_map = NULL; + sec_buf = NULL; + /* XXX */ + TXP_UNLOCK(sc); + err = txp_dma_alloc(sc, "firmware sections", &sec_tag, sizeof(uint32_t), + 0, &sec_map, (void **)&sec_buf, le32toh(sect->nbytes), &sec_paddr); + TXP_LOCK(sc); + if (err != 0) + goto bail; + bcopy(((uint8_t *)sect) + sizeof(*sect), sec_buf, + le32toh(sect->nbytes)); /* * dummy up mbuf and verify section checksum */ m.m_type = MT_DATA; m.m_next = m.m_nextpkt = NULL; - m.m_len = sect->nbytes; - m.m_data = sc->sc_fwbuf; + m.m_len = le32toh(sect->nbytes); + m.m_data = sec_buf; m.m_flags = 0; - csum = in_cksum(&m, sect->nbytes); + csum = in_cksum(&m, le32toh(sect->nbytes)); if (csum != sect->cksum) { - device_printf(sc->sc_dev, "fw section %d, bad " - "cksum (expected 0x%x got 0x%x)\n", - sectnum, sect->cksum, csum); - err = -1; + device_printf(sc->sc_dev, + "firmware section %d, bad cksum (expected 0x%x got 0x%x)\n", + sectnum, le16toh(sect->cksum), csum); + err = EIO; goto bail; } - WRITE_REG(sc, TXP_H2A_1, sect->nbytes); - WRITE_REG(sc, TXP_H2A_2, sect->cksum); - WRITE_REG(sc, TXP_H2A_3, sect->addr); - WRITE_REG(sc, TXP_H2A_4, 0); - WRITE_REG(sc, TXP_H2A_5, dma & 0xffffffff); + bus_dmamap_sync(sec_tag, sec_map, BUS_DMASYNC_PREWRITE); + + WRITE_REG(sc, TXP_H2A_1, le32toh(sect->nbytes)); + TXP_BARRIER(sc, TXP_H2A_1, 4, BUS_SPACE_BARRIER_WRITE); + WRITE_REG(sc, TXP_H2A_2, le16toh(sect->cksum)); + TXP_BARRIER(sc, TXP_H2A_2, 4, BUS_SPACE_BARRIER_WRITE); + WRITE_REG(sc, TXP_H2A_3, le32toh(sect->addr)); + TXP_BARRIER(sc, TXP_H2A_3, 4, BUS_SPACE_BARRIER_WRITE); + WRITE_REG(sc, TXP_H2A_4, TXP_ADDR_HI(sec_paddr)); + TXP_BARRIER(sc, TXP_H2A_4, 4, BUS_SPACE_BARRIER_WRITE); + WRITE_REG(sc, TXP_H2A_5, TXP_ADDR_LO(sec_paddr)); + TXP_BARRIER(sc, TXP_H2A_5, 4, BUS_SPACE_BARRIER_WRITE); WRITE_REG(sc, TXP_H2A_0, TXP_BOOTCMD_SEGMENT_AVAILABLE); + TXP_BARRIER(sc, TXP_H2A_0, 4, BUS_SPACE_BARRIER_WRITE); if (txp_download_fw_wait(sc)) { - device_printf(sc->sc_dev, "fw wait failed, " - "section %d\n", sectnum); - err = -1; + device_printf(sc->sc_dev, + "firmware wait failed, section %d\n", sectnum); + err = ETIMEDOUT; } + bus_dmamap_sync(sec_tag, sec_map, BUS_DMASYNC_POSTWRITE); bail: + txp_dma_free(sc, &sec_tag, &sec_map, (void **)&sec_buf); return (err); } -static void +static int txp_intr(void *vsc) { - struct txp_softc *sc = vsc; - struct txp_hostvar *hv = sc->sc_hostvar; + struct txp_softc *sc; + uint32_t status; + + sc = vsc; + status = READ_REG(sc, TXP_ISR); + if ((status & TXP_INT_LATCH) == 0) + return (FILTER_STRAY); + WRITE_REG(sc, TXP_ISR, status); + WRITE_REG(sc, TXP_IMR, TXP_INTR_ALL); + taskqueue_enqueue(sc->sc_tq, &sc->sc_int_task); + + return (FILTER_HANDLED); +} + +static void +txp_int_task(void *arg, int pending) +{ + struct txp_softc *sc; + struct ifnet *ifp; + struct txp_hostvar *hv; uint32_t isr; + int more; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 06:27:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4BF11065670 for ; Sun, 22 Mar 2009 06:27:12 +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 EB0768FC1A for ; Sun, 22 Mar 2009 06:27:11 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 22 Mar 2009 06:27:10 -0000 Received: from p54A3FD39.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.253.57] by mail.gmx.net (mp045) with SMTP; 22 Mar 2009 07:27:10 +0100 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX19yHBo7tf1yrGq0m7JM3c+OjahQ7V8s5wHbIUPLe4 5zK/rAokhWx1aM Message-ID: <49C5DA3C.9010800@gmx.de> Date: Sun, 22 Mar 2009 07:27:08 +0100 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: David Schultz References: <200903220544.n2M5iuAT058241@svn.freebsd.org> In-Reply-To: <200903220544.n2M5iuAT058241@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.64 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r190240 - stable/7/usr.bin/ncal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 06:27:12 -0000 David Schultz schrieb: > Author: das > Date: Sun Mar 22 05:44:56 2009 > New Revision: 190240 > URL: http://svn.freebsd.org/changeset/base/190240 > > Log: > MFC r189804: > Multibyte character support for cal(1). > > PR: 131578 > > Modified: > stable/7/usr.bin/ncal/ (props changed) > stable/7/usr.bin/ncal/ncal.1 > stable/7/usr.bin/ncal/ncal.c Hi David, did you see my former email that this change is partly erroneous? It is invalid to mix byte and wide functions (here printf() and wprintf()) on the same stream (C99 §7.19.2:5). I also attached a patch. Here's a link to the previous email: http://lists.freebsd.org/pipermail/svn-src-all/2009-March/006296.html Christoph From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 06:28:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F15631065675; Sun, 22 Mar 2009 06:28:53 +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 DDF348FC0A; Sun, 22 Mar 2009 06:28:53 +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 n2M6SrIK059474; Sun, 22 Mar 2009 06:28:53 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2M6Srhw059473; Sun, 22 Mar 2009 06:28:53 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903220628.n2M6Srhw059473@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 22 Mar 2009 06:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190248 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 06:28:55 -0000 Author: yongari Date: Sun Mar 22 06:28:53 2009 New Revision: 190248 URL: http://svn.freebsd.org/changeset/base/190248 Log: MFC r189715: Uncomment txp(4), txp(4) should work on all architectures. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/conf/GENERIC Modified: stable/7/sys/sparc64/conf/GENERIC ============================================================================== --- stable/7/sys/sparc64/conf/GENERIC Sun Mar 22 06:26:47 2009 (r190247) +++ stable/7/sys/sparc64/conf/GENERIC Sun Mar 22 06:28:53 2009 (r190248) @@ -155,7 +155,7 @@ device uart # Multi-uart driver device em # Intel PRO/1000 adapter Gigabit Ethernet Card #device ixgb # Intel PRO/10GbE Ethernet Card device le # AMD Am7900 LANCE and Am79C9xx PCnet -#device txp # 3Com 3cR990 (``Typhoon'') +device txp # 3Com 3cR990 (``Typhoon'') #device vx # 3Com 3c590, 3c595 (``Vortex'') # PCI Ethernet NICs that use the common MII bus controller code. From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 06:30:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FF38106566B; Sun, 22 Mar 2009 06:30:54 +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 7D6A58FC1A; Sun, 22 Mar 2009 06:30:54 +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 n2M6UsN6059572; Sun, 22 Mar 2009 06:30:54 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2M6UsOb059571; Sun, 22 Mar 2009 06:30:54 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903220630.n2M6UsOb059571@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 22 Mar 2009 06:30:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190249 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 06:30:55 -0000 Author: yongari Date: Sun Mar 22 06:30:54 2009 New Revision: 190249 URL: http://svn.freebsd.org/changeset/base/190249 Log: MFC r189716: Add txp(4) to the list of drivers supporting ALTQ. Modified: stable/7/share/man/man4/ (props changed) stable/7/share/man/man4/altq.4 stable/7/share/man/man4/igb.4 (props changed) Modified: stable/7/share/man/man4/altq.4 ============================================================================== --- stable/7/share/man/man4/altq.4 Sun Mar 22 06:28:53 2009 (r190248) +++ stable/7/share/man/man4/altq.4 Sun Mar 22 06:30:54 2009 (r190249) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2008 +.Dd March 12, 2009 .Dt ALTQ 4 .Os .Sh NAME @@ -152,6 +152,7 @@ They have been applied to the following .Xr sk 4 , .Xr ste 4 , .Xr stge 4 , +.Xr txp 4 , .Xr udav 4 , .Xr ural 4 , .Xr vge 4 , From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 06:31:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B23A0106566B; Sun, 22 Mar 2009 06:31:59 +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 9FA608FC0A; Sun, 22 Mar 2009 06:31:59 +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 n2M6VxAl059640; Sun, 22 Mar 2009 06:31:59 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2M6VxEW059639; Sun, 22 Mar 2009 06:31:59 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903220631.n2M6VxEW059639@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 22 Mar 2009 06:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190250 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 06:32:00 -0000 Author: yongari Date: Sun Mar 22 06:31:59 2009 New Revision: 190250 URL: http://svn.freebsd.org/changeset/base/190250 Log: MFC r189717: Xref altq.4 and bump .Dd Modified: stable/7/share/man/man4/ (props changed) stable/7/share/man/man4/igb.4 (props changed) stable/7/share/man/man4/txp.4 Modified: stable/7/share/man/man4/txp.4 ============================================================================== --- stable/7/share/man/man4/txp.4 Sun Mar 22 06:30:54 2009 (r190249) +++ stable/7/share/man/man4/txp.4 Sun Mar 22 06:31:59 2009 (r190250) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd March 12, 2009 .Dt TXP 4 .Os .Sh NAME @@ -134,6 +134,7 @@ driver supports the following cards: 3Com 3cR990B-SRV .El .Sh SEE ALSO +.Xr altq 4 , .Xr arp 4 , .Xr inet 4 , .Xr intro 4 , From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 06:37:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31BC2106566C; Sun, 22 Mar 2009 06:37:15 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 145FA8FC13; Sun, 22 Mar 2009 06:37:15 +0000 (UTC) (envelope-from n_hibma@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 n2M6bEam059790; Sun, 22 Mar 2009 06:37:14 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2M6bEfW059785; Sun, 22 Mar 2009 06:37:14 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200903220637.n2M6bEfW059785@svn.freebsd.org> From: Nick Hibma Date: Sun, 22 Mar 2009 06:37:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190251 - stable/7/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 06:37:16 -0000 Author: n_hibma Date: Sun Mar 22 06:37:14 2009 New Revision: 190251 URL: http://svn.freebsd.org/changeset/base/190251 Log: MFC 184941: Add a reset device command to ugen.c. This is needed to make some devices work that require a firmware upload and a USB reset afterwards. Modified: stable/7/sys/dev/usb/ugen.c stable/7/sys/dev/usb/usb.h stable/7/sys/dev/usb/usb_subr.c stable/7/sys/dev/usb/usbdi.c stable/7/sys/dev/usb/usbdi.h Modified: stable/7/sys/dev/usb/ugen.c ============================================================================== --- stable/7/sys/dev/usb/ugen.c Sun Mar 22 06:31:59 2009 (r190250) +++ stable/7/sys/dev/usb/ugen.c Sun Mar 22 06:37:14 2009 (r190251) @@ -1059,8 +1059,8 @@ ugen_isoc_rintr(usbd_xfer_handle xfer, u sce->cur += count; if(sce->cur >= sce->limit) sce->cur = sce->ibuf + (sce->limit - sce->cur); - DPRINTFN(5, ("ugen_isoc_rintr: throwing away %d bytes\n", - count)); + DPRINTF(("ugen_isoc_rintr: throwing away %d bytes\n", + count)); } isize = UGETW(sce->edesc->wMaxPacketSize); @@ -1427,7 +1427,6 @@ ugen_do_ioctl(struct ugen_softc *sc, int struct iovec iov; struct uio uio; void *ptr = 0; - usbd_status err; int error = 0; if (!(flag & FWRITE)) @@ -1485,6 +1484,11 @@ ugen_do_ioctl(struct ugen_softc *sc, int usbd_fill_deviceinfo(sc->sc_udev, (struct usb_device_info *)addr, 1); break; + case USB_RESET_DEVICE: + err = usbd_reset_device(sc->sc_udev); + if (err) + return EIO; + break; default: return (EINVAL); } Modified: stable/7/sys/dev/usb/usb.h ============================================================================== --- stable/7/sys/dev/usb/usb.h Sun Mar 22 06:31:59 2009 (r190250) +++ stable/7/sys/dev/usb/usb.h Sun Mar 22 06:37:14 2009 (r190251) @@ -697,6 +697,7 @@ struct usb_event { #define USB_GET_DEVICEINFO _IOR ('U', 112, struct usb_device_info) #define USB_SET_SHORT_XFER _IOW ('U', 113, int) #define USB_SET_TIMEOUT _IOW ('U', 114, int) +#define USB_RESET_DEVICE _IO ('U', 115) /* Modem device */ #define USB_GET_CM_OVER_DATA _IOR ('U', 130, int) Modified: stable/7/sys/dev/usb/usb_subr.c ============================================================================== --- stable/7/sys/dev/usb/usb_subr.c Sun Mar 22 06:31:59 2009 (r190250) +++ stable/7/sys/dev/usb/usb_subr.c Sun Mar 22 06:37:14 2009 (r190251) @@ -322,16 +322,10 @@ usbd_delay_ms(usbd_device_handle dev, u_ usbd_status usbd_reset_port(usbd_device_handle dev, int port, usb_port_status_t *ps) { - usb_device_request_t req; usbd_status err; int n; - req.bmRequestType = UT_WRITE_CLASS_OTHER; - req.bRequest = UR_SET_FEATURE; - USETW(req.wValue, UHF_PORT_RESET); - USETW(req.wIndex, port); - USETW(req.wLength, 0); - err = usbd_do_request(dev, &req, 0); + err = usbd_set_port_feature(dev, port, UHF_PORT_RESET); DPRINTFN(1,("usbd_reset_port: port %d reset done, error=%s\n", port, usbd_errstr(err))); if (err) @@ -685,11 +679,11 @@ usbd_set_config_index(usbd_device_handle DPRINTF(("power exceeded %d %d\n", power,dev->powersrc->power)); /* XXX print nicer message. */ if (msg) - printf("%s: device addr %d (config %d) exceeds power " - "budget, %d mA > %d mA\n", - device_get_nameunit(dev->bus->bdev), dev->address, - cdp->bConfigurationValue, - power, dev->powersrc->power); + device_printf(dev->bus->bdev, + "device addr %d (config %d) exceeds " + "power budget, %d mA > %d mA\n", + dev->address, cdp->bConfigurationValue, + power, dev->powersrc->power); err = USBD_NO_POWER; goto bad; } @@ -1023,8 +1017,7 @@ usbd_new_device(device_t parent, usbd_bu bus, port, depth, speed)); addr = usbd_getnewaddr(bus); if (addr < 0) { - printf("%s: No free USB addresses, new device ignored.\n", - device_get_nameunit(bus->bdev)); + device_printf(bus->bdev, "No free USB addresses\n"); return (USBD_NO_ADDR); } @@ -1370,11 +1363,14 @@ usb_disconnect_port(struct usbd_port *up if (dev->subdevs != NULL) { DPRINTFN(3,("usb_disconnect_port: disconnect subdevs\n")); for (i = 0; dev->subdevs[i]; i++) { - printf("%s: at %s", device_get_nameunit(dev->subdevs[i]), - hubname); - if (up->portno != 0) - printf(" port %d", up->portno); - printf(" (addr %d) disconnected\n", dev->address); + if (!device_is_quiet(dev->subdevs[i])) { + device_printf(dev->subdevs[i], + "at %s", hubname); + if (up->portno != 0) + printf(" port %d", up->portno); + printf(" (addr %d) disconnected\n", dev->address); + } + struct usb_attach_arg *uaap = device_get_ivars(dev->subdevs[i]); device_detach(dev->subdevs[i]); Modified: stable/7/sys/dev/usb/usbdi.c ============================================================================== --- stable/7/sys/dev/usb/usbdi.c Sun Mar 22 06:31:59 2009 (r190250) +++ stable/7/sys/dev/usb/usbdi.c Sun Mar 22 06:37:14 2009 (r190251) @@ -1230,6 +1230,15 @@ usbd_set_polling(usbd_device_handle dev, dev->bus->methods->soft_intr(dev->bus); } +usbd_status +usbd_reset_device(usbd_device_handle dev) +{ + usbd_device_handle parent = dev->myhub; + struct usbd_port *up = dev->powersrc; + + return usbd_reset_port(parent, up->portno, &up->status); +} + usb_endpoint_descriptor_t * usbd_get_endpoint_descriptor(usbd_interface_handle iface, u_int8_t address) Modified: stable/7/sys/dev/usb/usbdi.h ============================================================================== --- stable/7/sys/dev/usb/usbdi.h Sun Mar 22 06:31:59 2009 (r190250) +++ stable/7/sys/dev/usb/usbdi.h Sun Mar 22 06:37:14 2009 (r190251) @@ -158,6 +158,7 @@ usb_endpoint_descriptor_t *usbd_find_ede void usbd_dopoll(usbd_interface_handle); void usbd_set_polling(usbd_device_handle, int); +usbd_status usbd_reset_device(usbd_device_handle); const char *usbd_errstr(usbd_status); From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 06:47:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D5811065672; Sun, 22 Mar 2009 06:47:30 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61A948FC12; Sun, 22 Mar 2009 06:47:30 +0000 (UTC) (envelope-from n_hibma@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 n2M6lUYP060098; Sun, 22 Mar 2009 06:47:30 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2M6lUfd060093; Sun, 22 Mar 2009 06:47:30 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200903220647.n2M6lUfd060093@svn.freebsd.org> From: Nick Hibma Date: Sun, 22 Mar 2009 06:47:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190252 - stable/6/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 06:47:31 -0000 Author: n_hibma Date: Sun Mar 22 06:47:29 2009 New Revision: 190252 URL: http://svn.freebsd.org/changeset/base/190252 Log: MFC 184941: Add a reset device command to ugen.c. This is needed to make some devices work that require a firmware upload and a USB reset afterwards. Modified: stable/6/sys/dev/usb/ugen.c stable/6/sys/dev/usb/usb.h stable/6/sys/dev/usb/usb_subr.c stable/6/sys/dev/usb/usbdi.c stable/6/sys/dev/usb/usbdi.h Modified: stable/6/sys/dev/usb/ugen.c ============================================================================== --- stable/6/sys/dev/usb/ugen.c Sun Mar 22 06:37:14 2009 (r190251) +++ stable/6/sys/dev/usb/ugen.c Sun Mar 22 06:47:29 2009 (r190252) @@ -1133,8 +1133,8 @@ ugen_isoc_rintr(usbd_xfer_handle xfer, u sce->cur += count; if(sce->cur >= sce->limit) sce->cur = sce->ibuf + (sce->limit - sce->cur); - DPRINTFN(5, ("ugen_isoc_rintr: throwing away %d bytes\n", - count)); + DPRINTF(("ugen_isoc_rintr: throwing away %d bytes\n", + count)); } isize = UGETW(sce->edesc->wMaxPacketSize); @@ -1505,7 +1505,6 @@ ugen_do_ioctl(struct ugen_softc *sc, int struct iovec iov; struct uio uio; void *ptr = 0; - usbd_status err; int error = 0; if (!(flag & FWRITE)) @@ -1563,6 +1562,11 @@ ugen_do_ioctl(struct ugen_softc *sc, int usbd_fill_deviceinfo(sc->sc_udev, (struct usb_device_info *)addr, 1); break; + case USB_RESET_DEVICE: + err = usbd_reset_device(sc->sc_udev); + if (err) + return EIO; + break; default: return (EINVAL); } Modified: stable/6/sys/dev/usb/usb.h ============================================================================== --- stable/6/sys/dev/usb/usb.h Sun Mar 22 06:37:14 2009 (r190251) +++ stable/6/sys/dev/usb/usb.h Sun Mar 22 06:47:29 2009 (r190252) @@ -683,6 +683,7 @@ struct usb_event { #define USB_GET_DEVICEINFO _IOR ('U', 112, struct usb_device_info) #define USB_SET_SHORT_XFER _IOW ('U', 113, int) #define USB_SET_TIMEOUT _IOW ('U', 114, int) +#define USB_RESET_DEVICE _IO ('U', 115) /* Modem device */ #define USB_GET_CM_OVER_DATA _IOR ('U', 130, int) Modified: stable/6/sys/dev/usb/usb_subr.c ============================================================================== --- stable/6/sys/dev/usb/usb_subr.c Sun Mar 22 06:37:14 2009 (r190251) +++ stable/6/sys/dev/usb/usb_subr.c Sun Mar 22 06:47:29 2009 (r190252) @@ -334,16 +334,10 @@ usbd_delay_ms(usbd_device_handle dev, u_ usbd_status usbd_reset_port(usbd_device_handle dev, int port, usb_port_status_t *ps) { - usb_device_request_t req; usbd_status err; int n; - req.bmRequestType = UT_WRITE_CLASS_OTHER; - req.bRequest = UR_SET_FEATURE; - USETW(req.wValue, UHF_PORT_RESET); - USETW(req.wIndex, port); - USETW(req.wLength, 0); - err = usbd_do_request(dev, &req, 0); + err = usbd_set_port_feature(dev, port, UHF_PORT_RESET); DPRINTFN(1,("usbd_reset_port: port %d reset done, error=%s\n", port, usbd_errstr(err))); if (err) @@ -697,11 +691,11 @@ usbd_set_config_index(usbd_device_handle DPRINTF(("power exceeded %d %d\n", power,dev->powersrc->power)); /* XXX print nicer message. */ if (msg) - printf("%s: device addr %d (config %d) exceeds power " - "budget, %d mA > %d mA\n", - USBDEVNAME(dev->bus->bdev), dev->address, - cdp->bConfigurationValue, - power, dev->powersrc->power); + device_printf(dev->bus->bdev, + "device addr %d (config %d) exceeds " + "power budget, %d mA > %d mA\n", + dev->address, cdp->bConfigurationValue, + power, dev->powersrc->power); err = USBD_NO_POWER; goto bad; } @@ -1010,8 +1004,7 @@ usbd_new_device(device_ptr_t parent, usb bus, port, depth, speed)); addr = usbd_getnewaddr(bus); if (addr < 0) { - printf("%s: No free USB addresses, new device ignored.\n", - USBDEVNAME(bus->bdev)); + device_printf(bus->bdev, "No free USB addresses\n"); return (USBD_NO_ADDR); } @@ -1417,11 +1410,12 @@ usb_disconnect_port(struct usbd_port *up if (dev->subdevs != NULL) { DPRINTFN(3,("usb_disconnect_port: disconnect subdevs\n")); for (i = 0; dev->subdevs[i]; i++) { - printf("%s: at %s", USBDEVPTRNAME(dev->subdevs[i]), - hubname); - if (up->portno != 0) - printf(" port %d", up->portno); - printf(" (addr %d) disconnected\n", dev->address); + if (!device_is_quiet(dev->subdevs[i])) { + device_printf(dev->subdevs[i], "at %s",hubname); + if (up->portno != 0) + printf(" port %d", up->portno); + printf(" (addr %d) disconnected\n", dev->address); + } config_detach(dev->subdevs[i], DETACH_FORCE); dev->subdevs[i] = NULL; } Modified: stable/6/sys/dev/usb/usbdi.c ============================================================================== --- stable/6/sys/dev/usb/usbdi.c Sun Mar 22 06:37:14 2009 (r190251) +++ stable/6/sys/dev/usb/usbdi.c Sun Mar 22 06:47:29 2009 (r190252) @@ -1112,6 +1112,15 @@ usbd_set_polling(usbd_device_handle dev, dev->bus->methods->soft_intr(dev->bus); } +usbd_status +usbd_reset_device(usbd_device_handle dev) +{ + usbd_device_handle parent = dev->myhub; + struct usbd_port *up = dev->powersrc; + + return usbd_reset_port(parent, up->portno, &up->status); +} + usb_endpoint_descriptor_t * usbd_get_endpoint_descriptor(usbd_interface_handle iface, u_int8_t address) Modified: stable/6/sys/dev/usb/usbdi.h ============================================================================== --- stable/6/sys/dev/usb/usbdi.h Sun Mar 22 06:37:14 2009 (r190251) +++ stable/6/sys/dev/usb/usbdi.h Sun Mar 22 06:47:29 2009 (r190252) @@ -158,6 +158,7 @@ usb_endpoint_descriptor_t *usbd_find_ede void usbd_dopoll(usbd_interface_handle); void usbd_set_polling(usbd_device_handle, int); +usbd_status usbd_reset_device(usbd_device_handle); const char *usbd_errstr(usbd_status); From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 08:09:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DB34106564A; Sun, 22 Mar 2009 08:09:16 +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 6B3BB8FC0C; Sun, 22 Mar 2009 08:09:16 +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 n2M89GYE061660; Sun, 22 Mar 2009 08:09:16 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2M89GAr061659; Sun, 22 Mar 2009 08:09:16 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200903220809.n2M89GAr061659@svn.freebsd.org> From: Ed Schouten Date: Sun, 22 Mar 2009 08:09:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190253 - stable/7/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 08:09:17 -0000 Author: ed Date: Sun Mar 22 08:09:16 2009 New Revision: 190253 URL: http://svn.freebsd.org/changeset/base/190253 Log: MFC: Don't disable CR-to-NL translation when waiting for data to arrive. A difference between the old and the new TTY layer is that the new implementation does not perform any post-processing before returning data back to userspace when calling read(). sh(1)'s read turns the TTY into a raw mode before calling select(). This means that the first character will not receive any ICRNL processing. Inherit this flag from the original terminal attributes. Even though this issue is not present on RELENG_*, I'm MFCing it to make sh(1) in jails behave better. PR: bin/129566 Modified: stable/7/bin/sh/ (props changed) stable/7/bin/sh/miscbltin.c Modified: stable/7/bin/sh/miscbltin.c ============================================================================== --- stable/7/bin/sh/miscbltin.c Sun Mar 22 06:47:29 2009 (r190252) +++ stable/7/bin/sh/miscbltin.c Sun Mar 22 08:09:16 2009 (r190253) @@ -147,6 +147,7 @@ readcmd(int argc __unused, char **argv _ if (tcgetattr(0, &told) == 0) { memcpy(&tnew, &told, sizeof(told)); cfmakeraw(&tnew); + tnew.c_iflag |= told.c_iflag & ICRNL; tcsetattr(0, TCSANOW, &tnew); tsaved = 1; } From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 08:14:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92FFD106564A; Sun, 22 Mar 2009 08:14:01 +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 80AD48FC14; Sun, 22 Mar 2009 08:14:01 +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 n2M8E13G061811; Sun, 22 Mar 2009 08:14:01 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2M8E1F4061810; Sun, 22 Mar 2009 08:14:01 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200903220814.n2M8E1F4061810@svn.freebsd.org> From: Ed Schouten Date: Sun, 22 Mar 2009 08:14:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190254 - stable/6/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 08:14:02 -0000 Author: ed Date: Sun Mar 22 08:14:01 2009 New Revision: 190254 URL: http://svn.freebsd.org/changeset/base/190254 Log: MFC r189542: Don't disable CR-to-NL translation when waiting for data to arrive. A difference between the old and the new TTY layer is that the new implementation does not perform any post-processing before returning data back to userspace when calling read(). sh(1)'s read turns the TTY into a raw mode before calling select(). This means that the first character will not receive any ICRNL processing. Inherit this flag from the original terminal attributes. Even though this issue is not present on RELENG_*, I'm MFCing it to make sh(1) in jails behave better. PR: bin/129566 Modified: stable/6/bin/sh/ (props changed) stable/6/bin/sh/miscbltin.c Modified: stable/6/bin/sh/miscbltin.c ============================================================================== --- stable/6/bin/sh/miscbltin.c Sun Mar 22 08:09:16 2009 (r190253) +++ stable/6/bin/sh/miscbltin.c Sun Mar 22 08:14:01 2009 (r190254) @@ -147,6 +147,7 @@ readcmd(int argc __unused, char **argv _ if (tcgetattr(0, &told) == 0) { memcpy(&tnew, &told, sizeof(told)); cfmakeraw(&tnew); + tnew.c_iflag |= told.c_iflag & ICRNL; tcsetattr(0, TCSANOW, &tnew); tsaved = 1; } From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 08:37:03 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 08:54:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C1931065670 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 DAB798FC12 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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 09:19:02 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 37B95106566C 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 353B414F3D8 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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 09:57:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBD4B106566B; Sun, 22 Mar 2009 09:57:57 +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 AEB468FC0C; Sun, 22 Mar 2009 09:57:57 +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 n2M9vvmJ063805; Sun, 22 Mar 2009 09:57:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2M9vvEH063804; Sun, 22 Mar 2009 09:57:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903220957.n2M9vvEH063804@svn.freebsd.org> From: Marius Strobl Date: Sun, 22 Mar 2009 09:57:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190255 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 09:57:58 -0000 Author: marius Date: Sun Mar 22 09:57:57 2009 New Revision: 190255 URL: http://svn.freebsd.org/changeset/base/190255 Log: MFC: r181640, r190003 - Add sys_tick and the USIII and beyond sys_tick_cmpr to state_regs[]. - Const'ify and static'ize as appropriate. - Use __FBSDID(). Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/sparc64/db_disasm.c Modified: stable/7/sys/sparc64/sparc64/db_disasm.c ============================================================================== --- stable/7/sys/sparc64/sparc64/db_disasm.c Sun Mar 22 08:14:01 2009 (r190254) +++ stable/7/sys/sparc64/sparc64/db_disasm.c Sun Mar 22 09:57:57 2009 (r190255) @@ -28,9 +28,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * from: NetBSD: db_disasm.c,v 1.9 2000/08/16 11:29:42 pk Exp - * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #include #include @@ -76,18 +78,18 @@ struct sparc_insn { unsigned int match; - char* name; - char* format; + const char* name; + const char* format; }; -char* regs[] = { +static const char *const regs[] = { "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", "o0", "o1", "o2", "o3", "o4", "o5", "sp", "o7", "l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7", "i0", "i1", "i2", "i3", "i4", "i5", "fp", "i7" }; -char* priv_regs[] = { +static const char *const priv_regs[] = { "tpc", "tnpc", "tstate", "tt", "tick", "tba", "pstate", "tl", "pil", "cwp", "cansave", "canrestore", "cleanwin", "otherwin", "wstate", "fq", @@ -95,18 +97,18 @@ char* priv_regs[] = { "", "", "", "", "", "", "", "ver" }; -char* state_regs[] = { +static const char *const state_regs[] = { "y", "", "ccr", "asi", "tick", "pc", "fprs", "asr", "", "", "", "", "", "", "", "", - "pcr", "pic", "dcr", "gsr", "set_softint", "clr_softint", "softint", "tick_cmpr", "", - "", "", "", "", "", "", "", "" + "pcr", "pic", "dcr", "gsr", "set_softint", "clr_softint", "softint", + "tick_cmpr", "sys_tick", "sys_tick_cmpr", "", "", "", "", "", "", "" }; -char* ccodes[] = { +static const char *const ccodes[] = { "fcc0", "fcc1", "fcc2", "fcc3", "icc", "", "xcc", "" }; -char* prefetch[] = { +static const char *const prefetch[] = { "n_reads", "one_read", "n_writes", "one_write", "page" }; @@ -162,7 +164,7 @@ V8 only: */ -struct sparc_insn sparc_i[] = { +static const struct sparc_insn sparc_i[] = { /* * Format 1: Call @@ -803,11 +805,10 @@ struct sparc_insn sparc_i[] = { db_addr_t db_disasm(db_addr_t loc, boolean_t altfmt) { - struct sparc_insn* i_ptr = (struct sparc_insn *)&sparc_i; - + const struct sparc_insn* i_ptr = (struct sparc_insn *)&sparc_i; unsigned int insn, you_lose, bitmask; int matchp; - char* f_ptr, *cp; + const char* f_ptr, *cp; you_lose = 0; matchp = 0; @@ -1028,4 +1029,3 @@ db_disasm(db_addr_t loc, boolean_t altfm return (loc + 4); } - From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 10:08:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17B2D10656CA; Sun, 22 Mar 2009 10:08:42 +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 EECB08FC18; Sun, 22 Mar 2009 10:08:41 +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 n2MA8fb8065555; Sun, 22 Mar 2009 10:08:41 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MA8f6i065552; Sun, 22 Mar 2009 10:08:41 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903221008.n2MA8f6i065552@svn.freebsd.org> From: Marius Strobl Date: Sun, 22 Mar 2009 10:08:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190256 - in stable/7/sys: . conf contrib/pf dev/ath/ath_hal dev/cxgb sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 10:08:42 -0000 Author: marius Date: Sun Mar 22 10:08:41 2009 New Revision: 190256 URL: http://svn.freebsd.org/changeset/base/190256 Log: MFC: r182918 Add drivers for the power management devices found on Fireplane/ Safari- and JBus-based machines. Currently the main purpose of these drivers is debugging of the resource allocation on nexus(4) and the register content of these devices though. Added: stable/7/sys/sparc64/sparc64/jbusppm.c - copied unchanged from r182918, head/sys/sparc64/sparc64/jbusppm.c stable/7/sys/sparc64/sparc64/schppm.c - copied unchanged from r182918, head/sys/sparc64/sparc64/schppm.c Modified: stable/7/sys/ (props changed) stable/7/sys/conf/files.sparc64 stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/conf/files.sparc64 ============================================================================== --- stable/7/sys/conf/files.sparc64 Sun Mar 22 09:57:57 2009 (r190255) +++ stable/7/sys/conf/files.sparc64 Sun Mar 22 10:08:41 2009 (r190256) @@ -101,6 +101,7 @@ sparc64/sparc64/interrupt.S standard no- compile-with "${NORMAL_S} -mcpu=ultrasparc" sparc64/sparc64/intr_machdep.c standard sparc64/sparc64/iommu.c standard +sparc64/sparc64/jbusppm.c standard sparc64/sparc64/locore.S standard no-obj sparc64/sparc64/machdep.c standard sparc64/sparc64/mem.c optional mem @@ -116,6 +117,7 @@ sparc64/sparc64/prof_machdep.c optional sparc64/sparc64/rtc.c optional rtc ebus | rtc isa sparc64/sparc64/rwindow.c standard sparc64/sparc64/sc_machdep.c optional sc +sparc64/sparc64/schppm.c standard sparc64/sparc64/spitfire.c standard sparc64/sparc64/stack_machdep.c optional ddb | stack sparc64/sparc64/support.S standard \ Copied: stable/7/sys/sparc64/sparc64/jbusppm.c (from r182918, head/sys/sparc64/sparc64/jbusppm.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/sparc64/sparc64/jbusppm.c Sun Mar 22 10:08:41 2009 (r190256, copy of r182918, head/sys/sparc64/sparc64/jbusppm.c) @@ -0,0 +1,226 @@ +/*- + * Copyright (c) 2008 Marius Strobl + * 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 JBUSPPM_NREG 2 + +#define JBUSPPM_DEVID 0 +#define JBUSPPM_ESTAR 1 + +#define JBUSPPM_DEVID_JID 0x00 +#define JBUSPPM_DEVID_JID_MASTER 0x00040000 + +#define JBUSPPM_ESTAR_CTRL 0x00 +#define JBUSPPM_ESTAR_CTRL_1 0x00000001 +#define JBUSPPM_ESTAR_CTRL_2 0x00000002 +#define JBUSPPM_ESTAR_CTRL_32 0x00000020 +#define JBUSPPM_ESTAR_CTRL_MASK \ + (JBUSPPM_ESTAR_CTRL_1 | JBUSPPM_ESTAR_CTRL_2 | JBUSPPM_ESTAR_CTRL_32) +#define JBUSPPM_ESTAR_JCHNG 0x08 +#define JBUSPPM_ESTAR_JCHNG_DELAY_MASK 0x00000007 +#define JBUSPPM_ESTAR_JCHNG_START 0x00000010 +#define JBUSPPM_ESTAR_JCHNG_OCCURED 0x00000018 + +struct jbusppm_softc { + struct resource *sc_res[JBUSPPM_NREG]; + bus_space_tag_t sc_bt[JBUSPPM_NREG]; + bus_space_handle_t sc_bh[JBUSPPM_NREG]; +}; + +#define JBUSPPM_READ(sc, reg, off) \ + bus_space_read_8((sc)->sc_bt[(reg)], (sc)->sc_bh[(reg)], (off)) +#define JBUSPPM_WRITE(sc, reg, off, val) \ + bus_space_write_8((sc)->sc_bt[(reg)], (sc)->sc_bh[(reg)], (off), (val)) + +static device_probe_t jbusppm_probe; +static device_attach_t jbusppm_attach; + +static device_method_t jbusppm_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, jbusppm_probe), + DEVMETHOD(device_attach, jbusppm_attach), + + { NULL, NULL } +}; + +static devclass_t jbusppm_devclass; + +DEFINE_CLASS_0(jbusppm, jbusppm_driver, jbusppm_methods, + sizeof(struct jbusppm_softc)); +DRIVER_MODULE(jbusppm, nexus, jbusppm_driver, jbusppm_devclass, 0, 0); + +static int +jbusppm_probe(device_t dev) +{ + const char* compat; + + compat = ofw_bus_get_compat(dev); + if (compat != NULL && strcmp(ofw_bus_get_name(dev), "ppm") == 0 && + strcmp(compat, "jbus-ppm") == 0) { + device_set_desc(dev, "JBus power management"); + return (BUS_PROBE_DEFAULT); + } + return (ENXIO); +} + +static int +jbusppm_attach(device_t dev) +{ + struct jbusppm_softc *sc; + int i, rid; +#if 1 + device_t *children, tomatillo; + u_long tcount, tstart, jcount, jstart; + int j, nchildren; +#endif + + sc = device_get_softc(dev); + for (i = JBUSPPM_DEVID; i <= JBUSPPM_ESTAR; i++) { + rid = i; + /* + * The JBUSPPM_ESTAR resources is shared with that of the + * Tomatillo bus A controller configuration register bank. + */ +#if 0 + sc->sc_res[i] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, (i == JBUSPPM_ESTAR ? RF_SHAREABLE : 0) | RF_ACTIVE); + if (sc->sc_res[i] == NULL) { + device_printf(dev, + "could not allocate resource %d\n", i); + goto fail; + } + sc->sc_bt[i] = rman_get_bustag(sc->sc_res[i]); + sc->sc_bh[i] = rman_get_bushandle(sc->sc_res[i]); +#else + /* + * Workaround for the fact that rman(9) only allows to + * share resources of the same size. + */ + if (i == JBUSPPM_ESTAR) { + if (bus_get_resource(dev, SYS_RES_MEMORY, i, &jstart, + &jcount) != 0) { + device_printf(dev, + "could not determine Estar resource\n"); + goto fail; + } + if (device_get_children(device_get_parent(dev), + &children, &nchildren) != 0) { + device_printf(dev, "could not get children\n"); + goto fail; + } + tomatillo = NULL; + for (j = 0; j < nchildren; j++) { + if (ofw_bus_get_type(children[j]) != NULL && + strcmp(ofw_bus_get_type(children[j]), + "pci") == 0 && + ofw_bus_get_compat(children[j]) != NULL && + strcmp(ofw_bus_get_compat(children[j]), + "pci108e,a801") == 0 && + ((bus_get_resource_start(children[j], + SYS_RES_MEMORY, 0) >> 20) & 1) == 0) { + tomatillo = children[j]; + break; + } + } + free(children, M_TEMP); + if (tomatillo == NULL) { + device_printf(dev, + "could not find Tomatillo\n"); + goto fail; + } + if (bus_get_resource(tomatillo, SYS_RES_MEMORY, 1, + &tstart, &tcount) != 0) { + device_printf(dev, + "could not determine Tomatillo " + "resource\n"); + goto fail; + } + sc->sc_res[i] = bus_alloc_resource(dev, SYS_RES_MEMORY, + &rid, tstart, tstart + tcount - 1, tcount, + RF_SHAREABLE | RF_ACTIVE); + } else + sc->sc_res[i] = bus_alloc_resource_any(dev, + SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (sc->sc_res[i] == NULL) { + device_printf(dev, + "could not allocate resource %d\n", i); + goto fail; + } + sc->sc_bt[i] = rman_get_bustag(sc->sc_res[i]); + sc->sc_bh[i] = rman_get_bushandle(sc->sc_res[i]); + if (i == JBUSPPM_ESTAR) + bus_space_subregion(sc->sc_bt[i], sc->sc_bh[i], + jstart - tstart, jcount, &sc->sc_bh[i]); +#endif + } + + if (bootverbose) { + if ((JBUSPPM_READ(sc, JBUSPPM_DEVID, JBUSPPM_DEVID_JID) & + JBUSPPM_DEVID_JID_MASTER) != 0) + device_printf(dev, "master I/O bridge\n"); + device_printf(dev, "running at "); + switch (JBUSPPM_READ(sc, JBUSPPM_ESTAR, JBUSPPM_ESTAR_CTRL) & + JBUSPPM_ESTAR_CTRL_MASK) { + case JBUSPPM_ESTAR_CTRL_1: + printf("full"); + break; + case JBUSPPM_ESTAR_CTRL_2: + printf("half"); + break; + case JBUSPPM_ESTAR_CTRL_32: + printf("1/32"); + break; + default: + printf("unknown"); + break; + } + printf(" speed\n"); + } + + return (0); + + fail: + for (i = JBUSPPM_DEVID; i <= JBUSPPM_ESTAR && sc->sc_res[i] != NULL; + i++) + bus_release_resource(dev, SYS_RES_MEMORY, + rman_get_rid(sc->sc_res[i]), sc->sc_res[i]); + return (ENXIO); +} Copied: stable/7/sys/sparc64/sparc64/schppm.c (from r182918, head/sys/sparc64/sparc64/schppm.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/sparc64/sparc64/schppm.c Sun Mar 22 10:08:41 2009 (r190256, copy of r182918, head/sys/sparc64/sparc64/schppm.c) @@ -0,0 +1,132 @@ +/*- + * Copyright (c) 2008 Marius Strobl + * 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 SCHPPM_NREG 1 + +#define SCHPPM_ESTAR 0 + +#define SCHPPM_ESTAR_CTRL 0x00 +#define SCHPPM_ESTAR_CTRL_1 0x00000001 +#define SCHPPM_ESTAR_CTRL_2 0x00000002 +#define SCHPPM_ESTAR_CTRL_32 0x00000020 +#define SCHPPM_ESTAR_CTRL_MASK \ + (SCHPPM_ESTAR_CTRL_1 | SCHPPM_ESTAR_CTRL_2 | SCHPPM_ESTAR_CTRL_32) + +static struct resource_spec schppm_res_spec[] = { + { SYS_RES_MEMORY, SCHPPM_ESTAR, RF_ACTIVE }, + { -1, 0 } +}; + +struct schppm_softc { + struct resource *sc_res[SCHPPM_NREG]; +}; + +#define SCHPPM_READ(sc, reg, off) \ + bus_read_8((sc)->sc_res[(reg)], (off)) +#define SCHPPM_WRITE(sc, reg, off, val) \ + bus_write_8((sc)->sc_res[(reg)], (off), (val)) + +static device_probe_t schppm_probe; +static device_attach_t schppm_attach; + +static device_method_t schppm_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, schppm_probe), + DEVMETHOD(device_attach, schppm_attach), + + { NULL, NULL } +}; + +static devclass_t schppm_devclass; + +DEFINE_CLASS_0(schppm, schppm_driver, schppm_methods, + sizeof(struct schppm_softc)); +DRIVER_MODULE(schppm, nexus, schppm_driver, schppm_devclass, 0, 0); + +static int +schppm_probe(device_t dev) +{ + const char* compat; + + compat = ofw_bus_get_compat(dev); + if (compat != NULL && strcmp(ofw_bus_get_name(dev), "ppm") == 0 && + strcmp(compat, "gp2-ppm") == 0) { + device_set_desc(dev, "Schizo power management"); + return (BUS_PROBE_DEFAULT); + } + return (ENXIO); +} + +static int +schppm_attach(device_t dev) +{ + struct schppm_softc *sc; + + sc = device_get_softc(dev); + if (bus_alloc_resources(dev, schppm_res_spec, sc->sc_res)) { + device_printf(dev, "failed to allocate resources\n"); + bus_release_resources(dev, schppm_res_spec, sc->sc_res); + return (ENXIO); + } + + if (bootverbose) { + device_printf(dev, "running at "); + switch (SCHPPM_READ(sc, SCHPPM_ESTAR, SCHPPM_ESTAR_CTRL) & + SCHPPM_ESTAR_CTRL_MASK) { + case SCHPPM_ESTAR_CTRL_1: + printf("full"); + break; + case SCHPPM_ESTAR_CTRL_2: + printf("half"); + break; + case SCHPPM_ESTAR_CTRL_32: + printf("1/32"); + break; + default: + printf("unknown"); + break; + } + printf(" speed\n"); + } + + return (0); +} From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 10:33:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45BD21065670; Sun, 22 Mar 2009 10:33:11 +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 30EB58FC12; Sun, 22 Mar 2009 10:33:11 +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 n2MAXBXn066196; Sun, 22 Mar 2009 10:33:11 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MAXBme066193; Sun, 22 Mar 2009 10:33:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903221033.n2MAXBme066193@svn.freebsd.org> From: Marius Strobl Date: Sun, 22 Mar 2009 10:33:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190257 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/include sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 10:33:12 -0000 Author: marius Date: Sun Mar 22 10:33:10 2009 New Revision: 190257 URL: http://svn.freebsd.org/changeset/base/190257 Log: MFC: r183142, r186395, 190106 - Newer firmware versions no longer provide SUNW,stop-self so just disable interrupts and loop forever instead. We still could use SUNW,stop-self if implemented but acording to comments in OpenBSD, E{2,4}50 tend to have fragile firmware versions which wedge when using the OFW test service, so given that we don't really depend on SUNW,stop-self just nuke it altogether instead of risking problems. - Hide all MP-related bits in underneath #ifdef SMP. - Inline ipi_all_but_self(9) and ipi_selected(9). We don't expose any additional bits but save a few cycles by doing so. - Remove ipi_all(9), which actually only called panic(9). It can't be implemented natively anyway and having it removed at least causes MI users to already fail when linking. - At least Fire V880 have a small hardware glitch which causes the reception of IDR_NACKs for CPUs we actually haven't tried to send an IPI to, even not as part of the initial try. According to tests this apparently can be safely ignored though, so just return if checking for the individual IDR_NACKs indicates no outstanding dispatch. Serializing the sending of IPIs between MD and MI code by the combined usage of smp_ipi_mtx makes no difference to this phenomenon. [1] - Provide relevant debugging bits already with the initial panic in case of problems with the IPI dispatch, which would have allowed to diagnose the above problem without a specially built kernel. - In case of cheetah_ipi_selected() base the delay we wait for other CPUs which also might want to dispatch IPIs on the total amount of CPUs instead of just the number of CPUs we let this CPU send IPIs to because in the worst case all CPUs also want to IPI us at the same time. - There's no need to wrap kdb_active in #ifdef KDB as it's always available. Reported and access for extensive tests provided by: beat [1] Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/include/smp.h stable/7/sys/sparc64/sparc64/genassym.c stable/7/sys/sparc64/sparc64/mp_machdep.c Modified: stable/7/sys/sparc64/include/smp.h ============================================================================== --- stable/7/sys/sparc64/include/smp.h Sun Mar 22 10:08:41 2009 (r190256) +++ stable/7/sys/sparc64/include/smp.h Sun Mar 22 10:33:10 2009 (r190257) @@ -29,6 +29,8 @@ #ifndef _MACHINE_SMP_H_ #define _MACHINE_SMP_H_ +#ifdef SMP + #define CPU_TICKSYNC 1 #define CPU_STICKSYNC 2 #define CPU_INIT 3 @@ -91,10 +93,6 @@ void cpu_mp_shutdown(void); typedef void cpu_ipi_selected_t(u_int, u_long, u_long, u_long); extern cpu_ipi_selected_t *cpu_ipi_selected; -void ipi_selected(u_int cpus, u_int ipi); -void ipi_all(u_int ipi); -void ipi_all_but_self(u_int ipi); - void mp_init(void); extern struct mtx ipi_mtx; @@ -117,7 +115,19 @@ extern char tl_ipi_tlb_context_demap[]; extern char tl_ipi_tlb_page_demap[]; extern char tl_ipi_tlb_range_demap[]; -#ifdef SMP +static __inline void +ipi_all_but_self(u_int ipi) +{ + + cpu_ipi_selected(PCPU_GET(other_cpus), 0, (u_long)tl_ipi_level, ipi); +} + +static __inline void +ipi_selected(u_int cpus, u_int ipi) +{ + + cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_level, ipi); +} #if defined(_MACHINE_PMAP_H_) && defined(_SYS_MUTEX_H_) @@ -224,8 +234,12 @@ ipi_wait(void *cookie) #endif /* _MACHINE_PMAP_H_ && _SYS_MUTEX_H_ */ +#endif /* !LOCORE */ + #else +#ifndef LOCORE + static __inline void * ipi_dcache_page_inval(void *func, vm_paddr_t pa) { @@ -267,8 +281,26 @@ ipi_wait(void *cookie) } -#endif /* SMP */ +static __inline void +tl_ipi_cheetah_dcache_page_inval(void) +{ + +} + +static __inline void +tl_ipi_spitfire_dcache_page_inval(void) +{ + +} + +static __inline void +tl_ipi_spitfire_icache_page_inval(void) +{ + +} #endif /* !LOCORE */ +#endif /* SMP */ + #endif /* !_MACHINE_SMP_H_ */ Modified: stable/7/sys/sparc64/sparc64/genassym.c ============================================================================== --- stable/7/sys/sparc64/sparc64/genassym.c Sun Mar 22 10:08:41 2009 (r190256) +++ stable/7/sys/sparc64/sparc64/genassym.c Sun Mar 22 10:33:10 2009 (r190257) @@ -83,6 +83,7 @@ ASSYM(PAGE_SHIFT_4M, PAGE_SHIFT_4M); ASSYM(PAGE_SIZE, PAGE_SIZE); ASSYM(PAGE_SIZE_4M, PAGE_SIZE_4M); +#ifdef SMP ASSYM(CSA_PCPU, offsetof(struct cpu_start_args, csa_pcpu)); ASSYM(CSA_STATE, offsetof(struct cpu_start_args, csa_state)); #ifdef SUN4U @@ -95,6 +96,7 @@ ASSYM(CSA_VER, offsetof(struct cpu_start #ifdef SUN4V ASSYM(CSA_CPUID, offsetof(struct cpu_start_args, csa_cpuid)); #endif +#endif #ifdef SUN4U ASSYM(DC_SIZE, offsetof(struct cacheinfo, dc_size)); @@ -103,7 +105,9 @@ ASSYM(IC_SIZE, offsetof(struct cacheinfo ASSYM(IC_LINESIZE, offsetof(struct cacheinfo, ic_linesize)); #endif +#ifdef SMP ASSYM(ICA_PA, offsetof(struct ipi_cache_args, ica_pa)); +#endif ASSYM(KTR_SIZEOF, sizeof(struct ktr_entry)); ASSYM(KTR_LINE, offsetof(struct ktr_entry, ktr_line)); @@ -210,11 +214,13 @@ ASSYM(IR_ARG, offsetof(struct intr_reque ASSYM(IR_PRI, offsetof(struct intr_request, ir_pri)); ASSYM(IR_VEC, offsetof(struct intr_request, ir_vec)); +#ifdef SMP ASSYM(ITA_MASK, offsetof(struct ipi_tlb_args, ita_mask)); ASSYM(ITA_PMAP, offsetof(struct ipi_tlb_args, ita_pmap)); ASSYM(ITA_START, offsetof(struct ipi_tlb_args, ita_start)); ASSYM(ITA_END, offsetof(struct ipi_tlb_args, ita_end)); ASSYM(ITA_VA, offsetof(struct ipi_tlb_args, ita_va)); +#endif ASSYM(IV_FUNC, offsetof(struct intr_vector, iv_func)); ASSYM(IV_ARG, offsetof(struct intr_vector, iv_arg)); Modified: stable/7/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_machdep.c Sun Mar 22 10:08:41 2009 (r190256) +++ stable/7/sys/sparc64/sparc64/mp_machdep.c Sun Mar 22 10:33:10 2009 (r190257) @@ -92,6 +92,9 @@ __FBSDID("$FreeBSD$"); #include #include +#define SUNW_STARTCPU "SUNW,start-cpu" +#define SUNW_STOPSELF "SUNW,stop-self" + static ih_func_t cpu_ipi_ast; static ih_func_t cpu_ipi_preempt; static ih_func_t cpu_ipi_stop; @@ -119,7 +122,6 @@ static volatile u_int shutdown_cpus; static void cpu_mp_unleash(void *v); static void spitfire_ipi_send(u_int mid, u_long d0, u_long d1, u_long d2); static void sun4u_startcpu(phandle_t cpu, void *func, u_long arg); -static void sun4u_stopself(void); static cpu_ipi_selected_t cheetah_ipi_selected; static cpu_ipi_selected_t spitfire_ipi_selected; @@ -203,7 +205,7 @@ sun4u_startcpu(phandle_t cpu, void *func cell_t func; cell_t arg; } args = { - (cell_t)"SUNW,start-cpu", + (cell_t)SUNW_STARTCPU, 3, }; @@ -214,24 +216,6 @@ sun4u_startcpu(phandle_t cpu, void *func } /* - * Stop the calling CPU. - */ -static void -sun4u_stopself(void) -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - } args = { - (cell_t)"SUNW,stop-self", - }; - - openfirmware_exit(&args); - panic("%s: failed.", __func__); -} - -/* * Fire up any non-boot processors. */ void @@ -422,8 +406,6 @@ cpu_mp_shutdown(void) break; } } - /* XXX: delay a bit to allow the CPUs to actually enter the PROM. */ - DELAY(100000); critical_exit(); } @@ -443,7 +425,9 @@ cpu_ipi_stop(struct trapframe *tf) while ((started_cpus & PCPU_GET(cpumask)) == 0) { if ((shutdown_cpus & PCPU_GET(cpumask)) != 0) { atomic_clear_int(&shutdown_cpus, PCPU_GET(cpumask)); - sun4u_stopself(); + (void)intr_disable(); + for (;;) + ; } } atomic_clear_rel_int(&started_cpus, PCPU_GET(cpumask)); @@ -519,15 +503,12 @@ spitfire_ipi_send(u_int mid, u_long d0, */ DELAY(2); } - if ( -#ifdef KDB - kdb_active || -#endif - panicstr != NULL) + if (kdb_active != 0 || panicstr != NULL) printf("%s: couldn't send IPI to module 0x%u\n", __func__, mid); else - panic("%s: couldn't send IPI", __func__); + panic("%s: couldn't send IPI to module 0x%u", + __func__, mid); } static void @@ -581,40 +562,23 @@ cheetah_ipi_selected(u_int cpus, u_long } } /* + * On at least Fire V880 we may receive IDR_NACKs for + * CPUs we actually haven't tried to send an IPI to, + * but which apparently can be safely ignored. + */ + if (cpus == 0) + return; + /* * Leave interrupts enabled for a bit before retrying * in order to avoid deadlocks if the other CPUs are * also trying to send IPIs. */ - DELAY(2 * bnp); + DELAY(2 * mp_ncpus); } - if ( -#ifdef KDB - kdb_active || -#endif - panicstr != NULL) + if (kdb_active != 0 || panicstr != NULL) printf("%s: couldn't send IPI (cpus=0x%u ids=0x%lu)\n", __func__, cpus, ids); else - panic("%s: couldn't send IPI", __func__); -} - -void -ipi_selected(u_int cpus, u_int ipi) -{ - - cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_level, ipi); -} - -void -ipi_all(u_int ipi) -{ - - panic("%s", __func__); -} - -void -ipi_all_but_self(u_int ipi) -{ - - cpu_ipi_selected(PCPU_GET(other_cpus), 0, (u_long)tl_ipi_level, ipi); + panic("%s: couldn't send IPI (cpus=0x%u ids=0x%lu)", + __func__, cpus, ids); } From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 10:42:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C779106566B; Sun, 22 Mar 2009 10:42:08 +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 29F6E8FC08; Sun, 22 Mar 2009 10:42:08 +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 n2MAg7lv066452; Sun, 22 Mar 2009 10:42:07 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MAg7g0066451; Sun, 22 Mar 2009 10:42:07 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903221042.n2MAg7g0066451@svn.freebsd.org> From: Marius Strobl Date: Sun, 22 Mar 2009 10:42:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190258 - stable/6/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 10:42:08 -0000 Author: marius Date: Sun Mar 22 10:42:07 2009 New Revision: 190258 URL: http://svn.freebsd.org/changeset/base/190258 Log: MFC: r167274, r179694, r182816, r182962, r185004 - Some minor tweaks and updates to bus_dma(9) including some additional notes on the address filter and locking callback. - Mark "highaddr" and "lowaddr" appropriately. Change "dma" to "DMA". - Fix spelling mistage found by rodrigc@. - Document BUS_DMA_NOCACHE. - Remove unneeded comma. - For maximum flexibility, sparc64 supports BUS_DMA_COHERENT also with bus_dmamap_create() and not only bus_dmamem_alloc() so move the description of this flag up accordingly in order to document this fact. While at, it refine this description with an application example. Modified: stable/6/share/man/man9/ (props changed) From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 10:51:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44548106567A; Sun, 22 Mar 2009 10:51:41 +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 31A818FC1C; Sun, 22 Mar 2009 10:51:41 +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 n2MApeLT066683; Sun, 22 Mar 2009 10:51:40 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MApeGb066682; Sun, 22 Mar 2009 10:51:40 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200903221051.n2MApeGb066682@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sun, 22 Mar 2009 10:51:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190259 - stable/7/sbin/fdisk_pc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 10:51:42 -0000 Author: nyan Date: Sun Mar 22 10:51:40 2009 New Revision: 190259 URL: http://svn.freebsd.org/changeset/base/190259 Log: MFC: r190027 Use the common PC98_SID_ACTIVE define instead of a local define. Modified: stable/7/sbin/fdisk_pc98/ (props changed) stable/7/sbin/fdisk_pc98/fdisk.c Modified: stable/7/sbin/fdisk_pc98/fdisk.c ============================================================================== --- stable/7/sbin/fdisk_pc98/fdisk.c Sun Mar 22 10:42:07 2009 (r190258) +++ stable/7/sbin/fdisk_pc98/fdisk.c Sun Mar 22 10:51:40 2009 (r190259) @@ -84,8 +84,6 @@ struct mboot { static struct mboot mboot; static int fd; -#define ACTIVE 0x80 - static uint dos_cyls; static uint dos_heads; static uint dos_sectors; @@ -520,7 +518,7 @@ change_active(int which) active = -1; for (i = 0; i < NDOSPART; i++) { - if ((partp[i].dp_sid & ACTIVE) == 0) + if ((partp[i].dp_sid & PC98_SID_ACTIVE) == 0) continue; printf("Partition %d is marked active\n", i + 1); if (active == -1) @@ -545,7 +543,7 @@ setactive: active = new; } while (!ok("Are you happy with this choice")); if (active > 0 && active <= 8) - partp[active-1].dp_sid |= ACTIVE; + partp[active-1].dp_sid |= PC98_SID_ACTIVE; } static void From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 10:55:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02B1B106564A; Sun, 22 Mar 2009 10:55:08 +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 E38858FC13; Sun, 22 Mar 2009 10:55:07 +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 n2MAt7uM066806; Sun, 22 Mar 2009 10:55:07 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MAt7j9066805; Sun, 22 Mar 2009 10:55:07 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200903221055.n2MAt7j9066805@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sun, 22 Mar 2009 10:55:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190260 - in stable/7/sys: . boot/pc98/libpc98 contrib/pf dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 10:55:08 -0000 Author: nyan Date: Sun Mar 22 10:55:07 2009 New Revision: 190260 URL: http://svn.freebsd.org/changeset/base/190260 Log: MFC: r190029 Use the common PC98_MID_* defines instead of a magic number. Modified: stable/7/sys/ (props changed) stable/7/sys/boot/pc98/libpc98/biosdisk.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/boot/pc98/libpc98/biosdisk.c ============================================================================== --- stable/7/sys/boot/pc98/libpc98/biosdisk.c Sun Mar 22 10:51:40 2009 (r190259) +++ stable/7/sys/boot/pc98/libpc98/biosdisk.c Sun Mar 22 10:55:07 2009 (r190260) @@ -602,9 +602,9 @@ bd_bestslice(struct open_disk *od) dp = &od->od_slicetab[0]; for (i = 0; i < od->od_nslices; i++, dp++) { - switch(dp->dp_mid & 0x7f) { - case DOSMID_386BSD & 0x7f: /* FreeBSD */ - if ((dp->dp_mid & 0x80) && + switch(dp->dp_mid & PC98_MID_MASK) { + case PC98_MID_386BSD: /* FreeBSD */ + if ((dp->dp_mid & PC98_MID_BOOTABLE) && (preflevel > PREF_FBSD_ACT)) { pref = i; preflevel = PREF_FBSD_ACT; @@ -620,7 +620,7 @@ bd_bestslice(struct open_disk *od) case 0x22: case 0x23: case 0x63: - if ((dp->dp_mid & 0x80) && + if ((dp->dp_mid & PC98_MID_BOOTABLE) && (preflevel > PREF_DOS_ACT)) { pref = i; preflevel = PREF_DOS_ACT; From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 11:03:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37E861065674; Sun, 22 Mar 2009 11:03:25 +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 23ED98FC18; Sun, 22 Mar 2009 11:03:25 +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 n2MB3OXv067043; Sun, 22 Mar 2009 11:03:24 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MB3Oai067042; Sun, 22 Mar 2009 11:03:24 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200903221103.n2MB3Oai067042@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sun, 22 Mar 2009 11:03:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190261 - in stable/7/sys: . boot/pc98/libpc98 contrib/pf dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 11:03:27 -0000 Author: nyan Date: Sun Mar 22 11:03:24 2009 New Revision: 190261 URL: http://svn.freebsd.org/changeset/base/190261 Log: MFC: r190146, r190147 Teach the BIOS CD driver to use bounce buffers when the destination address is > 1 MB. Modified: stable/7/sys/ (props changed) stable/7/sys/boot/pc98/libpc98/bioscd.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/boot/pc98/libpc98/bioscd.c ============================================================================== --- stable/7/sys/boot/pc98/libpc98/bioscd.c Sun Mar 22 10:55:07 2009 (r190260) +++ stable/7/sys/boot/pc98/libpc98/bioscd.c Sun Mar 22 11:03:24 2009 (r190261) @@ -170,9 +170,9 @@ bc_add(int biosdev) static void bc_print(int verbose) { - int i; char line[80]; - + int i; + for (i = 0; i < nbcinfo; i++) { sprintf(line, " cd%d: Device 0x%x\n", i, bcinfo[i].bc_sp.sp_devicespec); @@ -232,7 +232,7 @@ bc_strategy(void *devdata, int rw, daddr if (dblk % (BIOSCD_SECSIZE / DEV_BSIZE) != 0) return (EINVAL); dblk /= (BIOSCD_SECSIZE / DEV_BSIZE); - DEBUG("read %d from %d to %p", blks, dblk, buf); + DEBUG("read %d from %lld to %p", blks, dblk, buf); if (rsize) *rsize = 0; @@ -241,9 +241,9 @@ bc_strategy(void *devdata, int rw, daddr return (EIO); } #ifdef BD_SUPPORT_FRAGS - DEBUG("bc_strategy: frag read %d from %d+%d to %p", + DEBUG("frag read %d from %lld+%d to %p", fragsize, dblk, blks, buf + (blks * BIOSCD_SECSIZE)); - if (fragsize && bc_read(unit, dblk + blks, 1, fragsize)) { + if (fragsize && bc_read(unit, dblk + blks, 1, fragbuf)) { DEBUG("frag read error"); return(EIO); } @@ -254,11 +254,14 @@ bc_strategy(void *devdata, int rw, daddr return (0); } +/* Max number of sectors to bounce-buffer at a time. */ +#define CD_BOUNCEBUF 8 + static int bc_read(int unit, daddr_t dblk, int blks, caddr_t dest) { - u_int result, retry; - static unsigned short packet[8]; + u_int maxfer, resid, result, retry, x; + caddr_t bbuf, p, xp; int biosdev; #ifdef DISK_DEBUG int error; @@ -272,40 +275,73 @@ bc_read(int unit, daddr_t dblk, int blks if (blks == 0) return (0); + /* Decide whether we have to bounce */ + if (VTOP(dest) >> 20 != 0) { + /* + * The destination buffer is above first 1MB of + * physical memory so we have to arrange a suitable + * bounce buffer. + */ + x = min(CD_BOUNCEBUF, (unsigned)blks); + bbuf = alloca(x * BIOSCD_SECSIZE); + maxfer = x; + } else { + bbuf = NULL; + maxfer = 0; + } + biosdev = bc_unit2bios(unit); - /* - * Loop retrying the operation a couple of times. The BIOS - * may also retry. - */ - for (retry = 0; retry < 3; retry++) { - /* If retrying, reset the drive */ - if (retry > 0) { + resid = blks; + p = dest; + + while (resid > 0) { + if (bbuf) + xp = bbuf; + else + xp = p; + x = resid; + if (maxfer > 0) + x = min(x, maxfer); + + /* + * Loop retrying the operation a couple of times. The BIOS + * may also retry. + */ + for (retry = 0; retry < 3; retry++) { + /* If retrying, reset the drive */ + if (retry > 0) { + v86.ctl = V86_FLAGS; + v86.addr = 0x1b; + v86.eax = 0x0300 | biosdev; + v86int(); + } + v86.ctl = V86_FLAGS; v86.addr = 0x1b; - v86.eax = 0x0300 | biosdev; + v86.eax = 0x0600 | (biosdev & 0x7f); + v86.ebx = x * BIOSCD_SECSIZE; + v86.ecx = dblk & 0xffff; + v86.edx = (dblk >> 16) & 0xffff; + v86.ebp = VTOPOFF(xp); + v86.es = VTOPSEG(xp); v86int(); + result = (v86.efl & PSL_C); + if (result == 0) + break; } - - v86.ctl = V86_FLAGS; - v86.addr = 0x1b; - v86.eax = 0x0600 | (biosdev & 0x7f); - v86.ebx = blks * BIOSCD_SECSIZE; - v86.ecx = dblk & 0xffff; - v86.edx = (dblk >> 16) & 0xffff; - v86.ebp = VTOPOFF(dest); - v86.es = VTOPSEG(dest); - v86int(); - result = (v86.efl & PSL_C); - if (result == 0) - break; - } #ifdef DISK_DEBUG - error = (v86.eax >> 8) & 0xff; + error = (v86.eax >> 8) & 0xff; #endif - DEBUG("%d sectors from %ld to %p (0x%x) %s", blks, dblk, dest, - VTOP(dest), result ? "failed" : "ok"); - DEBUG("unit %d status 0x%x", unit, error); + DEBUG("%d sectors from %lld to %p (0x%x) %s", x, dblk, p, + VTOP(p), result ? "failed" : "ok"); + DEBUG("unit %d status 0x%x", unit, error); + if (bbuf != NULL) + bcopy(bbuf, p, x * BIOSCD_SECSIZE); + p += (x * BIOSCD_SECSIZE); + dblk += x; + resid -= x; + } /* hexdump(dest, (blks * BIOSCD_SECSIZE)); */ return(0); From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 11:07:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D603A106566B; Sun, 22 Mar 2009 11:07:13 +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 C2AE88FC13; Sun, 22 Mar 2009 11:07:13 +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 n2MB7DZP067147; Sun, 22 Mar 2009 11:07:13 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MB7DpS067146; Sun, 22 Mar 2009 11:07:13 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200903221107.n2MB7DpS067146@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sun, 22 Mar 2009 11:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190262 - in stable/6/sys: . boot/pc98/libpc98 contrib/pf dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 11:07:14 -0000 Author: nyan Date: Sun Mar 22 11:07:13 2009 New Revision: 190262 URL: http://svn.freebsd.org/changeset/base/190262 Log: MFC: r190146, r190147 Teach the BIOS CD driver to use bounce buffers when the destination address is > 1 MB. Modified: stable/6/sys/ (props changed) stable/6/sys/boot/pc98/libpc98/bioscd.c stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/boot/pc98/libpc98/bioscd.c ============================================================================== --- stable/6/sys/boot/pc98/libpc98/bioscd.c Sun Mar 22 11:03:24 2009 (r190261) +++ stable/6/sys/boot/pc98/libpc98/bioscd.c Sun Mar 22 11:07:13 2009 (r190262) @@ -170,9 +170,9 @@ bc_add(int biosdev) static void bc_print(int verbose) { - int i; char line[80]; - + int i; + for (i = 0; i < nbcinfo; i++) { sprintf(line, " cd%d: Device 0x%x\n", i, bcinfo[i].bc_sp.sp_devicespec); @@ -232,7 +232,7 @@ bc_strategy(void *devdata, int rw, daddr if (dblk % (BIOSCD_SECSIZE / DEV_BSIZE) != 0) return (EINVAL); dblk /= (BIOSCD_SECSIZE / DEV_BSIZE); - DEBUG("read %d from %d to %p", blks, dblk, buf); + DEBUG("read %d from %lld to %p", blks, dblk, buf); if (rsize) *rsize = 0; @@ -241,9 +241,9 @@ bc_strategy(void *devdata, int rw, daddr return (EIO); } #ifdef BD_SUPPORT_FRAGS - DEBUG("bc_strategy: frag read %d from %d+%d to %p", + DEBUG("frag read %d from %lld+%d to %p", fragsize, dblk, blks, buf + (blks * BIOSCD_SECSIZE)); - if (fragsize && bc_read(unit, dblk + blks, 1, fragsize)) { + if (fragsize && bc_read(unit, dblk + blks, 1, fragbuf)) { DEBUG("frag read error"); return(EIO); } @@ -254,11 +254,14 @@ bc_strategy(void *devdata, int rw, daddr return (0); } +/* Max number of sectors to bounce-buffer at a time. */ +#define CD_BOUNCEBUF 8 + static int bc_read(int unit, daddr_t dblk, int blks, caddr_t dest) { - u_int result, retry; - static unsigned short packet[8]; + u_int maxfer, resid, result, retry, x; + caddr_t bbuf, p, xp; int biosdev; #ifdef DISK_DEBUG int error; @@ -272,40 +275,73 @@ bc_read(int unit, daddr_t dblk, int blks if (blks == 0) return (0); + /* Decide whether we have to bounce */ + if (VTOP(dest) >> 20 != 0) { + /* + * The destination buffer is above first 1MB of + * physical memory so we have to arrange a suitable + * bounce buffer. + */ + x = min(CD_BOUNCEBUF, (unsigned)blks); + bbuf = alloca(x * BIOSCD_SECSIZE); + maxfer = x; + } else { + bbuf = NULL; + maxfer = 0; + } + biosdev = bc_unit2bios(unit); - /* - * Loop retrying the operation a couple of times. The BIOS - * may also retry. - */ - for (retry = 0; retry < 3; retry++) { - /* If retrying, reset the drive */ - if (retry > 0) { + resid = blks; + p = dest; + + while (resid > 0) { + if (bbuf) + xp = bbuf; + else + xp = p; + x = resid; + if (maxfer > 0) + x = min(x, maxfer); + + /* + * Loop retrying the operation a couple of times. The BIOS + * may also retry. + */ + for (retry = 0; retry < 3; retry++) { + /* If retrying, reset the drive */ + if (retry > 0) { + v86.ctl = V86_FLAGS; + v86.addr = 0x1b; + v86.eax = 0x0300 | biosdev; + v86int(); + } + v86.ctl = V86_FLAGS; v86.addr = 0x1b; - v86.eax = 0x0300 | biosdev; + v86.eax = 0x0600 | (biosdev & 0x7f); + v86.ebx = x * BIOSCD_SECSIZE; + v86.ecx = dblk & 0xffff; + v86.edx = (dblk >> 16) & 0xffff; + v86.ebp = VTOPOFF(xp); + v86.es = VTOPSEG(xp); v86int(); + result = (v86.efl & PSL_C); + if (result == 0) + break; } - - v86.ctl = V86_FLAGS; - v86.addr = 0x1b; - v86.eax = 0x0600 | (biosdev & 0x7f); - v86.ebx = blks * BIOSCD_SECSIZE; - v86.ecx = dblk & 0xffff; - v86.edx = (dblk >> 16) & 0xffff; - v86.ebp = VTOPOFF(dest); - v86.es = VTOPSEG(dest); - v86int(); - result = (v86.efl & PSL_C); - if (result == 0) - break; - } #ifdef DISK_DEBUG - error = (v86.eax >> 8) & 0xff; + error = (v86.eax >> 8) & 0xff; #endif - DEBUG("%d sectors from %ld to %p (0x%x) %s", blks, dblk, dest, - VTOP(dest), result ? "failed" : "ok"); - DEBUG("unit %d status 0x%x", unit, error); + DEBUG("%d sectors from %lld to %p (0x%x) %s", x, dblk, p, + VTOP(p), result ? "failed" : "ok"); + DEBUG("unit %d status 0x%x", unit, error); + if (bbuf != NULL) + bcopy(bbuf, p, x * BIOSCD_SECSIZE); + p += (x * BIOSCD_SECSIZE); + dblk += x; + resid -= x; + } /* hexdump(dest, (blks * BIOSCD_SECSIZE)); */ return(0); From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 13:05:07 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 13:05:27 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 13:17:46 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 13:33:43 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAB181065675 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 1A9BE8FC20 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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 13:42:42 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 14:39:38 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 15:29:12 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 15:46:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C024B10656C3; Sun, 22 Mar 2009 15:46:12 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD8318FC12; Sun, 22 Mar 2009 15:46:12 +0000 (UTC) (envelope-from n_hibma@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 n2MFkCt9072599; Sun, 22 Mar 2009 15:46:12 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MFkCDv072598; Sun, 22 Mar 2009 15:46:12 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200903221546.n2MFkCDv072598@svn.freebsd.org> From: Nick Hibma Date: Sun, 22 Mar 2009 15:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190267 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 15:46:13 -0000 Author: n_hibma Date: Sun Mar 22 15:46:12 2009 New Revision: 190267 URL: http://svn.freebsd.org/changeset/base/190267 Log: If the device marked itself quiet, make detachment quiet as well. This avoids 'XX: detached' messages when the 'attached' message was suppressed. Modified: stable/7/sys/kern/subr_bus.c Modified: stable/7/sys/kern/subr_bus.c ============================================================================== --- stable/7/sys/kern/subr_bus.c Sun Mar 22 15:29:12 2009 (r190266) +++ stable/7/sys/kern/subr_bus.c Sun Mar 22 15:46:12 2009 (r190267) @@ -2444,7 +2444,8 @@ device_detach(device_t dev) if ((error = DEVICE_DETACH(dev)) != 0) return (error); devremoved(dev); - device_printf(dev, "detached\n"); + if (!device_is_quiet(dev)) + device_printf(dev, "detached\n"); if (dev->parent) BUS_CHILD_DETACHED(dev->parent, dev); From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 16:27:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A64E106564A; Sun, 22 Mar 2009 16:27:15 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 159FD8FC0C; Sun, 22 Mar 2009 16:27:15 +0000 (UTC) (envelope-from n_hibma@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 n2MGRErF073619; Sun, 22 Mar 2009 16:27:14 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MGREaS073611; Sun, 22 Mar 2009 16:27:14 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200903221627.n2MGREaS073611@svn.freebsd.org> From: Nick Hibma Date: Sun, 22 Mar 2009 16:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190268 - in stable/7: share/man/man4 sys/conf sys/dev/usb sys/modules sys/modules/u3g X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 16:27:15 -0000 Author: n_hibma Date: Sun Mar 22 16:27:14 2009 New Revision: 190268 URL: http://svn.freebsd.org/changeset/base/190268 Log: MFC the (current) u3g driver, a driver for USB based 3G cards and dongles. This includes changes to ubsa (removing attachment from that device), and small changes to ucom. Note: A change to umass reducing the attach priority for it was committed already. Added: stable/7/share/man/man4/u3g.4 (contents, props changed) stable/7/sys/dev/usb/u3g.c (contents, props changed) stable/7/sys/modules/u3g/ stable/7/sys/modules/u3g/Makefile (contents, props changed) Modified: stable/7/share/man/man4/Makefile stable/7/sys/conf/NOTES stable/7/sys/conf/files stable/7/sys/conf/options stable/7/sys/dev/usb/ubsa.c stable/7/sys/dev/usb/ucom.c stable/7/sys/dev/usb/usbdevs stable/7/sys/modules/Makefile Modified: stable/7/share/man/man4/Makefile ============================================================================== --- stable/7/share/man/man4/Makefile Sun Mar 22 15:46:12 2009 (r190267) +++ stable/7/share/man/man4/Makefile Sun Mar 22 16:27:14 2009 (r190268) @@ -373,6 +373,7 @@ MAN= aac.4 \ twe.4 \ tx.4 \ txp.4 \ + u3g.4 \ uark.4 \ uart.4 \ ubsa.4 \ @@ -538,6 +539,7 @@ MLINKS+=tl.4 if_tl.4 MLINKS+=tun.4 if_tun.4 MLINKS+=tx.4 if_tx.4 MLINKS+=txp.4 if_txp.4 +MLINKS+=u3g.4 u3gstub.4 MLINKS+=udav.4 if_udav.4 MLINKS+=ural.4 if_ural.4 MLINKS+=vge.4 if_vge.4 Added: stable/7/share/man/man4/u3g.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/share/man/man4/u3g.4 Sun Mar 22 16:27:14 2009 (r190268) @@ -0,0 +1,125 @@ +.\" +.\" Copyright (c) 2008 AnyWi Technologies +.\" All rights reserved. +.\" +.\" This code is derived from uark.c +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" $FreeBSD$ +.\" +.Dd October 7, 2008 +.Dt U3G 4 +.Os +.Sh NAME +.Nm u3g +.Nd USB support for 3G datacards +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device u3g" +.Cd "device ucom" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +u3g_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the multiple USB-to-serial interfaces exposed by +many 3G USB/PCCard modems. +.Pp +The device is accessed through the +.Xr ucom 4 +driver which makes it behave like a +.Xr tty 4 . +.Sh HARDWARE +The +.Nm +driver supports the following adapters: +.Pp +.Bl -bullet -compact +.It +Option GT 3G Fusion, GT Fusion Quad, etc. (only 3G part, not WLAN) +.It +Option GT 3G, GT 3G Quad, etc. +.It +Vodafone Mobile Connect Card 3G +.It +Qualcomm Inc. CDMA MSM +.It +Huawei B190, E220 ('') +.It +Novatal U740, MC950D, X950D, etc. +.It +Sierra MC875U, MC8775U, etc. +.El +.Pp +(See +.Pa /sys/dev/u3g.c +for the complete list of supported cards for each vendor +mentioned above.) +.Pp +The supported 3G cards provide the necessary modem port for ppp, pppd, or mpd +connections as well as extra ports (depending on the specific device) to +provide other functions (additional command port, diagnostic port, SIM toolkit +port). +.Pp +In some of these devices a mass storage device supported by the +.Xr umass 4 +driver is present which contains Windows and Mac OS X drivers. +The device starts up in disk mode (TruInstall, ZeroCD, etc.) and requires +additional commands to switch it to modem mode. +.Pp +The +.Xr u3gstub 4 +device will attach temporarily to a 3G device with a mass storage device and +force it to switch to modem mode, +The attach and detach of +.Xr u3gstub +and any driver disk device present on the 3G device is is hidden, unless the +machine was booted in verbose mode (see +.Xr boot 8 ) . +To temporarily unhide the device, set +.Va debug.bootverbose +to 1 using +.Xr sysctl 8 +and replug the device. +.Sh SEE ALSO +.Xr tty 4 , +.Xr ucom 4 , +.Xr usb 4 +.Sh HISTORY +The +.Nm +driver appeared in +.Fx 8.0 , +is based on the +.Xr uark 4 +driver, and written by +.An Andrea Guzzo Aq aguzzo@anywi.com +in September 2008. +.Sh AUTHORS +The +.Nm +driver was written by +.An Andrea Guzzo Aq aguzzo@anywi.com +and +.An Nick Hibma Aq n_hibma@freebsd.org . +Hardware for testing was provided by AnyWi Technologies, Leiden, NL. Modified: stable/7/sys/conf/NOTES ============================================================================== --- stable/7/sys/conf/NOTES Sun Mar 22 15:46:12 2009 (r190267) +++ stable/7/sys/conf/NOTES Sun Mar 22 16:27:14 2009 (r190268) @@ -2429,6 +2429,8 @@ device uscanner # # USB serial support device ucom +# USB support for 3G modem cards by Option, Novatel, Huawei and Sierra +device u3g # USB support for Technologies ARK3116 based serial adapters device uark # USB support for Belkin F5U103 and compatible serial adapters Modified: stable/7/sys/conf/files ============================================================================== --- stable/7/sys/conf/files Sun Mar 22 15:46:12 2009 (r190267) +++ stable/7/sys/conf/files Sun Mar 22 16:27:14 2009 (r190268) @@ -1286,6 +1286,7 @@ dev/usb/ohci_pci.c optional ohci pci dev/usb/sl811hs.c optional slhci dev/usb/slhci_pccard.c optional slhci pccard dev/usb/uark.c optional uark +dev/usb/u3g.c optional u3g dev/usb/ubsa.c optional ubsa dev/usb/ubser.c optional ubser dev/usb/ucom.c optional ucom Modified: stable/7/sys/conf/options ============================================================================== --- stable/7/sys/conf/options Sun Mar 22 15:46:12 2009 (r190267) +++ stable/7/sys/conf/options Sun Mar 22 16:27:14 2009 (r190268) @@ -619,6 +619,7 @@ UKBD_DFLT_KEYMAP opt_ukbd.h UPLCOM_INTR_INTERVAL opt_uplcom.h UVSCOM_DEFAULT_OPKTSIZE opt_uvscom.h UVSCOM_INTR_INTERVAL opt_uvscom.h +U3G_DEBUG opt_u3g.h # Embedded system options INIT_PATH Added: stable/7/sys/dev/usb/u3g.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/dev/usb/u3g.c Sun Mar 22 16:27:14 2009 (r190268) @@ -0,0 +1,799 @@ +/* + * Copyright (c) 2008 AnyWi Technologies + * Author: Andrea Guzzo + * * based on uark.c 1.1 2006/08/14 08:30:22 jsg * + * * parts from ubsa.c 183348 2008-09-25 12:00:56Z phk * + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ + +/* + * Notes: + * - The detour through the tty layer is ridiculously expensive wrt buffering + * due to the high speeds. + * We should consider adding a simple r/w device which allows attaching of PPP + * in a more efficient way. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#if __FreeBSD_version >= 800000 +#include "opt_u3g.h" +#endif +#include "usbdevs.h" + +//#define U3G_DEBUG +#ifdef U3G_DEBUG +#define DPRINTF(x...) do { if (u3gdebug) device_printf(sc->sc_dev, ##x); } while (0) +int u3gdebug = 1; +#else +#define DPRINTF(x...) /* nop */ +#endif + +#define U3G_MAXPORTS 4 +#define U3G_CONFIG_INDEX 0 + +struct u3g_softc { + struct ucom_softc sc_ucom[U3G_MAXPORTS]; + device_t sc_dev; + usbd_device_handle sc_udev; + u_int8_t sc_speed; + u_int8_t sc_flags; + u_char sc_numports; +}; + +static int u3g_open(void *addr, int portno); +static void u3g_close(void *addr, int portno); + +struct ucom_callback u3g_callback = { + NULL, + NULL, + NULL, + NULL, + u3g_open, + u3g_close, + NULL, + NULL, +}; + + +struct u3g_speeds_s { + u_int32_t ispeed; + u_int32_t ospeed; +}; + +static const struct u3g_speeds_s u3g_speeds[] = { +#define U3GSP_GPRS 0 + {64000, 64000}, +#define U3GSP_EDGE 1 + {384000, 64000}, +#define U3GSP_CDMA 2 + {384000, 64000}, +#define U3GSP_UMTS 3 + {384000, 64000}, +#define U3GSP_HSDPA 4 + {1200000, 384000}, +#define U3GSP_HSUPA 5 + {1200000, 384000}, +#define U3GSP_HSPA 6 + {7200000, 384000}, +}; + +#define U3GIBUFSIZE 1024 +#define U3GOBUFSIZE 1024 + +/* + * Various supported device vendors/products. + */ +struct u3g_dev_type_s { + struct usb_devno devno; + u_int8_t speed; + u_int8_t flags; +#define U3GFL_NONE 0x00 +#define U3GFL_HUAWEI_INIT 0x01 // Requires init command (Huawei cards) +#define U3GFL_SCSI_EJECT 0x02 // Requires SCSI eject command (Novatel) +#define U3GFL_SIERRA_INIT 0x04 // Requires init command (Sierra cards) +#define U3GFL_CMOTECH_INIT 0x08 // Requires init command (CMOTECH cards) +#define U3GFL_STUB_WAIT 0x80 // Device reappears after a short delay +}; + +// Note: The entries marked with XXX should be checked for the correct speed +// indication to set the buffer sizes. +static const struct u3g_dev_type_s u3g_devs[] = { + /* OEM: Option */ + {{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GT3G }, U3GSP_UMTS, U3GFL_NONE }, + {{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GT3GQUAD }, U3GSP_UMTS, U3GFL_NONE }, + {{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GT3GPLUS }, U3GSP_UMTS, U3GFL_NONE }, + {{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GTMAX36 }, U3GSP_HSDPA, U3GFL_NONE }, + {{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GTMAXHSUPA }, U3GSP_HSDPA, U3GFL_NONE }, + {{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_VODAFONEMC3G }, U3GSP_UMTS, U3GFL_NONE }, + /* OEM: Qualcomm, Inc. */ + {{ USB_VENDOR_QUALCOMMINC, USB_PRODUCT_QUALCOMMINC_ZTE_STOR }, U3GSP_CDMA, U3GFL_SCSI_EJECT }, + {{ USB_VENDOR_QUALCOMMINC, USB_PRODUCT_QUALCOMMINC_CDMA_MSM }, U3GSP_CDMA, U3GFL_SCSI_EJECT }, + /* OEM: Huawei */ + {{ USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_MOBILE }, U3GSP_HSDPA, U3GFL_HUAWEI_INIT }, + {{ USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E220 }, U3GSP_HSPA, U3GFL_HUAWEI_INIT }, + /* OEM: Novatel */ + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_CDMA_MODEM }, U3GSP_CDMA, U3GFL_SCSI_EJECT }, + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_ES620 }, U3GSP_UMTS, U3GFL_SCSI_EJECT }, // XXX + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_MC950D }, U3GSP_HSUPA, U3GFL_SCSI_EJECT }, + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U720 }, U3GSP_UMTS, U3GFL_SCSI_EJECT }, // XXX + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U727 }, U3GSP_UMTS, U3GFL_SCSI_EJECT }, // XXX + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U740 }, U3GSP_HSDPA, U3GFL_SCSI_EJECT }, + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U740_2 }, U3GSP_HSDPA, U3GFL_SCSI_EJECT }, + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U870 }, U3GSP_UMTS, U3GFL_SCSI_EJECT }, // XXX + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_V620 }, U3GSP_UMTS, U3GFL_SCSI_EJECT }, // XXX + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_V640 }, U3GSP_UMTS, U3GFL_SCSI_EJECT }, // XXX + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_V720 }, U3GSP_UMTS, U3GFL_SCSI_EJECT }, // XXX + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_V740 }, U3GSP_HSDPA, U3GFL_SCSI_EJECT }, + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_X950D }, U3GSP_HSUPA, U3GFL_SCSI_EJECT }, + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_XU870 }, U3GSP_HSDPA, U3GFL_SCSI_EJECT }, + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_ZEROCD }, U3GSP_HSUPA, U3GFL_SCSI_EJECT }, + {{ USB_VENDOR_DELL, USB_PRODUCT_DELL_U740 }, U3GSP_HSDPA, U3GFL_SCSI_EJECT }, + /* OEM: Merlin */ + {{ USB_VENDOR_MERLIN, USB_PRODUCT_MERLIN_V620 }, U3GSP_UMTS, U3GFL_NONE }, // XXX + /* OEM: Sierra Wireless: */ + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AIRCARD580 }, U3GSP_UMTS, U3GFL_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AIRCARD595 }, U3GSP_UMTS, U3GFL_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC595U }, U3GSP_UMTS, U3GFL_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC597E }, U3GSP_UMTS, U3GFL_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_C597 }, U3GSP_UMTS, U3GFL_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC880 }, U3GSP_UMTS, U3GFL_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC880E }, U3GSP_UMTS, U3GFL_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC880U }, U3GSP_UMTS, U3GFL_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC881 }, U3GSP_UMTS, U3GFL_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC881E }, U3GSP_UMTS, U3GFL_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC881U }, U3GSP_UMTS, U3GFL_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_EM5625 }, U3GSP_UMTS, U3GFL_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC5720 }, U3GSP_UMTS, U3GFL_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC5720_2 }, U3GSP_UMTS, U3GFL_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC5725 }, U3GSP_UMTS, U3GFL_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MINI5725 }, U3GSP_UMTS, U3GFL_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AIRCARD875 }, U3GSP_UMTS, U3GFL_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8755 }, U3GSP_UMTS, U3GFL_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8755_2 }, U3GSP_UMTS, U3GFL_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8755_3 }, U3GSP_UMTS, U3GFL_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8765 }, U3GSP_UMTS, U3GFL_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC875U }, U3GSP_UMTS, U3GFL_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8775_2 }, U3GSP_HSDPA, U3GFL_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8780 }, U3GSP_UMTS, U3GFL_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8781 }, U3GSP_UMTS, U3GFL_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_TRUINSTALL }, U3GSP_UMTS, U3GFL_SIERRA_INIT }, + {{ USB_VENDOR_HP, USB_PRODUCT_HP_HS2300 }, U3GSP_HSDPA, U3GFL_NONE }, + /* OEM: CMOTECH */ + {{ USB_VENDOR_CMOTECH, USB_PRODUCT_CMOTECH_CGU628 }, U3GSP_HSDPA, U3GFL_CMOTECH_INIT }, + {{ USB_VENDOR_CMOTECH, USB_PRODUCT_CMOTECH_DISK }, U3GSP_HSDPA, U3GFL_NONE }, +}; +#define u3g_lookup(v, p) ((const struct u3g_dev_type_s *)usb_lookup(u3g_devs, v, p)) + +static int +u3g_match(device_t self) +{ + struct usb_attach_arg *uaa = device_get_ivars(self); + const struct u3g_dev_type_s *u3g_dev_type; + + if (!uaa->iface) + return UMATCH_NONE; + + u3g_dev_type = u3g_lookup(uaa->vendor, uaa->product); + if (!u3g_dev_type) + return UMATCH_NONE; + + if (u3g_dev_type->flags&U3GFL_HUAWEI_INIT) { + /* If the interface class of the first interface is no longer + * mass storage the card has changed to modem (see u3g_attach() + * below). + */ + usb_interface_descriptor_t *id; + id = usbd_get_interface_descriptor(uaa->iface); + if (!id || id->bInterfaceClass == UICLASS_MASS) + return UMATCH_NONE; + } + + return UMATCH_VENDOR_PRODUCT_CONF_IFACE; +} + +static int +u3g_attach(device_t self) +{ + struct u3g_softc *sc = device_get_softc(self); + struct usb_attach_arg *uaa = device_get_ivars(self); + const struct u3g_dev_type_s *u3g_dev_type; + usbd_device_handle dev = uaa->device; + usb_interface_descriptor_t *id; + usb_endpoint_descriptor_t *ed; + int i, n; + usb_config_descriptor_t *cd; + char devnamefmt[32]; + +#if __FreeBSD_version < 700000 + char *devinfo = malloc(1024, M_USBDEV, M_WAITOK); + usbd_devinfo(dev, 0, devinfo); + device_printf(self, "%s\n", devinfo); + free(devinfo, M_USBDEV); +#endif + + /* get the config descriptor */ + cd = usbd_get_config_descriptor(dev); + if (cd == NULL) { + device_printf(self, "failed to get configuration descriptor\n"); + return ENXIO; + } + + sc->sc_dev = self; + sc->sc_udev = dev; + + u3g_dev_type = u3g_lookup(uaa->vendor, uaa->product); + sc->sc_flags = u3g_dev_type->flags; + sc->sc_speed = u3g_dev_type->speed; + + sprintf(devnamefmt,"U%d.%%d", device_get_unit(self)); + int portno = 0; + for (i = 0; i < uaa->nifaces && portno < U3G_MAXPORTS; i++) { + if (uaa->ifaces[i] == NULL) + continue; + + id = usbd_get_interface_descriptor(uaa->ifaces[i]); + if (id && id->bInterfaceClass == UICLASS_MASS) { + /* We attach to the interface instead of the device as + * some devices have a built-in SD card reader. + * Claim the first umass device (cdX) as it contains + * only Windows drivers anyway (CD-ROM), hiding it. + */ +#ifndef U3G_DEBUG + if (!bootverbose) + if (uaa->vendor == USB_VENDOR_HUAWEI) + if (id->bInterfaceNumber == 2) + uaa->ifaces[i] = NULL; +#endif + continue; + } + + int bulkin_no = -1, bulkout_no = -1; + int claim_iface = 0; + for (n = 0; n < id->bNumEndpoints && portno < U3G_MAXPORTS; n++) { + ed = usbd_interface2endpoint_descriptor(uaa->ifaces[i], n); + if (ed == NULL) + continue; + if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN + && UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) + bulkin_no = ed->bEndpointAddress; + else if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_OUT + && UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) + bulkout_no = ed->bEndpointAddress; + + /* If we have found a pair of bulk-in/-out endpoints + * create a serial port for it. Note: We assume that + * the bulk-in and bulk-out endpoints appear in pairs. + */ + if (bulkin_no != -1 && bulkout_no != -1) { + struct ucom_softc *ucom = &sc->sc_ucom[portno]; + + ucom->sc_dev = self; + ucom->sc_udev = dev; + ucom->sc_iface = uaa->ifaces[i]; + ucom->sc_bulkin_no = bulkin_no; + ucom->sc_bulkout_no = bulkout_no; + ucom->sc_ibufsize = U3GIBUFSIZE; + ucom->sc_ibufsizepad = U3GIBUFSIZE; + ucom->sc_obufsize = U3GOBUFSIZE; + ucom->sc_opkthdrlen = 0; + + ucom->sc_callback = &u3g_callback; + ucom->sc_parent = sc; + ucom->sc_portno = portno; + + DPRINTF("port=%d iface=%d in=0x%x out=0x%x\n", + portno, i, + ucom->sc_bulkin_no, + ucom->sc_bulkout_no); +#if __FreeBSD_version < 700000 + ucom_attach_tty(ucom, MINOR_CALLOUT, devnamefmt, portno); +#elif __FreeBSD_version < 800000 + ucom_attach_tty(ucom, TS_CALLOUT, devnamefmt, portno); +#else + ucom_attach_tty(ucom, devnamefmt, portno); +#endif + + claim_iface = 1; + portno++; + bulkin_no = bulkout_no = -1; + } + } + if (claim_iface) + uaa->ifaces[i] = NULL; // claim the interface + } + sc->sc_numports = portno; + + device_printf(self, "configured %d serial ports (%s)\n", + sc->sc_numports, devnamefmt); + return 0; +} + +static int +u3g_detach(device_t self) +{ + struct u3g_softc *sc = device_get_softc(self); + int rv = 0; + int i; + + for (i = 0; i < sc->sc_numports; i++) { + sc->sc_ucom[i].sc_dying = 1; + rv = ucom_detach(&sc->sc_ucom[i]); + if (rv != 0) { + device_printf(self, "ucom_detach(U%d.%d\n", device_get_unit(self), i); + return rv; + } + } + + return 0; +} + +static int +u3g_open(void *addr, int portno) +{ +#if __FreeBSD_version < 800000 + /* Supply generous buffering for these cards to avoid disappointments + * when setting the speed incorrectly. Only do this for the first port + * assuming that the rest of the ports are used for diagnostics only + * anyway. + * Note: We abuse the fact that ucom sets the speed through + * ispeed/ospeed, not through ispeedwat/ospeedwat. + */ + if (portno == 0) { + struct u3g_softc *sc = addr; + struct ucom_softc *ucom = &sc->sc_ucom[portno]; + struct tty *tp = ucom->sc_tty; + + tp->t_ispeedwat = u3g_speeds[sc->sc_speed].ispeed; + tp->t_ospeedwat = u3g_speeds[sc->sc_speed].ospeed; + + /* Avoid excessive buffer sizes. + * XXX The values here should be checked. Lower them and see + * whether 'lost chars' messages appear. + */ + if (tp->t_ispeedwat > 384000) + tp->t_ispeedwat = 384000; + if (tp->t_ospeedwat > 384000) + tp->t_ospeedwat = 384000; + + ttsetwater(tp); + } +#endif + + return 0; +} + +static void +u3g_close(void *addr, int portno) +{ +#if __FreeBSD_version < 800000 + if (portno == 0) { /* see u3g_open() */ + /* Reduce the buffers allocated above again */ + struct u3g_softc *sc = addr; + struct ucom_softc *ucom = &sc->sc_ucom[portno]; + struct tty *tp = ucom->sc_tty; +#ifdef U3G_DEBUG + device_t self = sc->sc_dev; +#endif + + tp->t_ispeedwat = (speed_t)-1; + tp->t_ospeedwat = (speed_t)-1; + + ttsetwater(tp); + } +#endif +} + +static device_method_t u3g_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, u3g_match), + DEVMETHOD(device_attach, u3g_attach), + DEVMETHOD(device_detach, u3g_detach), + + { 0, 0 } +}; + +static driver_t u3g_driver = { + "ucom", + u3g_methods, + sizeof (struct u3g_softc) +}; + +DRIVER_MODULE(u3g, uhub, u3g_driver, ucom_devclass, usbd_driver_load, 0); +MODULE_DEPEND(u3g, usb, 1, 1, 1); +MODULE_DEPEND(u3g, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); +MODULE_VERSION(u3g, 1); + +/******************************************************************* + ****** Stub driver to hide devices that need to reinitialise ****** + *******************************************************************/ + +struct u3gstub_softc { + device_t sc_dev; + usbd_device_handle sc_udev; + usbd_pipe_handle sc_pipe_out, sc_pipe_in; + usbd_xfer_handle sc_xfer; +}; + +static int +u3gstub_huawei_init(struct u3gstub_softc *sc, struct usb_attach_arg *uaa) +{ + usb_device_request_t req; + + req.bmRequestType = UT_WRITE_DEVICE; + req.bRequest = UR_SET_FEATURE; + USETW(req.wValue, UF_DEVICE_REMOTE_WAKEUP); + USETW(req.wIndex, UHF_PORT_SUSPEND); + USETW(req.wLength, 0); + + (void) usbd_do_request(uaa->device, &req, 0); /* ignore any error */ + + return 1; +} + +static void +u3gstub_BBB_cb(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status err) +{ + struct u3gstub_softc *sc = (struct u3gstub_softc *) priv; + unsigned char cmd[13]; + + if (err) { + device_printf(sc->sc_dev, + "Failed to send CD eject command to " + "change to modem mode\n"); + } else { + usbd_setup_xfer(sc->sc_xfer, sc->sc_pipe_in, NULL, cmd, sizeof(cmd), + 0, USBD_DEFAULT_TIMEOUT, NULL); + int err = usbd_transfer(sc->sc_xfer) != USBD_NORMAL_COMPLETION; + if (err != USBD_NORMAL_COMPLETION && err != USBD_IN_PROGRESS) + DPRINTF("failed to start transfer (CSW)\n"); + } +} + +static int +u3gstub_scsi_eject(struct u3gstub_softc *sc, struct usb_attach_arg *uaa) +{ + /* See definition of umass_bbb_cbw_t in sys/dev/usb/umass.c and struct + * scsi_start_stop_unit in sys/cam/scsi/scsi_all.h . + */ + unsigned char cmd[31] = { + 0x55, 0x53, 0x42, 0x43, /* 0..3: Command Block Wrapper (CBW) signature */ + 0x01, 0x00, 0x00, 0x00, /* 4..7: CBW Tag, unique 32-bit number */ + 0x00, 0x00, 0x00, 0x00, /* 8..11: CBW Transfer Length, no data here */ + 0x00, /* 12: CBW Flag: output */ + 0x00, /* 13: CBW Lun */ + 0x06, /* 14: CBW Length */ + + 0x1b, /* 15+0: opcode: SCSI START/STOP */ + 0x00, /* 15+1: byte2: Not immediate */ + 0x00, 0x00, /* 15+2..3: reserved */ + 0x02, /* 15+4: Load/Eject command */ + 0x00, /* 15+5: control */ + 0x00, 0x00, 0x00, 0x00, /* 15+6..15: unused */ + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00 + }; + + usb_interface_descriptor_t *id; + usb_endpoint_descriptor_t *ed = NULL; + int i; + + + /* Find the bulk-out endpoints */ + id = usbd_get_interface_descriptor(uaa->iface); + for (i = 0 ; i < id->bNumEndpoints; i++) { + ed = usbd_interface2endpoint_descriptor(uaa->iface, i); + if (ed != NULL + && (ed->bmAttributes & UE_XFERTYPE) == UE_BULK) { + if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_OUT) { + if (usbd_open_pipe(uaa->iface, + ed->bEndpointAddress, + USBD_EXCLUSIVE_USE, + &sc->sc_pipe_out) + != USBD_NORMAL_COMPLETION) { + DPRINTF("failed to open bulk-out pipe on endpoint %d\n", + ed->bEndpointAddress); + return 0; + } + } else { + if (usbd_open_pipe(uaa->iface, + ed->bEndpointAddress, + USBD_EXCLUSIVE_USE, + &sc->sc_pipe_in) + != USBD_NORMAL_COMPLETION) { + DPRINTF("failed to open bulk-in pipe on endpoint %d\n", + ed->bEndpointAddress); + return 0; + } + } + } + if (sc->sc_pipe_out && sc->sc_pipe_in) + break; + } + + if (i == id->bNumEndpoints) { + DPRINTF("failed to find bulk-out pipe\n"); + return 0; + } + + sc->sc_xfer = usbd_alloc_xfer(uaa->device); + if (sc->sc_xfer == NULL) { + DPRINTF("failed to allocate xfer\n"); + return 0; + } + + usbd_setup_xfer(sc->sc_xfer, sc->sc_pipe_out, NULL, cmd, sizeof(cmd), + 0, USBD_DEFAULT_TIMEOUT, u3gstub_BBB_cb); + int err = usbd_transfer(sc->sc_xfer) != USBD_NORMAL_COMPLETION; + if (err != USBD_NORMAL_COMPLETION && err != USBD_IN_PROGRESS) { + DPRINTF("failed to start transfer (CBW)\n"); + return 0; + } + + return 1; +} + +static int +u3gstub_cmotech_init(struct u3gstub_softc *sc, struct usb_attach_arg *uaa) +{ + /* See definition of umass_bbb_cbw_t in sys/dev/usb/umass.c + * in sys/cam/scsi/scsi_all.h . + */ + unsigned char cmd[31] = { + 0x55, 0x53, 0x42, 0x43, /* 0..3: Command Block Wrapper (CBW) signature */ + 0x01, 0x00, 0x00, 0x00, /* 4..7: CBW Tag, unique 32-bit number */ + 0x00, 0x00, 0x00, 0x00, /* 8..11: CBW Transfer Length, no data here */ + 0x80, /* 12: CBW Flag: output, so 0 */ + 0x00, /* 13: CBW Lun */ + 0x08, /* 14: CBW Length */ + + 0xff, /* 15+0 */ + 0x52, /* 15+1 */ + 0x44, /* 15+2 */ + 0x45, /* 15+2 */ + 0x56, /* 15+4 */ + 0x43, /* 15+5 */ + 0x48, /* 15+5 */ + 0x47, /* 15+5 */ + 0x00, 0x00, 0x00, 0x00, /* 15+8..15: unused */ + 0x00, 0x00, 0x00, 0x00 + }; + + usb_interface_descriptor_t *id; + usb_endpoint_descriptor_t *ed = NULL; + int i; + + + /* Find the bulk-out endpoints */ + id = usbd_get_interface_descriptor(uaa->iface); + for (i = 0 ; i < id->bNumEndpoints ; i++) { + ed = usbd_interface2endpoint_descriptor(uaa->iface, i); + if (ed != NULL + && (ed->bmAttributes & UE_XFERTYPE) == UE_BULK) { + if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_OUT) { + if (usbd_open_pipe(uaa->iface, + ed->bEndpointAddress, + USBD_EXCLUSIVE_USE, + &sc->sc_pipe_out) + != USBD_NORMAL_COMPLETION) { + DPRINTF("failed to open bulk-out pipe on endpoint %d\n", + ed->bEndpointAddress); + return 0; + } + } else { + if (usbd_open_pipe(uaa->iface, + ed->bEndpointAddress, + USBD_EXCLUSIVE_USE, + &sc->sc_pipe_in) + != USBD_NORMAL_COMPLETION) { + DPRINTF("failed to open bulk-in pipe on endpoint %d\n", + ed->bEndpointAddress); + return 0; + } + } + } + if (sc->sc_pipe_out && sc->sc_pipe_in) + break; + } + + if (i == id->bNumEndpoints) { + DPRINTF("failed to find bulk-out pipe\n"); + return 0; + } + + sc->sc_xfer = usbd_alloc_xfer(uaa->device); + if (sc->sc_xfer == NULL) { + DPRINTF("failed to allocate xfer\n"); + return 0; + } + + usbd_setup_xfer(sc->sc_xfer, sc->sc_pipe_out, NULL, cmd, sizeof(cmd), + 0, USBD_DEFAULT_TIMEOUT, u3gstub_BBB_cb); + int err = usbd_transfer(sc->sc_xfer) != USBD_NORMAL_COMPLETION; + if (err != USBD_NORMAL_COMPLETION && err != USBD_IN_PROGRESS) { + DPRINTF("failed to start transfer (CBW)\n"); + return 0; + } + + return 1; +} + +static int +u3gstub_sierra_init(struct u3gstub_softc *sc, struct usb_attach_arg *uaa) +{ + usb_device_request_t req; + + req.bmRequestType = UT_VENDOR; + req.bRequest = UR_SET_INTERFACE; + USETW(req.wValue, UF_DEVICE_REMOTE_WAKEUP); + USETW(req.wIndex, UHF_PORT_CONNECTION); + USETW(req.wLength, 0); + + (void) usbd_do_request(uaa->device, &req, 0); /* ignore any error */ + + return 1; +} + +static int +u3gstub_match(device_t self) +{ + struct usb_attach_arg *uaa = device_get_ivars(self); + const struct u3g_dev_type_s *u3g_dev_type; + usb_interface_descriptor_t *id; + + /* This stub handles 3G modem devices (E220, Mobile, etc.) with + * auto-install flash disks for Windows/MacOSX on the first interface. + * After some command or some delay they change appearance to a modem. + */ + + if (!uaa->iface) + return UMATCH_NONE; + + u3g_dev_type = u3g_lookup(uaa->vendor, uaa->product); + if (!u3g_dev_type) + return UMATCH_NONE; + + if (u3g_dev_type->flags&U3GFL_HUAWEI_INIT + || u3g_dev_type->flags&U3GFL_SCSI_EJECT + || u3g_dev_type->flags&U3GFL_SIERRA_INIT + || u3g_dev_type->flags&U3GFL_CMOTECH_INIT + || u3g_dev_type->flags&U3GFL_STUB_WAIT) { + /* We assume that if the first interface is still a mass + * storage device the device has not yet changed appearance. + */ + id = usbd_get_interface_descriptor(uaa->iface); + if (id && id->bInterfaceNumber == 0 + && id->bInterfaceClass == UICLASS_MASS) { +#ifndef U3G_DEBUG + if (!bootverbose) + device_quiet(self); +#endif + + return UMATCH_VENDOR_PRODUCT; + } + } + + return UMATCH_NONE; +} + +static int +u3gstub_attach(device_t self) +{ + struct u3gstub_softc *sc = device_get_softc(self); + struct usb_attach_arg *uaa = device_get_ivars(self); + const struct u3g_dev_type_s *u3g_dev_type; + int i; + +#ifndef U3G_DEBUG + if (!bootverbose) + device_quiet(self); +#endif + + sc->sc_dev = self; + sc->sc_udev = uaa->device; + + for (i = 0; i < uaa->nifaces; i++) + uaa->ifaces[i] = NULL; // claim all interfaces + + u3g_dev_type = u3g_lookup(uaa->vendor, uaa->product); + if (u3g_dev_type->flags&U3GFL_HUAWEI_INIT) { + if (bootverbose) + device_printf(sc->sc_dev, + "changing Huawei modem to modem mode\n"); + if (!u3gstub_huawei_init(sc, uaa)) + return ENXIO; + } else if (u3g_dev_type->flags&U3GFL_SCSI_EJECT) { + if (bootverbose) + device_printf(sc->sc_dev, "sending CD eject command to " + "change to modem mode\n"); + if (!u3gstub_scsi_eject(sc, uaa)) + return ENXIO; + } else if (u3g_dev_type->flags&U3GFL_SIERRA_INIT) { + if (bootverbose) + device_printf(sc->sc_dev, + "changing Sierra modem to modem mode\n"); + if (!u3gstub_sierra_init(sc, uaa)) + return ENXIO; + } else if (u3g_dev_type->flags&U3GFL_CMOTECH_INIT) { + if (bootverbose) + device_printf(sc->sc_dev, + "changing CMOTECH modem to modem mode\n"); + if (!u3gstub_cmotech_init(sc, uaa)) + return ENXIO; + } else if (u3g_dev_type->flags&U3GFL_STUB_WAIT) { + if (bootverbose) + device_printf(sc->sc_dev, "waiting for modem to change " + "to modem mode\n"); + /* nop */ + } + + return 0; +} + +static int +u3gstub_detach(device_t self) +{ + struct u3gstub_softc *sc = device_get_softc(self); + + if (sc->sc_xfer) + usbd_free_xfer(sc->sc_xfer); + + if (sc->sc_pipe_in) { + usbd_abort_pipe(sc->sc_pipe_in); + usbd_close_pipe(sc->sc_pipe_in); + } + if (sc->sc_pipe_out) { + usbd_abort_pipe(sc->sc_pipe_out); + usbd_close_pipe(sc->sc_pipe_out); + } + + return 0; +} + +static device_method_t u3gstub_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, u3gstub_match), + DEVMETHOD(device_attach, u3gstub_attach), + DEVMETHOD(device_detach, u3gstub_detach), + + { 0, 0 } +}; + +static driver_t u3gstub_driver = { + "u3g", + u3gstub_methods, + sizeof (struct u3gstub_softc) +}; + +DRIVER_MODULE(u3gstub, uhub, u3gstub_driver, ucom_devclass, usbd_driver_load, 0); +MODULE_DEPEND(u3gstub, usb, 1, 1, 1); Modified: stable/7/sys/dev/usb/ubsa.c ============================================================================== --- stable/7/sys/dev/usb/ubsa.c Sun Mar 22 15:46:12 2009 (r190267) +++ stable/7/sys/dev/usb/ubsa.c Sun Mar 22 16:27:14 2009 (r190268) @@ -210,8 +210,12 @@ static const struct ubsa_product { uint16_t vendor; uint16_t product; } ubsa_products [] = { + /* AnyData ADU-500A */ + { USB_VENDOR_ANYDATA, USB_PRODUCT_ANYDATA_ADU_500A }, /* AnyData ADU-E100A/H */ { USB_VENDOR_ANYDATA, USB_PRODUCT_ANYDATA_ADU_E100X }, + /* Axesstel MV100H */ + { USB_VENDOR_AXESSTEL, USB_PRODUCT_AXESSTEL_DATAMODEM }, /* BELKIN F5U103 */ { USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5U103 }, /* BELKIN F5U120 */ @@ -222,24 +226,6 @@ static const struct ubsa_product { { USB_VENDOR_GOHUBS, USB_PRODUCT_GOHUBS_GOCOM232 }, /* Peracom */ { USB_VENDOR_PERACOM, USB_PRODUCT_PERACOM_SERIAL1 }, - /* Novatel Wireless Merlin cards */ - { USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U740 }, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 17:09:57 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 17:20:43 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 17:22:15 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 18:15:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D1C9106571B for ; Sun, 22 Mar 2009 18:15:49 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outJ.internet-mail-service.net (outj.internet-mail-service.net [216.240.47.233]) by mx1.freebsd.org (Postfix) with ESMTP id 5A2B28FC1D 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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 18:20:57 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD1761065676 for ; Sun, 22 Mar 2009 18:20:57 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outF.internet-mail-service.net (outf.internet-mail-service.net [216.240.47.229]) by mx1.freebsd.org (Postfix) with ESMTP id 8C13B8FC1F 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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 18:56:27 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 19:16:59 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 20:36:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25F5B1065678; Sun, 22 Mar 2009 20:36:27 +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 1380A8FC2C; Sun, 22 Mar 2009 20:36:27 +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 n2MKaQhR082449; Sun, 22 Mar 2009 20:36:26 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MKaQqJ082448; Sun, 22 Mar 2009 20:36:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903222036.n2MKaQqJ082448@svn.freebsd.org> From: Marius Strobl Date: Sun, 22 Mar 2009 20:36:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190273 - stable/7/usr.sbin/eeprom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 20:36:28 -0000 Author: marius Date: Sun Mar 22 20:36:26 2009 New Revision: 190273 URL: http://svn.freebsd.org/changeset/base/190273 Log: MFC: 190097 - Sprinkle const. - Remove incorrect __unused. Modified: stable/7/usr.sbin/eeprom/ (props changed) stable/7/usr.sbin/eeprom/ofw_options.c Modified: stable/7/usr.sbin/eeprom/ofw_options.c ============================================================================== --- stable/7/usr.sbin/eeprom/ofw_options.c Sun Mar 22 18:56:26 2009 (r190272) +++ stable/7/usr.sbin/eeprom/ofw_options.c Sun Mar 22 20:36:26 2009 (r190273) @@ -52,18 +52,18 @@ __FBSDID("$FreeBSD$"); struct ofwo_extabent { const char *ex_prop; - int (*ex_handler)(struct ofwo_extabent *, int, const void *, - int, const char *); + int (*ex_handler)(const struct ofwo_extabent *, int, + const void *, int, const char *); }; -static int ofwo_oemlogo(struct ofwo_extabent *, int, const void *, int, - const char *); -static int ofwo_secmode(struct ofwo_extabent *, int, const void *, int, - const char *); -static int ofwo_secpwd(struct ofwo_extabent *, int, const void *, int, - const char *); +static int ofwo_oemlogo(const struct ofwo_extabent *, int, const void *, + int, const char *); +static int ofwo_secmode(const struct ofwo_extabent *, int, const void *, + int, const char *); +static int ofwo_secpwd(const struct ofwo_extabent *, int, const void *, + int, const char *); -static struct ofwo_extabent ofwo_extab[] = { +static const struct ofwo_extabent const ofwo_extab[] = { { "oem-logo", ofwo_oemlogo }, { "security-mode", ofwo_secmode }, { "security-password", ofwo_secpwd }, @@ -81,8 +81,8 @@ ofwo_printprop(const char *prop, const c } static int -ofwo_oemlogo(struct ofwo_extabent *exent, int fd, const void *buf, int buflen, - const char *val) +ofwo_oemlogo(const struct ofwo_extabent *exent, int fd, const void *buf, + int buflen, const char *val) { int lfd; char logo[OFWO_LOGO + 1]; @@ -117,8 +117,8 @@ ofwo_oemlogo(struct ofwo_extabent *exent } static int -ofwo_secmode(struct ofwo_extabent *exent, int fd, const void *buf, int buflen, - const char *val) +ofwo_secmode(const struct ofwo_extabent *exent, int fd, const void *buf, + int buflen, const char *val) { int res; @@ -145,8 +145,8 @@ ofwo_secmode(struct ofwo_extabent *exent } static int -ofwo_secpwd(struct ofwo_extabent *exent, int fd __unused, - const void *buf __unused, __unused int buflen, const char *val) +ofwo_secpwd(const struct ofwo_extabent *exent, int fd, const void *buf, + int buflen, const char *val) { void *pbuf; int len, pblen, rv; @@ -246,14 +246,14 @@ ofwo_dump(void) int fd, len, nlen, pblen; phandle_t optnode; char prop[OFWO_MAXPROP + 1]; - struct ofwo_extabent *ex; + const struct ofwo_extabent *ex; pblen = 0; pbuf = NULL; fd = ofw_open(O_RDONLY); optnode = ofw_optnode(fd); for (nlen = ofw_firstprop(fd, optnode, prop, sizeof(prop)); nlen != 0; - nlen = ofw_nextprop(fd, optnode, prop, prop, sizeof(prop))) { + nlen = ofw_nextprop(fd, optnode, prop, prop, sizeof(prop))) { len = ofw_getprop_alloc(fd, optnode, prop, &pbuf, &pblen, 1); if (len < 0) continue; @@ -277,7 +277,7 @@ ofwo_action(const char *prop, const char { void *pbuf; int fd, len, pblen, rv; - struct ofwo_extabent *ex; + const struct ofwo_extabent *ex; pblen = 0; rv = EX_OK; @@ -300,7 +300,7 @@ ofwo_action(const char *prop, const char rv = (*ex->ex_handler)(ex, fd, pbuf, len, val); else if (val) rv = ofwo_setstr(fd, pbuf, len, prop, val); - else + else ofwo_printprop(prop, (char *)pbuf, len); out: if (pbuf != NULL) From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 20:36:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2832910656C2; Sun, 22 Mar 2009 20:36:38 +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 153E48FC08; Sun, 22 Mar 2009 20:36:38 +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 n2MKab5W082488; Sun, 22 Mar 2009 20:36:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MKabLf082487; Sun, 22 Mar 2009 20:36:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903222036.n2MKabLf082487@svn.freebsd.org> From: Marius Strobl Date: Sun, 22 Mar 2009 20:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190274 - stable/6/usr.sbin/eeprom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 20:36:39 -0000 Author: marius Date: Sun Mar 22 20:36:37 2009 New Revision: 190274 URL: http://svn.freebsd.org/changeset/base/190274 Log: MFC: 190097 - Sprinkle const. - Remove incorrect __unused. Modified: stable/6/usr.sbin/eeprom/ (props changed) stable/6/usr.sbin/eeprom/ofw_options.c Modified: stable/6/usr.sbin/eeprom/ofw_options.c ============================================================================== --- stable/6/usr.sbin/eeprom/ofw_options.c Sun Mar 22 20:36:26 2009 (r190273) +++ stable/6/usr.sbin/eeprom/ofw_options.c Sun Mar 22 20:36:37 2009 (r190274) @@ -52,18 +52,18 @@ __FBSDID("$FreeBSD$"); struct ofwo_extabent { const char *ex_prop; - int (*ex_handler)(struct ofwo_extabent *, int, const void *, - int, const char *); + int (*ex_handler)(const struct ofwo_extabent *, int, + const void *, int, const char *); }; -static int ofwo_oemlogo(struct ofwo_extabent *, int, const void *, int, - const char *); -static int ofwo_secmode(struct ofwo_extabent *, int, const void *, int, - const char *); -static int ofwo_secpwd(struct ofwo_extabent *, int, const void *, int, - const char *); +static int ofwo_oemlogo(const struct ofwo_extabent *, int, const void *, + int, const char *); +static int ofwo_secmode(const struct ofwo_extabent *, int, const void *, + int, const char *); +static int ofwo_secpwd(const struct ofwo_extabent *, int, const void *, + int, const char *); -static struct ofwo_extabent ofwo_extab[] = { +static const struct ofwo_extabent const ofwo_extab[] = { { "oem-logo", ofwo_oemlogo }, { "security-mode", ofwo_secmode }, { "security-password", ofwo_secpwd }, @@ -82,8 +82,8 @@ ofwo_printprop(const char *prop, const c } static int -ofwo_oemlogo(struct ofwo_extabent *exent, int fd, const void *buf, int buflen, - const char *val) +ofwo_oemlogo(const struct ofwo_extabent *exent, int fd, const void *buf, + int buflen, const char *val) { int lfd; char logo[OFWO_LOGO + 1]; @@ -118,8 +118,8 @@ ofwo_oemlogo(struct ofwo_extabent *exent } static int -ofwo_secmode(struct ofwo_extabent *exent, int fd, const void *buf, int buflen, - const char *val) +ofwo_secmode(const struct ofwo_extabent *exent, int fd, const void *buf, + int buflen, const char *val) { int res; @@ -146,8 +146,8 @@ ofwo_secmode(struct ofwo_extabent *exent } static int -ofwo_secpwd(struct ofwo_extabent *exent, int fd __unused, - const void *buf __unused, __unused int buflen, const char *val) +ofwo_secpwd(const struct ofwo_extabent *exent, int fd, const void *buf, + int buflen, const char *val) { void *pbuf; int len, pblen, rv; @@ -247,14 +247,14 @@ ofwo_dump(void) int fd, len, nlen, pblen; phandle_t optnode; char prop[OFWO_MAXPROP + 1]; - struct ofwo_extabent *ex; + const struct ofwo_extabent *ex; pblen = 0; pbuf = NULL; fd = ofw_open(O_RDONLY); optnode = ofw_optnode(fd); for (nlen = ofw_firstprop(fd, optnode, prop, sizeof(prop)); nlen != 0; - nlen = ofw_nextprop(fd, optnode, prop, prop, sizeof(prop))) { + nlen = ofw_nextprop(fd, optnode, prop, prop, sizeof(prop))) { len = ofw_getprop_alloc(fd, optnode, prop, &pbuf, &pblen, 1); if (len < 0) continue; @@ -278,7 +278,7 @@ ofwo_action(const char *prop, const char { void *pbuf; int fd, len, pblen, rv; - struct ofwo_extabent *ex; + const struct ofwo_extabent *ex; pblen = 0; rv = EX_OK; @@ -301,7 +301,7 @@ ofwo_action(const char *prop, const char rv = (*ex->ex_handler)(ex, fd, pbuf, len, val); else if (val) rv = ofwo_setstr(fd, pbuf, len, prop, val); - else + else ofwo_printprop(prop, (char *)pbuf, len); out: if (pbuf != NULL) From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 20:46:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF6EB1065673; Sun, 22 Mar 2009 20:46:39 +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 AC3D18FC14; Sun, 22 Mar 2009 20:46:39 +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 n2MKkc6T082805; Sun, 22 Mar 2009 20:46:38 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MKkcUu082801; Sun, 22 Mar 2009 20:46:38 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200903222046.n2MKkcUu082801@svn.freebsd.org> From: Alan Cox Date: Sun, 22 Mar 2009 20:46:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190275 - in stable/7/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 20:46:40 -0000 Author: alc Date: Sun Mar 22 20:46:37 2009 New Revision: 190275 URL: http://svn.freebsd.org/changeset/base/190275 Log: MFC r188932, r189785, r189795, and r190272 Optimize free_pv_entry(); specifically, avoid repeated TAILQ_REMOVE()s. Update the pmap's resident page count when a page table page is freed in pmap_remove_pde() and pmap_remove_pages(). Update stale comments. The alternate address space mapping was eliminated when PAE support was added to i386. The direct mapping exists on amd64. Modified: stable/7/sys/amd64/amd64/pmap.c stable/7/sys/amd64/include/pmap.h stable/7/sys/i386/i386/pmap.c stable/7/sys/i386/include/pmap.h Modified: stable/7/sys/amd64/amd64/pmap.c ============================================================================== --- stable/7/sys/amd64/amd64/pmap.c Sun Mar 22 20:36:37 2009 (r190274) +++ stable/7/sys/amd64/amd64/pmap.c Sun Mar 22 20:46:37 2009 (r190275) @@ -1905,15 +1905,15 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv pc->pc_map[field] |= 1ul << bit; /* move to head of list */ TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); - TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); if (pc->pc_map[0] != PC_FREE0 || pc->pc_map[1] != PC_FREE1 || - pc->pc_map[2] != PC_FREE2) + pc->pc_map[2] != PC_FREE2) { + TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); return; + } PV_STAT(pv_entry_spare -= _NPCPV); PV_STAT(pc_chunk_count--); PV_STAT(pc_chunk_frees++); /* entire chunk is free, return it */ - TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); dump_drop_page(m->phys_addr); vm_page_unwire(m, 0); @@ -2325,6 +2325,7 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t mpte = pmap_lookup_pt_page(pmap, sva); if (mpte != NULL) { pmap_remove_pt_page(pmap, mpte); + pmap->pm_stats.resident_count--; KASSERT(mpte->wire_count == NPTEPG, ("pmap_remove_pde: pte page wire count error")); mpte->wire_count = 0; @@ -3797,6 +3798,7 @@ pmap_remove_pages(pmap_t pmap) mpte = pmap_lookup_pt_page(pmap, pv->pv_va); if (mpte != NULL) { pmap_remove_pt_page(pmap, mpte); + pmap->pm_stats.resident_count--; KASSERT(mpte->wire_count == NPTEPG, ("pmap_remove_pages: pte page wire count error")); mpte->wire_count = 0; Modified: stable/7/sys/amd64/include/pmap.h ============================================================================== --- stable/7/sys/amd64/include/pmap.h Sun Mar 22 20:36:37 2009 (r190274) +++ stable/7/sys/amd64/include/pmap.h Sun Mar 22 20:46:37 2009 (r190275) @@ -156,13 +156,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: stable/7/sys/i386/i386/pmap.c ============================================================================== --- stable/7/sys/i386/i386/pmap.c Sun Mar 22 20:36:37 2009 (r190274) +++ stable/7/sys/i386/i386/pmap.c Sun Mar 22 20:46:37 2009 (r190275) @@ -1973,15 +1973,15 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv pc->pc_map[field] |= 1ul << bit; /* move to head of list */ TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); - TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); for (idx = 0; idx < _NPCM; idx++) - if (pc->pc_map[idx] != pc_freemask[idx]) + if (pc->pc_map[idx] != pc_freemask[idx]) { + TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); return; + } PV_STAT(pv_entry_spare -= _NPCPV); PV_STAT(pc_chunk_count--); PV_STAT(pc_chunk_frees++); /* entire chunk is free, return it */ - TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); m = PHYS_TO_VM_PAGE(pmap_kextract((vm_offset_t)pc)); pmap_qremove((vm_offset_t)pc, 1); vm_page_unwire(m, 0); @@ -2431,6 +2431,7 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t mpte = pmap_lookup_pt_page(pmap, sva); if (mpte != NULL) { pmap_remove_pt_page(pmap, mpte); + pmap->pm_stats.resident_count--; KASSERT(mpte->wire_count == NPTEPG, ("pmap_remove_pde: pte page wire count error")); mpte->wire_count = 0; @@ -3935,6 +3936,7 @@ pmap_remove_pages(pmap_t pmap) mpte = pmap_lookup_pt_page(pmap, pv->pv_va); if (mpte != NULL) { pmap_remove_pt_page(pmap, mpte); + pmap->pm_stats.resident_count--; KASSERT(mpte->wire_count == NPTEPG, ("pmap_remove_pages: pte page wire count error")); mpte->wire_count = 0; Modified: stable/7/sys/i386/include/pmap.h ============================================================================== --- stable/7/sys/i386/include/pmap.h Sun Mar 22 20:36:37 2009 (r190274) +++ stable/7/sys/i386/include/pmap.h Sun Mar 22 20:46:37 2009 (r190275) @@ -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-all@FreeBSD.ORG Sun Mar 22 20:48:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6557C106564A; Sun, 22 Mar 2009 20:48:05 +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 527328FC14; Sun, 22 Mar 2009 20:48:05 +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 n2MKm55K082878; Sun, 22 Mar 2009 20:48:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MKm5RK082877; Sun, 22 Mar 2009 20:48:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903222048.n2MKm5RK082877@svn.freebsd.org> From: Marius Strobl Date: Sun, 22 Mar 2009 20:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190276 - in stable/6/sys: . contrib/pf dev/cxgb sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 20:48:06 -0000 Author: marius Date: Sun Mar 22 20:48:05 2009 New Revision: 190276 URL: http://svn.freebsd.org/changeset/base/190276 Log: MFC: r161587 Fix typo in a comment: DEFINE_CLASSx => DEFINE_CLASS_x. Modified: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) stable/6/sys/sys/kobj.h Modified: stable/6/sys/sys/kobj.h ============================================================================== --- stable/6/sys/sys/kobj.h Sun Mar 22 20:46:37 2009 (r190275) +++ stable/6/sys/sys/kobj.h Sun Mar 22 20:48:05 2009 (r190276) @@ -120,7 +120,7 @@ struct kobj_class classvar = { \ /* * Define a class inheriting a single base class. Use like this: * - * DEFINE_CLASS1(foo, foo_class, foo_methods, sizeof(foo_softc), + * DEFINE_CLASS_1(foo, foo_class, foo_methods, sizeof(foo_softc), * bar); */ #define DEFINE_CLASS_1(name, classvar, methods, size, \ @@ -135,7 +135,7 @@ struct kobj_class classvar = { \ /* * Define a class inheriting two base classes. Use like this: * - * DEFINE_CLASS2(foo, foo_class, foo_methods, sizeof(foo_softc), + * DEFINE_CLASS_2(foo, foo_class, foo_methods, sizeof(foo_softc), * bar, baz); */ #define DEFINE_CLASS_2(name, methods, size, \ @@ -151,7 +151,7 @@ struct kobj_class name ## _class = { \ /* * Define a class inheriting three base classes. Use like this: * - * DEFINE_CLASS3(foo, foo_class, foo_methods, sizeof(foo_softc), + * DEFINE_CLASS_3(foo, foo_class, foo_methods, sizeof(foo_softc), * bar, baz, foobar); */ #define DEFINE_CLASS_3(name, methods, size, \ From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 20:49:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D9CD1065672; Sun, 22 Mar 2009 20:49:27 +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 0B0F58FC0C; Sun, 22 Mar 2009 20:49:27 +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 n2MKnQJN082959; Sun, 22 Mar 2009 20:49:26 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MKnQgL082958; Sun, 22 Mar 2009 20:49:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903222049.n2MKnQgL082958@svn.freebsd.org> From: Marius Strobl Date: Sun, 22 Mar 2009 20:49:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190277 - in stable/6/sys: . contrib/pf dev/cxgb sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 20:49:27 -0000 Author: marius Date: Sun Mar 22 20:49:26 2009 New Revision: 190277 URL: http://svn.freebsd.org/changeset/base/190277 Log: MFC: 188040 Use NULL in preference to 0 for pointers. Modified: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) stable/6/sys/sys/kobj.h Modified: stable/6/sys/sys/kobj.h ============================================================================== --- stable/6/sys/sys/kobj.h Sun Mar 22 20:48:05 2009 (r190276) +++ stable/6/sys/sys/kobj.h Sun Mar 22 20:49:26 2009 (r190277) @@ -114,7 +114,7 @@ DEFINE_CLASS_0(name, name ## _class, met #define DEFINE_CLASS_0(name, classvar, methods, size) \ \ struct kobj_class classvar = { \ - #name, methods, size, 0 \ + #name, methods, size, NULL \ } /* @@ -127,7 +127,7 @@ struct kobj_class classvar = { \ base1) \ \ static kobj_class_t name ## _baseclasses[] = \ - { &base1, 0 }; \ + { &base1, NULL }; \ struct kobj_class classvar = { \ #name, methods, size, name ## _baseclasses \ } @@ -143,7 +143,7 @@ struct kobj_class classvar = { \ \ static kobj_class_t name ## _baseclasses[] = \ { &base1, \ - &base2, 0 }; \ + &base2, NULL }; \ struct kobj_class name ## _class = { \ #name, methods, size, name ## _baseclasses \ } @@ -160,7 +160,7 @@ struct kobj_class name ## _class = { \ static kobj_class_t name ## _baseclasses[] = \ { &base1, \ &base2, \ - &base3, 0 }; \ + &base3, NULL }; \ struct kobj_class name ## _class = { \ #name, methods, size, name ## _baseclasses \ } From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 20:50:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE7F010656D2; Sun, 22 Mar 2009 20:50:45 +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 D9F548FC27; Sun, 22 Mar 2009 20:50: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 n2MKojAf083031; Sun, 22 Mar 2009 20:50:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MKojsg083030; Sun, 22 Mar 2009 20:50:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903222050.n2MKojsg083030@svn.freebsd.org> From: Marius Strobl Date: Sun, 22 Mar 2009 20:50:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190278 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 20:50:49 -0000 Author: marius Date: Sun Mar 22 20:50:45 2009 New Revision: 190278 URL: http://svn.freebsd.org/changeset/base/190278 Log: MFC: 188040 Use NULL in preference to 0 for pointers. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sys/kobj.h Modified: stable/7/sys/sys/kobj.h ============================================================================== --- stable/7/sys/sys/kobj.h Sun Mar 22 20:49:26 2009 (r190277) +++ stable/7/sys/sys/kobj.h Sun Mar 22 20:50:45 2009 (r190278) @@ -114,7 +114,7 @@ DEFINE_CLASS_0(name, name ## _class, met #define DEFINE_CLASS_0(name, classvar, methods, size) \ \ struct kobj_class classvar = { \ - #name, methods, size, 0 \ + #name, methods, size, NULL \ } /* @@ -127,7 +127,7 @@ struct kobj_class classvar = { \ base1) \ \ static kobj_class_t name ## _baseclasses[] = \ - { &base1, 0 }; \ + { &base1, NULL }; \ struct kobj_class classvar = { \ #name, methods, size, name ## _baseclasses \ } @@ -143,7 +143,7 @@ struct kobj_class classvar = { \ \ static kobj_class_t name ## _baseclasses[] = \ { &base1, \ - &base2, 0 }; \ + &base2, NULL }; \ struct kobj_class name ## _class = { \ #name, methods, size, name ## _baseclasses \ } @@ -160,7 +160,7 @@ struct kobj_class name ## _class = { \ static kobj_class_t name ## _baseclasses[] = \ { &base1, \ &base2, \ - &base3, 0 }; \ + &base3, NULL }; \ struct kobj_class name ## _class = { \ #name, methods, size, name ## _baseclasses \ } From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 20:52:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB5421065670; Sun, 22 Mar 2009 20:52:43 +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 A7EC58FC25; Sun, 22 Mar 2009 20:52:43 +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 n2MKqhSQ083145; Sun, 22 Mar 2009 20:52:43 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MKqhbk083144; Sun, 22 Mar 2009 20:52:43 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903222052.n2MKqhbk083144@svn.freebsd.org> From: Marius Strobl Date: Sun, 22 Mar 2009 20:52:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190279 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 20:52:45 -0000 Author: marius Date: Sun Mar 22 20:52:43 2009 New Revision: 190279 URL: http://svn.freebsd.org/changeset/base/190279 Log: MFC: r188475 o Introduce KOBJMETHOD_END for the end of the kobj list. o Fix a minor indentation problem. o Put in the extra-strict KOBJMETHOD define, but commented out since the tree isn't yet ready. Reviewed by: (1) was posted to arch@ without objection (and 1 go for it) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sys/kobj.h Modified: stable/7/sys/sys/kobj.h ============================================================================== --- stable/7/sys/sys/kobj.h Sun Mar 22 20:50:45 2009 (r190278) +++ stable/7/sys/sys/kobj.h Sun Mar 22 20:52:43 2009 (r190279) @@ -92,7 +92,17 @@ struct kobjop_desc { /* * Shorthand for constructing method tables. */ +#if 1 #define KOBJMETHOD(NAME, FUNC) { &NAME##_desc, (kobjop_t) FUNC } +#else /* notyet */ +#define KOBJMETHOD(NAME, FUNC) \ +{ &NAME##_desc, (kobjop_t) (FUNC != (NAME##_t *)NULL ? FUNC : NULL) } +#endif + +/* + * + */ +#define KOBJMETHOD_END { NULL, NULL } /* * Declare a class (which should be defined in another file. @@ -127,7 +137,7 @@ struct kobj_class classvar = { \ base1) \ \ static kobj_class_t name ## _baseclasses[] = \ - { &base1, NULL }; \ + { &base1, NULL }; \ struct kobj_class classvar = { \ #name, methods, size, name ## _baseclasses \ } From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 20:52:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 510F11065677; Sun, 22 Mar 2009 20:52:45 +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 3E5FA8FC1A; Sun, 22 Mar 2009 20: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 n2MKqjG2083179; Sun, 22 Mar 2009 20: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 n2MKqjpR083178; Sun, 22 Mar 2009 20:52:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903222052.n2MKqjpR083178@svn.freebsd.org> From: Marius Strobl Date: Sun, 22 Mar 2009 20:52:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190280 - in stable/6/sys: . contrib/pf dev/cxgb sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 20:52:46 -0000 Author: marius Date: Sun Mar 22 20:52:44 2009 New Revision: 190280 URL: http://svn.freebsd.org/changeset/base/190280 Log: MFC: r188475 o Introduce KOBJMETHOD_END for the end of the kobj list. o Fix a minor indentation problem. o Put in the extra-strict KOBJMETHOD define, but commented out since the tree isn't yet ready. Reviewed by: (1) was posted to arch@ without objection (and 1 go for it) Modified: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) stable/6/sys/sys/kobj.h Modified: stable/6/sys/sys/kobj.h ============================================================================== --- stable/6/sys/sys/kobj.h Sun Mar 22 20:52:43 2009 (r190279) +++ stable/6/sys/sys/kobj.h Sun Mar 22 20:52:44 2009 (r190280) @@ -92,7 +92,17 @@ struct kobjop_desc { /* * Shorthand for constructing method tables. */ +#if 1 #define KOBJMETHOD(NAME, FUNC) { &NAME##_desc, (kobjop_t) FUNC } +#else /* notyet */ +#define KOBJMETHOD(NAME, FUNC) \ +{ &NAME##_desc, (kobjop_t) (FUNC != (NAME##_t *)NULL ? FUNC : NULL) } +#endif + +/* + * + */ +#define KOBJMETHOD_END { NULL, NULL } /* * Declare a class (which should be defined in another file. @@ -127,7 +137,7 @@ struct kobj_class classvar = { \ base1) \ \ static kobj_class_t name ## _baseclasses[] = \ - { &base1, NULL }; \ + { &base1, NULL }; \ struct kobj_class classvar = { \ #name, methods, size, name ## _baseclasses \ } From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 20:54:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84260106566C; Sun, 22 Mar 2009 20:54:22 +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 6FDC68FC2A; Sun, 22 Mar 2009 20:54:22 +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 n2MKsMlT083256; Sun, 22 Mar 2009 20:54:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MKsMAR083254; Sun, 22 Mar 2009 20:54:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903222054.n2MKsMAR083254@svn.freebsd.org> From: Marius Strobl Date: Sun, 22 Mar 2009 20:54:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190281 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/fhc sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 20:54:23 -0000 Author: marius Date: Sun Mar 22 20:54:22 2009 New Revision: 190281 URL: http://svn.freebsd.org/changeset/base/190281 Log: MFC: r190098 - Failing to register as interrupt controller during attach shouldn't be fatal so just inform about this instead of panicing. - Sort device methods. - Take advantage of KOBJMETHOD_END. - Remove some redundant variables. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/fhc/fhc.c stable/7/sys/sparc64/sparc64/upa.c Modified: stable/7/sys/sparc64/fhc/fhc.c ============================================================================== --- stable/7/sys/sparc64/fhc/fhc.c Sun Mar 22 20:52:44 2009 (r190280) +++ stable/7/sys/sparc64/fhc/fhc.c Sun Mar 22 20:54:22 2009 (r190281) @@ -90,14 +90,14 @@ static device_method_t fhc_methods[] = { /* Bus interface */ DEVMETHOD(bus_print_child, fhc_print_child), DEVMETHOD(bus_probe_nomatch, fhc_probe_nomatch), - DEVMETHOD(bus_setup_intr, fhc_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_alloc_resource, fhc_alloc_resource), - DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - DEVMETHOD(bus_get_resource_list, fhc_get_resource_list), + DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), + DEVMETHOD(bus_setup_intr, fhc_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), + DEVMETHOD(bus_get_resource_list, fhc_get_resource_list), /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, fhc_get_devinfo), @@ -107,7 +107,7 @@ static device_method_t fhc_methods[] = { DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - { NULL, NULL } + KOBJMETHOD_END }; static driver_t fhc_driver = { @@ -165,9 +165,7 @@ fhc_attach(device_t dev) int central; int error; int i; - int nintr; - int nreg; - int rid; + int j; sc = device_get_softc(dev); node = ofw_bus_get_node(dev); @@ -177,9 +175,9 @@ fhc_attach(device_t dev) central = 1; for (i = 0; i < FHC_NREG; i++) { - rid = i; + j = i; sc->sc_memres[i] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &rid, RF_ACTIVE); + &j, RF_ACTIVE); if (sc->sc_memres[i] == NULL) { device_printf(dev, "cannot allocate resource %d\n", i); error = ENXIO; @@ -239,7 +237,8 @@ fhc_attach(device_t dev) /* * Hunt through all the interrupt mapping regs and register * our interrupt controller for the corresponding interrupt - * vectors. + * vectors. We do this early in order to be able to catch + * stray interrupts. */ for (i = FHC_FANFAIL; i <= FHC_TOD; i++) { fica = malloc(sizeof(*fica), M_DEVBUF, M_NOWAIT); @@ -259,11 +258,13 @@ fhc_attach(device_t dev) * the IGN and the IGN is constant for all devices * on that FireHose controller. */ - if (intr_controller_register(INTMAP_VEC(sc->sc_ign, + j = intr_controller_register(INTMAP_VEC(sc->sc_ign, INTINO(bus_read_4(fica->fica_memres, FHC_IMAP))), - &fhc_ic, fica) != 0) - panic("%s: could not register interrupt " - "controller for map %d", __func__, i); + &fhc_ic, fica); + if (j != 0) + device_printf(dev, "could not register " + "interrupt controller for map %d (%d)\n", + i, j); } } else { snprintf(ledname, sizeof(ledname), "board%d", board); @@ -276,9 +277,9 @@ fhc_attach(device_t dev) free(fdi, M_DEVBUF); continue; } - nreg = OF_getprop_alloc(child, "reg", sizeof(*reg), + i = OF_getprop_alloc(child, "reg", sizeof(*reg), (void **)®); - if (nreg == -1) { + if (i == -1) { device_printf(dev, "<%s>: incomplete\n", fdi->fdi_obdinfo.obd_name); ofw_bus_gen_destroy_devinfo(&fdi->fdi_obdinfo); @@ -286,19 +287,19 @@ fhc_attach(device_t dev) continue; } resource_list_init(&fdi->fdi_rl); - for (i = 0; i < nreg; i++) - resource_list_add(&fdi->fdi_rl, SYS_RES_MEMORY, i, - reg[i].sbr_offset, reg[i].sbr_offset + - reg[i].sbr_size, reg[i].sbr_size); + for (j = 0; j < i; j++) + resource_list_add(&fdi->fdi_rl, SYS_RES_MEMORY, j, + reg[j].sbr_offset, reg[j].sbr_offset + + reg[j].sbr_size, reg[j].sbr_size); free(reg, M_OFWPROP); if (central == 1) { - nintr = OF_getprop_alloc(child, "interrupts", + i = OF_getprop_alloc(child, "interrupts", sizeof(*intr), (void **)&intr); - if (nintr != -1) { - for (i = 0; i < nintr; i++) { - iv = INTMAP_VEC(sc->sc_ign, intr[i]); + if (i != -1) { + for (j = 0; j < i; j++) { + iv = INTMAP_VEC(sc->sc_ign, intr[j]); resource_list_add(&fdi->fdi_rl, - SYS_RES_IRQ, i, iv, iv, 1); + SYS_RES_IRQ, j, iv, iv, 1); } free(intr, M_OFWPROP); } Modified: stable/7/sys/sparc64/sparc64/upa.c ============================================================================== --- stable/7/sys/sparc64/sparc64/upa.c Sun Mar 22 20:52:44 2009 (r190280) +++ stable/7/sys/sparc64/sparc64/upa.c Sun Mar 22 20:54:22 2009 (r190281) @@ -144,7 +144,7 @@ static device_method_t upa_methods[] = { DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - { NULL, NULL } + KOBJMETHOD_END }; static devclass_t upa_devclass; @@ -241,7 +241,7 @@ upa_attach(device_t dev) "pci108e,8001") == 0 && ((bus_get_resource_start(children[j], SYS_RES_MEMORY, 0) >> 20) & 1) == 1) { - schizo = children[j]; + schizo = children[j]; break; } } @@ -287,9 +287,10 @@ upa_attach(device_t dev) goto fail; } - /* + /* * Hunt through all the interrupt mapping regs and register our * interrupt controller for the corresponding interrupt vectors. + * We do this early in order to be able to catch stray interrupts. */ for (i = UPA_INO_BASE; i <= UPA_INO_MAX; i++) { imr = 0; @@ -312,10 +313,11 @@ upa_attach(device_t dev) device_printf(dev, "intr map (INO %d) IMR%d: %#lx\n", i, imr, (u_long)UPA_READ(sc, imr, 0x0)); #endif - if (intr_controller_register(INTMAP_VEC(sc->sc_ign, i), - &upa_ic, uica) != 0) - panic("%s: could not register interrupt controller " - "for INO %d", __func__, i); + j = intr_controller_register(INTMAP_VEC(sc->sc_ign, i), + &upa_ic, uica); + if (j != 0) + device_printf(dev, "could not register interrupt " + "controller for INO %d (%d)\n", i, j); } /* Make sure the power level is appropriate for normal operation. */ @@ -345,13 +347,13 @@ upa_attach(device_t dev) device_printf(dev, "could not determine upa-portid of child 0x%lx\n", (unsigned long)child); - continue; + continue; } if (portid > 1) { device_printf(dev, "upa-portid %d of child 0x%lx invalid\n", portid, (unsigned long)child); - continue; + continue; } if ((udi = upa_setup_dinfo(dev, sc, child, portid)) == NULL) continue; @@ -493,12 +495,12 @@ upa_setup_intr(device_t dev, device_t ch /* * Make sure the vector is fully specified and we registered * our interrupt controller for it. - */ + */ vec = rman_get_start(ires); if (INTIGN(vec) != sc->sc_ign || intr_vectors[vec].iv_ic != &upa_ic) { device_printf(dev, "invalid interrupt vector 0x%lx\n", vec); - return (EINVAL); - } + return (EINVAL); + } return (bus_generic_setup_intr(dev, child, ires, flags, filt, func, arg, cookiep)); } From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 20:58:29 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 21:00:58 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 21:09:22 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 21:09:24 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 21:12:00 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 21:14:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F3841065675; Sun, 22 Mar 2009 21:14:34 +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 2B34D8FC12; Sun, 22 Mar 2009 21:14:34 +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 n2MLEYSS083936; Sun, 22 Mar 2009 21:14:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MLEXFg083930; Sun, 22 Mar 2009 21:14:33 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903222114.n2MLEXFg083930@svn.freebsd.org> From: Marius Strobl Date: Sun, 22 Mar 2009 21:14:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190286 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/central sparc64/ebus sparc64/pci sparc64/sbus sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 21:14:34 -0000 Author: marius Date: Sun Mar 22 21:14:33 2009 New Revision: 190286 URL: http://svn.freebsd.org/changeset/base/190286 Log: MFC: r190099 - Sort device methods. - Take advantage of KOBJMETHOD_END. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/central/central.c stable/7/sys/sparc64/ebus/ebus.c stable/7/sys/sparc64/pci/apb.c stable/7/sys/sparc64/pci/ofw_pcib.c stable/7/sys/sparc64/sbus/dma_sbus.c stable/7/sys/sparc64/sparc64/nexus.c Modified: stable/7/sys/sparc64/central/central.c ============================================================================== --- stable/7/sys/sparc64/central/central.c Sun Mar 22 21:12:00 2009 (r190285) +++ stable/7/sys/sparc64/central/central.c Sun Mar 22 21:14:33 2009 (r190286) @@ -76,14 +76,14 @@ static device_method_t central_methods[] /* Bus interface */ DEVMETHOD(bus_print_child, central_print_child), DEVMETHOD(bus_probe_nomatch, central_probe_nomatch), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_alloc_resource, central_alloc_resource), - DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - DEVMETHOD(bus_get_resource_list, central_get_resource_list), + DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), + DEVMETHOD(bus_get_resource_list, central_get_resource_list), /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, central_get_devinfo), @@ -93,7 +93,7 @@ static device_method_t central_methods[] DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - { NULL, NULL } + KOBJMETHOD_END }; static driver_t central_driver = { Modified: stable/7/sys/sparc64/ebus/ebus.c ============================================================================== --- stable/7/sys/sparc64/ebus/ebus.c Sun Mar 22 21:12:00 2009 (r190285) +++ stable/7/sys/sparc64/ebus/ebus.c Sun Mar 22 21:14:33 2009 (r190286) @@ -110,14 +110,14 @@ static device_method_t ebus_methods[] = /* Bus interface */ DEVMETHOD(bus_print_child, ebus_print_child), DEVMETHOD(bus_probe_nomatch, ebus_probe_nomatch), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_alloc_resource, ebus_alloc_resource), - DEVMETHOD(bus_get_resource_list, ebus_get_resource_list), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_release_resource, ebus_release_resource), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), + DEVMETHOD(bus_get_resource_list, ebus_get_resource_list), /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, ebus_get_devinfo), @@ -127,7 +127,7 @@ static device_method_t ebus_methods[] = DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - { 0, 0 } + KOBJMETHOD_END }; static driver_t ebus_driver = { Modified: stable/7/sys/sparc64/pci/apb.c ============================================================================== --- stable/7/sys/sparc64/pci/apb.c Sun Mar 22 21:12:00 2009 (r190285) +++ stable/7/sys/sparc64/pci/apb.c Sun Mar 22 21:14:33 2009 (r190286) @@ -91,9 +91,9 @@ static device_method_t apb_methods[] = { DEVMETHOD(bus_read_ivar, pcib_read_ivar), DEVMETHOD(bus_write_ivar, pcib_write_ivar), DEVMETHOD(bus_alloc_resource, apb_alloc_resource), - DEVMETHOD(bus_release_resource, bus_generic_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), @@ -106,7 +106,7 @@ static device_method_t apb_methods[] = { /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, ofw_pcib_gen_get_node), - { 0, 0 } + KOBJMETHOD_END }; static devclass_t pcib_devclass; Modified: stable/7/sys/sparc64/pci/ofw_pcib.c ============================================================================== --- stable/7/sys/sparc64/pci/ofw_pcib.c Sun Mar 22 21:12:00 2009 (r190285) +++ stable/7/sys/sparc64/pci/ofw_pcib.c Sun Mar 22 21:14:33 2009 (r190286) @@ -72,9 +72,9 @@ static device_method_t ofw_pcib_methods[ DEVMETHOD(bus_read_ivar, pcib_read_ivar), DEVMETHOD(bus_write_ivar, pcib_write_ivar), DEVMETHOD(bus_alloc_resource, pcib_alloc_resource), - DEVMETHOD(bus_release_resource, bus_generic_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), @@ -87,7 +87,7 @@ static device_method_t ofw_pcib_methods[ /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, ofw_pcib_gen_get_node), - { 0, 0 } + KOBJMETHOD_END }; static devclass_t pcib_devclass; Modified: stable/7/sys/sparc64/sbus/dma_sbus.c ============================================================================== --- stable/7/sys/sparc64/sbus/dma_sbus.c Sun Mar 22 21:12:00 2009 (r190285) +++ stable/7/sys/sparc64/sbus/dma_sbus.c Sun Mar 22 21:14:33 2009 (r190286) @@ -122,14 +122,14 @@ static device_method_t dma_methods[] = { /* Bus interface */ DEVMETHOD(bus_print_child, dma_print_child), DEVMETHOD(bus_probe_nomatch, dma_probe_nomatch), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource), - DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - DEVMETHOD(bus_get_resource_list, dma_get_resource_list), + DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), + DEVMETHOD(bus_get_resource_list, dma_get_resource_list), /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, dma_get_devinfo), @@ -139,7 +139,7 @@ static device_method_t dma_methods[] = { DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - { 0, 0 } + KOBJMETHOD_END }; static driver_t dma_driver = { Modified: stable/7/sys/sparc64/sparc64/nexus.c ============================================================================== --- stable/7/sys/sparc64/sparc64/nexus.c Sun Mar 22 21:12:00 2009 (r190285) +++ stable/7/sys/sparc64/sparc64/nexus.c Sun Mar 22 21:14:33 2009 (r190286) @@ -122,11 +122,11 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_release_resource, nexus_release_resource), DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), + DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), + DEVMETHOD(bus_get_resource_list, nexus_get_resource_list), #ifdef SMP DEVMETHOD(bus_bind_intr, nexus_bind_intr), #endif - DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), - DEVMETHOD(bus_get_resource_list, nexus_get_resource_list), DEVMETHOD(bus_get_dma_tag, nexus_get_dma_tag), /* ofw_bus interface */ @@ -137,7 +137,7 @@ static device_method_t nexus_methods[] = DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - { 0, 0 } + KOBJMETHOD_END }; static devclass_t nexus_devclass; From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 21:16:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9B751065677; Sun, 22 Mar 2009 21:16:10 +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 BA3DF8FC29; Sun, 22 Mar 2009 21:16:10 +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 n2MLGADk084022; Sun, 22 Mar 2009 21:16:10 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MLGADC084018; Sun, 22 Mar 2009 21:16:10 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903222116.n2MLGADC084018@svn.freebsd.org> From: Marius Strobl Date: Sun, 22 Mar 2009 21:16:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190287 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/pci sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 21:16:12 -0000 Author: marius Date: Sun Mar 22 21:16:10 2009 New Revision: 190287 URL: http://svn.freebsd.org/changeset/base/190287 Log: MFC: r190101 Take advantage of KOBJMETHOD_END. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/pci/ofw_pcibus.c stable/7/sys/sparc64/sparc64/eeprom.c stable/7/sys/sparc64/sparc64/rtc.c stable/7/sys/sparc64/sparc64/sc_machdep.c Modified: stable/7/sys/sparc64/pci/ofw_pcibus.c ============================================================================== --- stable/7/sys/sparc64/pci/ofw_pcibus.c Sun Mar 22 21:14:33 2009 (r190286) +++ stable/7/sys/sparc64/pci/ofw_pcibus.c Sun Mar 22 21:16:10 2009 (r190287) @@ -88,7 +88,7 @@ static device_method_t ofw_pcibus_method DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - { 0, 0 } + KOBJMETHOD_END }; struct ofw_pcibus_devinfo { Modified: stable/7/sys/sparc64/sparc64/eeprom.c ============================================================================== --- stable/7/sys/sparc64/sparc64/eeprom.c Sun Mar 22 21:14:33 2009 (r190286) +++ stable/7/sys/sparc64/sparc64/eeprom.c Sun Mar 22 21:16:10 2009 (r190287) @@ -91,7 +91,7 @@ static device_method_t eeprom_methods[] DEVMETHOD(clock_gettime, mk48txx_gettime), DEVMETHOD(clock_settime, mk48txx_settime), - { 0, 0 } + KOBJMETHOD_END }; static driver_t eeprom_driver = { Modified: stable/7/sys/sparc64/sparc64/rtc.c ============================================================================== --- stable/7/sys/sparc64/sparc64/rtc.c Sun Mar 22 21:14:33 2009 (r190286) +++ stable/7/sys/sparc64/sparc64/rtc.c Sun Mar 22 21:16:10 2009 (r190287) @@ -89,7 +89,7 @@ static device_method_t rtc_ebus_methods[ DEVMETHOD(clock_gettime, mc146818_gettime), DEVMETHOD(clock_settime, mc146818_settime), - { 0, 0 } + KOBJMETHOD_END }; static driver_t rtc_ebus_driver = { Modified: stable/7/sys/sparc64/sparc64/sc_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/sc_machdep.c Sun Mar 22 21:14:33 2009 (r190286) +++ stable/7/sys/sparc64/sparc64/sc_machdep.c Sun Mar 22 21:16:10 2009 (r190287) @@ -57,7 +57,7 @@ static device_method_t sc_methods[] = { DEVMETHOD(device_probe, sc_probe), DEVMETHOD(device_attach, sc_attach), - { 0, 0 } + KOBJMETHOD_END }; static driver_t sc_driver = { From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 21:17:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BCBA1065748; Sun, 22 Mar 2009 21:17:21 +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 46E928FC21; Sun, 22 Mar 2009 21:17:21 +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 n2MLHLui084104; Sun, 22 Mar 2009 21:17:21 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MLHLYs084102; Sun, 22 Mar 2009 21:17:21 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903222117.n2MLHLYs084102@svn.freebsd.org> From: Marius Strobl Date: Sun, 22 Mar 2009 21:17:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190288 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 21:17:24 -0000 Author: marius Date: Sun Mar 22 21:17:20 2009 New Revision: 190288 URL: http://svn.freebsd.org/changeset/base/190288 Log: MFC: r190103 Take advantage of KOBJMETHOD_END. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/sparc64/jbusppm.c stable/7/sys/sparc64/sparc64/schppm.c Modified: stable/7/sys/sparc64/sparc64/jbusppm.c ============================================================================== --- stable/7/sys/sparc64/sparc64/jbusppm.c Sun Mar 22 21:16:10 2009 (r190287) +++ stable/7/sys/sparc64/sparc64/jbusppm.c Sun Mar 22 21:17:20 2009 (r190288) @@ -78,7 +78,7 @@ static device_method_t jbusppm_methods[] DEVMETHOD(device_probe, jbusppm_probe), DEVMETHOD(device_attach, jbusppm_attach), - { NULL, NULL } + KOBJMETHOD_END }; static devclass_t jbusppm_devclass; Modified: stable/7/sys/sparc64/sparc64/schppm.c ============================================================================== --- stable/7/sys/sparc64/sparc64/schppm.c Sun Mar 22 21:16:10 2009 (r190287) +++ stable/7/sys/sparc64/sparc64/schppm.c Sun Mar 22 21:17:20 2009 (r190288) @@ -73,7 +73,7 @@ static device_method_t schppm_methods[] DEVMETHOD(device_probe, schppm_probe), DEVMETHOD(device_attach, schppm_attach), - { NULL, NULL } + KOBJMETHOD_END }; static devclass_t schppm_devclass; From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 21:31:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47549106566C; Sun, 22 Mar 2009 21:31:03 +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 3375F8FC12; Sun, 22 Mar 2009 21:31:03 +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 n2MLV3GQ084415; Sun, 22 Mar 2009 21:31:03 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MLV2Ka084411; Sun, 22 Mar 2009 21:31:02 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903222131.n2MLV2Ka084411@svn.freebsd.org> From: Marius Strobl Date: Sun, 22 Mar 2009 21:31:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190289 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/include sparc64/sparc64 sun4v/include sun4v/sun4v X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 21:31:04 -0000 Author: marius Date: Sun Mar 22 21:31:02 2009 New Revision: 190289 URL: http://svn.freebsd.org/changeset/base/190289 Log: MFC: 190107 (partial) - There's no need to wrap kdb_active and kdb_trap() in #ifdef KDB as they're always available. - Remove unused variable. [1] - Add a missing const. - Sort includes. Submitted by: Christoph Mallon [1] Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/include/trap.h stable/7/sys/sparc64/sparc64/trap.c stable/7/sys/sun4v/include/trap.h stable/7/sys/sun4v/sun4v/trap.c Modified: stable/7/sys/sparc64/include/trap.h ============================================================================== --- stable/7/sys/sparc64/include/trap.h Sun Mar 22 21:17:20 2009 (r190288) +++ stable/7/sys/sparc64/include/trap.h Sun Mar 22 21:31:02 2009 (r190289) @@ -91,7 +91,7 @@ #ifndef LOCORE void sun4u_set_traptable(void *tba_addr); -extern const char *trap_msg[]; +extern const char *const trap_msg[]; #endif #endif Modified: stable/7/sys/sparc64/sparc64/trap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/trap.c Sun Mar 22 21:17:20 2009 (r190288) +++ stable/7/sys/sparc64/sparc64/trap.c Sun Mar 22 21:31:02 2009 (r190289) @@ -83,7 +83,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -113,7 +112,7 @@ extern char fas_nofault_end[]; extern char *syscallnames[]; -const char *trap_msg[] = { +const char *const trap_msg[] = { "reserved", "instruction access exception", "instruction access error", @@ -328,15 +327,12 @@ trap(struct trapframe *tf) KASSERT((tf->tf_type & T_KERNEL) != 0, ("trap: kernel trap isn't")); -#ifdef KDB if (kdb_active) { kdb_reenter(); return; } -#endif switch (tf->tf_type & ~T_KERNEL) { -#ifdef KDB case T_BREAKPOINT: case T_KSTACK_FAULT: error = (kdb_trap(tf->tf_type, 0, tf) == 0); @@ -348,7 +344,6 @@ trap(struct trapframe *tf) error = db_watch_trap(tf); break; #endif -#endif case T_DATA_MISS: case T_DATA_PROTECTION: case T_INSTRUCTION_MISS: @@ -408,7 +403,6 @@ static int trap_pfault(struct thread *td, struct trapframe *tf) { struct vmspace *vm; - struct pcb *pcb; struct proc *p; vm_offset_t va; vm_prot_t prot; @@ -428,7 +422,6 @@ trap_pfault(struct thread *td, struct tr rv = KERN_SUCCESS; ctx = TLB_TAR_CTX(tf->tf_tar); - pcb = td->td_pcb; type = tf->tf_type & ~T_KERNEL; va = TLB_TAR_VA(tf->tf_tar); @@ -558,11 +551,6 @@ syscall(struct trapframe *tf) PCPU_INC(cnt.v_syscall); - narg = 0; - error = 0; - reg = 0; - regcnt = REG_MAXARGS; - td->td_pticks = 0; td->td_frame = tf; if (td->td_ucred != p->p_ucred) @@ -580,6 +568,8 @@ syscall(struct trapframe *tf) tpc = tf->tf_tpc; TF_DONE(tf); + reg = 0; + regcnt = REG_MAXARGS; if (p->p_sysent->sv_prepsyscall) { /* * The prep code is MP aware. Modified: stable/7/sys/sun4v/include/trap.h ============================================================================== --- stable/7/sys/sun4v/include/trap.h Sun Mar 22 21:17:20 2009 (r190288) +++ stable/7/sys/sun4v/include/trap.h Sun Mar 22 21:31:02 2009 (r190289) @@ -144,7 +144,7 @@ #ifndef LOCORE -extern const char *trap_msg[]; +extern const char *const trap_msg[]; extern void set_mmfsa_traptable(void *, uint64_t); extern void trap_init(void); #endif Modified: stable/7/sys/sun4v/sun4v/trap.c ============================================================================== --- stable/7/sys/sun4v/sun4v/trap.c Sun Mar 22 21:17:20 2009 (r190288) +++ stable/7/sys/sun4v/sun4v/trap.c Sun Mar 22 21:31:02 2009 (r190289) @@ -81,7 +81,6 @@ #include #include #include -#include #include #include #include @@ -119,7 +118,7 @@ extern char fas_nofault_end[]; extern char *syscallnames[]; -const char *trap_msg[] = { +const char *const trap_msg[] = { "reserved", "instruction access exception", "instruction access error", @@ -390,21 +389,17 @@ trap(struct trapframe *tf, int64_t type, ("trap: kernel trap isn't - trap: %ld:%s: 0x%lx at 0x%lx on cpu=%d\n", trapno, trap_msg[trapno], data, tf->tf_tpc, curcpu)); -#ifdef KDB if (kdb_active) { kdb_reenter(); return; } -#endif switch (trapno) { -#ifdef KDB case T_BREAKPOINT: case T_KSTACK_FAULT: error = (kdb_trap(trapno, 0, tf) == 0); TF_DONE(tf); break; -#endif case T_DATA_MISS: case T_DATA_PROTECTION: case T_INSTRUCTION_MISS: @@ -460,7 +455,6 @@ static int trap_pfault(struct thread *td, struct trapframe *tf, int64_t type, uint64_t data) { struct vmspace *vm; - struct pcb *pcb; struct proc *p; vm_offset_t va; vm_prot_t prot; @@ -475,7 +469,6 @@ trap_pfault(struct thread *td, struct tr rv = KERN_SUCCESS; ctx = TLB_TAR_CTX(data); - pcb = td->td_pcb; type = type & ~T_KERNEL; va = TLB_TAR_VA(data); @@ -603,11 +596,6 @@ syscall(struct trapframe *tf) PCPU_INC(cnt.v_syscall); - narg = 0; - error = 0; - reg = 0; - regcnt = REG_MAXARGS; - td->td_pticks = 0; td->td_frame = tf; if (td->td_ucred != p->p_ucred) @@ -621,6 +609,8 @@ syscall(struct trapframe *tf) tpc = tf->tf_tpc; TF_DONE(tf); + reg = 0; + regcnt = REG_MAXARGS; if (p->p_sysent->sv_prepsyscall) { /* * The prep code is MP aware. From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 21:32:27 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 21:38:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 397E11065675; Sun, 22 Mar 2009 21:38:25 +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 25CF68FC0C; Sun, 22 Mar 2009 21:38:25 +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 n2MLcPZG084615; Sun, 22 Mar 2009 21:38:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MLcOnK084613; Sun, 22 Mar 2009 21:38:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903222138.n2MLcOnK084613@svn.freebsd.org> From: Marius Strobl Date: Sun, 22 Mar 2009 21:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190290 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 21:38:25 -0000 Author: marius Date: Sun Mar 22 21:38:24 2009 New Revision: 190290 URL: http://svn.freebsd.org/changeset/base/190290 Log: MFC: r190109 - Ensure we find no unexpected partner. - Failing to register as interrupt controller during attach shouldn't be fatal so just inform about this instead of panicing. - Disable rerun of the streaming cache as workaround for a silicon bug of certain Psycho versions. - Remove the comment regarding lack of newbus'ified bus_dma(9) as being able to associate a DMA tag with a device would allow to implement CDMA flushing/syncing in bus_dmamap_sync(9) but that would totally kill performance. Given that for devices not behind a PCI-PCI bridge the host-to-PCI bridges also only do CDMA flushing/syncing based on interrupts there's no additional disadvantage for polling(4) callbacks in the case schizo(4) has to do the CDMA flushing/syncing but rather a general problem. - Don't panic if the power failure, power management or over-temperature interrupts doesn't exist as these aren't mandatory and not available with all controllers (not even Psychos). [1] - Take advantage of KOBJMETHOD_END. - Remove some redundant variables. - Add missing const. PR: 131371 [1] Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/pci/psycho.c stable/7/sys/sparc64/pci/psychovar.h Modified: stable/7/sys/sparc64/pci/psycho.c ============================================================================== --- stable/7/sys/sparc64/pci/psycho.c Sun Mar 22 21:31:02 2009 (r190289) +++ stable/7/sys/sparc64/pci/psycho.c Sun Mar 22 21:38:24 2009 (r190290) @@ -84,7 +84,7 @@ static void psycho_set_intr(struct psych driver_filter_t, driver_intr_t); static int psycho_find_intrmap(struct psycho_softc *, u_int, bus_addr_t *, bus_addr_t *, u_long *); -static driver_filter_t psycho_dmasync; +static driver_filter_t psycho_dma_sync_stub; static void psycho_intr_enable(void *); static void psycho_intr_disable(void *); static void psycho_intr_assign(void *); @@ -151,7 +151,7 @@ static device_method_t psycho_methods[] /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, psycho_get_node), - { 0, 0 } + KOBJMETHOD_END }; static devclass_t psycho_devclass; @@ -176,7 +176,7 @@ struct psycho_icarg { bus_addr_t pica_clr; }; -struct psycho_dmasync { +struct psycho_dma_sync { struct psycho_softc *pds_sc; driver_filter_t *pds_handler; /* handler to call */ void *pds_arg; /* argument for the handler */ @@ -233,14 +233,14 @@ struct psycho_desc { const char *pd_name; }; -static const struct psycho_desc psycho_compats[] = { +static const struct psycho_desc const psycho_compats[] = { { "pci108e,8000", PSYCHO_MODE_PSYCHO, "Psycho compatible" }, { "pci108e,a000", PSYCHO_MODE_SABRE, "Sabre compatible" }, { "pci108e,a001", PSYCHO_MODE_SABRE, "Hummingbird compatible" }, { NULL, 0, NULL } }; -static const struct psycho_desc psycho_models[] = { +static const struct psycho_desc const psycho_models[] = { { "SUNW,psycho", PSYCHO_MODE_PSYCHO, "Psycho" }, { "SUNW,sabre", PSYCHO_MODE_SABRE, "Sabre" }, { NULL, 0, NULL } @@ -297,8 +297,8 @@ psycho_attach(device_t dev) phandle_t child, node; uint32_t dvmabase, prop, prop_array[2]; int32_t rev; - u_int ver; - int i, n, nrange, rid; + u_int rerun, ver; + int i, n; node = ofw_bus_get_node(dev); sc = device_get_softc(dev); @@ -316,7 +316,7 @@ psycho_attach(device_t dev) * (2) the shared Psycho configuration registers */ if (sc->sc_mode == PSYCHO_MODE_PSYCHO) { - rid = 2; + i = 2; sc->sc_pcictl = bus_get_resource_start(dev, SYS_RES_MEMORY, 0) - bus_get_resource_start(dev, SYS_RES_MEMORY, 2); @@ -333,18 +333,18 @@ psycho_attach(device_t dev) /* NOTREACHED */ } } else { - rid = 0; + i = 0; sc->sc_pcictl = PSR_PCICTL0; sc->sc_half = 0; } - sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &i, (sc->sc_mode == PSYCHO_MODE_PSYCHO ? RF_SHAREABLE : 0) | RF_ACTIVE); if (sc->sc_mem_res == NULL) panic("%s: could not allocate registers", __func__); /* - * Match other Psycho's that are already configured against + * Match other Psychos that are already configured against * the base physical address. This will be the same for a * pair of devices that share register space. */ @@ -364,6 +364,8 @@ psycho_attach(device_t dev) panic("%s: could not malloc mutex", __func__); mtx_init(sc->sc_mtx, "pcib_mtx", NULL, MTX_SPIN); } else { + if (sc->sc_mode != PSYCHO_MODE_PSYCHO) + panic("%s: no partner expected", __func__); if (mtx_initialized(osc->sc_mtx) == 0) panic("%s: mutex not initialized", __func__); sc->sc_mtx = osc->sc_mtx; @@ -409,16 +411,17 @@ psycho_attach(device_t dev) case 0: dr |= DIAG_RTRY_DIS; dr &= ~DIAG_DWSYNC_DIS; - /* XXX need to also disable rerun of the streaming buffers. */ + rerun = 0; break; case 1: csr &= ~PCICTL_ARB_PARK; dr |= DIAG_RTRY_DIS | DIAG_DWSYNC_DIS; - /* XXX need to also disable rerun of the streaming buffers. */ + rerun = 0; break; default: dr |= DIAG_DWSYNC_DIS; dr &= ~DIAG_RTRY_DIS; + rerun = 1; break; } @@ -461,13 +464,12 @@ psycho_attach(device_t dev) rman_manage_region(&sc->sc_pci_mem_rman, 0, PSYCHO_MEM_SIZE) != 0) panic("%s: failed to set up memory rman", __func__); - nrange = OF_getprop_alloc(node, "ranges", sizeof(*range), - (void **)&range); + n = OF_getprop_alloc(node, "ranges", sizeof(*range), (void **)&range); /* * Make sure that the expected ranges are present. The * OFW_PCI_CS_MEM64 one is not currently used though. */ - if (nrange != PSYCHO_NRANGE) + if (n != PSYCHO_NRANGE) panic("%s: unsupported number of ranges", __func__); /* * Find the addresses of the various bus spaces. @@ -494,7 +496,8 @@ psycho_attach(device_t dev) /* * Hunt through all the interrupt mapping regs and register * our interrupt controller for the corresponding interrupt - * vectors. + * vectors. We do this early in order to be able to catch + * stray interrupts. */ for (n = 0; n <= PSYCHO_MAX_INO; n++) { if (psycho_find_intrmap(sc, n, &intrmap, &intrclr, @@ -524,22 +527,23 @@ psycho_attach(device_t dev) INTMAP_ENABLE(INTMAP_VEC(sc->sc_ign, n), PCPU_GET(mid))); #endif - if (intr_controller_register(INTMAP_VEC(sc->sc_ign, n), - &psycho_ic, pica) != 0) - panic("%s: could not register interrupt " - "controller for INO %d", __func__, n); + i = intr_controller_register(INTMAP_VEC(sc->sc_ign, n), + &psycho_ic, pica); + if (i != 0) + device_printf(dev, "could not register " + "interrupt controller for INO %d (%d)\n", + n, i); } - if (sc->sc_mode == PSYCHO_MODE_PSYCHO) { - /* Initialize the counter-timer. */ + if (sc->sc_mode == PSYCHO_MODE_PSYCHO) sparc64_counter_init(device_get_nameunit(dev), rman_get_bustag(sc->sc_mem_res), rman_get_bushandle(sc->sc_mem_res), PSR_TC0); - } /* * Set up IOMMU and PCI configuration if we're the first - * of a pair of Psycho's to arrive here. + * of a pair of Psychos to arrive here or a Hummingbird + * or Sabre. * * We should calculate a TSB size based on amount of RAM * and number of bus controllers and number and type of @@ -557,10 +561,10 @@ psycho_attach(device_t dev) else sc->sc_is->is_pmaxaddr = IOMMU_MAXADDR(PSYCHO_IOMMU_BITS); - sc->sc_is->is_sb[0] = 0; - sc->sc_is->is_sb[1] = 0; + sc->sc_is->is_sb[0] = sc->sc_is->is_sb[1] = 0; if (OF_getproplen(node, "no-streaming-cache") < 0) sc->sc_is->is_sb[0] = sc->sc_pcictl + PCR_STRBUF; + sc->sc_is->is_flags |= (rerun != 1) ? IOMMU_RERUN_DISABLE : 0; psycho_iommu_init(sc, 3, dvmabase); } else { /* Just copy IOMMU state, config tag and address. */ @@ -695,12 +699,20 @@ psycho_set_intr(struct psycho_softc *sc, rid = index; sc->sc_irq_res[index] = bus_alloc_resource_any(sc->sc_dev, SYS_RES_IRQ, &rid, RF_ACTIVE); + if (sc->sc_irq_res[index] == NULL && intrmap >= PSR_POWER_INT_MAP) { + /* + * These interrupts aren't mandatory and not available + * with all controllers (not even Psychos). + */ + return; + } if (sc->sc_irq_res[index] == NULL || INTIGN(vec = rman_get_start(sc->sc_irq_res[index])) != sc->sc_ign || INTVEC(PSYCHO_READ8(sc, intrmap)) != vec || intr_vectors[vec].iv_ic != &psycho_ic || - bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index], INTR_TYPE_MISC, - filt, intr, sc, &sc->sc_ihand[index]) != 0) + bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index], + INTR_TYPE_MISC | INTR_FAST, filt, intr, sc, + &sc->sc_ihand[index]) != 0) panic("%s: failed to set up interrupt %d", __func__, index); } @@ -1066,9 +1078,9 @@ psycho_read_ivar(device_t dev, device_t } static int -psycho_dmasync(void *arg) +psycho_dma_sync_stub(void *arg) { - struct psycho_dmasync *pds = arg; + struct psycho_dma_sync *pds = arg; (void)PCIB_READ_CONFIG(pds->pds_ppb, pds->pds_bus, pds->pds_slot, pds->pds_func, PCIR_VENDOR, 2); @@ -1126,7 +1138,7 @@ psycho_setup_intr(device_t dev, device_t devclass_t pci_devclass; device_t cdev, pdev, pcidev; struct psycho_softc *sc; - struct psycho_dmasync *pds; + struct psycho_dma_sync *pds; u_long vec; int error; @@ -1143,17 +1155,12 @@ psycho_setup_intr(device_t dev, device_t } /* - * The Sabre-APB-combination has a bug where it does not drain - * DMA write data for devices behind additional PCI-PCI bridges - * underneath the APB PCI-PCI bridge. The workaround is to do - * a read on the farest PCI-PCI bridge followed by a read of the - * PCI DMA write sync register of the Sabre. - * XXX installing the wrapper for an affected device and the - * actual workaround in psycho_dmasync() should be moved to - * psycho(4)-specific bus_dma_tag_create() and bus_dmamap_sync() - * methods, respectively, once DMA tag creation is newbus'ified, - * so the workaround isn't only applied for interrupt handlers - * but also for polling(4) callbacks. + * The Sabre-APB-combination does not automatically flush DMA + * write data for devices behind additional PCI-PCI bridges + * underneath the APB PCI-PCI bridge. The procedure for a + * manual flush is to do a PIO read on the far side of the + * farthest PCI-PCI bridge followed by a read of the PCI DMA + * write sync register of the Sabre. */ if (sc->sc_mode == PSYCHO_MODE_SABRE) { pds = malloc(sizeof(*pds), M_DEVBUF, M_NOWAIT | M_ZERO); @@ -1192,20 +1199,20 @@ psycho_setup_intr(device_t dev, device_t pds->pds_func = pci_get_function(pcidev); if (bootverbose) device_printf(dev, "installed DMA sync " - "workaround for device %d.%d on bus %d\n", + "wrapper for device %d.%d on bus %d\n", pds->pds_slot, pds->pds_func, pds->pds_bus); if (intr == NULL) { pds->pds_handler = filt; error = bus_generic_setup_intr(dev, child, - ires, flags, psycho_dmasync, intr, pds, - cookiep); + ires, flags, psycho_dma_sync_stub, intr, + pds, cookiep); } else { pds->pds_handler = (driver_filter_t *)intr; error = bus_generic_setup_intr(dev, child, ires, flags, filt, - (driver_intr_t *)psycho_dmasync, pds, - cookiep); + (driver_intr_t *)psycho_dma_sync_stub, + pds, cookiep); } } else error = bus_generic_setup_intr(dev, child, ires, @@ -1227,7 +1234,7 @@ psycho_teardown_intr(device_t dev, devic void *cookie) { struct psycho_softc *sc; - struct psycho_dmasync *pds; + struct psycho_dma_sync *pds; int error; sc = device_get_softc(dev); @@ -1315,8 +1322,8 @@ psycho_activate_resource(device_t bus, d type, rid, r)); if (type == SYS_RES_MEMORY) { /* - * Need to memory-map the device space, as some drivers depend - * on the virtual address being set and useable. + * Need to memory-map the device space, as some drivers + * depend on the virtual address being set and usable. */ error = sparc64_bus_mem_map(rman_get_bustag(r), rman_get_bushandle(r), rman_get_size(r), 0, 0, &p); Modified: stable/7/sys/sparc64/pci/psychovar.h ============================================================================== --- stable/7/sys/sparc64/pci/psychovar.h Sun Mar 22 21:31:02 2009 (r190289) +++ stable/7/sys/sparc64/pci/psychovar.h Sun Mar 22 21:38:24 2009 (r190290) @@ -49,8 +49,8 @@ struct psycho_softc { phandle_t sc_node; /* Firmware node */ u_int sc_mode; -#define PSYCHO_MODE_SABRE 1 -#define PSYCHO_MODE_PSYCHO 2 +#define PSYCHO_MODE_SABRE 0 +#define PSYCHO_MODE_PSYCHO 1 /* Bus A or B of a psycho pair? */ u_int sc_half; From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 22:00:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3231A106564A; Sun, 22 Mar 2009 22:00:20 +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 1F5098FC14; Sun, 22 Mar 2009 22:00:20 +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 n2MM0Kr6085085; Sun, 22 Mar 2009 22:00:20 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MM0KJ9085084; Sun, 22 Mar 2009 22:00:20 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903222200.n2MM0KJ9085084@svn.freebsd.org> From: Marius Strobl Date: Sun, 22 Mar 2009 22:00:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190291 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 22:00:21 -0000 Author: marius Date: Sun Mar 22 22:00:19 2009 New Revision: 190291 URL: http://svn.freebsd.org/changeset/base/190291 Log: MFC: r190111 Add device found in B100. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/isa/isa.c Modified: stable/7/sys/sparc64/isa/isa.c ============================================================================== --- stable/7/sys/sparc64/isa/isa.c Sun Mar 22 21:38:24 2009 (r190290) +++ stable/7/sys/sparc64/isa/isa.c Sun Mar 22 22:00:19 2009 (r190291) @@ -118,7 +118,7 @@ isa_init(device_t dev) static const struct { const char *name; uint32_t id; -} ofw_isa_pnp_map[] = { +} const ofw_isa_pnp_map[] = { { "SUNW,lomh", 0x0000ae4e }, /* SUN0000 */ { "dma", 0x0002d041 }, /* PNP0200 */ { "floppy", 0x0007d041 }, /* PNP0700 */ @@ -130,6 +130,7 @@ static const struct { { "rmc-comm", 0x0300ae4e }, /* SUN0003 */ { "kb_ps2", 0x0303d041 }, /* PNP0303 */ { "kdmouse", 0x030fd041 }, /* PNP0F03 */ + { "bscbus", 0x0400ae4e }, /* SUN0004 */ { "power", 0x0c0cd041 }, /* PNP0C0C */ { NULL, 0x0 } }; From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 22:05:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAEF81065672; Sun, 22 Mar 2009 22:05:22 +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 C73048FC1C; Sun, 22 Mar 2009 22:05:22 +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 n2MM5MaF085264; Sun, 22 Mar 2009 22:05:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MM5MtV085262; Sun, 22 Mar 2009 22:05:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903222205.n2MM5MtV085262@svn.freebsd.org> From: Marius Strobl Date: Sun, 22 Mar 2009 22:05:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190292 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/sbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 22:05:23 -0000 Author: marius Date: Sun Mar 22 22:05:22 2009 New Revision: 190292 URL: http://svn.freebsd.org/changeset/base/190292 Log: MFC: r190112 - As suggested by OpenSolaris use up-burst-sizes for determining the supported burst sizes. - Add support for 64-bit burst sizes (required for SBus GEM). - Register our interrupt filters with the revived INTR_FAST so they these interrupts can even interrupt filters of device drivers as necessary. - Failing to register as interrupt controller during attach shouldn't be fatal so just inform about this instead of panicing. - Take advantage of KOBJMETHOD_END. - Remove some redundant variables. - Add missing const. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/sbus/sbus.c stable/7/sys/sparc64/sbus/sbusvar.h Modified: stable/7/sys/sparc64/sbus/sbus.c ============================================================================== --- stable/7/sys/sparc64/sbus/sbus.c Sun Mar 22 22:00:19 2009 (r190291) +++ stable/7/sys/sparc64/sbus/sbus.c Sun Mar 22 22:05:22 2009 (r190292) @@ -190,7 +190,7 @@ static bus_deactivate_resource_t sbus_de static bus_get_dma_tag_t sbus_get_dma_tag; static ofw_bus_get_devinfo_t sbus_get_devinfo; -static int sbus_inlist(const char *, const char **); +static int sbus_inlist(const char *, const char *const *); static struct sbus_devinfo * sbus_setup_dinfo(device_t, struct sbus_softc *, phandle_t); static void sbus_destroy_dinfo(struct sbus_devinfo *); @@ -217,14 +217,14 @@ static device_method_t sbus_methods[] = DEVMETHOD(bus_print_child, sbus_print_child), DEVMETHOD(bus_probe_nomatch, sbus_probe_nomatch), DEVMETHOD(bus_read_ivar, sbus_read_ivar), - DEVMETHOD(bus_setup_intr, sbus_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_alloc_resource, sbus_alloc_resource), DEVMETHOD(bus_activate_resource, sbus_activate_resource), DEVMETHOD(bus_deactivate_resource, sbus_deactivate_resource), DEVMETHOD(bus_release_resource, sbus_release_resource), - DEVMETHOD(bus_get_resource_list, sbus_get_resource_list), + DEVMETHOD(bus_setup_intr, sbus_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), + DEVMETHOD(bus_get_resource_list, sbus_get_resource_list), DEVMETHOD(bus_get_dma_tag, sbus_get_dma_tag), /* ofw_bus interface */ @@ -235,7 +235,7 @@ static device_method_t sbus_methods[] = DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - { 0, 0 } + KOBJMETHOD_END }; static driver_t sbus_driver = { @@ -265,14 +265,14 @@ struct sbus_icarg { bus_addr_t sica_clr; }; -static const char *sbus_order_first[] = { +static const char *const sbus_order_first[] = { "auxio", "dma", NULL }; static int -sbus_inlist(const char *name, const char **list) +sbus_inlist(const char *name, const char *const *list) { int i; @@ -312,32 +312,33 @@ sbus_attach(device_t dev) bus_size_t size; u_long vec; phandle_t child, node; - int clock, i, intr, rid; + uint32_t prop; + int i, j; sc = device_get_softc(dev); sc->sc_dev = dev; node = ofw_bus_get_node(dev); - rid = 0; - sc->sc_sysio_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + i = 0; + sc->sc_sysio_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &i, RF_ACTIVE); if (sc->sc_sysio_res == NULL) panic("%s: cannot allocate device memory", __func__); - if (OF_getprop(node, "interrupts", &intr, sizeof(intr)) == -1) + if (OF_getprop(node, "interrupts", &prop, sizeof(prop)) == -1) panic("%s: cannot get IGN", __func__); - sc->sc_ign = INTIGN(intr); + sc->sc_ign = INTIGN(prop); sc->sc_cbustag = sbus_alloc_bustag(sc); /* * Record clock frequency for synchronous SCSI. * IS THIS THE CORRECT DEFAULT?? */ - if (OF_getprop(node, "clock-frequency", &clock, sizeof(clock)) == -1) - clock = 25000000; - sc->sc_clockfreq = clock; - clock /= 1000; - device_printf(dev, "clock %d.%03d MHz\n", clock / 1000, clock % 1000); + if (OF_getprop(node, "clock-frequency", &prop, sizeof(prop)) == -1) + prop = 25000000; + sc->sc_clockfreq = prop; + prop /= 1000; + device_printf(dev, "clock %d.%03d MHz\n", prop / 1000, prop % 1000); /* * Collect address translations from the OBP. @@ -361,9 +362,9 @@ sbus_attach(device_t dev) sc->sc_rd[i].rd_slot = range[i].cspace; sc->sc_rd[i].rd_coffset = range[i].coffset; sc->sc_rd[i].rd_cend = sc->sc_rd[i].rd_coffset + size; - rid = resource_list_add_next(rl, SYS_RES_MEMORY, phys, + j = resource_list_add_next(rl, SYS_RES_MEMORY, phys, phys + size - 1, size); - if ((res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + if ((res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &j, RF_ACTIVE)) == NULL) panic("%s: cannot allocate decoded range", __func__); sc->sc_rd[i].rd_bushandle = rman_get_bushandle(res); @@ -380,11 +381,12 @@ sbus_attach(device_t dev) /* * Get the SBus burst transfer size if burst transfers are supported. - * XXX: is the default correct? */ - if (OF_getprop(node, "burst-sizes", &sc->sc_burst, + if (OF_getprop(node, "up-burst-sizes", &sc->sc_burst, sizeof(sc->sc_burst)) == -1 || sc->sc_burst == 0) - sc->sc_burst = SBUS_BURST_DEF; + sc->sc_burst = + (SBUS_BURST64_DEF << SBUS_BURST64_SHIFT) | SBUS_BURST_DEF; + /* initalise the IOMMU */ @@ -420,6 +422,7 @@ sbus_attach(device_t dev) /* * Hunt through all the interrupt mapping regs and register our * interrupt controller for the corresponding interrupt vectors. + * We do this early in order to be able to catch stray interrupts. */ for (i = 0; i <= SBUS_MAX_INO; i++) { if (sbus_find_intrmap(sc, i, &intrmap, &intrclr) == 0) @@ -438,31 +441,32 @@ sbus_attach(device_t dev) (u_long)intrmap, (u_long)SYSIO_READ8(sc, intrmap), (u_long)intrclr); #endif - if (intr_controller_register(INTMAP_VEC(sc->sc_ign, i), - &sbus_ic, sica) != 0) - panic("%s: could not register interrupt controller " - "for INO %d", __func__, i); + j = intr_controller_register(INTMAP_VEC(sc->sc_ign, i), + &sbus_ic, sica); + if (j != 0) + device_printf(dev, "could not register interrupt " + "controller for INO %d (%d)\n", i, j); } /* Enable the over-temperature and power-fail interrupts. */ - rid = 4; - sc->sc_ot_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + i = 4; + sc->sc_ot_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &i, RF_ACTIVE); if (sc->sc_ot_ires == NULL || INTIGN(vec = rman_get_start(sc->sc_ot_ires)) != sc->sc_ign || INTVEC(SYSIO_READ8(sc, SBR_THERM_INT_MAP)) != vec || intr_vectors[vec].iv_ic != &sbus_ic || - bus_setup_intr(dev, sc->sc_ot_ires, INTR_TYPE_MISC, + bus_setup_intr(dev, sc->sc_ot_ires, INTR_TYPE_MISC | INTR_FAST, NULL, sbus_overtemp, sc, &sc->sc_ot_ihand) != 0) panic("%s: failed to set up temperature interrupt", __func__); - rid = 3; - sc->sc_pf_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + i = 3; + sc->sc_pf_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &i, RF_ACTIVE); if (sc->sc_pf_ires == NULL || INTIGN(vec = rman_get_start(sc->sc_pf_ires)) != sc->sc_ign || INTVEC(SYSIO_READ8(sc, SBR_POWER_INT_MAP)) != vec || intr_vectors[vec].iv_ic != &sbus_ic || - bus_setup_intr(dev, sc->sc_pf_ires, INTR_TYPE_MISC, + bus_setup_intr(dev, sc->sc_pf_ires, INTR_TYPE_MISC | INTR_FAST, NULL, sbus_pwrfail, sc, &sc->sc_pf_ihand) != 0) panic("%s: failed to set up power fail interrupt", __func__); @@ -848,8 +852,8 @@ sbus_activate_resource(device_t bus, dev } if (type == SYS_RES_MEMORY) { /* - * Need to memory-map the device space, as some drivers depend - * on the virtual address being set and useable. + * Need to memory-map the device space, as some drivers + * depend on the virtual address being set and usable. */ error = sparc64_bus_mem_map(rman_get_bustag(r), rman_get_bushandle(r), rman_get_size(r), 0, 0, &p); Modified: stable/7/sys/sparc64/sbus/sbusvar.h ============================================================================== --- stable/7/sys/sparc64/sbus/sbusvar.h Sun Mar 22 22:00:19 2009 (r190291) +++ stable/7/sys/sparc64/sbus/sbusvar.h Sun Mar 22 22:05:22 2009 (r190292) @@ -77,7 +77,7 @@ */ #ifndef _SPARC64_SBUS_SBUSVAR_H_ -#define _SPARC64_SBUS_SBUSVAR_H_ +#define _SPARC64_SBUS_SBUSVAR_H_ /* * Macros for probe order @@ -88,18 +88,24 @@ /* * PROM-reported DMA burst sizes for the SBus */ -#define SBUS_BURST_1 0x1 -#define SBUS_BURST_2 0x2 -#define SBUS_BURST_4 0x4 -#define SBUS_BURST_8 0x8 -#define SBUS_BURST_16 0x10 -#define SBUS_BURST_32 0x20 -#define SBUS_BURST_64 0x40 +#define SBUS_BURST_1 (1 << 0) +#define SBUS_BURST_2 (1 << 1) +#define SBUS_BURST_4 (1 << 2) +#define SBUS_BURST_8 (1 << 3) +#define SBUS_BURST_16 (1 << 4) +#define SBUS_BURST_32 (1 << 5) +#define SBUS_BURST_64 (1 << 6) +#define SBUS_BURST_MASK ((1 << SBUS_BURST_SIZE) - 1) +#define SBUS_BURST_SIZE 16 +#define SBUS_BURST64_MASK (SBUS_BURST_MASK << SBUS_BURST64_SHIFT) +#define SBUS_BURST64_SHIFT 16 /* Used if no burst sizes are specified for the bus. */ #define SBUS_BURST_DEF \ (SBUS_BURST_1 | SBUS_BURST_2 | SBUS_BURST_4 | SBUS_BURST_8 | \ - SBUS_BURST_16) + SBUS_BURST_16 | SBUS_BURST_32 | SBUS_BURST_64) +#define SBUS_BURST64_DEF \ + (SBUS_BURST_8 | SBUS_BURST_16 | SBUS_BURST_32 | SBUS_BURST_64) enum sbus_device_ivars { SBUS_IVAR_BURSTSZ, @@ -111,7 +117,7 @@ enum sbus_device_ivars { /* * Simplified accessors for sbus devices */ -#define SBUS_ACCESSOR(var, ivar, type) \ +#define SBUS_ACCESSOR(var, ivar, type) \ __BUS_ACCESSOR(sbus, var, SBUS, ivar, type) SBUS_ACCESSOR(burstsz, BURSTSZ, int) From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 22:07:52 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 22:08:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59FF910656C6; Sun, 22 Mar 2009 22:08:31 +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 2C3478FC1E; Sun, 22 Mar 2009 22:08:31 +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 n2MM8UZt085421; Sun, 22 Mar 2009 22:08:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MM8Uu4085419; Sun, 22 Mar 2009 22:08:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903222208.n2MM8Uu4085419@svn.freebsd.org> From: Marius Strobl Date: Sun, 22 Mar 2009 22:08:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190294 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 22:08:33 -0000 Author: marius Date: Sun Mar 22 22:08:30 2009 New Revision: 190294 URL: http://svn.freebsd.org/changeset/base/190294 Log: MFC: r190117 - Set MIIF_NOLOOP and don't add IFM_LOOP as loopback apparently isn't supported with these pseudo-PHYs. The MIIF_NOLOOP flag currently triggers nothing but hopefully will be respected by mii_phy_setmedia() later on. - Don't add IFM_NONE as isolation isn't supported by these pseudo-PHYs. - Use mii_phy_add_media() instead of mii_add_media() so the latter can be eventually retired. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/dc/dcphy.c stable/7/sys/dev/dc/pnphy.c Modified: stable/7/sys/dev/dc/dcphy.c ============================================================================== --- stable/7/sys/dev/dc/dcphy.c Sun Mar 22 22:07:52 2009 (r190293) +++ stable/7/sys/dev/dc/dcphy.c Sun Mar 22 22:08:30 2009 (r190294) @@ -154,13 +154,12 @@ dcphy_attach(device_t dev) sc->mii_service = dcphy_service; sc->mii_pdata = mii; - sc->mii_flags |= MIIF_NOISOLATE; - mii->mii_instance++; - -#define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) + /* + * Apparently, we can neither isolate nor do loopback. + */ + sc->mii_flags |= MIIF_NOISOLATE | MIIF_NOLOOP; - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_NONE, 0, sc->mii_inst), - BMCR_ISO); + mii->mii_instance++; /*dcphy_reset(sc);*/ dc_sc = mii->mii_ifp->if_softc; @@ -186,9 +185,8 @@ dcphy_attach(device_t dev) sc->mii_capabilities &= ma->mii_capmask; device_printf(dev, " "); - mii_add_media(sc); + mii_phy_add_media(sc); printf("\n"); -#undef ADD MIIBUS_MEDIAINIT(sc->mii_dev); return (0); Modified: stable/7/sys/dev/dc/pnphy.c ============================================================================== --- stable/7/sys/dev/dc/pnphy.c Sun Mar 22 22:07:52 2009 (r190293) +++ stable/7/sys/dev/dc/pnphy.c Sun Mar 22 22:08:30 2009 (r190294) @@ -137,24 +137,19 @@ pnphy_attach(device_t dev) sc->mii_service = pnphy_service; sc->mii_pdata = mii; - sc->mii_flags |= MIIF_NOISOLATE; - mii->mii_instance++; + /* + * Apparently, we can neither isolate nor do loopback. + */ + sc->mii_flags |= MIIF_NOISOLATE | MIIF_NOLOOP; -#define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) + mii->mii_instance++; sc->mii_capabilities = BMSR_100TXFDX | BMSR_100TXHDX | BMSR_10TFDX | BMSR_10THDX; sc->mii_capabilities &= ma->mii_capmask; device_printf(dev, " "); - mii_add_media(sc); + mii_phy_add_media(sc); printf("\n"); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_NONE, 0, sc->mii_inst), - BMCR_ISO); - - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_LOOP, sc->mii_inst), - BMCR_LOOP|BMCR_S100); - -#undef ADD MIIBUS_MEDIAINIT(sc->mii_dev); return (0); From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 22:09:13 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 22:14:46 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 22:15:48 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 22:19:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E65CD1065672; Sun, 22 Mar 2009 22:19:54 +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 D1F528FC16; Sun, 22 Mar 2009 22:19:54 +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 n2MMJsRT085867; Sun, 22 Mar 2009 22:19:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MMJsPB085861; Sun, 22 Mar 2009 22:19:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903222219.n2MMJsPB085861@svn.freebsd.org> From: Marius Strobl Date: Sun, 22 Mar 2009 22:19:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190297 - in stable/7/sys: . conf contrib/pf dev/ath/ath_hal dev/cxgb sparc64/pci sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 22:19:55 -0000 Author: marius Date: Sun Mar 22 22:19:54 2009 New Revision: 190297 URL: http://svn.freebsd.org/changeset/base/190297 Log: MFC: r183423, r184428, r185133, r186290, r190108 Add a driver for `Schizo' Fireplane/Safari to PCI 2.1 and `Tomatillo' JBus to PCI 2.2 bridges including subsequent fixes and improvements as of r190108. Added: stable/7/sys/sparc64/pci/schizo.c - copied, changed from r183423, head/sys/sparc64/pci/schizo.c stable/7/sys/sparc64/pci/schizoreg.h - copied, changed from r183423, head/sys/sparc64/pci/schizoreg.h stable/7/sys/sparc64/pci/schizovar.h - copied, changed from r183423, head/sys/sparc64/pci/schizovar.h Modified: stable/7/sys/ (props changed) stable/7/sys/conf/files.sparc64 stable/7/sys/conf/options.sparc64 stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/sparc64/nexus.c Modified: stable/7/sys/conf/files.sparc64 ============================================================================== --- stable/7/sys/conf/files.sparc64 Sun Mar 22 22:14:46 2009 (r190296) +++ stable/7/sys/conf/files.sparc64 Sun Mar 22 22:19:54 2009 (r190297) @@ -74,6 +74,7 @@ sparc64/pci/ofw_pcib.c optional pci sparc64/pci/ofw_pcib_subr.c optional pci sparc64/pci/ofw_pcibus.c optional pci sparc64/pci/psycho.c optional pci +sparc64/pci/schizo.c optional pci sparc64/sbus/dma_sbus.c optional sbus sparc64/sbus/sbus.c optional sbus sparc64/sbus/lsi64854.c optional sbus Modified: stable/7/sys/conf/options.sparc64 ============================================================================== --- stable/7/sys/conf/options.sparc64 Sun Mar 22 22:14:46 2009 (r190296) +++ stable/7/sys/conf/options.sparc64 Sun Mar 22 22:19:54 2009 (r190297) @@ -24,5 +24,7 @@ PSM_RESETAFTERSUSPEND opt_psm.h DEBUGGER_ON_POWERFAIL opt_psycho.h PSYCHO_DEBUG opt_psycho.h +SCHIZO_DEBUG opt_schizo.h + SUNKBD_DFLT_KEYMAP opt_sunkbd.h SUNKBD_EMULATE_ATKBD opt_sunkbd.h Copied and modified: stable/7/sys/sparc64/pci/schizo.c (from r183423, head/sys/sparc64/pci/schizo.c) ============================================================================== --- head/sys/sparc64/pci/schizo.c Sun Sep 28 00:07:05 2008 (r183423, copy source) +++ stable/7/sys/sparc64/pci/schizo.c Sun Mar 22 22:19:54 2009 (r190297) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -79,11 +80,13 @@ __FBSDID("$FreeBSD$"); static const struct schizo_desc *schizo_get_desc(device_t); static void schizo_set_intr(struct schizo_softc *, u_int, u_int, driver_filter_t); -static driver_filter_t schizo_dmasync; +static driver_filter_t schizo_dma_sync_stub; +static driver_filter_t ichip_dma_sync_stub; static void schizo_intr_enable(void *); static void schizo_intr_disable(void *); static void schizo_intr_assign(void *); static void schizo_intr_clear(void *); +static int schizo_intr_register(struct schizo_softc *sc, u_int ino); static int schizo_get_intrmap(struct schizo_softc *, u_int, bus_addr_t *, bus_addr_t *); static bus_space_tag_t schizo_alloc_bus_tag(struct schizo_softc *, int); @@ -94,6 +97,7 @@ static driver_filter_t schizo_pci_bus; static driver_filter_t schizo_ue; static driver_filter_t schizo_ce; static driver_filter_t schizo_host_bus; +static driver_filter_t schizo_cdma; /* IOMMU support */ static void schizo_iommu_init(struct schizo_softc *, int, uint32_t); @@ -145,7 +149,7 @@ static device_method_t schizo_methods[] /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, schizo_get_node), - { 0, 0 } + KOBJMETHOD_END }; static devclass_t schizo_devclass; @@ -170,14 +174,16 @@ struct schizo_icarg { bus_addr_t sica_clr; }; -struct schizo_dmasync { +struct schizo_dma_sync { struct schizo_softc *sds_sc; driver_filter_t *sds_handler; void *sds_arg; void *sds_cookie; - bus_size_t sds_syncreg; uint64_t sds_syncval; - u_int sds_bswar; + device_t sds_ppb; /* farest PCI-PCI bridge */ + uint8_t sds_bus; /* bus of farest PCI device */ + uint8_t sds_slot; /* slot of farest PCI device */ + uint8_t sds_func; /* func. of farest PCI device */ }; #define SCHIZO_PERF_CNT_QLTY 100 @@ -212,7 +218,7 @@ struct schizo_desc { const char *sd_name; }; -static const struct schizo_desc schizo_compats[] = { +static const struct schizo_desc const schizo_compats[] = { { "pci108e,8001", SCHIZO_MODE_SCZ, "Schizo" }, { "pci108e,a801", SCHIZO_MODE_TOM, "Tomatillo" }, { NULL, 0, NULL } @@ -252,10 +258,8 @@ schizo_attach(device_t dev) { struct ofw_pci_ranges *range; const struct schizo_desc *desc; - struct schizo_icarg *sica; struct schizo_softc *asc, *sc, *osc; struct timecounter *tc; - bus_addr_t intrclr, intrmap; uint64_t ino_bitmap, reg; phandle_t node; uint32_t prop, prop_array[2]; @@ -269,6 +273,7 @@ schizo_attach(device_t dev) sc->sc_dev = dev; sc->sc_node = node; sc->sc_mode = mode; + sc->sc_flags = 0; /* * The Schizo has three register banks: @@ -322,6 +327,8 @@ schizo_attach(device_t dev) panic("%s: could not malloc mutex", __func__); mtx_init(sc->sc_mtx, "pcib_mtx", NULL, MTX_SPIN); } else { + if (sc->sc_mode != SCHIZO_MODE_SCZ) + panic("%s: no partner expected", __func__); if (mtx_initialized(osc->sc_mtx) == 0) panic("%s: mutex not initialized", __func__); sc->sc_mtx = osc->sc_mtx; @@ -388,9 +395,10 @@ schizo_attach(device_t dev) /* * Hunt through all the interrupt mapping regs and register - * the interrupt controller for our interrupt vectors. This - * is complicated by the fact that a pair of Schizo PBMs - * share one IGN. + * the interrupt controller for our interrupt vectors. We do + * this early in order to be able to catch stray interrupts. + * This is complicated by the fact that a pair of Schizo PBMs + * shares one IGN. */ n = OF_getprop(node, "ino-bitmap", (void *)prop_array, sizeof(prop_array)); @@ -403,24 +411,10 @@ schizo_attach(device_t dev) if (n == STX_FB0_INO || n == STX_FB1_INO) /* Leave for upa(4). */ continue; - if (schizo_get_intrmap(sc, n, &intrmap, &intrclr) == 0) - continue; - sica = malloc(sizeof(*sica), M_DEVBUF, M_NOWAIT); - if (sica == NULL) - panic("%s: could not allocate interrupt controller " - "argument", __func__); - sica->sica_sc = sc; - sica->sica_map = intrmap; - sica->sica_clr = intrclr; -#ifdef SCHIZO_DEBUG - device_printf(dev, "intr map (INO %d) %#lx: %#lx, clr: %#lx\n", - n, (u_long)intrmap, (u_long)SCHIZO_PCI_READ_8(sc, intrmap), - (u_long)intrclr); -#endif - if (intr_controller_register(INTMAP_VEC(sc->sc_ign, n), - &schizo_ic, sica) != 0) - panic("%s: could not register interrupt controller " - "for INO %d", __func__, n); + i = schizo_intr_register(sc, n); + if (i != 0) + device_printf(dev, "could not register interrupt " + "controller for INO %d (%d)\n", n, i); } /* @@ -456,11 +450,16 @@ schizo_attach(device_t dev) tc_init(tc); } - /* Set up the IOMMU. Both Schizo and Tomatillo have one per PBM. */ + /* + * Set up the IOMMU. Schizo, Tomatillo and XMITS all have + * one per PBM. Schizo and XMITS additionally have a streaming + * buffer, in Schizo version < 5 (i.e. revision < 2.3) it's + * affected by several errata and basically unusable though. + */ sc->sc_is.is_pmaxaddr = IOMMU_MAXADDR(STX_IOMMU_BITS); - sc->sc_is.is_sb[0] = 0; - sc->sc_is.is_sb[1] = 0; - if (OF_getproplen(node, "no-streaming-cache") < 0) + sc->sc_is.is_sb[0] = sc->sc_is.is_sb[1] = 0; + if (OF_getproplen(node, "no-streaming-cache") < 0 && + !(sc->sc_mode == SCHIZO_MODE_SCZ && sc->sc_ver < 5)) sc->sc_is.is_sb[0] = STX_PCI_STRBUF; #define TSBCASE(x) \ @@ -489,6 +488,7 @@ schizo_attach(device_t dev) } schizo_iommu_init(sc, tsbsize, prop_array[0]); } + #undef TSBCASE /* Initialize memory and I/O rmans. */ @@ -627,6 +627,39 @@ schizo_attach(device_t dev) schizo_set_intr(sc, 3, STX_BUS_INO, schizo_host_bus); /* + * According to the Schizo Errata I-13, consistent DMA flushing/ + * syncing is FUBAR in version < 5 (i.e. revision < 2.3) bridges, + * so we can't use it and need to live with the consequences. + * With Schizo version >= 5, CDMA flushing/syncing is usable + * but requires the the workaround described in Schizo Errata + * I-23. With Tomatillo and XMITS, CDMA flushing/syncing works + * as expected, Tomatillo version <= 4 (i.e. revision <= 2.3) + * bridges additionally require a block store after a write to + * TOMXMS_PCI_DMA_SYNC_PEND though. + */ + if ((sc->sc_mode == SCHIZO_MODE_SCZ && sc->sc_ver >= 5) || + sc->sc_mode == SCHIZO_MODE_TOM || sc->sc_mode == SCHIZO_MODE_XMS) { + sc->sc_flags |= SCHIZO_FLAGS_CDMA; + if (sc->sc_mode == SCHIZO_MODE_SCZ) { + n = STX_CDMA_A_INO + sc->sc_half; + if (bus_set_resource(dev, SYS_RES_IRQ, 5, + INTMAP_VEC(sc->sc_ign, n), 1) != 0) + panic("%s: failed to add CDMA interrupt", + __func__); + i = schizo_intr_register(sc, n); + if (i != 0) + panic("%s: could not register interrupt " + "controller for CDMA (%d)", __func__, i); + (void)schizo_get_intrmap(sc, n, NULL, + &sc->sc_cdma_clr); + sc->sc_cdma_state = SCHIZO_CDMA_STATE_DONE; + schizo_set_intr(sc, 5, n, schizo_cdma); + } + if (sc->sc_mode == SCHIZO_MODE_TOM && sc->sc_ver <= 4) + sc->sc_flags |= SCHIZO_FLAGS_BSWAR; + } + + /* * Set the latency timer register as this isn't always done by the * firmware. */ @@ -653,12 +686,40 @@ schizo_set_intr(struct schizo_softc *sc, INTIGN(vec = rman_get_start(sc->sc_irq_res[index])) != sc->sc_ign || INTINO(vec) != ino || intr_vectors[vec].iv_ic != &schizo_ic || - bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index], INTR_TYPE_MISC, - handler, NULL, sc, &sc->sc_ihand[index]) != 0) + bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index], + INTR_TYPE_MISC | INTR_FAST, handler, NULL, sc, + &sc->sc_ihand[index]) != 0) panic("%s: failed to set up interrupt %d", __func__, index); } static int +schizo_intr_register(struct schizo_softc *sc, u_int ino) +{ + struct schizo_icarg *sica; + bus_addr_t intrclr, intrmap; + int error; + + if (schizo_get_intrmap(sc, ino, &intrmap, &intrclr) == 0) + return (ENXIO); + sica = malloc(sizeof(*sica), M_DEVBUF, M_NOWAIT); + if (sica == NULL) + return (ENOMEM); + sica->sica_sc = sc; + sica->sica_map = intrmap; + sica->sica_clr = intrclr; +#ifdef SCHIZO_DEBUG + device_printf(sc->sc_dev, "intr map (INO %d) %#lx: %#lx, clr: %#lx\n", + ino, (u_long)intrmap, (u_long)SCHIZO_PCI_READ_8(sc, intrmap), + (u_long)intrclr); +#endif + error = (intr_controller_register(INTMAP_VEC(sc->sc_ign, ino), + &schizo_ic, sica)); + if (error != 0) + free(sica, M_DEVBUF); + return (error); +} + +static int schizo_get_intrmap(struct schizo_softc *sc, u_int ino, bus_addr_t *intrmapptr, bus_addr_t *intrclrptr) { @@ -801,6 +862,15 @@ schizo_host_bus(void *arg) return (FILTER_HANDLED); } +static int +schizo_cdma(void *arg) +{ + struct schizo_softc *sc = arg; + + atomic_store_rel_32(&sc->sc_cdma_state, SCHIZO_CDMA_STATE_DONE); + return (FILTER_HANDLED); +} + static void schizo_iommu_init(struct schizo_softc *sc, int tsbsize, uint32_t dvmabase) { @@ -947,33 +1017,65 @@ schizo_read_ivar(device_t dev, device_t return (ENOENT); } +static int +schizo_dma_sync_stub(void *arg) +{ + struct timeval cur, end; + struct schizo_dma_sync *sds = arg; + struct schizo_softc *sc = sds->sds_sc; + uint32_t state; + + (void)PCIB_READ_CONFIG(sds->sds_ppb, sds->sds_bus, sds->sds_slot, + sds->sds_func, PCIR_VENDOR, 2); + for (; atomic_cmpset_acq_32(&sc->sc_cdma_state, SCHIZO_CDMA_STATE_DONE, + SCHIZO_CDMA_STATE_PENDING) == 0;) + ; + SCHIZO_PCI_WRITE_8(sc, sc->sc_cdma_clr, 1); + microuptime(&cur); + end.tv_sec = 1; + end.tv_usec = 0; + timevaladd(&end, &cur); + for (; (state = atomic_load_32(&sc->sc_cdma_state)) != + SCHIZO_CDMA_STATE_DONE && timevalcmp(&cur, &end, <=);) + microuptime(&cur); + if (state != SCHIZO_CDMA_STATE_DONE) + panic("%s: DMA does not sync", __func__); + return (sds->sds_handler(sds->sds_arg)); +} + #define VIS_BLOCKSIZE 64 static int -schizo_dmasync(void *arg) +ichip_dma_sync_stub(void *arg) { static u_char buf[VIS_BLOCKSIZE] __aligned(VIS_BLOCKSIZE); - struct schizo_dmasync *sds = arg; + struct timeval cur, end; + struct schizo_dma_sync *sds = arg; struct schizo_softc *sc = sds->sds_sc; - uint64_t reg; - int timeout; + register_t reg, s; - SCHIZO_PCI_WRITE_8(sc, sds->sds_syncreg, sds->sds_syncval); - timeout = 1000000; - for (; (SCHIZO_PCI_READ_8(sc, sds->sds_syncreg) & - sds->sds_syncval) != 0;) - if (--timeout < 0) - panic("%s: DMA does not sync", __func__); + (void)PCIB_READ_CONFIG(sds->sds_ppb, sds->sds_bus, sds->sds_slot, + sds->sds_func, PCIR_VENDOR, 2); + SCHIZO_PCI_WRITE_8(sc, TOMXMS_PCI_DMA_SYNC_PEND, sds->sds_syncval); + microuptime(&cur); + end.tv_sec = 1; + end.tv_usec = 0; + timevaladd(&end, &cur); + for (; ((reg = SCHIZO_PCI_READ_8(sc, TOMXMS_PCI_DMA_SYNC_PEND)) & + sds->sds_syncval) != 0 && timevalcmp(&cur, &end, <=);) + microuptime(&cur); + if ((reg & sds->sds_syncval) != 0) + panic("%s: DMA does not sync", __func__); - if (sds->sds_bswar != 0) { - critical_enter(); + if ((sc->sc_flags & SCHIZO_FLAGS_BSWAR) != 0) { + s = intr_disable(); reg = rd(fprs); wr(fprs, reg | FPRS_FEF, 0); - __asm__ __volatile__("stda %%f0, [%0] %1" + __asm __volatile("stda %%f0, [%0] %1" : : "r" (buf), "n" (ASI_BLK_COMMIT_S)); - wr(fprs, reg, 0); membar(Sync); - critical_exit(); + wr(fprs, reg, 0); + intr_restore(s); } return (sds->sds_handler(sds->sds_arg)); } @@ -1021,56 +1123,109 @@ schizo_setup_intr(device_t dev, device_t int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) { - struct schizo_dmasync *sds; + devclass_t pci_devclass; + device_t cdev, pdev, pcidev; + struct schizo_dma_sync *sds; struct schizo_softc *sc; u_long vec; - int error; + int error, found; sc = device_get_softc(dev); /* - * Make sure the vector is fully specified and we registered - * our interrupt controller for it. + * Make sure the vector is fully specified. */ vec = rman_get_start(ires); - if (INTIGN(vec) != sc->sc_ign || - intr_vectors[vec].iv_ic != &schizo_ic) { + if (INTIGN(vec) != sc->sc_ign) { device_printf(dev, "invalid interrupt vector 0x%lx\n", vec); return (EINVAL); } + if (intr_vectors[vec].iv_ic == &schizo_ic) { + /* + * Ensure we use the right softc in case the interrupt + * is routed to our companion PBM for some odd reason. + */ + sc = ((struct schizo_icarg *)intr_vectors[vec].iv_icarg)-> + sica_sc; + } else if (intr_vectors[vec].iv_ic == NULL) { + /* + * Work around broken firmware which misses entries in + * the ino-bitmap. + */ + error = schizo_intr_register(sc, INTINO(vec)); + if (error != 0) { + device_printf(dev, "could not register interrupt " + "controller for vector 0x%lx (%d)\n", vec, error); + return (error); + } + if (bootverbose) + device_printf(dev, "belatedly registered as " + "interrupt controller for vector 0x%lx\n", vec); + } else { + device_printf(dev, + "invalid interrupt controller for vector 0x%lx\n", vec); + return (EINVAL); + } + /* - * Schizo revision >= 2.3 (i.e. version >= 5) and Tomatillo bridges - * need to be manually told to sync DMA writes. - * Tomatillo revision <= 2.3 (i.e. version <= 4) bridges additionally - * need a block store as a workaround for a hardware bug. - * XXX setup of the wrapper and the contents of schizo_dmasync() - * should be moved to schizo(4)-specific bus_dma_tag_create() and - * bus_dmamap_sync() methods, respectively, once DMA tag creation - * is newbus'ified, so the wrapper isn't only applied for interrupt - * handlers but also for polling(4) callbacks. + * Install a a wrapper for CDMA flushing/syncing for devices + * behind PCI-PCI bridges if possible. */ - if ((sc->sc_mode == SCHIZO_MODE_SCZ && sc->sc_ver >= 5) || - sc->sc_mode == SCHIZO_MODE_TOM) { + pcidev = NULL; + found = 0; + pci_devclass = devclass_find("pci"); + for (cdev = child; cdev != dev; cdev = pdev) { + pdev = device_get_parent(cdev); + if (pcidev == NULL) { + if (device_get_devclass(pdev) != pci_devclass) + continue; + pcidev = cdev; + continue; + } + if (pci_get_class(cdev) == PCIC_BRIDGE && + pci_get_subclass(cdev) == PCIS_BRIDGE_PCI) + found = 1; + } + if ((sc->sc_flags & SCHIZO_FLAGS_CDMA) != 0) { sds = malloc(sizeof(*sds), M_DEVBUF, M_NOWAIT | M_ZERO); if (sds == NULL) return (ENOMEM); - sds->sds_sc = sc; - sds->sds_arg = arg; - sds->sds_syncreg = sc->sc_mode == SCHIZO_MODE_SCZ ? - SCZ_PCI_DMA_SYNC : TOMXMS_PCI_DMA_SYNC_PEND; - sds->sds_syncval = 1ULL << INTINO(vec); - if (sc->sc_mode == SCHIZO_MODE_TOM && sc->sc_ver <= 4) - sds->sds_bswar = 1; - if (intr == NULL) { - sds->sds_handler = filt; - error = bus_generic_setup_intr(dev, child, ires, - flags, schizo_dmasync, intr, sds, cookiep); - } else { - sds->sds_handler = (driver_filter_t *)intr; + if (found != 0 && pcidev != NULL) { + sds->sds_sc = sc; + sds->sds_arg = arg; + sds->sds_ppb = + device_get_parent(device_get_parent(pcidev)); + sds->sds_bus = pci_get_bus(pcidev); + sds->sds_slot = pci_get_slot(pcidev); + sds->sds_func = pci_get_function(pcidev); + sds->sds_syncval = 1ULL << INTINO(vec); + if (bootverbose) + device_printf(dev, "installed DMA sync " + "wrapper for device %d.%d on bus %d\n", + sds->sds_slot, sds->sds_func, + sds->sds_bus); + +#define DMA_SYNC_STUB \ + (sc->sc_mode == SCHIZO_MODE_SCZ ? schizo_dma_sync_stub : \ + ichip_dma_sync_stub) + + if (intr == NULL) { + sds->sds_handler = filt; + error = bus_generic_setup_intr(dev, child, + ires, flags, DMA_SYNC_STUB, intr, sds, + cookiep); + } else { + sds->sds_handler = (driver_filter_t *)intr; + error = bus_generic_setup_intr(dev, child, + ires, flags, filt, (driver_intr_t *) + DMA_SYNC_STUB, sds, cookiep); + } + +#undef DMA_SYNC_STUB + + } else error = bus_generic_setup_intr(dev, child, ires, - flags, filt, (driver_intr_t *)schizo_dmasync, - sds, cookiep); - } + flags, filt, intr, arg, cookiep); if (error != 0) { free(sds, M_DEVBUF); return (error); @@ -1078,7 +1233,9 @@ schizo_setup_intr(device_t dev, device_t sds->sds_cookie = *cookiep; *cookiep = sds; return (error); - } + } else if (found != 0) + device_printf(dev, "WARNING: using devices behind PCI-PCI " + "bridges may cause data corruption\n"); return (bus_generic_setup_intr(dev, child, ires, flags, filt, intr, arg, cookiep)); } @@ -1087,12 +1244,12 @@ static int schizo_teardown_intr(device_t dev, device_t child, struct resource *vec, void *cookie) { - struct schizo_dmasync *sds; + struct schizo_dma_sync *sds; struct schizo_softc *sc; int error; sc = device_get_softc(dev); - if (sc->sc_mode == SCHIZO_MODE_TOM) { + if ((sc->sc_flags & SCHIZO_FLAGS_CDMA) != 0) { sds = cookie; error = bus_generic_teardown_intr(dev, child, vec, sds->sds_cookie); @@ -1176,8 +1333,8 @@ schizo_activate_resource(device_t bus, d type, rid, r)); if (type == SYS_RES_MEMORY) { /* - * Need to memory-map the device space, as some drivers depend - * on the virtual address being set and useable. + * Need to memory-map the device space, as some drivers + * depend on the virtual address being set and usable. */ error = sparc64_bus_mem_map(rman_get_bustag(r), rman_get_bushandle(r), rman_get_size(r), 0, 0, &p); Copied and modified: stable/7/sys/sparc64/pci/schizoreg.h (from r183423, head/sys/sparc64/pci/schizoreg.h) ============================================================================== --- head/sys/sparc64/pci/schizoreg.h Sun Sep 28 00:07:05 2008 (r183423, copy source) +++ stable/7/sys/sparc64/pci/schizoreg.h Sun Mar 22 22:19:54 2009 (r190297) @@ -31,7 +31,7 @@ #ifndef _SPARC64_PCI_SCHIZOREG_H_ #define _SPARC64_PCI_SCHIZOREG_H_ -#define STX_NINTR 4 +#define STX_NINTR 5 /* 4 via OFW + 1 CDMA */ #define STX_NRANGE 4 #define SCZ_NREG 3 #define TOM_NREG 4 @@ -276,6 +276,8 @@ #define STX_PCIERR_A_INO 0x32 /* PCI bus A error */ #define STX_PCIERR_B_INO 0x33 /* PCI bus B error */ #define STX_BUS_INO 0x34 /* Safari/JBus error */ +#define STX_CDMA_A_INO 0x35 /* PCI bus A CDMA */ +#define STX_CDMA_B_INO 0x36 /* PCI bus B CDMA */ #define STX_MAX_INO 0x37 /* Device space defines */ Copied and modified: stable/7/sys/sparc64/pci/schizovar.h (from r183423, head/sys/sparc64/pci/schizovar.h) ============================================================================== --- head/sys/sparc64/pci/schizovar.h Sun Sep 28 00:07:05 2008 (r183423, copy source) +++ stable/7/sys/sparc64/pci/schizovar.h Sun Mar 22 22:19:54 2009 (r190297) @@ -39,9 +39,18 @@ struct schizo_softc { phandle_t sc_node; u_int sc_mode; -#define SCHIZO_MODE_SCZ 1 -#define SCHIZO_MODE_TOM 2 -#define SCHIZO_MODE_XMS 3 +#define SCHIZO_MODE_SCZ 0 +#define SCHIZO_MODE_TOM 1 +#define SCHIZO_MODE_XMS 2 + + u_int sc_flags; +#define SCHIZO_FLAGS_BSWAR (1 << 0) +#define SCHIZO_FLAGS_CDMA (1 << 1) + + bus_addr_t sc_cdma_clr; + uint32_t sc_cdma_state; +#define SCHIZO_CDMA_STATE_DONE (1 << 0) +#define SCHIZO_CDMA_STATE_PENDING (1 << 1) u_int sc_half; uint32_t sc_ign; Modified: stable/7/sys/sparc64/sparc64/nexus.c ============================================================================== --- stable/7/sys/sparc64/sparc64/nexus.c Sun Mar 22 22:14:46 2009 (r190296) +++ stable/7/sys/sparc64/sparc64/nexus.c Sun Mar 22 22:19:54 2009 (r190297) @@ -96,7 +96,7 @@ static ofw_bus_get_devinfo_t nexus_get_d #ifdef SMP static int nexus_bind_intr(device_t, device_t, struct resource *, int); #endif -static int nexus_inlist(const char *, const char **); +static int nexus_inlist(const char *, const char *const *); static struct nexus_devinfo * nexus_setup_dinfo(device_t, phandle_t); static void nexus_destroy_dinfo(struct nexus_devinfo *); static int nexus_print_res(struct nexus_devinfo *); @@ -122,6 +122,7 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_release_resource, nexus_release_resource), DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), + DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_get_resource_list, nexus_get_resource_list), #ifdef SMP @@ -145,7 +146,7 @@ static devclass_t nexus_devclass; DEFINE_CLASS_0(nexus, nexus_driver, nexus_methods, sizeof(struct nexus_softc)); DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); -static const char *nexus_excl_name[] = { +static const char *const nexus_excl_name[] = { "aliases", "associations", "chosen", @@ -159,7 +160,7 @@ static const char *nexus_excl_name[] = { NULL }; -static const char *nexus_excl_type[] = { +static const char *const nexus_excl_type[] = { "cpu", NULL }; @@ -168,7 +169,7 @@ extern struct bus_space_tag nexus_bustag extern struct bus_dma_tag nexus_dmatag; static int -nexus_inlist(const char *name, const char **list) +nexus_inlist(const char *name, const char *const *list) { int i; From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 22:57:54 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 23:00:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83E1E106564A; Sun, 22 Mar 2009 23:00:00 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63EB28FC19; Sun, 22 Mar 2009 23:00:00 +0000 (UTC) (envelope-from silby@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 n2MN00f2086772; Sun, 22 Mar 2009 23:00:00 GMT (envelope-from silby@svn.freebsd.org) Received: (from silby@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2MN00IO086771; Sun, 22 Mar 2009 23:00:00 GMT (envelope-from silby@svn.freebsd.org) Message-Id: <200903222300.n2MN00IO086771@svn.freebsd.org> From: Mike Silbersack Date: Sun, 22 Mar 2009 23:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190299 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 23:00:09 -0000 Author: silby Date: Sun Mar 22 23:00:00 2009 New Revision: 190299 URL: http://svn.freebsd.org/changeset/base/190299 Log: Fix unp_gc so that it recognizes file descriptors that are currently in the process of being passed between processes as alive and does not try to garbage collect them. The full description of the problem and a test program to reproduce it can be found in PR 112554. This fix was inspired by similar fixes in NetBSD and BSD/OS. However, it does not apply to FreeBSD 8 and above - when this code was rewritten and optimized, the bug was fixed in a different way. The test program in the PR passes on 8-current with flying colors. PR: 112554 Submitted by: Spencer Minear Reviewed by: Mike Silbersack Obtained from: Secure Computing Corp MFC after: 4 weeks Modified: stable/7/sys/kern/uipc_usrreq.c Modified: stable/7/sys/kern/uipc_usrreq.c ============================================================================== --- stable/7/sys/kern/uipc_usrreq.c Sun Mar 22 22:57:53 2009 (r190298) +++ stable/7/sys/kern/uipc_usrreq.c Sun Mar 22 23:00:00 2009 (r190299) @@ -1878,6 +1878,7 @@ unp_gc(__unused void *arg, int pending) { struct file *fp, *nextfp; struct socket *so; + struct socket *soa; struct file **extra_ref, **fpp; int nunref, i; int nfiles_snap; @@ -1984,6 +1985,20 @@ unp_gc(__unused void *arg, int pending) SOCKBUF_UNLOCK(&so->so_rcv); /* + * If socket is in listening state, then sockets + * in its accept queue are accessible, and so + * are any descriptors in those sockets' receive + * queues. + */ + ACCEPT_LOCK(); + TAILQ_FOREACH(soa, &so->so_comp, so_list) { + SOCKBUF_LOCK(&soa->so_rcv); + unp_scan(soa->so_rcv.sb_mb, unp_mark); + SOCKBUF_UNLOCK(&soa->so_rcv); + } + ACCEPT_UNLOCK(); + + /* * Wake up any threads waiting in fdrop(). */ FILE_LOCK(fp); From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 23:00:53 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Mar 22 23:05:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0590106566B; Sun, 22 Mar 2009 23:05:54 +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 BAE9A8FC22; Sun, 22 Mar 2009 23:05:54 +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 622E946B58; Sun, 22 Mar 2009 19:05:54 -0400 (EDT) Date: Sun, 22 Mar 2009 23:05:54 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Mike Silbersack In-Reply-To: <200903222300.n2MN00IO086771@svn.freebsd.org> Message-ID: References: <200903222300.n2MN00IO086771@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: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r190299 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 23:05:55 -0000 On Sun, 22 Mar 2009, Mike Silbersack wrote: > Fix unp_gc so that it recognizes file descriptors > that are currently in the process of being passed > between processes as alive and does not > try to garbage collect them. > > The full description of the problem and a test > program to reproduce it can be found in PR 112554. > > This fix was inspired by similar fixes in NetBSD and BSD/OS. > However, it does not apply to FreeBSD 8 and above - > when this code was rewritten and optimized, the bug > was fixed in a different way. The test program in the > PR passes on 8-current with flying colors. We have a UNIX domain socket-passing regression test that creates various contortion-esque situations and then looks to see if sockets were leaked. If it doesn't yet capture this failure mode, could you add it to that test? Robert N M Watson Computer Laboratory University of Cambridge > > PR: 112554 > Submitted by: Spencer Minear > Reviewed by: Mike Silbersack > Obtained from: Secure Computing Corp > MFC after: 4 weeks > > Modified: > stable/7/sys/kern/uipc_usrreq.c > > Modified: stable/7/sys/kern/uipc_usrreq.c > ============================================================================== > --- stable/7/sys/kern/uipc_usrreq.c Sun Mar 22 22:57:53 2009 (r190298) > +++ stable/7/sys/kern/uipc_usrreq.c Sun Mar 22 23:00:00 2009 (r190299) > @@ -1878,6 +1878,7 @@ unp_gc(__unused void *arg, int pending) > { > struct file *fp, *nextfp; > struct socket *so; > + struct socket *soa; > struct file **extra_ref, **fpp; > int nunref, i; > int nfiles_snap; > @@ -1984,6 +1985,20 @@ unp_gc(__unused void *arg, int pending) > SOCKBUF_UNLOCK(&so->so_rcv); > > /* > + * If socket is in listening state, then sockets > + * in its accept queue are accessible, and so > + * are any descriptors in those sockets' receive > + * queues. > + */ > + ACCEPT_LOCK(); > + TAILQ_FOREACH(soa, &so->so_comp, so_list) { > + SOCKBUF_LOCK(&soa->so_rcv); > + unp_scan(soa->so_rcv.sb_mb, unp_mark); > + SOCKBUF_UNLOCK(&soa->so_rcv); > + } > + ACCEPT_UNLOCK(); > + > + /* > * Wake up any threads waiting in fdrop(). > */ > FILE_LOCK(fp); > From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 23:42:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 845071065677 for ; Sun, 22 Mar 2009 23:42:32 +0000 (UTC) (envelope-from silby@silby.com) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) by mx1.freebsd.org (Postfix) with SMTP id 249A48FC15 for ; Sun, 22 Mar 2009 23:42:31 +0000 (UTC) (envelope-from silby@silby.com) Received: (qmail 28058 invoked from network); 22 Mar 2009 23:15:50 -0000 Received: from 209.68.2.70 (HELO localhost) (209.68.2.70) by relay01.pair.com with SMTP; 22 Mar 2009 23:15:50 -0000 X-pair-Authenticated: 209.68.2.70 Date: Sun, 22 Mar 2009 18:15:49 -0500 (CDT) From: Mike Silbersack To: Robert Watson In-Reply-To: Message-ID: References: <200903222300.n2MN00IO086771@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: svn-src-stable-7@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Mike Silbersack , src-committers@freebsd.org Subject: Re: svn commit: r190299 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2009 23:42:33 -0000 On Sun, 22 Mar 2009, Robert Watson wrote: > On Sun, 22 Mar 2009, Mike Silbersack wrote: > >> Fix unp_gc so that it recognizes file descriptors >> that are currently in the process of being passed >> between processes as alive and does not >> try to garbage collect them. >> >> The full description of the problem and a test >> program to reproduce it can be found in PR 112554. >> >> This fix was inspired by similar fixes in NetBSD and BSD/OS. >> However, it does not apply to FreeBSD 8 and above - >> when this code was rewritten and optimized, the bug >> was fixed in a different way. The test program in the >> PR passes on 8-current with flying colors. > > We have a UNIX domain socket-passing regression test that creates various > contortion-esque situations and then looks to see if sockets were leaked. If > it doesn't yet capture this failure mode, could you add it to that test? > > Robert N M Watson > Computer Laboratory > University of Cambridge I've been meaning to do that for two years, that's what delayed me from committing this. I finally decided to get it in before I missed another release. So I can try, but I won't make any guarantees. Mike "Silby" Silbersack From owner-svn-src-all@FreeBSD.ORG Mon Mar 23 00:00:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE501106566B; Mon, 23 Mar 2009 00:00:50 +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 7BA058FC08; 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 n2N00oRi088171; 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 n2N00ogM088169; Mon, 23 Mar 2009 00:00:50 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200903230000.n2N00ogM088169@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-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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: stable/7/sys/kern/kern_environment.c stable/7/sys/kern/kern_time.c Changes in other areas also in this revision: Modified: head/sys/kern/kern_environment.c head/sys/kern/kern_time.c 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 Modified: stable/7/sys/kern/kern_environment.c ============================================================================== --- stable/7/sys/kern/kern_environment.c Sun Mar 22 23:00:52 2009 (r190300) +++ stable/7/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: stable/7/sys/kern/kern_time.c ============================================================================== --- stable/7/sys/kern/kern_time.c Sun Mar 22 23:00:52 2009 (r190300) +++ stable/7/sys/kern/kern_time.c Mon Mar 23 00:00:50 2009 (r190301) @@ -1079,7 +1079,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-all@FreeBSD.ORG Mon Mar 23 00:00:51 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 00:00:52 -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-all@FreeBSD.ORG Mon Mar 23 00:00:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C25991065672; 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 292D48FC0C; Mon, 23 Mar 2009 00:00:51 +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 n2N00p8P088191; Mon, 23 Mar 2009 00:00:51 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2N00oZk088183; Mon, 23 Mar 2009 00:00:50 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200903230000.n2N00oZk088183@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-releng@freebsd.org X-SVN-Group: releng 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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 00:00:52 -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: 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 Changes in other areas also in this revision: Modified: head/sys/kern/kern_environment.c head/sys/kern/kern_time.c stable/7/sys/kern/kern_environment.c stable/7/sys/kern/kern_time.c Modified: releng/7.0/UPDATING ============================================================================== --- releng/7.0/UPDATING Sun Mar 22 23:00:52 2009 (r190300) +++ releng/7.0/UPDATING Mon Mar 23 00:00:50 2009 (r190301) @@ -8,6 +8,12 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20090323: p11 FreeBSD-SA-09:06.ktimer, FreeBSD-EN-09:01.kenv + Correctly sanity-check timer IDs. [SA-09:06] + + Limit the size of malloced buffer when dumping environment + variables. [EN-09:01] + 20090216: p10 FreeBSD-SA-09:05.telnetd Correctly scrub telnetd's environment. Modified: releng/7.0/sys/conf/newvers.sh ============================================================================== --- releng/7.0/sys/conf/newvers.sh Sun Mar 22 23:00:52 2009 (r190300) +++ releng/7.0/sys/conf/newvers.sh Mon Mar 23 00:00:50 2009 (r190301) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="7.0" -BRANCH="RELEASE-p10" +BRANCH="RELEASE-p11" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/7.0/sys/kern/kern_environment.c ============================================================================== --- releng/7.0/sys/kern/kern_environment.c Sun Mar 22 23:00:52 2009 (r190300) +++ releng/7.0/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: releng/7.0/sys/kern/kern_time.c ============================================================================== --- releng/7.0/sys/kern/kern_time.c Sun Mar 22 23:00:52 2009 (r190300) +++ releng/7.0/sys/kern/kern_time.c Mon Mar 23 00:00:50 2009 (r190301) @@ -1068,7 +1068,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); } Modified: releng/7.1/UPDATING ============================================================================== --- releng/7.1/UPDATING Sun Mar 22 23:00:52 2009 (r190300) +++ releng/7.1/UPDATING Mon Mar 23 00:00:50 2009 (r190301) @@ -8,6 +8,12 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20090323: p4 FreeBSD-SA-09:06.ktimer, FreeBSD-EN-09:01.kenv + Correctly sanity-check timer IDs. [SA-09:06] + + Limit the size of malloced buffer when dumping environment + variables. [EN-09:01] + 20090216: p3 FreeBSD-SA-09:05.telnetd Correctly scrub telnetd's environment. Modified: releng/7.1/sys/conf/newvers.sh ============================================================================== --- releng/7.1/sys/conf/newvers.sh Sun Mar 22 23:00:52 2009 (r190300) +++ releng/7.1/sys/conf/newvers.sh Mon Mar 23 00:00:50 2009 (r190301) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="7.1" -BRANCH="RELEASE-p3" +BRANCH="RELEASE-p4" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/7.1/sys/kern/kern_environment.c ============================================================================== --- releng/7.1/sys/kern/kern_environment.c Sun Mar 22 23:00:52 2009 (r190300) +++ releng/7.1/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: releng/7.1/sys/kern/kern_time.c ============================================================================== --- releng/7.1/sys/kern/kern_time.c Sun Mar 22 23:00:52 2009 (r190300) +++ releng/7.1/sys/kern/kern_time.c Mon Mar 23 00:00:50 2009 (r190301) @@ -1079,7 +1079,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-all@FreeBSD.ORG Mon Mar 23 00:15:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6259B1065670; Mon, 23 Mar 2009 00:15:38 +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 4DCB58FC1E; Mon, 23 Mar 2009 00:15:38 +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 n2N0Fcv3088569; Mon, 23 Mar 2009 00:15:38 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2N0Fcd6088568; Mon, 23 Mar 2009 00:15:38 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200903230015.n2N0Fcd6088568@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 23 Mar 2009 00:15:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190302 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb powerpc/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 00:15:39 -0000 Author: nwhitehorn Date: Mon Mar 23 00:15:38 2009 New Revision: 190302 URL: http://svn.freebsd.org/changeset/base/190302 Log: MFC r189675: Change the PVO zone for fictitious pages to the unmanaged PVO zone, to match the unmanaged flag set in the PVO attributes. Without doing this, pmap_remove() could try to remove fictitious pages (like those created by mmap of physical memory) from the wrong UMA zone, causing a panic. Reported by: Justin Hibbits Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/powerpc/powerpc/mmu_oea.c Modified: stable/7/sys/powerpc/powerpc/mmu_oea.c ============================================================================== --- stable/7/sys/powerpc/powerpc/mmu_oea.c Mon Mar 23 00:00:50 2009 (r190301) +++ stable/7/sys/powerpc/powerpc/mmu_oea.c Mon Mar 23 00:15:38 2009 (r190302) @@ -1102,8 +1102,11 @@ moea_enter_locked(pmap_t pmap, vm_offset PMAP_LOCK_ASSERT(pmap, MA_OWNED); /* XXX change the pvo head for fake pages */ - if ((m->flags & PG_FICTITIOUS) == PG_FICTITIOUS) + if ((m->flags & PG_FICTITIOUS) == PG_FICTITIOUS) { + pvo_flags &= ~PVO_MANAGED; pvo_head = &moea_pvo_kunmanaged; + zone = moea_upvo_zone; + } /* * If this is a managed page, and it's the first reference to the page, From owner-svn-src-all@FreeBSD.ORG Mon Mar 23 00:27:47 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Mar 23 00:40:08 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Mar 23 01:13:35 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Mar 23 01:24:17 2009 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 01:24:17 -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-all@FreeBSD.ORG Mon Mar 23 03:03:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BB38106566C; Mon, 23 Mar 2009 03:03:44 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68B4C8FC15; Mon, 23 Mar 2009 03:03:44 +0000 (UTC) (envelope-from scf@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 n2N33iPZ092235; Mon, 23 Mar 2009 03:03:44 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2N33iGT092234; Mon, 23 Mar 2009 03:03:44 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <200903230303.n2N33iGT092234@svn.freebsd.org> From: Sean Farley Date: Mon, 23 Mar 2009 03:03:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190307 - stable/7/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 03:03:45 -0000 Author: scf Date: Mon Mar 23 03:03:44 2009 New Revision: 190307 URL: http://svn.freebsd.org/changeset/base/190307 Log: Merge r189866 from head to stable/7: Add the SIOCSIFMTU ioctl handling directly to tap(4) permitting it to have its MTU set higher than 1500 (ETHERMTU). Its new limit is now 65535 as enforced by ifhwioctl() in if.c This allows a tap(4) device to be added to a bridge, which requires all interface members to have the same MTU, with an interface configured for jumbo frames. QEMU may now connect to a network via tap(4) without requiring the real interface to have its MTU set to 1500 or lower. Reviewed by: rpaulo, bms Merge r189907 from head to stable/7: Remove the splimp()/splx() calls around the setting of the MTU. They are no-op's that I inadvertently added. Even if locking is needed in general for the ioctl's, setting a single long will not need it due to the operation being atomic. Reported by: rwatson Modified: stable/7/sys/net/if_tap.c Modified: stable/7/sys/net/if_tap.c ============================================================================== --- stable/7/sys/net/if_tap.c Mon Mar 23 01:24:17 2009 (r190306) +++ stable/7/sys/net/if_tap.c Mon Mar 23 03:03:44 2009 (r190307) @@ -600,6 +600,7 @@ static int tapifioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct tap_softc *tp = ifp->if_softc; + struct ifreq *ifr = (struct ifreq *)data; struct ifstat *ifs = NULL; int s, dummy; @@ -609,6 +610,10 @@ tapifioctl(struct ifnet *ifp, u_long cmd case SIOCDELMULTI: break; + case SIOCSIFMTU: + ifp->if_mtu = ifr->ifr_mtu; + break; + case SIOCGIFSTATUS: s = splimp(); ifs = (struct ifstat *)data; From owner-svn-src-all@FreeBSD.ORG Mon Mar 23 03:26:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F9FF106564A; Mon, 23 Mar 2009 03:26:02 +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 F06F38FC0C; Mon, 23 Mar 2009 03:26:01 +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 n2N3Q1wv093035; Mon, 23 Mar 2009 03:26:01 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2N3Q1XC093033; Mon, 23 Mar 2009 03:26:01 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200903230326.n2N3Q1XC093033@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 23 Mar 2009 03:26:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190308 - stable/7/share/zoneinfo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 03:26:02 -0000 Author: edwin Date: Mon Mar 23 03:26:01 2009 New Revision: 190308 URL: http://svn.freebsd.org/changeset/base/190308 Log: MFC of ... r187524: Latest bulletin C from Daniel GAMBIS: no leap at the end of june 2009. r188436: MFV of tzdata2009b. - Updated leapseconds r189923: MFV of tzdata2009c - Cuba has DST again. Modified: stable/7/share/zoneinfo/ (props changed) stable/7/share/zoneinfo/leapseconds stable/7/share/zoneinfo/northamerica Modified: stable/7/share/zoneinfo/leapseconds ============================================================================== --- stable/7/share/zoneinfo/leapseconds Mon Mar 23 03:03:44 2009 (r190307) +++ stable/7/share/zoneinfo/leapseconds Mon Mar 23 03:26:01 2009 (r190308) @@ -58,28 +58,19 @@ Leap 2008 Dec 31 23:59:60 + S # e-mail : services.iers@obspm.fr # http://hpiers.obspm.fr/eop-pc # -# Paris, 4 July 2008 +# Paris, 15 January 2009 # -# Bulletin C 36 +# Bulletin C 37 # # To authorities responsible # for the measurement and # distribution of time # -# UTC TIME STEP -# on the 1st of January 2009 -# -# A positive leap second will be introduced at the end of December 2008. -# The sequence of dates of the UTC second markers will be: -# -# 2008 December 31, 23h 59m 59s -# 2008 December 31, 23h 59m 60s -# 2009 January 1, 0h 0m 0s -# -# The difference between UTC and the International Atomic Time TAI is: -# -# from 2006 January 1, 0h UTC, to 2009 January 1 0h UTC : UTC-TAI = - 33s -# from 2009 January 1, 0h UTC, until further notice : UTC-TAI = - 34s +# NO positive leap second will be introduced at the end of June 2009. +# The difference between Coordinated Universal Time UTC and the +# International Atomic Time TAI is : +# +# from 2009 January 1, 0h UTC, until further notice : UTC-TAI = -34 s # # Leap seconds can be introduced in UTC at the end of the months of December # or June, depending on the evolution of UT1-TAI. Bulletin C is mailed every Modified: stable/7/share/zoneinfo/northamerica ============================================================================== --- stable/7/share/zoneinfo/northamerica Mon Mar 23 03:03:44 2009 (r190307) +++ stable/7/share/zoneinfo/northamerica Mon Mar 23 03:26:01 2009 (r190308) @@ -1,4 +1,4 @@ -# @(#)northamerica 8.26 +# @(#)northamerica 8.27 #
 
 # also includes Central America and the Caribbean
@@ -2258,6 +2258,25 @@ Zone America/Costa_Rica	-5:36:20 -	LMT	1
 # From Arthur David Olson (2008-03-12):
 # Assume Sun>=15 (third Sunday) going forward.
 
+# From Alexander Krivenyshev (2009-03-04)
+# According to the Radio Reloj - Cuba will start Daylight Saving Time on
+# midnight between Saturday, March 07, 2009 and Sunday, March 08, 2009-
+# not on midnight March 14 / March 15 as previously thought.
+#
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_cuba05.html
+# (in Spanish)
+# 
+
+# From Arthur David Olson (2009-03-09)
+# I listened over the Internet to
+# 
+# http://media.enet.cu/readioreloj
+# 
+# this morning; when it was 10:05 a. m. here in Bethesda, Maryland the
+# the time was announced as "diez cinco"--the same time as here, indicating
+# that has indeed switched to DST. Assume second Sunday from 2009 forward.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Cuba	1928	only	-	Jun	10	0:00	1:00	D
 Rule	Cuba	1928	only	-	Oct	10	0:00	0	S
@@ -2290,7 +2309,8 @@ Rule	Cuba	1998	2003	-	Oct	lastSun	0:00s	
 Rule	Cuba	2000	2004	-	Apr	Sun>=1	0:00s	1:00	D
 Rule	Cuba	2006	max	-	Oct	lastSun	0:00s	0	S
 Rule	Cuba	2007	only	-	Mar	Sun>=8	0:00s	1:00	D
-Rule	Cuba	2008	max	-	Mar	Sun>=15	0:00s	1:00	D
+Rule	Cuba	2008	only	-	Mar	Sun>=15	0:00s	1:00	D
+Rule	Cuba	2009	max	-	Mar	Sun>=8	0:00s	1:00	D
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	America/Havana	-5:29:28 -	LMT	1890

From owner-svn-src-all@FreeBSD.ORG  Mon Mar 23 03:26:03 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EEDAB106566B;
	Mon, 23 Mar 2009 03:26:03 +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 DBAA08FC12;
	Mon, 23 Mar 2009 03:26:03 +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 n2N3Q3pH093070;
	Mon, 23 Mar 2009 03:26:03 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2N3Q3Ux093068;
	Mon, 23 Mar 2009 03:26:03 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <200903230326.n2N3Q3Ux093068@svn.freebsd.org>
From: Edwin Groothuis 
Date: Mon, 23 Mar 2009 03:26:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
X-SVN-Group: stable-6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190309 - stable/6/share/zoneinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 23 Mar 2009 03:26:04 -0000

Author: edwin
Date: Mon Mar 23 03:26:03 2009
New Revision: 190309
URL: http://svn.freebsd.org/changeset/base/190309

Log:
  MFC of ...
  
  r187524:
  Latest bulletin C from Daniel GAMBIS: no leap at the end of june 2009.
  
  r188436:
  MFV of tzdata2009b.
  - Updated leapseconds
  
  r189923:
  MFV of tzdata2009c
  - Cuba has DST again.

Modified:
  stable/6/share/zoneinfo/   (props changed)
  stable/6/share/zoneinfo/leapseconds
  stable/6/share/zoneinfo/northamerica

Modified: stable/6/share/zoneinfo/leapseconds
==============================================================================
--- stable/6/share/zoneinfo/leapseconds	Mon Mar 23 03:26:01 2009	(r190308)
+++ stable/6/share/zoneinfo/leapseconds	Mon Mar 23 03:26:03 2009	(r190309)
@@ -58,28 +58,19 @@ Leap	2008	Dec	31	23:59:60	+	S
 # e-mail    : services.iers@obspm.fr
 # http://hpiers.obspm.fr/eop-pc
 #
-# Paris, 4 July 2008
+# Paris, 15 January 2009
 #
-# Bulletin C 36
+# Bulletin C 37
 #
 # To authorities responsible
 # for the measurement and
 # distribution of time
 #
-# UTC TIME STEP
-# on the 1st of January 2009
-#
-# A positive leap second will be introduced at the end of December 2008.
-# The sequence of dates of the UTC second markers will be:		
-#
-# 2008 December 31,     23h 59m 59s
-# 2008 December 31,     23h 59m 60s
-# 2009 January   1,      0h  0m  0s
-#
-# The difference between UTC and the International Atomic Time TAI is:
-#
-# from 2006 January 1, 0h UTC, to 2009 January 1  0h UTC  : UTC-TAI = - 33s
-# from 2009 January 1, 0h UTC, until further notice       : UTC-TAI = - 34s
+# NO positive leap second will be introduced at the end of June 2009.
+# The difference between Coordinated Universal Time UTC and the 
+# International Atomic Time TAI is :             
+#                
+#     from 2009 January 1, 0h UTC, until further notice : UTC-TAI = -34 s
 #
 # Leap seconds can be introduced in UTC at the end of the months of December
 # or June, depending on the evolution of UT1-TAI. Bulletin C is mailed every

Modified: stable/6/share/zoneinfo/northamerica
==============================================================================
--- stable/6/share/zoneinfo/northamerica	Mon Mar 23 03:26:01 2009	(r190308)
+++ stable/6/share/zoneinfo/northamerica	Mon Mar 23 03:26:03 2009	(r190309)
@@ -1,4 +1,4 @@
-# @(#)northamerica	8.26
+# @(#)northamerica	8.27
 # 
 
 # also includes Central America and the Caribbean
@@ -2258,6 +2258,25 @@ Zone America/Costa_Rica	-5:36:20 -	LMT	1
 # From Arthur David Olson (2008-03-12):
 # Assume Sun>=15 (third Sunday) going forward.
 
+# From Alexander Krivenyshev (2009-03-04)
+# According to the Radio Reloj - Cuba will start Daylight Saving Time on
+# midnight between Saturday, March 07, 2009 and Sunday, March 08, 2009-
+# not on midnight March 14 / March 15 as previously thought.
+#
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_cuba05.html
+# (in Spanish)
+# 
+
+# From Arthur David Olson (2009-03-09)
+# I listened over the Internet to
+# 
+# http://media.enet.cu/readioreloj
+# 
+# this morning; when it was 10:05 a. m. here in Bethesda, Maryland the
+# the time was announced as "diez cinco"--the same time as here, indicating
+# that has indeed switched to DST. Assume second Sunday from 2009 forward.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Cuba	1928	only	-	Jun	10	0:00	1:00	D
 Rule	Cuba	1928	only	-	Oct	10	0:00	0	S
@@ -2290,7 +2309,8 @@ Rule	Cuba	1998	2003	-	Oct	lastSun	0:00s	
 Rule	Cuba	2000	2004	-	Apr	Sun>=1	0:00s	1:00	D
 Rule	Cuba	2006	max	-	Oct	lastSun	0:00s	0	S
 Rule	Cuba	2007	only	-	Mar	Sun>=8	0:00s	1:00	D
-Rule	Cuba	2008	max	-	Mar	Sun>=15	0:00s	1:00	D
+Rule	Cuba	2008	only	-	Mar	Sun>=15	0:00s	1:00	D
+Rule	Cuba	2009	max	-	Mar	Sun>=8	0:00s	1:00	D
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	America/Havana	-5:29:28 -	LMT	1890

From owner-svn-src-all@FreeBSD.ORG  Mon Mar 23 04:06:21 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 887341065673;
	Mon, 23 Mar 2009 04:06:21 +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 74E598FC13;
	Mon, 23 Mar 2009 04:06:21 +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 n2N46LPI093839;
	Mon, 23 Mar 2009 04:06:21 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2N46L7V093838;
	Mon, 23 Mar 2009 04:06:21 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200903230406.n2N46L7V093838@svn.freebsd.org>
From: Andrew Thompson 
Date: Mon, 23 Mar 2009 04:06:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190310 - stable/7/sys/dev/usb
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 23 Mar 2009 04:06:22 -0000

Author: thompsa
Date: Mon Mar 23 04:06:21 2009
New Revision: 190310
URL: http://svn.freebsd.org/changeset/base/190310

Log:
  Sync usbdevs to HEAD, keeping name compat.

Modified:
  stable/7/sys/dev/usb/usbdevs

Modified: stable/7/sys/dev/usb/usbdevs
==============================================================================
--- stable/7/sys/dev/usb/usbdevs	Mon Mar 23 03:26:03 2009	(r190309)
+++ stable/7/sys/dev/usb/usbdevs	Mon Mar 23 04:06:21 2009	(r190310)
@@ -151,6 +151,7 @@ vendor PLANTRONICS	0x047f	Plantronics
 vendor KYOCERA		0x0482	Kyocera Wireless Corp.
 vendor STMICRO		0x0483	STMicroelectronics
 vendor FOXCONN		0x0489	Foxconn
+vendor MEIZU		0x0492	Meizu Electronics
 vendor YAMAHA		0x0499	YAMAHA
 vendor COMPAQ		0x049f	Compaq
 vendor HITACHI		0x04a4	Hitachi
@@ -282,6 +283,7 @@ vendor INSYSTEM		0x05ab	In-System Design
 vendor APPLE		0x05ac	Apple Computer
 vendor YCCABLE		0x05ad	Y.C. Cable
 vendor DIGITALPERSONA	0x05ba	DigitalPersona
+vendor 3G		0x05bc	3G Green Green Globe
 vendor RAFI		0x05bd	RAFI
 vendor TYCO		0x05be	Tyco
 vendor KAWASAKI		0x05c1	Kawasaki
@@ -364,6 +366,7 @@ vendor SYNTECH		0x0745	Syntech Informati
 vendor DIGITALSTREAM	0x074e	Digital Stream
 vendor AUREAL		0x0755	Aureal Semiconductor
 vendor MIDIMAN		0x0763	Midiman
+vendor CYBERPOWER	0x0764	Cyber Power Systems, Inc.
 vendor SURECOM		0x0769	Surecom Technology
 vendor LINKSYS2		0x077b	Linksys
 vendor GRIFFIN		0x077d	Griffin Technology
@@ -435,6 +438,7 @@ vendor AUDIOTECHNICA	0x0909	Audio-Techni
 vendor TRUMPION		0x090a	Trumpion Microelectronics
 vendor FEIYA		0x090c	Feiya
 vendor ALATION		0x0910	Alation Systems
+vendor GLOBESPAN	0x0915	Globespan
 vendor CONCORDCAMERA	0x0919	Concord Camera
 vendor GARMIN		0x091e	Garmin International
 vendor GOHUBS		0x0921	GoHubs
@@ -497,6 +501,7 @@ vendor AMBIT		0x0bb2	Ambit Microsystems
 vendor HTC		0x0bb4	HTC
 vendor REALTEK		0x0bda	Realtek
 vendor ADDONICS2	0x0bf6	Addonics Technology
+vendor FSC		0x0bf8	Fujitsu Siemens Computers
 vendor AGATE		0x0c08	Agate Technologies
 vendor DMI		0x0c0b	DMI
 vendor MICRODIA		0x0c45	Chicony
@@ -522,6 +527,7 @@ vendor HAWKING		0x0e66	Hawking
 vendor FOSSIL		0x0e67	Fossil, Inc
 vendor GMATE		0x0e7e	G.Mate, Inc
 vendor OTI		0x0ea0	Ours Technology
+vendor YISO		0x0eab	Yiso Wireless Co.
 vendor PILOTECH		0x0eaf	Pilotech
 vendor NOVATECH		0x0eb0	NovaTech
 vendor ITEGNO		0x0eba	iTegno
@@ -587,6 +593,7 @@ vendor SILICOM		0x1485	Silicom
 vendor RALINK		0x148f	Ralink Technology
 vendor IMAGINATION	0x149a	Imagination Technologies
 vendor CONCEPTRONIC2	0x14b2	Conceptronic
+vendor SUPERTOP		0x14cd	Super Top
 vendor PLANEX3		0x14ea	Planex Communications
 vendor SILICONPORTALS	0x1527	Silicon Portals
 vendor UBIQUAM		0x1529	UBIQUAM Co., Ltd.
@@ -607,8 +614,8 @@ vendor GIGASET		0x1690	Gigaset
 vendor GLOBALSUN	0x16ab	Global Sun Technology
 vendor ANYDATA		0x16d5	AnyDATA Corporation
 vendor JABLOTRON	0x16d6	Jablotron
-vendor CMOTECH		0x16d8	CMOTECH Co., Ltd.
-vendor AXESSTEL		0x1726	Axesstel Co., Ltd.
+vendor CMOTECH		0x16d8	C-motech
+vendor AXESSTEL		0x1726  Axesstel Co., Ltd.
 vendor LINKSYS4		0x1737	Linksys
 vendor SENAO		0x1740	Senao
 vendor METAGEEK		0x1781	MetaGeek
@@ -616,6 +623,8 @@ vendor AMIT		0x18c5	AMIT
 vendor QCOM		0x18e8	Qcom
 vendor LINKSYS3		0x1915	Linksys
 vendor QUALCOMMINC	0x19d2	Qualcomm, Incorporated
+vendor STELERA		0x1a8d	Stelera Wireless
+vendor DRESDENELEKTRONIK 0x1cf1 dresden elektronik
 vendor DLINK		0x2001	D-Link
 vendor PLANEX2		0x2019	Planex Communications
 vendor ERICSSON		0x2282	Ericsson
@@ -700,6 +709,7 @@ product ACCTON USB320_EC	0x1046	USB320-E
 product ACCTON 2664W		0x3501	2664W
 product ACCTON 111		0x3503	T-Sinus 111 Wireless Adapter
 product ACCTON SMCWUSBG		0x4505	SMCWUSB-G
+product ACCTON PRISM_GT		0x4521	PrismGT USB 2.0 WLAN
 product ACCTON SS1001		0x5046	SpeedStream Ethernet Adapter
 product ACCTON ZD1211B		0xe501	ZD1211B
 
@@ -801,6 +811,7 @@ product AKS USBHASP		0x0001	USB-HASP 0.0
 /* Alcor Micro, Inc. products */
 product ALCOR2 KBD_HUB		0x2802	Kbd Hub
 
+product ALCOR TRANSCEND		0x6387	Transcend JetFlash Drive
 product ALCOR MA_KBD_HUB	0x9213	MacAlly Kbd Hub
 product ALCOR AU9814		0x9215	AU9814 Hub
 product ALCOR UMCR_9361		0x9361	USB Multimedia Card Reader
@@ -879,6 +890,7 @@ product ASUS WL159G		0x170c	WL-159g
 product ASUS A9T_WIFI		0x171b	A9T wireless
 product ASUS RT2573_1		0x1723	RT2573
 product ASUS RT2573_2		0x1724	RT2573
+product ASUS LCM		0x1726	LCM display
 product ASUS P535		0x420f	ASUS P535 PDA
 
 /* ATen products */
@@ -900,6 +912,7 @@ product ATHEROS2 AR5523_3	0x0005	AR5523
 product ATHEROS2 AR5523_3_NF	0x0006	AR5523 (no firmware)
 
 /* Atmel Comp. products */
+product ATMEL STK541		0x2109	Zigbee Controller
 product ATMEL UHB124		0x3301	UHB124 hub
 product ATMEL DWL120		0x7603	DWL-120 Wireless Adapter
 product ATMEL BW002		0x7605	BW002 Wireless Adapter
@@ -910,7 +923,7 @@ product ATMEL AT76C505A		0x7614	AT76c505
 product AVISION 1200U		0x0268	1200U scanner
 
 /* Axesstel products */
-product AXESSTEL DATAMODEM	0x1000	Data Modem
+product AXESSTEL DATAMODEM	0x1000  Data Modem
 
 /* Baltech products */
 product BALTECH CARDREADER	0x9999	Card reader
@@ -926,6 +939,7 @@ product BELKIN FBT003V		0x0084	FBT003v2 
 product BELKIN F5U103		0x0103	F5U103 Serial
 product BELKIN F5U109		0x0109	F5U109 Serial
 product BELKIN USB2SCSI		0x0115	USB to SCSI
+product BELKIN F8T012		0x0121	F8T012xx1 Bluetooth USB Adapter
 product BELKIN USB2LAN		0x0121	USB to LAN
 product BELKIN F5U208		0x0208	F5U208 VideoBus II
 product BELKIN F5U237		0x0237	F5U237 USB 2.0 7-Port Hub
@@ -938,6 +952,7 @@ product BELKIN F5D5055		0x5055	F5D5055
 product BELKIN F5D7050		0x7050	F5D7050 Wireless Adapter
 product BELKIN F5D7051		0x7051	F5D7051 54g USB Network Adapter
 product BELKIN F5D7050A		0x705a	F5D7050A Wireless Adapter
+/* Also sold as 'Ativa 802.11g wireless card' */
 product BELKIN F5D7050_V4000	0x705c	F5D7050 v4000 Wireless Adapter
 product BELKIN F5D9050V3	0x905b	F5D9050 ver 3 Wireless Adapter
 product BELKIN2 F5U002		0x0002	F5U002 Parallel printer
@@ -968,6 +983,7 @@ product CANON LIDE25		0x2220	CanoScan LI
 product CANON S10		0x3041	PowerShot S10
 product CANON S100		0x3045	PowerShot S100
 product CANON S200		0x3065	PowerShot S200
+product CANON REBELXT		0x30ef	Digital Rebel XT
 
 /* CATC products */
 product CATC NETMATE		0x000a	Netmate Ethernet
@@ -977,6 +993,7 @@ product CATC ANDROMEDA		0x1237	Andromeda
 
 /* CASIO products */
 product CASIO QV_DIGICAM	0x1001	QV DigiCam
+product CASIO EXS880		0x1105	Exilim EX-S880
 product CASIO BE300		0x2002	BE-300 PDA
 product CASIO NAMELAND		0x4001	CASIO Nameland EZ-USB
 
@@ -1030,6 +1047,7 @@ product COMPAQ IPAQLINUX	0x505a	iPAQ Lin
 product COMPOSITE USBPS2	0x0001	USB to PS2 Adaptor
 
 /* Conceptronic products */
+product CONCEPTRONIC PRISM_GT	0x3762	PrismGT USB 2.0 WLAN
 product CONCEPTRONIC C11U	0x7100	C11U
 product CONCEPTRONIC WL210	0x7110	WL-210
 product CONCEPTRONIC AR5523_1	0x7801	AR5523
@@ -1050,6 +1068,8 @@ product COREGA FETHER_USB_TXS	0x000d	FEt
 product COREGA WLANUSB		0x0012	Wireless LAN Stick-11
 product COREGA FETHER_USB2_TX	0x0017	FEther USB2-TX
 product COREGA WLUSB_11_KEY	0x001a	ULUSB-11 Key
+product COREGA CGWLUSB2GL	0x002d	CG-WLUSB2GL
+product COREGA CGWLUSB2GPX	0x002e	CG-WLUSB2GPX
 product COREGA WLUSB_11_STICK	0x7613	WLAN USB Stick 11
 product COREGA FETHER_USB_TXC	0x9601	FEther USB-TXC
 
@@ -1072,6 +1092,9 @@ product CURITEL HX550C		0x1101	CDMA 2000
 product CURITEL HX57XB		0x2101	CDMA 2000 1xRTT USB modem (HX-570/575B/PR-600)
 product CURITEL PC5740		0x3701	Broadband Wireless modem
 
+/* CyberPower products */
+product CYBERPOWER 1500CAVRLCD	0x0501	1500CAVRLCD
+
 /* CyberTAN Technology products */
 product CYBERTAN TG54USB	0x1666	TG54USB
 
@@ -1092,8 +1115,11 @@ product DALLAS J6502		0x4201	J-6502 spea
 
 /* Dell products */
 product DELL PORT		0x0058	Port Replicator
+product DELL AIO926		0x5115	Photo AIO Printer 926
 product DELL BC02		0x8000	BC02 Bluetooth USB Adapter
+product DELL PRISM_GT_1		0x8102	PrismGT USB 2.0 WLAN
 product DELL TM350		0x8103	TrueMobile 350 Bluetooth USB Adapter
+product DELL PRISM_GT_2		0x8104	PrismGT USB 2.0 WLAN
 product DELL U740		0x8135	Dell U740 CDMA
 
 /* Delorme Paublishing products */
@@ -1148,6 +1174,10 @@ product DMI CFSM_RW		0xa109	CF/SM Reader
 /* DrayTek products */
 product DRAYTEK VIGOR550	0x0550	Vigor550
 
+/* dresden elektronik products */
+product DRESDENELEKTRONIK SENSORTERMINALBOARD  0x0001 SensorTerminalBoard
+product DRESDENELEKTRONIK WIRELESSHANDHELDTERMINAL  0x0004 Wireless Handheld Terminal
+
 /* Dynastream Innovations */
 product DYNASTREAM ANTDEVBOARD	0x1003	ANT dev board
 
@@ -1220,12 +1250,18 @@ product EPSON STYLUS_895	0x0602	Stylus P
 product EPSON CX5400		0x0808	CX5400 scanner
 product EPSON 3500		0x080e	CX-3500/3600/3650 MFP
 product EPSON RX425		0x080f	Stylus Photo RX425 scanner
-product EPSON 4800		0x0819	CX4800 MP scanner
-product EPSON 4200		0x0820	CX4200 MP scanner
-product EPSON 5000		0x082b	DX-50x0 MFP scanner
-product EPSON 6000		0x082e	DX-60x0 MFP scanner
-product EPSON DX7400		0x0838	DX7400/CX7300 scanner
-product EPSON DX8400		0x0839	DX8400 scanner
+product EPSON DX3800		0x0818	CX3700/CX3800/DX38x0 MFP scanner
+product EPSON 4800		0x0819	CX4700/CX4800/DX48x0 MFP scanner
+product EPSON 4200		0x0820	CX4100/CX4200/DX4200 MFP scanner
+product EPSON 5000		0x082b  CX4900/CX5000/DX50x0 MFP scanner
+product EPSON 6000		0x082e  CX5900/CX6000/DX60x0 MFP scanner
+product EPSON DX4000		0x082f  DX4000 MFP scanner
+product EPSON DX7400		0x0838	CX7300/CX7400/DX7400 MFP scanner
+product EPSON DX8400		0x0839	CX8300/CX8400/DX8400 MFP scanner
+product EPSON SX100		0x0841	SX100/NX100 MFP scanner
+product EPSON NX300		0x0848	NX300 MFP scanner
+product EPSON SX200		0x0849	SX200/SX205 MFP scanner
+product EPSON SX400		0x084a	SX400/NX400/TX400 MFP scanner
 
 /* e-TEK Labs products */
 product ETEK 1COM		0x8007	Serial
@@ -1245,6 +1281,9 @@ product FOSSIL WRISTPDA		0x0002	Wrist PD
 /* Freecom products */
 product FREECOM DVD		0xfc01	DVD drive
 
+/* Fujitsu Siemens Computers products */
+product FSC E5400		0x1009	PrismGT USB 2.0 WLAN
+
 /* Future Technology Devices products */
 product FTDI SERIAL_8U100AX	0x8372	8U100AX Serial
 product FTDI SERIAL_8U232AM	0x6001	8U232AM Serial
@@ -1258,6 +1297,7 @@ product FTDI UOPTBR		0xe889	USB-RS232 Op
 product FTDI EMCU2D		0xe88a	Expert mouseCLOCK USB II
 product FTDI PCMSFU		0xe88b	Precision Clock MSF USB
 product FTDI EMCU2H		0xe88c	Expert mouseCLOCK USB II HBG
+product	FTDI MAXSTREAM		0xee18	Maxstream PKG-U
 product FTDI USBSERIAL		0xfa00	Matrix Orbital USB Serial
 product FTDI MX2_3		0xfa01	Matrix Orbital MX2 or MX3
 product FTDI MX4_5		0xfa02	Matrix Orbital MX4 or MX5
@@ -1312,6 +1352,10 @@ product GLOBALSUN AR5523_1_NF	0x7802	AR5
 product GLOBALSUN AR5523_2	0x7811	AR5523
 product GLOBALSUN AR5523_2_NF	0x7812	AR5523 (no firmware)
 
+/* Globespan products */
+product GLOBESPAN PRISM_GT_1	0x2000	PrismGT USB 2.0 WLAN
+product GLOBESPAN PRISM_GT_2	0x2002	PrismGT USB 2.0 WLAN
+
 /* G.Mate, Inc products */
 product GMATE YP3X00		0x1001	YP3X00 PDA
 
@@ -1391,8 +1435,9 @@ product HP 840C			0x0604	DeskJet 840c
 product HP 2200C		0x0605	ScanJet 2200C
 product HP 5300C		0x0701	Scanjet 5300C
 product HP 4400C		0x0705	Scanjet 4400C
+product	HP 4470C		0x0805	Scanjet 4470C
 product HP 82x0C		0x0b01	Scanjet 82x0C
-product HP 2300D		0x0b17	Laserjet 2300d
+product HP 2300D 		0x0b17	Laserjet 2300d
 product HP 970CSE		0x1004	Deskjet 970Cse
 product HP 5400C		0x1005	Scanjet 5400C
 product HP 2215			0x1016	iPAQ 22xx/Jornada 548
@@ -1403,6 +1448,7 @@ product HP HS2300		0x1e1d  HS2300 HSDPA 
 product HP 640C			0x2004	DeskJet 640c
 product HP 4670V		0x3005	ScanJet 4670v
 product HP P1100		0x3102	Photosmart P1100
+product HP OJ4215		0x3d11	OfficeJet 4215
 product HP HN210E		0x811c	Ethernet HN210E
 product HP2 C500		0x6002	PhotoSmart C500
 
@@ -1440,6 +1486,7 @@ product INTEL EASYPC_CAMERA	0x0110	Easy 
 product INTEL TESTBOARD		0x9890	82930 test board
 
 /* Intersil products */
+product INTERSIL PRISM_GT	0x1000	PrismGT USB 2.0 WLAN
 product INTERSIL PRISM_2X	0x3642	Prism2.x or Atmel WLAN
 
 /* Interpid Control Systems products */
@@ -1466,6 +1513,7 @@ product IOMEGA ZIP250		0x0030	Zip 250
 
 /* Ituner networks products */
 product ITUNERNET USBLCD2X20	0x0002	USB-LCD 2x20
+product ITUNERNET USBLCD4X20	0xc001	USB-LCD 4x20
 
 /* Jablotron products */
 product JABLOTRON PC60B		0x0001	PC-60B
@@ -1585,6 +1633,7 @@ product LOGITECH QUICKCAMWEB	0x0801	Quic
 product LOGITECH QUICKCAMPRO	0x0810	QuickCam Pro
 product LOGITECH QUICKCAMEXP	0x0840	QuickCam Express
 product LOGITECH QUICKCAM	0x0850	QuickCam
+product LOGITECH QUICKCAMPRO3	0x0990	QuickCam Pro 9000
 product LOGITECH N43		0xc000	N43
 product LOGITECH N48		0xc001	N48 mouse
 product LOGITECH MBA47		0xc002	M-BA47 mouse
@@ -1620,6 +1669,9 @@ product MCT DU_H3SP_USB232	0x0200	D-Link
 product MCT USB232		0x0210	USB-232 Interface
 product MCT SITECOM_USB232	0x0230	Sitecom USB-232 Products
 
+/* Meizu Electronics */
+product MEIZU M6_SL		0x0140	MiniPlayer M6 (SL)
+
 /* Melco, Inc products */
 product MELCO LUATX1		0x0001	LUA-TX Ethernet
 product MELCO LUATX5		0x0005	LUA-TX Ethernet
@@ -1635,6 +1687,10 @@ product MELCO PCOPRS1		0x00b3	PC-OP-RS1 
 product MELCO SG54HP		0x00d8	WLI-U2-SG54HP
 product MELCO G54HP		0x00d9	WLI-U2-G54HP
 product MELCO KG54L		0x00da	WLI-U2-KG54L
+product MELCO SG54HG		0x00f4	WLI-U2-SG54HG
+
+/* Merlin products */
+product MERLIN V620             0x1110  Merlin V620
 
 /* MetaGeek products */
 product METAGEEK WISPY1B	0x083e	MetaGeek Wi-Spy
@@ -1675,6 +1731,7 @@ product MICROSOFT MN510		0x006e	MN510 Wi
 product MICROSOFT MN110		0x007a	10/100 USB NIC
 product MICROSOFT WLINTELLIMOUSE 0x008c	Wireless Optical IntelliMouse
 product MICROSOFT WLNOTEBOOK	0x00b9	Wireless Optical Mouse (Model 1023)
+product MICROSOFT COMFORT3000	0x00d1	Comfort Optical Mouse 3000 (Model 1043)
 product MICROSOFT WLNOTEBOOK2	0x00e1	Wireless Optical Mouse 3000 (Model 1056)
 product MICROSOFT WLNOTEBOOK3	0x00d2	Wireless Optical Mouse 3000 (Model 1049)
 product MICROSOFT WLUSBMOUSE	0x00b9	Wireless USB Mouse
@@ -1757,6 +1814,7 @@ product MSYSTEMS DISKONKEY2	0x0011	DiskO
 
 /* Myson products */
 product MYSON HEDEN		0x8818	USB-IDE
+product MYSON STARREADER	0x9920	USB flash card adapter
 
 /* National Semiconductor */
 product NATIONAL BEARPAW1200	0x1000	BearPaw 1200
@@ -1784,8 +1842,10 @@ product NETGEAR EA101		0x1001	Ethernet
 product NETGEAR EA101X		0x1002	Ethernet
 product NETGEAR FA101		0x1020	Ethernet 10/100, USB1.1
 product NETGEAR FA120		0x1040	USB 2.0 Ethernet
+product NETGEAR WG111V2_2	0x4240	PrismGT USB 2.0 WLAN
 product NETGEAR WG111U		0x4300	WG111U
 product NETGEAR WG111U_NF	0x4301	WG111U (no firmware)
+product NETGEAR WG111V2		0x6a00	WG111V2
 product NETGEAR2 MA101		0x4100	MA101
 product NETGEAR2 MA101B		0x4102	MA101 Rev B
 product NETGEAR3 WG111T		0x4250	WG111T
@@ -1821,6 +1881,8 @@ product NOVATEL U720		0x2110	Merlin U720
 product NOVATEL U727		0x4100	Merlin U727 CDMA
 product NOVATEL MC950D		0x4400	Novatel MC950D HSUPA
 product NOVATEL ZEROCD		0x5010	Novatel ZeroCD
+product NOVATEL ZEROCD2		0x5030	Novatel ZeroCD
+product NOVATEL U760		0x6000	Novatel U760
 product NOVATEL2 FLEXPACKGPS	0x0100	NovAtel FlexPack GPS receiver
 
 /* Merlin products */
@@ -1846,16 +1908,15 @@ product ONSPEC CFSM_COMBO	0xa109	USB to 
 product ONSPEC UCF100		0xa400	FlashLink UCF-100 CompactFlash Reader
 product ONSPEC2 IMAGEMATE_SDDR55	0xa103	ImageMate SDDR55
 
-
 /* Option products */
 product OPTION VODAFONEMC3G	0x5000	Vodafone Mobile Connect 3G datacard
 product OPTION GT3G		0x6000	GlobeTrotter 3G datacard
 product OPTION GT3GQUAD		0x6300	GlobeTrotter 3G QUAD datacard
 product OPTION GT3GPLUS		0x6600	GlobeTrotter 3G+ datacard
+product OPTION GTICON322	0xd033	GlobeTrotter Icon322 storage
 product OPTION GTMAX36		0x6701	GlobeTrotter Max 3.6 Modem
 product OPTION GTMAXHSUPA	0x7001	GlobeTrotter HSUPA
 
-
 /* OQO */
 product OQO WIFI01		0x0002	model 01 WiFi interface
 product OQO BT01		0x0003	model 01 Bluetooth interface
@@ -1914,6 +1975,7 @@ product PLANEX2 GWUS54HP	0xab01	GW-US54H
 product PLANEX2 GWUS54MINI2	0xab50	GW-US54Mini2
 product PLANEX2 GWUS54SG	0xc002	GW-US54SG
 product PLANEX2 GWUS54GZL	0xc007	GW-US54GZL
+product PLANEX2 GWUS54GD	0xed01	GW-US54GD
 product PLANEX2 GWUSMM		0xed02	GW-USMM
 product PLANEX3 GWUS54GZ	0xab10	GW-US54GZ
 product PLANEX3 GU1000T		0xab11	GU-1000T
@@ -1978,6 +2040,7 @@ product QUALCOMM2 RWT_FCT	0x3100	RWT FCT
 product QUALCOMM2 CDMA_MSM	0x3196	CDMA Technologies MSM modem
 product QUALCOMMINC CDMA_MSM	0x0001	CDMA Technologies MSM modem
 product QUALCOMMINC ZTE_STOR	0x2000	USB ZTE Storage
+product QUALCOMMINC AC8700	0xfffe	CDMA 1xEVDO USB modem
 
 /* Qtronix products */
 product QTRONIX 980N		0x2011	Scorpion-980N keyboard
@@ -2002,6 +2065,15 @@ product RALINK RT2573_2		0x9021	RT2501US
 /* ReakTek products */
 /* Green House and CompUSA OEM this part */
 product REALTEK USBKR100	0x8150	USBKR100 USB Ethernet
+product REALTEK RTL8187		0x8187	RTL8187 Wireless Adapter
+
+/* Ricoh products */
+product RICOH VGPVCC2		0x1830	VGP-VCC2 Camera
+product RICOH VGPVCC3		0x1832	VGP-VCC3 Camera
+product RICOH VGPVCC2_2		0x1833	VGP-VCC2 Camera
+product RICOH VGPVCC2_3		0x1834	VGP-VCC2 Camera
+product RICOH VGPVCC7		0x183a	VGP-VCC7 Camera
+product RICOH VGPVCC8		0x183b	VGP-VCC8 Camera
 
 /* Roland products */
 product ROLAND UM1		0x0009	UM-1 MIDI I/F
@@ -2039,7 +2111,7 @@ product SANDISK SDCZ4_128	0x7112	Cruzer 
 product SANDISK SDCZ4_256	0x7113	Cruzer Micro 256MB
 
 /* Sanyo Electric products */
-product SANYO SCP4900		0x0701	Sanyo SCP-4900 USB Phone
+product SANYO SCP4900 		0x0701	Sanyo SCP-4900 USB Phone
 
 /* ScanLogic products */
 product SCANLOGIC SL11R		0x0002	SL11R IDE Adapter
@@ -2050,6 +2122,7 @@ product SENAO NUB8301		0x2000	NUB-8301
 
 /* ShanTou products */
 product SHANTOU ST268		0x0268	ST268
+product SHANTOU DM9601		0x9601	DM 9601
 
 /* Shark products */
 product SHARK PA		0x0400	Pocket Adapter
@@ -2080,7 +2153,7 @@ product SHUTTLE EUSBORCA	0x0325	eUSB ORC
 product SIEMENS SPEEDSTREAM	0x1001	SpeedStream
 product SIEMENS SPEEDSTREAM22	0x1022	SpeedStream 1022
 product SIEMENS2 WLL013		0x001b	WLL013
-product SIEMENS2 ES75		0x0034	GSM module MC35
+product SIEMENS2 ES75		0x0034  GSM module MC35
 product SIEMENS2 WL54G		0x3c06	54g USB Network Adapter
 product SIEMENS3 SX1		0x0001	SX1
 product SIEMENS3 X65		0x0003	X65
@@ -2092,12 +2165,14 @@ product SIERRA AIRCARD595	0x0019	Sierra 
 product SIERRA AC595U		0x0120	Sierra Wireless AirCard 595U
 product SIERRA AC597E		0x0021	Sierra Wireless AirCard 597E
 product SIERRA C597		0x0023	Sierra Wireless Compass 597
+product SIERRA AC875		0x6820	Sierra Wireless AirCard 875
 product SIERRA AC880		0x6850	Sierra Wireless AirCard 880
 product SIERRA AC881		0x6851	Sierra Wireless AirCard 881
 product SIERRA AC880E		0x6852	Sierra Wireless AirCard 880E
 product SIERRA AC881E		0x6853	Sierra Wireless AirCard 881E
 product SIERRA AC880U		0x6855	Sierra Wireless AirCard 880U
 product SIERRA AC881U		0x6856	Sierra Wireless AirCard 881U
+product SIERRA AC885U		0x6880	Sierra Wireless AirCard 885U
 product SIERRA EM5625		0x0017	EM5625
 product SIERRA MC5720		0x0218	MC5720 Wireless Modem
 product SIERRA MC5720_2		0x0018	MC5720
@@ -2114,7 +2189,6 @@ product SIERRA MC8780		0x6832	MC8780
 product SIERRA MC8781		0x6833	MC8781
 product SIERRA TRUINSTALL	0x0fff	Aircard Tru Installer
 
-
 /* Sigmatel products */
 product SIGMATEL I_BEAD100	0x8008	i-Bead 100 MP3 Player
 
@@ -2131,6 +2205,7 @@ product SILICOM GPE		0x0002	Psion Gold P
 
 /* SI Labs */
 product SILABS	POLOLU		0x803b	Pololu Serial
+product SILABS	SAEL		0x8053	SA-EL USB
 product SILABS	ARGUSISP	0x8066	Argussoft ISP
 product SILABS	CRUMB128	0x807a	Crumb128 board
 product SILABS	DEGREE		0x80ca	Degree Controls Inc
@@ -2216,11 +2291,15 @@ product SOURCENEXT KEIKAI8	0x039f	Keikai
 product SOURCENEXT KEIKAI8_CHG	0x012e	KeikaiDenwa 8 with charger
 
 /* SparkLAN products */
-product SPARKLAN RT2573		0x0004	RT2573
+product SPARKLAN RT2573		0x0004	 RT2573
 
 /* Sphairon Access Systems GmbH products */
 product SPHAIRON UB801R		0x0110	UB801R
 
+/* Stelera Wireless products */
+product STELERA ZEROCD		0x1000	Zerocd Installer
+product STELERA C105		0x1002	Stelera/Bandrish C105 USB
+
 /* STMicroelectronics products */
 product STMICRO BIOCPU		0x2016	Biometric Coprocessor
 product STMICRO COMMUNICATOR	0x7554	USB Communicator
@@ -2238,8 +2317,13 @@ product SUNTAC AS144L4		0x0011	SUNTAC U-
 
 /* Sun Microsystems products */
 product SUN KEYBOARD		0x0005	Type 6 USB keyboard
+product SUN KEYBOARD_TYPE_7	0x00a2	Type 7 USB keyboard
 /* XXX The above is a North American PC style keyboard possibly */
 product SUN MOUSE		0x0100	Type 6 USB mouse
+product SUN KBD_HUB		0x100e	Kbd Hub
+
+/* Super Top products */
+product	SUPERTOP IDE		0x6600	USB-IDE
 
 /* Supra products */
 product DIAMOND2 SUPRAEXPRESS56K 0x07da	Supra Express 56K modem
@@ -2378,7 +2462,8 @@ product WACOM GRAPHIRE		0x0010	Graphire
 product WACOM GRAPHIRE3_4X5	0x0013	Graphire 3 4x5
 product WACOM INTUOSA5		0x0021	Intuos A5
 product WACOM GD0912U		0x0022	Intuos 9x12 Graphics Tablet
-
+/* WCH products*/
+product WCH CH341SER		0x5523	CH341/CH340 USB-Serial Bridge
 /* Western Digital products */
 product WESTERN COMBO		0x0200	Firewire USB Combo
 product WESTERN EXTHDD		0x0400	External HDD
@@ -2392,6 +2477,7 @@ product WINBOND UH104		0x5518	4-port USB
 product WINMAXGROUP FLASH64MC	0x6660	USB Flash Disk 64M-C
 
 /* Wistron NeWeb products */
+product WISTRONNEWEB UR045G	0x0427	PrismGT USB 2.0 WLAN
 product WISTRONNEWEB UR055G	0x0711	UR055G
 product WISTRONNEWEB AR5523_1	0x0826	AR5523
 product WISTRONNEWEB AR5523_1_NF	0x0827	AR5523 (no firmware)
@@ -2404,6 +2490,10 @@ product XEROX WCM15		0xffef	WorkCenter M
 /* Xirlink products */
 product XIRLINK PCCAM		0x8080	IBM PC Camera
 
+/* Xyratex products */
+product XYRATEX PRISM_GT_1	0x2000	PrismGT USB 2.0 WLAN
+product XYRATEX PRISM_GT_2	0x2002	PrismGT USB 2.0 WLAN
+
 /* Y-E Data products */
 product YEDATA FLASHBUSTERU	0x0000	Flashbuster-U
 
@@ -2419,10 +2509,14 @@ product YAMAHA RTW65I		0x4002	NetVolante
 product YANO U640MO		0x0101	U640MO-03
 product YANO FW800HD		0x05fc	METALWEAR-HDD
 
+/* Yiso Wireless Co. products */
+product	YISO C893		0xc893	CDMA 2000 1xEVDO PC Card
+
 /* Z-Com products */
 product ZCOM M4Y750		0x0001	M4Y-750
 product ZCOM XI725		0x0002	XI-725/726
 product ZCOM XI735		0x0005	XI-735
+product ZCOM XG703A		0x0008	PrismGT USB 2.0 WLAN
 product ZCOM ZD1211		0x0011	ZD1211
 product ZCOM AR5523		0x0012	AR5523
 product ZCOM AR5523_NF		0x0013	AR5523 driver (no firmware)

From owner-svn-src-all@FreeBSD.ORG  Mon Mar 23 04:07:46 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8C0C5106566B;
	Mon, 23 Mar 2009 04:07:46 +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 5ED8D8FC14;
	Mon, 23 Mar 2009 04:07:46 +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 n2N47kZZ093897;
	Mon, 23 Mar 2009 04:07:46 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2N47kLB093896;
	Mon, 23 Mar 2009 04:07:46 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200903230407.n2N47kLB093896@svn.freebsd.org>
From: Andrew Thompson 
Date: Mon, 23 Mar 2009 04:07:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190311 - stable/7/sys/dev/usb
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 23 Mar 2009 04:07:47 -0000

Author: thompsa
Date: Mon Mar 23 04:07:46 2009
New Revision: 190311
URL: http://svn.freebsd.org/changeset/base/190311

Log:
  Sync umass quirks to HEAD.

Modified:
  stable/7/sys/dev/usb/umass.c

Modified: stable/7/sys/dev/usb/umass.c
==============================================================================
--- stable/7/sys/dev/usb/umass.c	Mon Mar 23 04:06:21 2009	(r190310)
+++ stable/7/sys/dev/usb/umass.c	Mon Mar 23 04:07:46 2009	(r190311)
@@ -340,6 +340,10 @@ static struct umass_devdescr_t umass_dev
 	  UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
 	  NO_QUIRKS
 	},
+	{ USB_VENDOR_ALCOR, USB_PRODUCT_ALCOR_TRANSCEND, RID_WILDCARD,
+	  UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
+	  NO_GETMAXLUN
+	},
 	{ USB_VENDOR_ALCOR, USB_PRODUCT_ALCOR_UMCR_9361, RID_WILDCARD,
 	  UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
 	  NO_GETMAXLUN
@@ -414,7 +418,8 @@ static struct umass_devdescr_t umass_dev
 	},
 	{ USB_VENDOR_GENESYS,  USB_PRODUCT_GENESYS_GL641USB2IDE, RID_WILDCARD,
 	  UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
-	  FORCE_SHORT_INQUIRY | NO_START_STOP | IGNORE_RESIDUE
+	  FORCE_SHORT_INQUIRY | NO_START_STOP | IGNORE_RESIDUE |
+	  NO_SYNCHRONIZE_CACHE
 	},
 	{ USB_VENDOR_GENESYS,  USB_PRODUCT_GENESYS_GL641USB2IDE_2, RID_WILDCARD,
 	  UMASS_PROTO_ATAPI | UMASS_PROTO_BBB,
@@ -564,7 +569,11 @@ static struct umass_devdescr_t umass_dev
 	},
 	{ USB_VENDOR_MYSON,  USB_PRODUCT_MYSON_HEDEN, RID_WILDCARD,
 	  UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
-	  NO_INQUIRY | IGNORE_RESIDUE
+	  NO_INQUIRY | IGNORE_RESIDUE | NO_SYNCHRONIZE_CACHE
+	},
+	{ USB_VENDOR_MYSON, USB_PRODUCT_MYSON_STARREADER, RID_WILDCARD,
+	  UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
+	  NO_SYNCHRONIZE_CACHE
 	},
 	{ USB_VENDOR_NEODIO, USB_PRODUCT_NEODIO_ND3260, RID_WILDCARD,
 	  UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
@@ -798,6 +807,10 @@ static struct umass_devdescr_t umass_dev
 	  UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
 	  NO_QUIRKS
 	},
+	{ USB_VENDOR_SUPERTOP, USB_PRODUCT_SUPERTOP_IDE, RID_WILDCARD,
+	  UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
+	  IGNORE_RESIDUE | NO_SYNCHRONIZE_CACHE
+	},
 	{ USB_VENDOR_TAUGA, USB_PRODUCT_TAUGA_CAMERAMATE, RID_WILDCARD,
 	  UMASS_PROTO_SCSI,
 	  NO_QUIRKS
@@ -870,6 +883,10 @@ static struct umass_devdescr_t umass_dev
 	  UMASS_PROTO_ATAPI | UMASS_PROTO_CBI,
 	  NO_QUIRKS
 	},
+	{ USB_VENDOR_MEIZU, USB_PRODUCT_MEIZU_M6_SL, RID_WILDCARD,
+	  UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
+	  NO_INQUIRY | NO_SYNCHRONIZE_CACHE
+	},
 	{ VID_EOT, PID_EOT, RID_EOT, 0, 0 }
 };
 

From owner-svn-src-all@FreeBSD.ORG  Mon Mar 23 04:54:52 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C449D1065672;
	Mon, 23 Mar 2009 04:54:52 +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 B0C618FC26;
	Mon, 23 Mar 2009 04:54:52 +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 n2N4sqEC094855;
	Mon, 23 Mar 2009 04:54:52 GMT
	(envelope-from gshapiro@svn.freebsd.org)
Received: (from gshapiro@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2N4sqmG094854;
	Mon, 23 Mar 2009 04:54:52 GMT
	(envelope-from gshapiro@svn.freebsd.org)
Message-Id: <200903230454.n2N4sqmG094854@svn.freebsd.org>
From: Gregory Neil Shapiro 
Date: Mon, 23 Mar 2009 04:54:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190312 - in stable/7/etc: . mail periodic/weekly
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 23 Mar 2009 04:54:53 -0000

Author: gshapiro
Date: Mon Mar 23 04:54:52 2009
New Revision: 190312
URL: http://svn.freebsd.org/changeset/base/190312

Log:
  MFC r190304: Add the URL for RFC2142
  
  PR:		conf/127510

Modified:
  stable/7/etc/   (props changed)
  stable/7/etc/mail/aliases
  stable/7/etc/periodic/weekly/   (props changed)

Modified: stable/7/etc/mail/aliases
==============================================================================
--- stable/7/etc/mail/aliases	Mon Mar 23 04:07:46 2009	(r190311)
+++ stable/7/etc/mail/aliases	Mon Mar 23 04:54:52 2009	(r190312)
@@ -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-all@FreeBSD.ORG  Mon Mar 23 04:56:34 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 08A661065673;
	Mon, 23 Mar 2009 04:56:34 +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 E9B2A8FC1A;
	Mon, 23 Mar 2009 04:56:33 +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 n2N4uXrl094951;
	Mon, 23 Mar 2009 04:56:33 GMT
	(envelope-from gshapiro@svn.freebsd.org)
Received: (from gshapiro@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2N4uXWT094950;
	Mon, 23 Mar 2009 04:56:33 GMT
	(envelope-from gshapiro@svn.freebsd.org)
Message-Id: <200903230456.n2N4uXWT094950@svn.freebsd.org>
From: Gregory Neil Shapiro 
Date: Mon, 23 Mar 2009 04:56:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
X-SVN-Group: stable-6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190313 - in stable/6/etc: . mail
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 23 Mar 2009 04:56:34 -0000

Author: gshapiro
Date: Mon Mar 23 04:56:33 2009
New Revision: 190313
URL: http://svn.freebsd.org/changeset/base/190313

Log:
  MFC r190304: Add the URL for RFC2142
  
  PR:		conf/127510

Modified:
  stable/6/etc/   (props changed)
  stable/6/etc/mail/aliases

Modified: stable/6/etc/mail/aliases
==============================================================================
--- stable/6/etc/mail/aliases	Mon Mar 23 04:54:52 2009	(r190312)
+++ stable/6/etc/mail/aliases	Mon Mar 23 04:56:33 2009	(r190313)
@@ -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-all@FreeBSD.ORG  Mon Mar 23 05:46:29 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Mon Mar 23 08:33:20 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2C521106566B;
	Mon, 23 Mar 2009 08:33:20 +0000 (UTC)
	(envelope-from rodrigc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 178AD8FC08;
	Mon, 23 Mar 2009 08:33:20 +0000 (UTC)
	(envelope-from rodrigc@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 n2N8XJAu000496;
	Mon, 23 Mar 2009 08:33:19 GMT (envelope-from rodrigc@svn.freebsd.org)
Received: (from rodrigc@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2N8XJd2000495;
	Mon, 23 Mar 2009 08:33:19 GMT (envelope-from rodrigc@svn.freebsd.org)
Message-Id: <200903230833.n2N8XJd2000495@svn.freebsd.org>
From: Craig Rodrigues 
Date: Mon, 23 Mar 2009 08:33:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190315 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb nfsclient
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 23 Mar 2009 08:33:20 -0000

Author: rodrigc
Date: Mon Mar 23 08:33:19 2009
New Revision: 190315
URL: http://svn.freebsd.org/changeset/base/190315

Log:
  MFC 183005, 187812:
  
  Add code to parse mount options passed as individual
  items of the nmount() iovec.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/nfsclient/nfs_vfsops.c

Modified: stable/7/sys/nfsclient/nfs_vfsops.c
==============================================================================
--- stable/7/sys/nfsclient/nfs_vfsops.c	Mon Mar 23 05:46:28 2009	(r190314)
+++ stable/7/sys/nfsclient/nfs_vfsops.c	Mon Mar 23 08:33:19 2009	(r190315)
@@ -717,7 +717,15 @@ nfs_decode_args(struct mount *mp, struct
 	}
 }
 
-static const char *nfs_opts[] = { "from", "nfs_args", NULL };
+static const char *nfs_opts[] = { "from", "nfs_args",
+    "noatime", "noexec", "suiddir", "nosuid", "nosymfollow", "union",
+    "noclusterr", "noclusterw", "multilabel", "acls", "force", "update",
+    "async", "dumbtimer", "noconn", "nolockd", "intr", "rdirplus", "resvport",
+    "readdirsize", "soft", "hard", "mntudp", "tcp", "udp", "wsize", "rsize",
+    "retrans", "acregmin", "acregmax", "acdirmin", "acdirmax", 
+    "deadthresh", "hostname", "timeout", "addr", "fh", "nfsv3",
+    "maxgroups",
+    NULL };
 
 /*
  * VFS Operations.
@@ -732,13 +740,20 @@ static const char *nfs_opts[] = { "from"
 static int
 nfs_mount(struct mount *mp, struct thread *td)
 {
-	int error;
+	int error, ret, has_nfs_args_opt;
+	int has_addr_opt, has_fh_opt, has_hostname_opt;
 	struct nfs_args args;
 	struct sockaddr *nam;
 	struct vnode *vp;
 	char hst[MNAMELEN];
 	size_t len;
 	u_char nfh[NFSX_V3FHMAX];
+	char *opt;
+
+	has_nfs_args_opt = 0;
+	has_addr_opt = 0;
+	has_fh_opt = 0;
+	has_hostname_opt = 0;
 
 	if (vfs_filteropt(mp->mnt_optnew, nfs_opts)) {
 		error = EINVAL;
@@ -750,12 +765,223 @@ nfs_mount(struct mount *mp, struct threa
 		goto out;
 	}
 
-	error = vfs_copyopt(mp->mnt_optnew, "nfs_args", &args, sizeof args);
-	if (error)
-		goto out;
+	/*
+	 * The old mount_nfs program passed the struct nfs_args
+	 * from userspace to kernel.  The new mount_nfs program
+	 * passes string options via nmount() from userspace to kernel
+	 * and we populate the struct nfs_args in the kernel.
+	 */
+	if (vfs_getopt(mp->mnt_optnew, "nfs_args", NULL, NULL) == 0) {
+		error = vfs_copyopt(mp->mnt_optnew, "nfs_args", &args,
+		    sizeof args);
+		if (error)
+			goto out;
+
+		if (args.version != NFS_ARGSVERSION) {
+			error = EPROGMISMATCH;
+			goto out;
+		}
+		has_nfs_args_opt = 1;
+	}
 
-	if (args.version != NFS_ARGSVERSION) {
-		error = EPROGMISMATCH;
+	if (vfs_getopt(mp->mnt_optnew, "dumbtimer", NULL, NULL) == 0)
+		args.flags |= NFSMNT_DUMBTIMR;
+	if (vfs_getopt(mp->mnt_optnew, "noconn", NULL, NULL) == 0)
+		args.flags |= NFSMNT_NOCONN;
+	if (vfs_getopt(mp->mnt_optnew, "conn", NULL, NULL) == 0)
+		args.flags |= NFSMNT_NOCONN;
+	if (vfs_getopt(mp->mnt_optnew, "nolockd", NULL, NULL) == 0)
+		args.flags |= NFSMNT_NOLOCKD;
+	if (vfs_getopt(mp->mnt_optnew, "lockd", NULL, NULL) == 0)
+		args.flags &= ~NFSMNT_NOLOCKD;
+	if (vfs_getopt(mp->mnt_optnew, "intr", NULL, NULL) == 0)
+		args.flags |= NFSMNT_INT;
+	if (vfs_getopt(mp->mnt_optnew, "rdirplus", NULL, NULL) == 0)
+		args.flags |= NFSMNT_RDIRPLUS;
+	if (vfs_getopt(mp->mnt_optnew, "resvport", NULL, NULL) == 0)
+		args.flags |= NFSMNT_RESVPORT;
+	if (vfs_getopt(mp->mnt_optnew, "noresvport", NULL, NULL) == 0)
+		args.flags &= ~NFSMNT_RESVPORT;
+	if (vfs_getopt(mp->mnt_optnew, "soft", NULL, NULL) == 0)
+		args.flags |= NFSMNT_SOFT;
+	if (vfs_getopt(mp->mnt_optnew, "hard", NULL, NULL) == 0)
+		args.flags &= ~NFSMNT_SOFT;
+	if (vfs_getopt(mp->mnt_optnew, "mntudp", NULL, NULL) == 0)
+		args.sotype = SOCK_DGRAM;
+	if (vfs_getopt(mp->mnt_optnew, "udp", NULL, NULL) == 0)
+		args.sotype = SOCK_DGRAM;
+	if (vfs_getopt(mp->mnt_optnew, "tcp", NULL, NULL) == 0)
+		args.sotype = SOCK_STREAM;
+	if (vfs_getopt(mp->mnt_optnew, "nfsv3", NULL, NULL) == 0)
+		args.flags |= NFSMNT_NFSV3;
+	if (vfs_getopt(mp->mnt_optnew, "readdirsize", (void **)&opt, NULL) == 0) {
+		if (opt == NULL) { 
+			vfs_mount_error(mp, "illegal readdirsize");
+			error = EINVAL;
+			goto out;
+		}
+		ret = sscanf(opt, "%d", &args.readdirsize);
+		if (ret != 1 || args.readdirsize <= 0) {
+			vfs_mount_error(mp, "illegal readdirsize: %s",
+			    opt);
+			error = EINVAL;
+			goto out;
+		}
+		args.flags |= NFSMNT_READDIRSIZE;
+	}
+	if (vfs_getopt(mp->mnt_optnew, "readahead", (void **)&opt, NULL) == 0) {
+		if (opt == NULL) { 
+			vfs_mount_error(mp, "illegal readahead");
+			error = EINVAL;
+			goto out;
+		}
+		ret = sscanf(opt, "%d", &args.readahead);
+		if (ret != 1 || args.readahead <= 0) {
+			vfs_mount_error(mp, "illegal readahead: %s",
+			    opt);
+			error = EINVAL;
+			goto out;
+		}
+		args.flags |= NFSMNT_READAHEAD;
+	}
+	if (vfs_getopt(mp->mnt_optnew, "wsize", (void **)&opt, NULL) == 0) {
+		if (opt == NULL) { 
+			vfs_mount_error(mp, "illegal wsize");
+			error = EINVAL;
+			goto out;
+		}
+		ret = sscanf(opt, "%d", &args.wsize);
+		if (ret != 1 || args.wsize <= 0) {
+			vfs_mount_error(mp, "illegal wsize: %s",
+			    opt);
+			error = EINVAL;
+			goto out;
+		}
+		args.flags |= NFSMNT_WSIZE;
+	}
+	if (vfs_getopt(mp->mnt_optnew, "rsize", (void **)&opt, NULL) == 0) {
+		if (opt == NULL) { 
+			vfs_mount_error(mp, "illegal rsize");
+			error = EINVAL;
+			goto out;
+		}
+		ret = sscanf(opt, "%d", &args.rsize);
+		if (ret != 1 || args.rsize <= 0) {
+			vfs_mount_error(mp, "illegal wsize: %s",
+			    opt);
+			error = EINVAL;
+			goto out;
+		}
+		args.flags |= NFSMNT_RSIZE;
+	}
+	if (vfs_getopt(mp->mnt_optnew, "retrans", (void **)&opt, NULL) == 0) {
+		if (opt == NULL) { 
+			vfs_mount_error(mp, "illegal retrans");
+			error = EINVAL;
+			goto out;
+		}
+		ret = sscanf(opt, "%d", &args.retrans);
+		if (ret != 1 || args.retrans <= 0) {
+			vfs_mount_error(mp, "illegal retrans: %s",
+			    opt);
+			error = EINVAL;
+			goto out;
+		}
+		args.flags |= NFSMNT_RETRANS;
+	}
+	if (vfs_getopt(mp->mnt_optnew, "acregmin", (void **)&opt, NULL) == 0) {
+		ret = sscanf(opt, "%d", &args.acregmin);
+		if (ret != 1 || args.acregmin < 0) {
+			vfs_mount_error(mp, "illegal acregmin: %s",
+			    opt);
+			error = EINVAL;
+			goto out;
+		}
+		args.flags |= NFSMNT_ACREGMIN;
+	}
+	if (vfs_getopt(mp->mnt_optnew, "acregmax", (void **)&opt, NULL) == 0) {
+		ret = sscanf(opt, "%d", &args.acregmax);
+		if (ret != 1 || args.acregmax < 0) {
+			vfs_mount_error(mp, "illegal acregmax: %s",
+			    opt);
+			error = EINVAL;
+			goto out;
+		}
+		args.flags |= NFSMNT_ACREGMAX;
+	}
+	if (vfs_getopt(mp->mnt_optnew, "acdirmin", (void **)&opt, NULL) == 0) {
+		ret = sscanf(opt, "%d", &args.acdirmin);
+		if (ret != 1 || args.acdirmin < 0) {
+			vfs_mount_error(mp, "illegal acdirmin: %s",
+			    opt);
+			error = EINVAL;
+			goto out;
+		}
+		args.flags |= NFSMNT_ACDIRMIN;
+	}
+	if (vfs_getopt(mp->mnt_optnew, "acdirmax", (void **)&opt, NULL) == 0) {
+		ret = sscanf(opt, "%d", &args.acdirmax);
+		if (ret != 1 || args.acdirmax < 0) {
+			vfs_mount_error(mp, "illegal acdirmax: %s",
+			    opt);
+			error = EINVAL;
+			goto out;
+		}
+		args.flags |= NFSMNT_ACDIRMAX;
+	}
+	if (vfs_getopt(mp->mnt_optnew, "deadthresh", (void **)&opt, NULL) == 0) {
+		ret = sscanf(opt, "%d", &args.deadthresh);
+		if (ret != 1 || args.deadthresh <= 0) {
+			vfs_mount_error(mp, "illegal deadthresh: %s",
+			    opt);
+			error = EINVAL;
+			goto out;
+		}
+		args.flags |= NFSMNT_DEADTHRESH;
+	}
+	if (vfs_getopt(mp->mnt_optnew, "timeout", (void **)&opt, NULL) == 0) {
+		ret = sscanf(opt, "%d", &args.timeo);
+		if (ret != 1 || args.timeo <= 0) {
+			vfs_mount_error(mp, "illegal timeout: %s",
+			    opt);
+			error = EINVAL;
+			goto out;
+		}
+		args.flags |= NFSMNT_TIMEO;
+	}
+	if (vfs_getopt(mp->mnt_optnew, "maxgroups", (void **)&opt, NULL) == 0) {
+		ret = sscanf(opt, "%d", &args.maxgrouplist);
+		if (ret != 1 || args.timeo <= 0) {
+			vfs_mount_error(mp, "illegal maxgroups: %s",
+			    opt);
+			error = EINVAL;
+			goto out;
+		}
+		args.flags |= NFSMNT_MAXGRPS;
+	}
+	if (vfs_getopt(mp->mnt_optnew, "addr", (void **)&args.addr,
+		&args.addrlen) == 0) {
+		has_addr_opt = 1;
+		if (args.addrlen > SOCK_MAXADDRLEN) {
+			error = ENAMETOOLONG;
+			goto out;
+		}
+		MALLOC(nam, struct sockaddr *, args.addrlen, M_SONAME,
+		    M_WAITOK);
+		bcopy(args.addr, nam, args.addrlen);
+		nam->sa_len = args.addrlen;
+	}
+	if (vfs_getopt(mp->mnt_optnew, "fh", (void **)&args.fh,
+		&args.fhsize) == 0) {
+		has_fh_opt = 1;
+	}
+	if (vfs_getopt(mp->mnt_optnew, "hostname", (void **)&args.hostname,
+		NULL) == 0) {
+		has_hostname_opt = 1;
+	}
+	if (args.hostname == NULL) {
+		vfs_mount_error(mp, "Invalid hostname");
+		error = EINVAL;
 		goto out;
 	}
 	if (mp->mnt_flag & MNT_UPDATE) {
@@ -788,23 +1014,38 @@ nfs_mount(struct mount *mp, struct threa
 	 */
 	if (nfs_ip_paranoia == 0)
 		args.flags |= NFSMNT_NOCONN;
-	if (args.fhsize < 0 || args.fhsize > NFSX_V3FHMAX) {
-		error = EINVAL;
-		goto out;
+
+	if (has_nfs_args_opt) {
+		/*
+		 * In the 'nfs_args' case, the pointers in the args
+		 * structure are in userland - we copy them in here.
+		 */
+		if (!has_fh_opt) {
+			error = copyin((caddr_t)args.fh, (caddr_t)nfh,
+			    args.fhsize);
+			if (error) {
+				goto out;
+			}
+			args.fh = nfh;
+		}
+		if (!has_hostname_opt) {
+			error = copyinstr(args.hostname, hst, MNAMELEN-1, &len);
+			if (error) {
+				goto out;
+			}
+			bzero(&hst[len], MNAMELEN - len);
+			args.hostname = hst;
+		}
+		if (!has_addr_opt) {
+			/* sockargs() call must be after above copyin() calls */
+			error = getsockaddr(&nam, (caddr_t)args.addr,
+			    args.addrlen);
+			if (error) {
+				goto out;
+			}
+		}
 	}
-	error = copyin((caddr_t)args.fh, (caddr_t)nfh, args.fhsize);
-	if (error)
-		goto out;
-	error = copyinstr(args.hostname, hst, MNAMELEN-1, &len);
-	if (error)
-		goto out;
-	bzero(&hst[len], MNAMELEN - len);
-	/* sockargs() call must be after above copyin() calls */
-	error = getsockaddr(&nam, (caddr_t)args.addr, args.addrlen);
-	if (error)
-		goto out;
-	args.fh = nfh;
-	error = mountnfs(&args, mp, nam, hst, &vp, td->td_ucred);
+	error = mountnfs(&args, mp, nam, args.hostname, &vp, td->td_ucred);
 out:
 	if (!error) {
 		MNT_ILOCK(mp);

From owner-svn-src-all@FreeBSD.ORG  Mon Mar 23 09:00:33 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BBC67106566B;
	Mon, 23 Mar 2009 09:00:33 +0000 (UTC)
	(envelope-from maxim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A7D7D8FC0A;
	Mon, 23 Mar 2009 09:00:33 +0000 (UTC)
	(envelope-from maxim@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 n2N90Xu5001149;
	Mon, 23 Mar 2009 09:00:33 GMT (envelope-from maxim@svn.freebsd.org)
Received: (from maxim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2N90XbS001147;
	Mon, 23 Mar 2009 09:00:33 GMT (envelope-from maxim@svn.freebsd.org)
Message-Id: <200903230900.n2N90XbS001147@svn.freebsd.org>
From: Maxim Konovalov 
Date: Mon, 23 Mar 2009 09:00:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190316 - stable/7/usr.sbin/gstat
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 23 Mar 2009 09:00:34 -0000

Author: maxim
Date: Mon Mar 23 09:00:33 2009
New Revision: 190316
URL: http://svn.freebsd.org/changeset/base/190316

Log:
  MFC r175118: when the ms/req fields exceed 1 second, drop the fractions
  to fit more digits.
  MFC r183665: batch mode.
  MFC r189738: fix man page sinopsys; remove BUG section.
  MFC r189739: turn the batch mode on if stdout is not tty.
  > Description of fields to fill in above:                     76 columns --|
  > PR:            If a GNATS PR is affected by the change.
  > Submitted by:  If someone else sent in the change.
  > Reviewed by:   If someone else reviewed your modification.
  > Approved by:   If you needed approval for this commit.
  > Obtained from: If the change is from a third party.
  > MFC after:     N [day[s]|week[s]|month[s]].  Request a reminder email.
  > Security:      Vulnerability reference (one per line) or description.
  > Empty fields above will be automatically removed.
  
  _M   gstat
  M    gstat/gstat.c
  M    gstat/gstat.8

Modified:
  stable/7/usr.sbin/gstat/   (props changed)
  stable/7/usr.sbin/gstat/gstat.8
  stable/7/usr.sbin/gstat/gstat.c

Modified: stable/7/usr.sbin/gstat/gstat.8
==============================================================================
--- stable/7/usr.sbin/gstat/gstat.8	Mon Mar 23 08:33:19 2009	(r190315)
+++ stable/7/usr.sbin/gstat/gstat.8	Mon Mar 23 09:00:33 2009	(r190316)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 20, 2006
+.Dd March 12, 2009
 .Dt GSTAT 8
 .Os
 .Sh NAME
@@ -32,7 +32,7 @@
 .Nd print statistics about GEOM disks
 .Sh SYNOPSIS
 .Nm
-.Op Fl acd
+.Op Fl abcd
 .Op Fl f Ar filter
 .Op Fl I Ar interval
 .Sh DESCRIPTION
@@ -46,6 +46,10 @@ The options are as follows:
 .Bl -tag -width indent
 .It Fl a
 Only display providers that are at least 0.1% busy.
+.It Fl b
+Batch mode.
+Collect numbers, print and exit.
+Default if stdout is not a tty.
 .It Fl c
 Enable display of
 .Xr geom 4
@@ -90,15 +94,3 @@ A
 .Nm
 utility appeared in
 .Fx 5.0 .
-.Sh BUGS
-The
-.Nm
-utility only works interactively.
-It should probably detect when it is run non-interactively and produce
-simple
-.Tn ASCII
-text output.
-Otherwise, this utility should probably be folded into
-.Xr systat 1
-which only works interactively and is the obvious utility to run for
-various other forms of system statistics.

Modified: stable/7/usr.sbin/gstat/gstat.c
==============================================================================
--- stable/7/usr.sbin/gstat/gstat.c	Mon Mar 23 08:33:19 2009	(r190315)
+++ stable/7/usr.sbin/gstat/gstat.c	Mon Mar 23 09:00:33 2009	(r190316)
@@ -51,9 +51,16 @@
 #include 
 #include 
 
-static int flag_a, flag_c, flag_d;
+static int flag_a, flag_b, flag_c, flag_d;
 static int flag_I = 1000000;
 
+#define PRINTMSG(...) do {						\
+		if (flag_b && !loop)					\
+			printf(__VA_ARGS__);				\
+		else if (!flag_b)					\
+			printw(__VA_ARGS__);				\
+	} while(0)
+
 static void usage(void);
 
 static const char*
@@ -67,7 +74,7 @@ int
 main(int argc, char **argv)
 {
 	int error, i, quit;
-	int curx, cury, maxx, maxy, line_len, max_flen;
+	int curx, cury, maxx, maxy, line_len, loop, max_flen;
 	struct devstat *gsp, *gsq;
 	void *sp, *sq;
 	double dt;
@@ -87,12 +94,24 @@ main(int argc, char **argv)
 	History *hist;
 	HistEvent hist_ev;
 
+	hist = NULL;
+	el = NULL;
+	maxx = -1;
+	curx = -1;
+	loop = 1;
+	/* Turn on batch mode if output is not tty. */
+	if (!isatty(fileno(stdout)))
+		flag_b = 1;
+
 	f_s[0] = '\0';
-	while ((i = getopt(argc, argv, "adcf:I:")) != -1) {
+	while ((i = getopt(argc, argv, "adcf:I:b")) != -1) {
 		switch (i) {
 		case 'a':
 			flag_a = 1;
 			break;
+		case 'b':
+			flag_b = 1;
+			break;
 		case 'c':
 			flag_c = 1;
 			break;
@@ -141,34 +160,36 @@ main(int argc, char **argv)
 	sq = geom_stats_snapshot_get();
 	if (sq == NULL)
 		err(1, "geom_stats_snapshot()");
-	/* Setup curses */
-	initscr();
-	start_color();
-	use_default_colors();
-	pair_content(0, &cf, &cb);
-	init_pair(1, COLOR_GREEN, cb);
-	init_pair(2, COLOR_MAGENTA, cb);
-	init_pair(3, COLOR_RED, cb);
-	cbreak();
-	noecho();
-	nonl();
-	nodelay(stdscr, 1);
-	intrflush(stdscr, FALSE);
-	keypad(stdscr, TRUE);
-	/* Setup libedit */
-	hist = history_init();
-	if (hist == NULL)
-		err(EX_SOFTWARE, "history_init()");
-	history(hist, &hist_ev, H_SETSIZE, 100);
-	el = el_init("gstat", stdin, stdout, stderr);
-	if (el == NULL)
-		err(EX_SOFTWARE, "el_init");
-	el_set(el, EL_EDITOR, "emacs");
-	el_set(el, EL_SIGNAL, 1);
-	el_set(el, EL_HIST, history, hist);
-	el_set(el, EL_PROMPT, el_prompt);
-	if (f_s[0] != '\0')
-		history(hist, &hist_ev, H_ENTER, f_s);
+	if (!flag_b) {
+		/* Setup curses */
+		initscr();
+		start_color();
+		use_default_colors();
+		pair_content(0, &cf, &cb);
+		init_pair(1, COLOR_GREEN, cb);
+		init_pair(2, COLOR_MAGENTA, cb);
+		init_pair(3, COLOR_RED, cb);
+		cbreak();
+		noecho();
+		nonl();
+		nodelay(stdscr, 1);
+		intrflush(stdscr, FALSE);
+		keypad(stdscr, TRUE);
+		/* Setup libedit */
+		hist = history_init();
+		if (hist == NULL)
+			err(EX_SOFTWARE, "history_init()");
+		history(hist, &hist_ev, H_SETSIZE, 100);
+		el = el_init("gstat", stdin, stdout, stderr);
+		if (el == NULL)
+			err(EX_SOFTWARE, "el_init");
+		el_set(el, EL_EDITOR, "emacs");
+		el_set(el, EL_SIGNAL, 1);
+		el_set(el, EL_HIST, history, hist);
+		el_set(el, EL_PROMPT, el_prompt);
+		if (f_s[0] != '\0')
+			history(hist, &hist_ev, H_ENTER, f_s);
+	}
 	geom_stats_snapshot_timestamp(sq, &tq);
 	for (quit = 0; !quit;) {
 		sp = geom_stats_snapshot_get();
@@ -182,12 +203,13 @@ main(int argc, char **argv)
 		geom_stats_snapshot_reset(sp);
 		geom_stats_snapshot_reset(sq);
 		move(0,0);
-		printw("dT: %5.3fs  w: %.3fs",
-		    dt, (float)flag_I / 1000000);
+		PRINTMSG("dT: %5.3fs  w: %.3fs", dt, (float)flag_I / 1000000);
 		if (f_s[0] != '\0') {
-			printw("  filter: ");
-			getyx(stdscr, cury, curx);
-			getmaxyx(stdscr, maxy, maxx);
+			PRINTMSG("  filter: ");
+			if (!flag_b) {
+				getyx(stdscr, cury, curx);
+				getmaxyx(stdscr, maxy, maxx);
+			}
 			strncpy(pf_s, f_s, sizeof(pf_s));
 			max_flen = maxx - curx - 1;
 			if ((int)strlen(f_s) > max_flen && max_flen >= 0) {
@@ -199,15 +221,15 @@ main(int argc, char **argv)
 					pf_s[max_flen - 1] = '.';
 				pf_s[max_flen] = '\0';
 			}
-			printw("%s", pf_s);
+			PRINTMSG("%s", pf_s);
 		}
-		printw("\n");
-		printw(" L(q)  ops/s   ");
-		printw(" r/s   kBps   ms/r   ");
-		printw(" w/s   kBps   ms/w   ");
+		PRINTMSG("\n");
+		PRINTMSG(" L(q)  ops/s   ");
+		PRINTMSG(" r/s   kBps   ms/r   ");
+		PRINTMSG(" w/s   kBps   ms/w   ");
 		if (flag_d)
-			printw(" d/s   kBps   ms/d   ");
-		printw("%%busy Name\n");
+			PRINTMSG(" d/s   kBps   ms/d   ");
+		PRINTMSG("%%busy Name\n");
 		for (;;) {
 			gsp = geom_stats_snapshot_next(sp);
 			gsq = geom_stats_snapshot_next(sq);
@@ -228,9 +250,11 @@ main(int argc, char **argv)
 			if (gid->lg_what == ISCONSUMER && !flag_c)
 				continue;
 			/* Do not print past end of window */
-			getyx(stdscr, cury, curx);
-			if (curx > 0)
-				continue;
+			if (!flag_b) {
+				getyx(stdscr, cury, curx);
+				if (curx > 0)
+					continue;
+			}
 			if ((gid->lg_what == ISPROVIDER
 			    || gid->lg_what == ISCONSUMER) && f_s[0] != '\0') {
 				pp = gid->lg_ptr;
@@ -239,7 +263,7 @@ main(int argc, char **argv)
 				  continue;
 			}
 			if (gsp->sequence0 != gsp->sequence1) {
-				printw("*\n");
+				PRINTMSG("*\n");
 				continue;
 			}
 			devstat_compute_statistics(gsp, gsq, dt, 
@@ -265,19 +289,28 @@ main(int argc, char **argv)
 				continue;
 			}
 
-			printw(" %4ju", (uintmax_t)u64);
-			printw(" %6.0f", (double)ld[0]);
-			printw(" %6.0f", (double)ld[1]);
-			printw(" %6.0f", (double)ld[2] * 1024);
-			printw(" %6.1f", (double)ld[3]);
-			printw(" %6.0f", (double)ld[4]);
-			printw(" %6.0f", (double)ld[5] * 1024);
-			printw(" %6.1f", (double)ld[6]);
+			PRINTMSG(" %4ju", (uintmax_t)u64);
+			PRINTMSG(" %6.0f", (double)ld[0]);
+			PRINTMSG(" %6.0f", (double)ld[1]);
+			PRINTMSG(" %6.0f", (double)ld[2] * 1024);
+			if (ld[3] > 1e3) 
+				PRINTMSG(" %6.0f", (double)ld[3]);
+			else
+				PRINTMSG(" %6.1f", (double)ld[3]);
+			PRINTMSG(" %6.0f", (double)ld[4]);
+			PRINTMSG(" %6.0f", (double)ld[5] * 1024);
+			if (ld[6] > 1e3) 
+				PRINTMSG(" %6.0f", (double)ld[6]);
+			else
+				PRINTMSG(" %6.1f", (double)ld[6]);
 
 			if (flag_d) {
-				printw(" %6.0f", (double)ld[8]);
-				printw(" %6.0f", (double)ld[9] * 1024);
-				printw(" %6.1f", (double)ld[10]);
+				PRINTMSG(" %6.0f", (double)ld[8]);
+				PRINTMSG(" %6.0f", (double)ld[9] * 1024);
+				if (ld[10] > 1e3) 
+					PRINTMSG(" %6.0f", (double)ld[10]);
+				else
+					PRINTMSG(" %6.1f", (double)ld[10]);
 			}
 
 			if (ld[7] > 80)
@@ -286,27 +319,40 @@ main(int argc, char **argv)
 				i = 2;
 			else 
 				i = 1;
-			attron(COLOR_PAIR(i));
-			printw(" %6.1lf", (double)ld[7]);
-			attroff(COLOR_PAIR(i));
-			printw("|");
+			if (!flag_b)
+				attron(COLOR_PAIR(i));
+			PRINTMSG(" %6.1lf", (double)ld[7]);
+			if (!flag_b) {
+				attroff(COLOR_PAIR(i));
+				PRINTMSG("|");
+			} else
+				PRINTMSG(" ");
 			if (gid == NULL) {
-				printw(" ??");
+				PRINTMSG(" ??");
 			} else if (gid->lg_what == ISPROVIDER) {
 				pp = gid->lg_ptr;
-				printw(" %s", pp->lg_name);
+				PRINTMSG(" %s", pp->lg_name);
 			} else if (gid->lg_what == ISCONSUMER) {
 				cp = gid->lg_ptr;
-				printw(" %s/%s/%s",
+				PRINTMSG(" %s/%s/%s",
 				    cp->lg_geom->lg_class->lg_name,
 				    cp->lg_geom->lg_name,
 				    cp->lg_provider->lg_name);
 			}
-			clrtoeol();
-			printw("\n");
+			if (!flag_b)
+				clrtoeol();
+			PRINTMSG("\n");
 			*gsq = *gsp;
 		}
 		geom_stats_snapshot_free(sp);
+		if (flag_b) {
+			/* We loop extra to make sure we get the information. */
+			if (!loop)
+				break;
+			loop = 0;
+			usleep(flag_I);
+			continue;
+		}
 		getyx(stdscr, cury, curx);
 		getmaxyx(stdscr, maxy, maxx);
 		clrtobot();
@@ -369,15 +415,17 @@ main(int argc, char **argv)
 		}
 	}
 
-	endwin();
-	el_end(el);
+	if (!flag_b) {
+		endwin();
+		el_end(el);
+	}
 	exit(EX_OK);
 }
 
 static void
 usage(void)
 {
-	fprintf(stderr, "usage: gstat [-acd] [-f filter] [-I interval]\n");
+	fprintf(stderr, "usage: gstat [-abcd] [-f filter] [-I interval]\n");
 	exit(EX_USAGE);
         /* NOTREACHED */
 }

From owner-svn-src-all@FreeBSD.ORG  Mon Mar 23 11:07:34 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Mon Mar 23 12:07:30 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F222710658BB;
	Mon, 23 Mar 2009 12:07:29 +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 BBC6E8FC12;
	Mon, 23 Mar 2009 12:07:29 +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 n2NC7TIC008833;
	Mon, 23 Mar 2009 12:07:29 GMT (envelope-from jamie@svn.freebsd.org)
Received: (from jamie@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NC7Tl8008829;
	Mon, 23 Mar 2009 12:07:29 GMT (envelope-from jamie@svn.freebsd.org)
Message-Id: <200903231207.n2NC7Tl8008829@svn.freebsd.org>
From: Jamie Gritton 
Date: Mon, 23 Mar 2009 12:07:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190318 - in stable/7: sbin/ifconfig sys sys/contrib/pf
	sys/dev/ath/ath_hal sys/dev/cxgb sys/net
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 23 Mar 2009 12:08:03 -0000

Author: jamie
Date: Mon Mar 23 12:07:29 2009
New Revision: 190318
URL: http://svn.freebsd.org/changeset/base/190318

Log:
  MFC:
  
   r189864:
     Default to AF_LOCAL instead of AF_INET sockets for non-family-specific
     operations.  This allows the query operations to work in non-IPv4 jails,
     and will be necessary in a future of possible non-INET networking.
     (reprise r189970)
  
   r190151:
     Call the interface's if_ioctl from ifioctl(), if the protocol didn't
     handle the ioctl.  There are other paths that already call it, but this
     allows for a non-interface socket (like AF_LOCAL which ifconfig now
     uses) to use a broader class of interface ioctls.
  
  Approved by:	bz (mentor)

Modified:
  stable/7/sbin/ifconfig/   (props changed)
  stable/7/sbin/ifconfig/ifclone.c
  stable/7/sbin/ifconfig/ifconfig.c
  stable/7/sbin/ifconfig/ifgroup.c
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/net/if.c

Modified: stable/7/sbin/ifconfig/ifclone.c
==============================================================================
--- stable/7/sbin/ifconfig/ifclone.c	Mon Mar 23 11:07:34 2009	(r190317)
+++ stable/7/sbin/ifconfig/ifclone.c	Mon Mar 23 12:07:29 2009	(r190318)
@@ -53,9 +53,9 @@ list_cloners(void)
 	int idx;
 	int s;
 
-	s = socket(AF_INET, SOCK_DGRAM, 0);
+	s = socket(AF_LOCAL, SOCK_DGRAM, 0);
 	if (s == -1)
-		err(1, "socket(AF_INET,SOCK_DGRAM)");
+		err(1, "socket(AF_LOCAL,SOCK_DGRAM)");
 
 	memset(&ifcr, 0, sizeof(ifcr));
 

Modified: stable/7/sbin/ifconfig/ifconfig.c
==============================================================================
--- stable/7/sbin/ifconfig/ifconfig.c	Mon Mar 23 11:07:34 2009	(r190317)
+++ stable/7/sbin/ifconfig/ifconfig.c	Mon Mar 23 12:07:29 2009	(r190318)
@@ -434,21 +434,22 @@ static const struct cmd setifdstaddr_cmd
 	DEF_CMD("ifdstaddr", 0, setifdstaddr);
 
 static int
-ifconfig(int argc, char *const *argv, int iscreate, const struct afswtch *afp)
+ifconfig(int argc, char *const *argv, int iscreate, const struct afswtch *uafp)
 {
-	const struct afswtch *nafp;
+	const struct afswtch *afp, *nafp;
 	struct callback *cb;
 	int s;
 
 	strncpy(ifr.ifr_name, name, sizeof ifr.ifr_name);
+	afp = uafp != NULL ? uafp : af_getbyname("inet");
 top:
-	if (afp == NULL)
-		afp = af_getbyname("inet");
 	ifr.ifr_addr.sa_family =
 		afp->af_af == AF_LINK || afp->af_af == AF_UNSPEC ?
-		AF_INET : afp->af_af;
+		AF_LOCAL : afp->af_af;
 
-	if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0)
+	if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0 &&
+	    (uafp != NULL || errno != EPROTONOSUPPORT ||
+	     (s = socket(AF_LOCAL, SOCK_DGRAM, 0)) < 0))
 		err(1, "socket(family %u,SOCK_DGRAM", ifr.ifr_addr.sa_family);
 
 	while (argc > 0) {
@@ -792,11 +793,12 @@ status(const struct afswtch *afp, const 
 
 	if (afp == NULL) {
 		allfamilies = 1;
-		afp = af_getbyname("inet");
-	} else
+		ifr.ifr_addr.sa_family = AF_LOCAL;
+	} else {
 		allfamilies = 0;
-
-	ifr.ifr_addr.sa_family = afp->af_af == AF_LINK ? AF_INET : afp->af_af;
+		ifr.ifr_addr.sa_family =
+		    afp->af_af == AF_LINK ? AF_LOCAL : afp->af_af;
+	}
 	strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
 
 	s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0);

Modified: stable/7/sbin/ifconfig/ifgroup.c
==============================================================================
--- stable/7/sbin/ifconfig/ifgroup.c	Mon Mar 23 11:07:34 2009	(r190317)
+++ stable/7/sbin/ifconfig/ifgroup.c	Mon Mar 23 12:07:29 2009	(r190318)
@@ -131,9 +131,9 @@ printgroup(const char *groupname)
 	int			 len, cnt = 0;
 	int			 s;
 
-	s = socket(AF_INET, SOCK_DGRAM, 0);
+	s = socket(AF_LOCAL, SOCK_DGRAM, 0);
 	if (s == -1)
-		err(1, "socket(AF_INET,SOCK_DGRAM)");
+		err(1, "socket(AF_LOCAL,SOCK_DGRAM)");
 	bzero(&ifgr, sizeof(ifgr));
 	strlcpy(ifgr.ifgr_name, groupname, sizeof(ifgr.ifgr_name));
 	if (ioctl(s, SIOCGIFGMEMB, (caddr_t)&ifgr) == -1) {

Modified: stable/7/sys/net/if.c
==============================================================================
--- stable/7/sys/net/if.c	Mon Mar 23 11:07:34 2009	(r190317)
+++ stable/7/sys/net/if.c	Mon Mar 23 12:07:29 2009	(r190318)
@@ -1968,6 +1968,8 @@ ifioctl(struct socket *so, u_long cmd, c
 	error = ((*so->so_proto->pr_usrreqs->pru_control)(so, cmd,
 								 data,
 								 ifp, td));
+	if (error == EOPNOTSUPP && ifp != NULL && ifp->if_ioctl != NULL)
+		error = (*ifp->if_ioctl)(ifp, cmd, data);
 #else
 	{
 		int ocmd = cmd;
@@ -2009,6 +2011,9 @@ ifioctl(struct socket *so, u_long cmd, c
 								   cmd,
 								   data,
 								   ifp, td));
+		if (error == EOPNOTSUPP && ifp != NULL &&
+		    ifp->if_ioctl != NULL)
+			error = (*ifp->if_ioctl)(ifp, cmd, data);
 		switch (ocmd) {
 
 		case OSIOCGIFADDR:

From owner-svn-src-all@FreeBSD.ORG  Mon Mar 23 12:52:03 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C3EAA106564A;
	Mon, 23 Mar 2009 12:52:03 +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 93F4A8FC2D;
	Mon, 23 Mar 2009 12:52:03 +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 4189746B6C;
	Mon, 23 Mar 2009 08:52:03 -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 n2NCpvNx052767;
	Mon, 23 Mar 2009 08:51:57 -0400 (EDT) (envelope-from jhb@freebsd.org)
From: John Baldwin 
To: Craig Rodrigues 
Date: Mon, 23 Mar 2009 08:42:01 -0400
User-Agent: KMail/1.9.7
References: <200903212116.n2LLG589047158@svn.freebsd.org>
In-Reply-To: <200903212116.n2LLG589047158@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200903230842.01826.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]);
	Mon, 23 Mar 2009 08:51:57 -0400 (EDT)
X-Virus-Scanned: ClamAV 0.94.2/9151/Mon Mar 23 01:23:57 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-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-7@freebsd.org
Subject: Re: svn commit: r190217 - in stable/7/etc: defaults rc.d
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 23 Mar 2009 12:52:04 -0000

On Saturday 21 March 2009 5:16:05 pm Craig Rodrigues wrote:
> Author: rodrigc
> Date: Sat Mar 21 21:16:05 2009
> New Revision: 190217
> URL: http://svn.freebsd.org/changeset/base/190217
> 
> Log:
>   MFC r182460:
>   
>   Add the ability to run /usr/sbin/crashinfo on a new core dump 
automatically
>   during boot.  Right now this is disabled by default, but it can be enabled
>   by setting 'crashinfo_enable=YES' in rc.conf.

This isn't quite right and is why I haven't merged it yet.  You only want to 
run crashinfo if savecore found an actual crash dump.

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Mon Mar 23 14:36:51 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Mon Mar 23 14:42:41 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Mon Mar 23 14:53:22 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 44677106566B;
	Mon, 23 Mar 2009 14:53:22 +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 16E458FC30;
	Mon, 23 Mar 2009 14:53:22 +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 n2NErLP5012457;
	Mon, 23 Mar 2009 14:53:21 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NErLZL012455;
	Mon, 23 Mar 2009 14:53:21 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <200903231453.n2NErLZL012455@svn.freebsd.org>
From: Doug Barton 
Date: Mon, 23 Mar 2009 14:53:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190321 - stable/7/usr.sbin/mergemaster
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 23 Mar 2009 14:53:23 -0000

Author: dougb
Date: Mon Mar 23 14:53:21 2009
New Revision: 190321
URL: http://svn.freebsd.org/changeset/base/190321

Log:
  MFC 190320, don't expand example $FreeBSD strings

Modified:
  stable/7/usr.sbin/mergemaster/   (props changed)
  stable/7/usr.sbin/mergemaster/mergemaster.8
  stable/7/usr.sbin/mergemaster/mergemaster.sh

Modified: stable/7/usr.sbin/mergemaster/mergemaster.8
==============================================================================
--- stable/7/usr.sbin/mergemaster/mergemaster.8	Mon Mar 23 14:42:41 2009	(r190320)
+++ stable/7/usr.sbin/mergemaster/mergemaster.8	Mon Mar 23 14:53:21 2009	(r190321)
@@ -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: stable/7/usr.sbin/mergemaster/mergemaster.sh
==============================================================================
--- stable/7/usr.sbin/mergemaster/mergemaster.sh	Mon Mar 23 14:42:41 2009	(r190320)
+++ stable/7/usr.sbin/mergemaster/mergemaster.sh	Mon Mar 23 14:53:21 2009	(r190321)
@@ -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-all@FreeBSD.ORG  Mon Mar 23 14:54:01 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AE6A01065673;
	Mon, 23 Mar 2009 14:54:01 +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 829228FC2A;
	Mon, 23 Mar 2009 14:54:01 +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 n2NEs1so012521;
	Mon, 23 Mar 2009 14:54:01 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NEs1NO012519;
	Mon, 23 Mar 2009 14:54:01 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <200903231454.n2NEs1NO012519@svn.freebsd.org>
From: Doug Barton 
Date: Mon, 23 Mar 2009 14:54:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
X-SVN-Group: stable-6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190322 - stable/6/usr.sbin/mergemaster
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 23 Mar 2009 14:54:02 -0000

Author: dougb
Date: Mon Mar 23 14:54:01 2009
New Revision: 190322
URL: http://svn.freebsd.org/changeset/base/190322

Log:
  MFC 190320, don't expand example $FreeBSD strings

Modified:
  stable/6/usr.sbin/mergemaster/   (props changed)
  stable/6/usr.sbin/mergemaster/mergemaster.8
  stable/6/usr.sbin/mergemaster/mergemaster.sh

Modified: stable/6/usr.sbin/mergemaster/mergemaster.8
==============================================================================
--- stable/6/usr.sbin/mergemaster/mergemaster.8	Mon Mar 23 14:53:21 2009	(r190321)
+++ stable/6/usr.sbin/mergemaster/mergemaster.8	Mon Mar 23 14:54:01 2009	(r190322)
@@ -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: stable/6/usr.sbin/mergemaster/mergemaster.sh
==============================================================================
--- stable/6/usr.sbin/mergemaster/mergemaster.sh	Mon Mar 23 14:53:21 2009	(r190321)
+++ stable/6/usr.sbin/mergemaster/mergemaster.sh	Mon Mar 23 14:54:01 2009	(r190322)
@@ -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-all@FreeBSD.ORG  Mon Mar 23 16:01:54 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 25BBD106564A;
	Mon, 23 Mar 2009 16:01:54 +0000 (UTC)
	(envelope-from jh@saunalahti.fi)
Received: from gw01.mail.saunalahti.fi (gw01.mail.saunalahti.fi
	[195.197.172.115])
	by mx1.freebsd.org (Postfix) with ESMTP id D4E1F8FC18;
	Mon, 23 Mar 2009 16:01:53 +0000 (UTC)
	(envelope-from jh@saunalahti.fi)
Received: from a91-153-125-115.elisa-laajakaista.fi
	(a91-153-125-115.elisa-laajakaista.fi [91.153.125.115])
	by gw01.mail.saunalahti.fi (Postfix) with SMTP id EBF97151861;
	Mon, 23 Mar 2009 17:45:36 +0200 (EET)
Date: Mon, 23 Mar 2009 17:45:36 +0200
From: Jaakko Heinonen 
To: Sam Leffler 
Message-ID: <20090323154536.GA2853@a91-153-125-115.elisa-laajakaista.fi>
References: <200903190028.n2J0SsTa042656@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200903190028.n2J0SsTa042656@svn.freebsd.org>
User-Agent: Mutt/1.5.18 (2008-05-17)
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-7@freebsd.org
Subject: Re: svn commit: r190006 - in stable/7/usr.sbin: . makefs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 23 Mar 2009 16:01:54 -0000

On 2009-03-19, Sam Leffler wrote:
> Log:
>   MFC makefs: a tool for creating a file system image from a directory tree

FYI, images created with sector size (-S option) other than 512 don't
work on FreeBSD. (PR 131341)

Sector size affects to the value of the fs_fsbtodb super block field.
Looks like FreeBSD ffs requires that it's always calculated with
DEV_BSIZE (512). newfs(8) sets the sector size to DEV_BSIZE before
calculating fs_fsbtodb (however the code is marked with XXX).

Here is a workaround to recalculate fs_fsbtodb at mount time if it's not
based on DEV_BSIZE:

http://www.saunalahti.fi/~jh3/patches/ffs-fs_fsbtodb.diff

-- 
Jaakko

From owner-svn-src-all@FreeBSD.ORG  Mon Mar 23 16:20:39 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Mon Mar 23 16:49:00 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Mon Mar 23 17:51:08 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Mon Mar 23 18:04:22 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 794081065675;
	Mon, 23 Mar 2009 18:04:22 +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 4BAFE8FC20;
	Mon, 23 Mar 2009 18:04:22 +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 n2NI4M2Y016658;
	Mon, 23 Mar 2009 18:04:22 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NI4MAe016657;
	Mon, 23 Mar 2009 18:04:22 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200903231804.n2NI4MAe016657@svn.freebsd.org>
From: John Baldwin 
Date: Mon, 23 Mar 2009 18:04:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190326 - in stable/7/etc: . periodic/weekly
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 23 Mar 2009 18:04:24 -0000

Author: jhb
Date: Mon Mar 23 18:04:22 2009
New Revision: 190326
URL: http://svn.freebsd.org/changeset/base/190326

Log:
  Merge 187210 to /etc to consolidate mergeinfo.

Modified:
  stable/7/etc/   (props changed)
  stable/7/etc/periodic/weekly/   (props changed)

From owner-svn-src-all@FreeBSD.ORG  Mon Mar 23 18:13:18 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CA772106564A;
	Mon, 23 Mar 2009 18:13:18 +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 B7BD98FC20;
	Mon, 23 Mar 2009 18:13:18 +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 n2NIDIei016878;
	Mon, 23 Mar 2009 18:13:18 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NIDIkx016877;
	Mon, 23 Mar 2009 18:13:18 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200903231813.n2NIDIkx016877@svn.freebsd.org>
From: Andrew Thompson 
Date: Mon, 23 Mar 2009 18:13:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190327 - stable/7/sys/dev/usb
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 23 Mar 2009 18:13:20 -0000

Author: thompsa
Date: Mon Mar 23 18:13:18 2009
New Revision: 190327
URL: http://svn.freebsd.org/changeset/base/190327

Log:
  MFC r189905
  
  Fix checking of the IGNORE_RESIDUE quirk.
  
  Submitted by:	marius

Modified:
  stable/7/sys/dev/usb/umass.c

Modified: stable/7/sys/dev/usb/umass.c
==============================================================================
--- stable/7/sys/dev/usb/umass.c	Mon Mar 23 18:04:22 2009	(r190326)
+++ stable/7/sys/dev/usb/umass.c	Mon Mar 23 18:13:18 2009	(r190327)
@@ -1872,6 +1872,7 @@ umass_bbb_state(usbd_xfer_handle xfer, u
 {
 	struct umass_softc *sc = (struct umass_softc *) priv;
 	usbd_xfer_handle next_xfer;
+	int Residue;
 
 	KASSERT(sc->proto & UMASS_PROTO_BBB,
 		("%s: umass_bbb_state: wrong sc->proto 0x%02x\n",
@@ -2056,10 +2057,8 @@ umass_bbb_state(usbd_xfer_handle xfer, u
 				USETDW(sc->csw.dCSWSignature, CSWSIGNATURE);
 		}
 
-		int Residue;
 		Residue = UGETDW(sc->csw.dCSWDataResidue);
-		if (Residue == 0 &&
-		    sc->transfer_datalen - sc->transfer_actlen != 0)
+		if (Residue == 0 || (sc->quirks & IGNORE_RESIDUE))
 			Residue = sc->transfer_datalen - sc->transfer_actlen;
 
 		/* Check CSW and handle any error */

From owner-svn-src-all@FreeBSD.ORG  Mon Mar 23 19:10:38 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Mon Mar 23 19:27:24 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Mon Mar 23 19:58:27 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Mon Mar 23 20:18:07 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Mon Mar 23 20:23:28 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BF80B1065678;
	Mon, 23 Mar 2009 20:23:28 +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 ACEE78FC08;
	Mon, 23 Mar 2009 20:23:28 +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 n2NKNSBk020671;
	Mon, 23 Mar 2009 20:23:28 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NKNSlf020670;
	Mon, 23 Mar 2009 20:23:28 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200903232023.n2NKNSlf020670@svn.freebsd.org>
From: John Baldwin 
Date: Mon, 23 Mar 2009 20:23:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190332 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 23 Mar 2009 20:23:29 -0000

Author: jhb
Date: Mon Mar 23 20:23:28 2009
New Revision: 190332
URL: http://svn.freebsd.org/changeset/base/190332

Log:
  MFC: Move the debug.hashstat sysctl tree under DIAGNOSTIC.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/kern/vfs_cache.c

Modified: stable/7/sys/kern/vfs_cache.c
==============================================================================
--- stable/7/sys/kern/vfs_cache.c	Mon Mar 23 20:18:06 2009	(r190331)
+++ stable/7/sys/kern/vfs_cache.c	Mon Mar 23 20:23:28 2009	(r190332)
@@ -179,6 +179,7 @@ static MALLOC_DEFINE(M_VFSCACHE, "vfscac
  */
 #define NCF_WHITE	1
 
+#ifdef DIAGNOSTIC
 /*
  * Grab an atomic snapshot of the name cache hash chain lengths
  */
@@ -259,6 +260,7 @@ sysctl_debug_hashstat_nchash(SYSCTL_HAND
 SYSCTL_PROC(_debug_hashstat, OID_AUTO, nchash, CTLTYPE_INT|CTLFLAG_RD|
 	CTLFLAG_MPSAFE, 0, 0, sysctl_debug_hashstat_nchash, "I",
 	"nchash chain lengths");
+#endif
 
 /*
  * cache_zap():

From owner-svn-src-all@FreeBSD.ORG  Mon Mar 23 20:29:54 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A7224106566C;
	Mon, 23 Mar 2009 20:29:54 +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 952718FC34;
	Mon, 23 Mar 2009 20:29:54 +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 n2NKTsQ3020863;
	Mon, 23 Mar 2009 20:29:54 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NKTsP3020862;
	Mon, 23 Mar 2009 20:29:54 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200903232029.n2NKTsP3020862@svn.freebsd.org>
From: John Baldwin 
Date: Mon, 23 Mar 2009 20:29:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190333 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 23 Mar 2009 20:29:55 -0000

Author: jhb
Date: Mon Mar 23 20:29:54 2009
New Revision: 190333
URL: http://svn.freebsd.org/changeset/base/190333

Log:
  MFC: Export the current values of nbuf, ncallout, and nswbuf via read-only
  sysctls that match the tunable names.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/kern/subr_param.c

Modified: stable/7/sys/kern/subr_param.c
==============================================================================
--- stable/7/sys/kern/subr_param.c	Mon Mar 23 20:23:28 2009	(r190332)
+++ stable/7/sys/kern/subr_param.c	Mon Mar 23 20:29:54 2009	(r190333)
@@ -87,6 +87,12 @@ 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, 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");
+SYSCTL_INT(_kern, OID_AUTO, nswbuf, CTLFLAG_RDTUN, &nswbuf, 0,
+    "Number of swap buffers");
 SYSCTL_INT(_kern, OID_AUTO, maxswzone, CTLFLAG_RDTUN, &maxswzone, 0,
     "max swmeta KVA storage");
 SYSCTL_INT(_kern, OID_AUTO, maxbcache, CTLFLAG_RDTUN, &maxbcache, 0,

From owner-svn-src-all@FreeBSD.ORG  Mon Mar 23 20:37:38 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9BF8C1065670;
	Mon, 23 Mar 2009 20:37:38 +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 A15D78FC29;
	Mon, 23 Mar 2009 20:37:37 +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 n2NKbbj3021052;
	Mon, 23 Mar 2009 20:37:37 GMT (envelope-from vanhu@svn.freebsd.org)
Received: (from vanhu@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NKbb8M021051;
	Mon, 23 Mar 2009 20:37:37 GMT (envelope-from vanhu@svn.freebsd.org)
Message-Id: <200903232037.n2NKbb8M021051@svn.freebsd.org>
From: VANHULLEBUS Yvan 
Date: Mon, 23 Mar 2009 20:37:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190334 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb netipsec
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 23 Mar 2009 20:37:40 -0000

Author: vanhu
Date: Mon Mar 23 20:37:37 2009
New Revision: 190334
URL: http://svn.freebsd.org/changeset/base/190334

Log:
  SAs are valid (but dying) when they reached soft lifetime,
  even if they have never been used.
  
  Approved by:	gnn(mentor)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/netipsec/key.c

Modified: stable/7/sys/netipsec/key.c
==============================================================================
--- stable/7/sys/netipsec/key.c	Mon Mar 23 20:29:54 2009	(r190333)
+++ stable/7/sys/netipsec/key.c	Mon Mar 23 20:37:37 2009	(r190334)
@@ -4109,22 +4109,20 @@ key_flush_sad(time_t now)
 			/* check SOFT lifetime */
 			if (sav->lft_s->addtime != 0 &&
 			    now - sav->created > sav->lft_s->addtime) {
-				/*
-				 * check SA to be used whether or not.
-				 * when SA hasn't been used, delete it.
+				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)
 				 */
-				if (sav->lft_c->usetime == 0) {
-					key_sa_chgstate(sav, SADB_SASTATE_DEAD);
-					KEY_FREESAV(&sav);
-				} else {
-					key_sa_chgstate(sav, SADB_SASTATE_DYING);
-					/*
-					 * XXX If we keep to send expire
-					 * message in the status of
-					 * DYING. Do remove below code.
-					 */
+				if (sav->lft_c->usetime != 0)
 					key_expire(sav);
-				}
 			}
 			/* check SOFT lifetime by bytes */
 			/*

From owner-svn-src-all@FreeBSD.ORG  Mon Mar 23 20:53:39 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1BAD810657D9;
	Mon, 23 Mar 2009 20:53:39 +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 07F438FC2A;
	Mon, 23 Mar 2009 20:53:39 +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 n2NKrcND021385;
	Mon, 23 Mar 2009 20:53:38 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NKrc2O021383;
	Mon, 23 Mar 2009 20:53:38 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903232053.n2NKrc2O021383@svn.freebsd.org>
From: Marius Strobl 
Date: Mon, 23 Mar 2009 20:53:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190335 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/bge dev/cxgb
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 23 Mar 2009 20:53:40 -0000

Author: marius
Date: Mon Mar 23 20:53:38 2009
New Revision: 190335
URL: http://svn.freebsd.org/changeset/base/190335

Log:
  MFC: r190194
  
  - In bge_ifmedia_upd_locked() take advantrage of LIST_FOREACH().
  - If boot verbose, print asicrev, chiprev and bus type on attach.
  - For PCI Express devices:
    1) Adjust max read request size to 4Kbytes
    2) Turn on FIFO_LONG_BURST in RDMA during bge_blockinit()
    Though 1) does not seem to have much to do with the poor TX performance
    observed on PCI Express bge(4), 2) does fix the problem. [1]
  - Nuke the RX CPU self-diag, which prevents working cards from working
    (Linux tg3 does not have this diag neither does OpenBSD's bge(4)).
    The increasing of the firmware handshaking timeout to 20000 retries
    done as part of the original commit isn't merged as way already have a
    way higher BGE_TIMEOUT of 100000.
  
  PR:		119361 [1]
  Obtained from:	tg3 via DragonflyBSD [1], DragonflyBSD

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/bge/if_bge.c
  stable/7/sys/dev/bge/if_bgereg.h
  stable/7/sys/dev/cxgb/   (props changed)

Modified: stable/7/sys/dev/bge/if_bge.c
==============================================================================
--- stable/7/sys/dev/bge/if_bge.c	Mon Mar 23 20:37:37 2009	(r190334)
+++ stable/7/sys/dev/bge/if_bge.c	Mon Mar 23 20:53:38 2009	(r190335)
@@ -384,6 +384,7 @@ static uint32_t bge_readreg_ind(struct b
 #endif
 static void bge_writemem_direct(struct bge_softc *, int, int);
 static void bge_writereg_ind(struct bge_softc *, int, int);
+static void bge_set_max_readrq(struct bge_softc *, int);
 
 static int bge_miibus_readreg(device_t, int, int);
 static int bge_miibus_writereg(device_t, int, int, int);
@@ -523,6 +524,34 @@ bge_writemem_ind(struct bge_softc *sc, i
 	pci_write_config(dev, BGE_PCI_MEMWIN_BASEADDR, 0, 4);
 }
 
+/*
+ * PCI Express only
+ */
+static void
+bge_set_max_readrq(struct bge_softc *sc, int expr_ptr)
+{
+	device_t dev;
+	uint16_t val;
+
+	KASSERT((sc->bge_flags & BGE_FLAG_PCIE) && expr_ptr != 0,
+	    ("%s: not applicable", __func__));
+
+	dev = sc->bge_dev;
+
+	val = pci_read_config(dev, expr_ptr + BGE_PCIE_DEVCTL, 2);
+	if ((val & BGE_PCIE_DEVCTL_MAX_READRQ_MASK) !=
+	    BGE_PCIE_DEVCTL_MAX_READRQ_4096) {
+		if (bootverbose)
+			device_printf(dev, "adjust device control 0x%04x ",
+			    val);
+		val &= ~BGE_PCIE_DEVCTL_MAX_READRQ_MASK;
+		val |= BGE_PCIE_DEVCTL_MAX_READRQ_4096;
+		pci_write_config(dev, expr_ptr + BGE_PCIE_DEVCTL, val, 2);
+		if (bootverbose)
+			printf("-> 0x%04x\n", val);
+	}
+}
+
 #ifdef notdef
 static uint32_t
 bge_readreg_ind(struct bge_softc *sc, int off)
@@ -1278,18 +1307,6 @@ bge_chipinit(struct bge_softc *sc)
 	/* Set endianness before we access any non-PCI registers. */
 	pci_write_config(sc->bge_dev, BGE_PCI_MISC_CTL, BGE_INIT, 4);
 
-	/*
-	 * Check the 'ROM failed' bit on the RX CPU to see if
-	 * self-tests passed. Skip this check when there's no
-	 * chip containing the Ethernet address fitted, since
-	 * in that case it will always fail.
-	 */
-	if ((sc->bge_flags & BGE_FLAG_EADDR) &&
-	    CSR_READ_4(sc, BGE_RXCPU_MODE) & BGE_RXCPUMODE_ROMFAIL) {
-		device_printf(sc->bge_dev, "RX CPU self-diagnostics failed!\n");
-		return (ENODEV);
-	}
-
 	/* Clear the MAC control register */
 	CSR_WRITE_4(sc, BGE_MAC_MODE, 0);
 
@@ -1742,14 +1759,18 @@ bge_blockinit(struct bge_softc *sc)
 	/* Enable host coalescing bug fix. */
 	if (sc->bge_asicrev == BGE_ASICREV_BCM5755 ||
 	    sc->bge_asicrev == BGE_ASICREV_BCM5787)
-			val |= 1 << 29;
+		val |= 1 << 29;
 
 	/* Turn on write DMA state machine */
 	CSR_WRITE_4(sc, BGE_WDMA_MODE, val);
+	DELAY(40);
 
 	/* Turn on read DMA state machine */
-	CSR_WRITE_4(sc, BGE_RDMA_MODE,
-	    BGE_RDMAMODE_ENABLE | BGE_RDMAMODE_ALL_ATTNS);
+	val = BGE_RDMAMODE_ENABLE | BGE_RDMAMODE_ALL_ATTNS;
+	if (sc->bge_flags & BGE_FLAG_PCIE)
+		val |= BGE_RDMAMODE_FIFO_LONG_BURST;
+	CSR_WRITE_4(sc, BGE_RDMA_MODE, val);
+	DELAY(40);
 
 	/* Turn on RX data completion state machine */
 	CSR_WRITE_4(sc, BGE_RDC_MODE, BGE_RDCMODE_ENABLE);
@@ -2387,7 +2408,7 @@ bge_attach(device_t dev)
 		goto fail;
 	}
 
-	/* Save ASIC rev. */
+	/* Save various chip information. */
 	sc->bge_chipid =
 	    pci_read_config(dev, BGE_PCI_MISC_CTL, 4) &
 	    BGE_PCIMISCCTL_ASICREV;
@@ -2470,14 +2491,17 @@ bge_attach(device_t dev)
 		 * Found a PCI Express capabilities register, this
 		 * must be a PCI Express device.
 		 */
-		if (reg != 0)
+		if (reg != 0) {
 			sc->bge_flags |= BGE_FLAG_PCIE;
 #else
 	if (BGE_IS_5705_PLUS(sc)) {
 		reg = pci_read_config(dev, BGE_PCIE_CAPID_REG, 4);
-		if ((reg & 0xFF) == BGE_PCIE_CAPID)
+		if ((reg & 0xFF) == BGE_PCIE_CAPID) {
 			sc->bge_flags |= BGE_FLAG_PCIE;
+			reg = BGE_PCIE_CAPID;
 #endif
+			bge_set_max_readrq(sc, reg);
+		}
 	} else {
 		/*
 		 * Check if the device is in PCI-X Mode.
@@ -2522,6 +2546,13 @@ bge_attach(device_t dev)
 		goto fail;
 	}
 
+	if (bootverbose)
+		device_printf(dev,
+		    "CHIP ID 0x%08x; ASIC REV 0x%02x; CHIP REV 0x%02x; %s\n",
+		    sc->bge_chipid, sc->bge_asicrev, sc->bge_chiprev,
+		    (sc->bge_flags & BGE_FLAG_PCIX) ? "PCI-X" :
+		    ((sc->bge_flags & BGE_FLAG_PCIE) ? "PCI-E" : "PCI"));
+
 	BGE_LOCK_INIT(sc, device_get_nameunit(dev));
 
 	/* Try to reset the chip. */
@@ -3882,6 +3913,7 @@ bge_ifmedia_upd_locked(struct ifnet *ifp
 {
 	struct bge_softc *sc = ifp->if_softc;
 	struct mii_data *mii;
+	struct mii_softc *miisc;
 	struct ifmedia *ifm;
 
 	BGE_LOCK_ASSERT(sc);
@@ -3932,12 +3964,9 @@ bge_ifmedia_upd_locked(struct ifnet *ifp
 
 	sc->bge_link_evt++;
 	mii = device_get_softc(sc->bge_miibus);
-	if (mii->mii_instance) {
-		struct mii_softc *miisc;
-		for (miisc = LIST_FIRST(&mii->mii_phys); miisc != NULL;
-		    miisc = LIST_NEXT(miisc, mii_list))
+	if (mii->mii_instance)
+		LIST_FOREACH(miisc, &mii->mii_phys, mii_list)
 			mii_phy_reset(miisc);
-	}
 	mii_mediachg(mii);
 
 	/*

Modified: stable/7/sys/dev/bge/if_bgereg.h
==============================================================================
--- stable/7/sys/dev/bge/if_bgereg.h	Mon Mar 23 20:37:37 2009	(r190334)
+++ stable/7/sys/dev/bge/if_bgereg.h	Mon Mar 23 20:53:38 2009	(r190335)
@@ -176,6 +176,22 @@
 #define	BGE_PCI_MSI_ADDR_LO		0x60
 #define	BGE_PCI_MSI_DATA		0x64
 
+/*
+ * PCI Express definitions
+ * According to
+ * PCI Express base specification, REV. 1.0a
+ */
+
+/* PCI Express device control, 16bits */
+#define	BGE_PCIE_DEVCTL			0x08
+#define	BGE_PCIE_DEVCTL_MAX_READRQ_MASK	0x7000
+#define	BGE_PCIE_DEVCTL_MAX_READRQ_128	0x0000
+#define	BGE_PCIE_DEVCTL_MAX_READRQ_256	0x1000
+#define	BGE_PCIE_DEVCTL_MAX_READRQ_512	0x2000
+#define	BGE_PCIE_DEVCTL_MAX_READRQ_1024	0x3000
+#define	BGE_PCIE_DEVCTL_MAX_READRQ_2048	0x4000
+#define	BGE_PCIE_DEVCTL_MAX_READRQ_4096	0x5000
+
 /* PCI MSI. ??? */
 #define	BGE_PCIE_CAPID_REG		0xD0
 #define	BGE_PCIE_CAPID			0x10
@@ -1359,6 +1375,8 @@
 #define	BGE_RDMAMODE_PCI_FIFOOREAD_ATTN	0x00000100
 #define	BGE_RDMAMODE_LOCWRITE_TOOBIG	0x00000200
 #define	BGE_RDMAMODE_ALL_ATTNS		0x000003FC
+#define	BGE_RDMAMODE_FIFO_SIZE_128	0x00020000
+#define	BGE_RDMAMODE_FIFO_LONG_BURST	0x00030000
 
 /* Read DMA status register */
 #define	BGE_RDMASTAT_PCI_TGT_ABRT_ATTN	0x00000004

From owner-svn-src-all@FreeBSD.ORG  Mon Mar 23 20:53:50 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DD5F510656C4;
	Mon, 23 Mar 2009 20:53:50 +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 CA4898FC1E;
	Mon, 23 Mar 2009 20:53:50 +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 n2NKroSb021425;
	Mon, 23 Mar 2009 20:53:50 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NKro6V021423;
	Mon, 23 Mar 2009 20:53:50 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903232053.n2NKro6V021423@svn.freebsd.org>
From: Marius Strobl 
Date: Mon, 23 Mar 2009 20:53:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
X-SVN-Group: stable-6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190336 - in stable/6/sys: . contrib/pf dev/bge dev/cxgb
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 23 Mar 2009 20:53:52 -0000

Author: marius
Date: Mon Mar 23 20:53:50 2009
New Revision: 190336
URL: http://svn.freebsd.org/changeset/base/190336

Log:
  MFC: r190194
  
  - In bge_ifmedia_upd_locked() take advantrage of LIST_FOREACH().
  - If boot verbose, print asicrev, chiprev and bus type on attach.
  - For PCI Express devices:
    1) Adjust max read request size to 4Kbytes
    2) Turn on FIFO_LONG_BURST in RDMA during bge_blockinit()
    Though 1) does not seem to have much to do with the poor TX performance
    observed on PCI Express bge(4), 2) does fix the problem. [1]
  - Nuke the RX CPU self-diag, which prevents working cards from working
    (Linux tg3 does not have this diag neither does OpenBSD's bge(4)).
    The increasing of the firmware handshaking timeout to 20000 retries
    done as part of the original commit isn't merged as way already have a
    way higher BGE_TIMEOUT of 100000.
  
  PR:		119361 [1]
  Obtained from:	tg3 via DragonflyBSD [1], DragonflyBSD

Modified:
  stable/6/sys/   (props changed)
  stable/6/sys/contrib/pf/   (props changed)
  stable/6/sys/dev/bge/if_bge.c
  stable/6/sys/dev/bge/if_bgereg.h
  stable/6/sys/dev/cxgb/   (props changed)

Modified: stable/6/sys/dev/bge/if_bge.c
==============================================================================
--- stable/6/sys/dev/bge/if_bge.c	Mon Mar 23 20:53:38 2009	(r190335)
+++ stable/6/sys/dev/bge/if_bge.c	Mon Mar 23 20:53:50 2009	(r190336)
@@ -383,6 +383,7 @@ static uint32_t bge_readreg_ind(struct b
 #endif
 static void bge_writemem_direct(struct bge_softc *, int, int);
 static void bge_writereg_ind(struct bge_softc *, int, int);
+static void bge_set_max_readrq(struct bge_softc *, int);
 
 static int bge_miibus_readreg(device_t, int, int);
 static int bge_miibus_writereg(device_t, int, int, int);
@@ -521,6 +522,34 @@ bge_writemem_ind(struct bge_softc *sc, i
 	pci_write_config(dev, BGE_PCI_MEMWIN_BASEADDR, 0, 4);
 }
 
+/*
+ * PCI Express only
+ */
+static void
+bge_set_max_readrq(struct bge_softc *sc, int expr_ptr)
+{
+	device_t dev;
+	uint16_t val;
+
+	KASSERT((sc->bge_flags & BGE_FLAG_PCIE) && expr_ptr != 0,
+	    ("%s: not applicable", __func__));
+
+	dev = sc->bge_dev;
+
+	val = pci_read_config(dev, expr_ptr + BGE_PCIE_DEVCTL, 2);
+	if ((val & BGE_PCIE_DEVCTL_MAX_READRQ_MASK) !=
+	    BGE_PCIE_DEVCTL_MAX_READRQ_4096) {
+		if (bootverbose)
+			device_printf(dev, "adjust device control 0x%04x ",
+			    val);
+		val &= ~BGE_PCIE_DEVCTL_MAX_READRQ_MASK;
+		val |= BGE_PCIE_DEVCTL_MAX_READRQ_4096;
+		pci_write_config(dev, expr_ptr + BGE_PCIE_DEVCTL, val, 2);
+		if (bootverbose)
+			printf("-> 0x%04x\n", val);
+	}
+}
+
 #ifdef notdef
 static uint32_t
 bge_readreg_ind(struct bge_softc *sc, int off)
@@ -1261,18 +1290,6 @@ bge_chipinit(struct bge_softc *sc)
 	/* Set endianness before we access any non-PCI registers. */
 	pci_write_config(sc->bge_dev, BGE_PCI_MISC_CTL, BGE_INIT, 4);
 
-	/*
-	 * Check the 'ROM failed' bit on the RX CPU to see if
-	 * self-tests passed. Skip this check when there's no
-	 * chip containing the Ethernet address fitted, since
-	 * in that case it will always fail.
-	 */
-	if ((sc->bge_flags & BGE_FLAG_EADDR) &&
-	    CSR_READ_4(sc, BGE_RXCPU_MODE) & BGE_RXCPUMODE_ROMFAIL) {
-		device_printf(sc->bge_dev, "RX CPU self-diagnostics failed!\n");
-		return (ENODEV);
-	}
-
 	/* Clear the MAC control register */
 	CSR_WRITE_4(sc, BGE_MAC_MODE, 0);
 
@@ -1736,14 +1753,18 @@ bge_blockinit(struct bge_softc *sc)
 	/* Enable host coalescing bug fix. */
 	if (sc->bge_asicrev == BGE_ASICREV_BCM5755 ||
 	    sc->bge_asicrev == BGE_ASICREV_BCM5787)
-			val |= 1 << 29;
+		val |= 1 << 29;
 
 	/* Turn on write DMA state machine */
 	CSR_WRITE_4(sc, BGE_WDMA_MODE, val);
+	DELAY(40);
 
 	/* Turn on read DMA state machine */
-	CSR_WRITE_4(sc, BGE_RDMA_MODE,
-	    BGE_RDMAMODE_ENABLE | BGE_RDMAMODE_ALL_ATTNS);
+	val = BGE_RDMAMODE_ENABLE | BGE_RDMAMODE_ALL_ATTNS;
+	if (sc->bge_flags & BGE_FLAG_PCIE)
+		val |= BGE_RDMAMODE_FIFO_LONG_BURST;
+	CSR_WRITE_4(sc, BGE_RDMA_MODE, val);
+	DELAY(40);
 
 	/* Turn on RX data completion state machine */
 	CSR_WRITE_4(sc, BGE_RDC_MODE, BGE_RDCMODE_ENABLE);
@@ -2383,8 +2404,7 @@ bge_attach(device_t dev)
 	sc->bge_btag = rman_get_bustag(sc->bge_res);
 	sc->bge_bhandle = rman_get_bushandle(sc->bge_res);
 
-	/* Save ASIC rev. */
-
+	/* Save various chip information. */
 	sc->bge_chipid =
 	    pci_read_config(dev, BGE_PCI_MISC_CTL, 4) &
 	    BGE_PCIMISCCTL_ASICREV;
@@ -2457,14 +2477,17 @@ bge_attach(device_t dev)
 		 * Found a PCI Express capabilities register, this
 		 * must be a PCI Express device.
 		 */
-		if (reg != 0)
+		if (reg != 0) {
 			sc->bge_flags |= BGE_FLAG_PCIE;
 #else
 	if (BGE_IS_5705_PLUS(sc)) {
 		reg = pci_read_config(dev, BGE_PCIE_CAPID_REG, 4);
-		if ((reg & 0xFF) == BGE_PCIE_CAPID)
+		if ((reg & 0xFF) == BGE_PCIE_CAPID) {
 			sc->bge_flags |= BGE_FLAG_PCIE;
+			reg = BGE_PCIE_CAPID;
 #endif
+			bge_set_max_readrq(sc, reg);
+		}
 	} else {
 		/*
 		 * Check if the device is in PCI-X Mode.
@@ -2509,6 +2532,13 @@ bge_attach(device_t dev)
 		goto fail;
 	}
 
+	if (bootverbose)
+		device_printf(dev,
+		    "CHIP ID 0x%08x; ASIC REV 0x%02x; CHIP REV 0x%02x; %s\n",
+		    sc->bge_chipid, sc->bge_asicrev, sc->bge_chiprev,
+		    (sc->bge_flags & BGE_FLAG_PCIX) ? "PCI-X" :
+		    ((sc->bge_flags & BGE_FLAG_PCIE) ? "PCI-E" : "PCI"));
+
 	BGE_LOCK_INIT(sc, device_get_nameunit(dev));
 
 	/* Try to reset the chip. */
@@ -3860,6 +3890,7 @@ bge_ifmedia_upd_locked(struct ifnet *ifp
 {
 	struct bge_softc *sc = ifp->if_softc;
 	struct mii_data *mii;
+	struct mii_softc *miisc;
 	struct ifmedia *ifm;
 
 	BGE_LOCK_ASSERT(sc);
@@ -3910,12 +3941,9 @@ bge_ifmedia_upd_locked(struct ifnet *ifp
 
 	sc->bge_link_evt++;
 	mii = device_get_softc(sc->bge_miibus);
-	if (mii->mii_instance) {
-		struct mii_softc *miisc;
-		for (miisc = LIST_FIRST(&mii->mii_phys); miisc != NULL;
-		    miisc = LIST_NEXT(miisc, mii_list))
+	if (mii->mii_instance)
+		LIST_FOREACH(miisc, &mii->mii_phys, mii_list)
 			mii_phy_reset(miisc);
-	}
 	mii_mediachg(mii);
 
 	return (0);

Modified: stable/6/sys/dev/bge/if_bgereg.h
==============================================================================
--- stable/6/sys/dev/bge/if_bgereg.h	Mon Mar 23 20:53:38 2009	(r190335)
+++ stable/6/sys/dev/bge/if_bgereg.h	Mon Mar 23 20:53:50 2009	(r190336)
@@ -176,6 +176,22 @@
 #define	BGE_PCI_MSI_ADDR_LO		0x60
 #define	BGE_PCI_MSI_DATA		0x64
 
+/*
+ * PCI Express definitions
+ * According to
+ * PCI Express base specification, REV. 1.0a
+ */
+
+/* PCI Express device control, 16bits */
+#define	BGE_PCIE_DEVCTL			0x08
+#define	BGE_PCIE_DEVCTL_MAX_READRQ_MASK	0x7000
+#define	BGE_PCIE_DEVCTL_MAX_READRQ_128	0x0000
+#define	BGE_PCIE_DEVCTL_MAX_READRQ_256	0x1000
+#define	BGE_PCIE_DEVCTL_MAX_READRQ_512	0x2000
+#define	BGE_PCIE_DEVCTL_MAX_READRQ_1024	0x3000
+#define	BGE_PCIE_DEVCTL_MAX_READRQ_2048	0x4000
+#define	BGE_PCIE_DEVCTL_MAX_READRQ_4096	0x5000
+
 /* PCI MSI. ??? */
 #define	BGE_PCIE_CAPID_REG		0xD0
 #define	BGE_PCIE_CAPID			0x10
@@ -1357,6 +1373,8 @@
 #define	BGE_RDMAMODE_PCI_FIFOOREAD_ATTN	0x00000100
 #define	BGE_RDMAMODE_LOCWRITE_TOOBIG	0x00000200
 #define	BGE_RDMAMODE_ALL_ATTNS		0x000003FC
+#define	BGE_RDMAMODE_FIFO_SIZE_128	0x00020000
+#define	BGE_RDMAMODE_FIFO_LONG_BURST	0x00030000
 
 /* Read DMA status register */
 #define	BGE_RDMASTAT_PCI_TGT_ABRT_ATTN	0x00000004

From owner-svn-src-all@FreeBSD.ORG  Mon Mar 23 21:16:22 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Mon Mar 23 21:32:03 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B04AB1065720;
	Mon, 23 Mar 2009 21:32:03 +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 9CECF8FC0C;
	Mon, 23 Mar 2009 21:32:03 +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 n2NLW3MA022185;
	Mon, 23 Mar 2009 21:32:03 GMT (envelope-from luigi@svn.freebsd.org)
Received: (from luigi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NLW3Mv022184;
	Mon, 23 Mar 2009 21:32:03 GMT (envelope-from luigi@svn.freebsd.org)
Message-Id: <200903232132.n2NLW3Mv022184@svn.freebsd.org>
From: Luigi Rizzo 
Date: Mon, 23 Mar 2009 21:32:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190338 - stable/7/release/picobsd/build
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 23 Mar 2009 21:32:05 -0000

Author: luigi
Date: Mon Mar 23 21:32:03 2009
New Revision: 190338
URL: http://svn.freebsd.org/changeset/base/190338

Log:
  MFC: add support for local config files and non-chroot
  copy of files from the host filesystem

Modified:
  stable/7/release/picobsd/build/picobsd

Modified: stable/7/release/picobsd/build/picobsd
==============================================================================
--- stable/7/release/picobsd/build/picobsd	Mon Mar 23 21:16:21 2009	(r190337)
+++ stable/7/release/picobsd/build/picobsd	Mon Mar 23 21:32:03 2009	(r190338)
@@ -284,6 +284,9 @@ build_image() {
     if [ -f ${MY_TREE}/config ] ; then
 	. ${MY_TREE}/config
     fi
+    if [ -f ${o_additional_config} ] ; then
+	. ${o_additional_config}
+    fi
 
     # location of the object directory
     PICO_OBJ=${l_objtree}/picobsd/${THETYPE}
@@ -529,6 +532,32 @@ populate_floppy_fs() {		# OK
     ) || true
 }
 
+# Copy the specified files to the destination filesystem.
+# Each file is specified as a pair "src dst", dst is assumed to be
+# a directory (and created with mkdir -p) if it has a trailing /
+# Be careful to escape metacharacters.
+# You can use ${CROSS} to point to the root of the cross build
+# (remember that it might be incomplete)
+
+do_copyfiles() {	# rootdir varname
+	log Copy files to $1
+	local root=$1
+	local srcs dst
+	local CROSS=${_SHLIBDIRPREFIX}
+	eval set "\${${2}}"
+        srcs=""
+	for dst in $* ; do
+		[ x"$srcs" = x ] && srcs=$dst && continue
+		eval srcs="$srcs"	# expand wildcard and vars
+		case x"$dst" in
+		*/ )	mkdir -p ${root}/${dst} ;;
+		# * )	mkdir -p `dirname ${root}/${dst}` ;;
+		esac
+		cp -p ${srcs} ${root}/${dst} || true
+		srcs=""
+        done
+}
+
 # Populate the memory filesystem with binaries and non-variable
 # configuration files.
 # First do an mtree pass, then create directory links and device entries,
@@ -537,7 +566,7 @@ populate_floppy_fs() {		# OK
 # Finally, if required, make a copy of the floppy.tree onto /fd
 
 populate_mfs_tree() {
-    local a dst MFS_TREE
+    local i j a dst MFS_TREE
 
     log "populate_mfs_tree()"
     dst=${BUILDDIR}/mfs.tree
@@ -552,12 +581,15 @@ populate_mfs_tree() {
     log "Running mtree using $a..."
     mtree -deU -f $a -p ${dst} > /dev/null || fail $? mtree
 
-    # XXX create links
+    # Create symlinks using relative pathnames, so it is possible
+    # to follow them also when building the image.
+    # Note that names in STAND_LINKS should not have a leading /
     for i in ${STAND_LINKS}; do
-	ln -s /stand ${dst}/$i
+	j=`echo $i | sed -E 's:^[^/]+::;s:/[^/]+:../:g'`
+	ln -s ${j}stand ${dst}/$i
     done
-    ln -s /dev/null ${dst}/var/run/log
-    ln -s /etc/termcap ${dst}/usr/share/misc/termcap
+    ln -s ../../dev/null ${dst}/var/run/log
+    ln -s ../../../etc/termcap ${dst}/usr/share/misc/termcap
 
     ### now build the crunched binaries ###
     (
@@ -629,6 +661,13 @@ populate_mfs_tree() {
 	(cd ${dst}; chown -R root . )
     fi
 
+    if [ -n "${copy_files}" ] ; then
+	do_copyfiles ${dst} copy_files
+    fi
+
+    # The 'import_files' mechanism is deprecated, as it requires
+    # root permissions to follow the symlinks, and also does
+    # not let you rename the entries.
     if [ -n "${import_files}" ] ; then
 	log "importing ${import_files} into mfs"
 	# We do it in a chroot environment on the target so
@@ -641,6 +680,7 @@ populate_mfs_tree() {
 	rm -rf ${dst}/rescue
     fi
 
+    # final step -- build the mfs image
     (cd ${BUILDDIR}
 	# override the owner
 	echo "/set uid=0 gid=0" > mtree.out
@@ -916,6 +956,11 @@ while [ true ]; do
 	generate_iso="YES"
 	;;
 
+    --cfg) # read additional config from this file
+	o_additional_config=`realpath $2`
+	shift
+	;;
+
     *)
 	break
 	;;

From owner-svn-src-all@FreeBSD.ORG  Mon Mar 23 22:06:10 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Mon Mar 23 22:12:34 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Mon Mar 23 22:35:31 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Mon Mar 23 23:32:21 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 49C48106566B;
	Mon, 23 Mar 2009 23:32:21 +0000 (UTC)
	(envelope-from obrien@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 373798FC19;
	Mon, 23 Mar 2009 23:32:21 +0000 (UTC)
	(envelope-from obrien@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 n2NNWLP2024785;
	Mon, 23 Mar 2009 23:32:21 GMT (envelope-from obrien@svn.freebsd.org)
Received: (from obrien@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2NNWLKc024784;
	Mon, 23 Mar 2009 23:32:21 GMT (envelope-from obrien@svn.freebsd.org)
Message-Id: <200903232332.n2NNWLKc024784@svn.freebsd.org>
From: "David E. O'Brien" 
Date: Mon, 23 Mar 2009 23:32:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190343 - stable/7/lib/libelf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 23 Mar 2009 23:32:22 -0000

Author: obrien
Date: Mon Mar 23 23:32:20 2009
New Revision: 190343
URL: http://svn.freebsd.org/changeset/base/190343

Log:
  MFC: r189721: don't need to set symbol, default value OK

Modified:
  stable/7/lib/libelf/Makefile

Modified: stable/7/lib/libelf/Makefile
==============================================================================
--- stable/7/lib/libelf/Makefile	Mon Mar 23 23:22:09 2009	(r190342)
+++ stable/7/lib/libelf/Makefile	Mon Mar 23 23:32:20 2009	(r190343)
@@ -148,7 +148,7 @@ VERSION_MAP=		${.CURDIR}/Version.map
 
 LIBELF_TEST_HOOKS?=	1
 .if defined(LIBELF_TEST_HOOKS) && (${LIBELF_TEST_HOOKS} > 0)
-CFLAGS+=	-DLIBELF_TEST_HOOKS=1
+CFLAGS+= -DLIBELF_TEST_HOOKS
 .endif
 
 libelf_convert.c:	elf_types.m4 libelf_convert.m4

From owner-svn-src-all@FreeBSD.ORG  Mon Mar 23 23:43:08 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 00:07:18 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 75C5D106564A;
	Tue, 24 Mar 2009 00:07:18 +0000 (UTC)
	(envelope-from obrien@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 61A6E8FC0A;
	Tue, 24 Mar 2009 00:07:18 +0000 (UTC)
	(envelope-from obrien@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 n2O07IUs025595;
	Tue, 24 Mar 2009 00:07:18 GMT (envelope-from obrien@svn.freebsd.org)
Received: (from obrien@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2O07H1w025582;
	Tue, 24 Mar 2009 00:07:17 GMT (envelope-from obrien@svn.freebsd.org)
Message-Id: <200903240007.n2O07H1w025582@svn.freebsd.org>
From: "David E. O'Brien" 
Date: Tue, 24 Mar 2009 00:07:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190345 - stable/7/usr.bin/make
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 00:07:19 -0000

Author: obrien
Date: Tue Mar 24 00:07:17 2009
New Revision: 190345
URL: http://svn.freebsd.org/changeset/base/190345

Log:
  MFC:
  r187475: Remove inlining of functions that are used mostly in different
  	 object files.  This lets use to remove NO_WERROR.
  r186558: Consistently use Var_SetGlobal().
  r186713: Add the -Q be-quiet flag for parallel jobs.
  r186279: Exit with error code 2 when run with -k (continue if errors)
  	 and build failed.
  r186559: Add the ability to tweak the token output before targets in job mode.
  r181021: Add POSIX -p flag to make(1).
  r186502: Clarify the behaviour of conditionals when dealing with comparisons.

Modified:
  stable/7/usr.bin/make/Makefile
  stable/7/usr.bin/make/buf.c
  stable/7/usr.bin/make/for.c
  stable/7/usr.bin/make/globals.h
  stable/7/usr.bin/make/job.c
  stable/7/usr.bin/make/job.h
  stable/7/usr.bin/make/main.c
  stable/7/usr.bin/make/make.1
  stable/7/usr.bin/make/make.c
  stable/7/usr.bin/make/make.h
  stable/7/usr.bin/make/parse.c
  stable/7/usr.bin/make/suff.c
  stable/7/usr.bin/make/var.c

Modified: stable/7/usr.bin/make/Makefile
==============================================================================
--- stable/7/usr.bin/make/Makefile	Mon Mar 23 23:43:07 2009	(r190344)
+++ stable/7/usr.bin/make/Makefile	Tue Mar 24 00:07:17 2009	(r190345)
@@ -8,7 +8,6 @@ SRCS=	arch.c buf.c cond.c dir.c for.c ha
 	lst.c main.c make.c parse.c proc.c shell.c str.c suff.c targ.c	\
 	util.c var.c
 
-NO_WERROR=
 WARNS?=	6
 NO_SHARED?=	YES
 
@@ -52,7 +51,7 @@ hash:
 	  echo ' * DO NOT EDIT' ;					\
 	  echo ' * $$''FreeBSD$$' ;					\
 	  echo -n ' * auto-generated from ' ;				\
-	  sed -nEe '/\$$FreeBSD/s/^.*\$$(.*)\$$.*$$/\1/p'		\
+	  sed -nEe '/\$$FreeBSD$/\1/p'		\
 		${.CURDIR}/parse.c ;					\
 	  echo ' * DO NOT EDIT' ;					\
 	  echo ' */' ;							\

Modified: stable/7/usr.bin/make/buf.c
==============================================================================
--- stable/7/usr.bin/make/buf.c	Mon Mar 23 23:43:07 2009	(r190344)
+++ stable/7/usr.bin/make/buf.c	Tue Mar 24 00:07:17 2009	(r190345)
@@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$");
  * Returns the number of bytes in the buffer.  Doesn't include the
  * null-terminating byte.
  */
-inline size_t
+size_t
 Buf_Size(const Buffer *buf)
 {
 
@@ -70,7 +70,7 @@ Buf_Size(const Buffer *buf)
  *  
  * @note Adding data to the Buffer object may invalidate the reference.
  */
-inline char *
+char *
 Buf_Data(const Buffer *bp)
 {
 
@@ -98,7 +98,7 @@ BufExpand(Buffer *bp, size_t nb)
 /**
  * Add a single byte to the buffer.
  */
-inline void
+void
 Buf_AddByte(Buffer *bp, Byte byte)
 {
 

Modified: stable/7/usr.bin/make/for.c
==============================================================================
--- stable/7/usr.bin/make/for.c	Mon Mar 23 23:43:07 2009	(r190344)
+++ stable/7/usr.bin/make/for.c	Tue Mar 24 00:07:17 2009	(r190345)
@@ -254,7 +254,7 @@ For_Run(int lineno)
 
 	LST_FOREACH(ln, &values) {
 		val = Lst_Datum(ln);
-		Var_Set(var, val, VAR_GLOBAL);
+		Var_SetGlobal(var, val);
 
 		DEBUGF(FOR, ("--- %s = %s\n", var, val));
 		str = Buf_Peel(Var_SubstOnly(var, Buf_Data(buf), FALSE));

Modified: stable/7/usr.bin/make/globals.h
==============================================================================
--- stable/7/usr.bin/make/globals.h	Mon Mar 23 23:43:07 2009	(r190344)
+++ stable/7/usr.bin/make/globals.h	Tue Mar 24 00:07:17 2009	(r190345)
@@ -70,11 +70,13 @@ extern struct Path parseIncPath;
 extern struct Path sysIncPath;
 
 extern int	jobLimit;	/* -j argument: maximum number of jobs */
+extern int	makeErrors;	/* Number of targets not remade due to errors */
 extern Boolean	jobsRunning;	/* True if jobs are running */
 extern Boolean	compatMake;	/* True if we are make compatible */
 extern Boolean	ignoreErrors;	/* True if should ignore all errors */
 extern Boolean	beSilent;	/* True if should print no commands */
 extern Boolean	beVerbose;	/* True if should print extra cruft */
+extern Boolean	beQuiet;	/* True if want quiet headers with -j */
 extern Boolean	noExecute;	/* True if should execute nothing */
 extern Boolean	allPrecious;	/* True if every target is precious */
 extern Boolean	is_posix;	/* .POSIX target seen */

Modified: stable/7/usr.bin/make/job.c
==============================================================================
--- stable/7/usr.bin/make/job.c	Mon Mar 23 23:43:07 2009	(r190344)
+++ stable/7/usr.bin/make/job.c	Tue Mar 24 00:07:17 2009	(r190345)
@@ -263,7 +263,6 @@ TAILQ_HEAD(JobList, Job);
 /*
  * error handling variables
  */
-static int	errors = 0;	/* number of errors reported */
 static int	aborting = 0;	/* why is the make aborting? */
 #define	ABORT_ERROR	1	/* Because of an error */
 #define	ABORT_INTERRUPT	2	/* Because it was interrupted */
@@ -322,10 +321,11 @@ static GNode	*lastNode;	/* The node for 
 static const char *targFmt;	/* Format string to use to head output from a
 				 * job when it's not the most-recent job heard
 				 * from */
+static char *targPrefix = NULL;	/* What we print at the start of targFmt */
 
-#define	TARG_FMT  "--- %s ---\n" /* Default format */
+#define TARG_FMT  "%s %s ---\n"	/* Default format */
 #define	MESSAGE(fp, gn) \
-	 fprintf(fp, targFmt, gn->name);
+	fprintf(fp, targFmt, targPrefix, gn->name);
 
 /*
  * When JobStart attempts to run a job but isn't allowed to
@@ -844,7 +844,7 @@ JobClose(Job *job)
  *
  *	If we got an error and are aborting (aborting == ABORT_ERROR) and
  *	the job list is now empty, we are done for the day.
- *	If we recognized an error (errors !=0), we set the aborting flag
+ *	If we recognized an error (makeErrors !=0), we set the aborting flag
  *	to ABORT_ERROR so no more jobs will be started.
  */
 static void
@@ -1119,7 +1119,7 @@ JobFinish(Job *job, int *status)
 		free(job);
 
 	} else if (*status != 0) {
-		errors += 1;
+		makeErrors++;
 		free(job);
 	}
 
@@ -1128,7 +1128,7 @@ JobFinish(Job *job, int *status)
 	/*
 	 * Set aborting if any error.
 	 */
-	if (errors && !keepgoing && aborting != ABORT_INTERRUPT) {
+	if (makeErrors && !keepgoing && aborting != ABORT_INTERRUPT) {
 		/*
 		 * If we found any errors in this batch of children and the -k
 		 * flag wasn't given, we set the aborting flag so no more jobs
@@ -1141,7 +1141,7 @@ JobFinish(Job *job, int *status)
 		/*
 		 * If we are aborting and the job table is now empty, we finish.
 		 */
-		Finish(errors);
+		Finish(makeErrors);
 	}
 }
 
@@ -2279,6 +2279,18 @@ Job_Make(GNode *gn)
 	JobStart(gn, 0, NULL);
 }
 
+void
+Job_SetPrefix(void)
+{
+
+	if (targPrefix) {
+		free(targPrefix);
+	} else if (!Var_Exists(MAKE_JOB_PREFIX, VAR_GLOBAL)) {
+		Var_SetGlobal(MAKE_JOB_PREFIX, "---");
+	}
+	targPrefix = Var_Subst("${" MAKE_JOB_PREFIX "}", VAR_GLOBAL, 0)->buf;
+}
+
 /**
  * Job_Init
  *	Initialize the process module, given a maximum number of jobs.
@@ -2342,11 +2354,10 @@ Job_Init(int maxproc)
 	nJobs = 0;
 
 	aborting = 0;
-	errors = 0;
+	makeErrors = 0;
 
 	lastNode = NULL;
-
-	if ((maxJobs == 1 && fifoFd < 0) || beVerbose == 0) {
+	if ((maxJobs == 1 && fifoFd < 0) || !beVerbose || is_posix || beQuiet) {
 		/*
 		 * If only one job can run at a time, there's no need for a
 		 * banner, no is there?
@@ -2534,14 +2545,14 @@ JobInterrupt(int runINTERRUPT, int signo
  *	attached to the .END target.
  *
  * Results:
- *	Number of errors reported.
+ *	None.
  */
-int
+void
 Job_Finish(void)
 {
 
 	if (postCommands != NULL && !Lst_IsEmpty(&postCommands->commands)) {
-		if (errors) {
+		if (makeErrors) {
 			Error("Errors reported so .END ignored");
 		} else {
 			JobStart(postCommands, JOB_SPECIAL | JOB_IGNDOTS, NULL);
@@ -2558,7 +2569,6 @@ Job_Finish(void)
 		if (fifoMaster)
 			unlink(fifoName);
 	}
-	return (errors);
 }
 
 /**
@@ -3322,7 +3332,6 @@ void
 Compat_Run(Lst *targs)
 {
 	GNode	*gn = NULL;	/* Current root target */
-	int	error_cnt;		/* Number of targets not remade due to errors */
 	LstNode	*ln;
 
 	Compat_InstallSignalHandlers();
@@ -3355,7 +3364,7 @@ Compat_Run(Lst *targs)
 	 *	ABORTED	  gn was not remade because one of its inferiors
 	 *		  could not be made due to errors.
 	 */
-	error_cnt = 0;
+	makeErrors = 0;
 	while (!Lst_IsEmpty(targs)) {
 		gn = Lst_DeQueue(targs);
 		Compat_Make(gn, gn);
@@ -3365,18 +3374,17 @@ Compat_Run(Lst *targs)
 		} else if (gn->made == ABORTED) {
 			printf("`%s' not remade because of errors.\n",
 			    gn->name);
-			error_cnt += 1;
+			makeErrors++;
 		}
 	}
 
 	/*
 	 * If the user has defined a .END target, run its commands.
 	 */
-	if (error_cnt == 0) {
+	if (makeErrors == 0) {
 		LST_FOREACH(ln, &ENDNode->commands) {
 			if (Compat_RunCommand(Lst_Datum(ln), ENDNode))
 				break;
 		}
 	}
 }
-

Modified: stable/7/usr.bin/make/job.h
==============================================================================
--- stable/7/usr.bin/make/job.h	Mon Mar 23 23:43:07 2009	(r190344)
+++ stable/7/usr.bin/make/job.h	Tue Mar 24 00:07:17 2009	(r190345)
@@ -64,9 +64,10 @@ void Job_Make(struct GNode *);
 void Job_Init(int);
 Boolean Job_Full(void);
 Boolean Job_Empty(void);
-int Job_Finish(void);
+void Job_Finish(void);
 void Job_Wait(void);
 void Job_AbortAll(void);
+void Job_SetPrefix(void);
 
 void Proc_Init(void);
 

Modified: stable/7/usr.bin/make/main.c
==============================================================================
--- stable/7/usr.bin/make/main.c	Mon Mar 23 23:43:07 2009	(r190344)
+++ stable/7/usr.bin/make/main.c	Tue Mar 24 00:07:17 2009	(r190345)
@@ -126,13 +126,16 @@ Boolean		is_posix;	/* .POSIX target seen
 Boolean		mfAutoDeps;	/* .MAKEFILEDEPS target seen */
 Boolean		beSilent;	/* -s flag */
 Boolean		beVerbose;	/* -v flag */
+Boolean		beQuiet;	/* -Q flag */
 Boolean		compatMake;	/* -B argument */
 int		debug;		/* -d flag */
 Boolean		ignoreErrors;	/* -i flag */
 int		jobLimit;	/* -j argument */
+int		makeErrors;	/* Number of targets not remade due to errors */
 Boolean		jobsRunning;	/* TRUE if the jobs might be running */
 Boolean		keepgoing;	/* -k flag */
 Boolean		noExecute;	/* -n flag */
+Boolean		printGraphOnly;	/* -p flag */
 Boolean		queryFlag;	/* -q flag */
 Boolean		touchFlag;	/* -t flag */
 Boolean		usePipes;	/* !-P flag */
@@ -150,7 +153,7 @@ static void
 usage(void)
 {
 	fprintf(stderr,
-	    "usage: make [-BPSXeiknqrstv] [-C directory] [-D variable]\n"
+	    "usage: make [-BPSXeiknpqrstv] [-C directory] [-D variable]\n"
 	    "\t[-d flags] [-E variable] [-f makefile] [-I directory]\n"
 	    "\t[-j max_jobs] [-m directory] [-V variable]\n"
 	    "\t[variable=value] [target ...]\n");
@@ -368,7 +371,7 @@ MainParseArgs(int argc, char **argv)
 rearg:
 	optind = 1;	/* since we're called more than once */
 	optreset = 1;
-#define OPTFLAGS "ABC:D:E:I:PSV:Xd:ef:ij:km:nqrstvx:"
+#define OPTFLAGS "ABC:D:d:E:ef:I:ij:km:nPpQqrSstV:vXx:"
 	for (;;) {
 		if ((optind < argc) && strcmp(argv[optind], "--") == 0) {
 			found_dd = TRUE;
@@ -382,6 +385,11 @@ rearg:
 			arch_fatal = FALSE;
 			MFLAGS_append("-A", NULL);
 			break;
+		case 'B':
+			compatMake = TRUE;
+			MFLAGS_append("-B", NULL);
+			unsetenv("MAKE_JOBS_FIFO");
+			break;
 		case 'C':
 			if (chdir(optarg) == -1)
 				err(1, "chdir %s", optarg);
@@ -390,30 +398,6 @@ rearg:
 			Var_SetGlobal(optarg, "1");
 			MFLAGS_append("-D", optarg);
 			break;
-		case 'I':
-			Parse_AddIncludeDir(optarg);
-			MFLAGS_append("-I", optarg);
-			break;
-		case 'V':
-			Lst_AtEnd(&variables, estrdup(optarg));
-			MFLAGS_append("-V", optarg);
-			break;
-		case 'X':
-			expandVars = FALSE;
-			break;
-		case 'B':
-			compatMake = TRUE;
-			MFLAGS_append("-B", NULL);
-			unsetenv("MAKE_JOBS_FIFO");
-			break;
-		case 'P':
-			usePipes = FALSE;
-			MFLAGS_append("-P", NULL);
-			break;
-		case 'S':
-			keepgoing = FALSE;
-			MFLAGS_append("-S", NULL);
-			break;
 		case 'd': {
 			char *modules = optarg;
 
@@ -481,6 +465,10 @@ rearg:
 		case 'f':
 			Lst_AtEnd(&makefiles, estrdup(optarg));
 			break;
+		case 'I':
+			Parse_AddIncludeDir(optarg);
+			MFLAGS_append("-I", optarg);
+			break;
 		case 'i':
 			ignoreErrors = TRUE;
 			MFLAGS_append("-i", NULL);
@@ -510,6 +498,19 @@ rearg:
 			noExecute = TRUE;
 			MFLAGS_append("-n", NULL);
 			break;
+		case 'P':
+			usePipes = FALSE;
+			MFLAGS_append("-P", NULL);
+			break;
+		case 'p':
+			printGraphOnly = TRUE;
+			debug |= DEBUG_GRAPH1;
+			break;
+		case 'Q':
+			beQuiet = TRUE;
+			beVerbose = FALSE;
+			MFLAGS_append("-Q", NULL);
+			break;
 		case 'q':
 			queryFlag = TRUE;
 			/* Kind of nonsensical, wot? */
@@ -519,6 +520,10 @@ rearg:
 			noBuiltins = TRUE;
 			MFLAGS_append("-r", NULL);
 			break;
+		case 'S':
+			keepgoing = FALSE;
+			MFLAGS_append("-S", NULL);
+			break;
 		case 's':
 			beSilent = TRUE;
 			MFLAGS_append("-s", NULL);
@@ -527,10 +532,18 @@ rearg:
 			touchFlag = TRUE;
 			MFLAGS_append("-t", NULL);
 			break;
+		case 'V':
+			Lst_AtEnd(&variables, estrdup(optarg));
+			MFLAGS_append("-V", optarg);
+			break;
 		case 'v':
 			beVerbose = TRUE;
+			beQuiet = FALSE;
 			MFLAGS_append("-v", NULL);
 			break;
+		case 'X':
+			expandVars = FALSE;
+			break;
 		case 'x':
 			if (Main_ParseWarn(optarg, 1) != -1)
 				MFLAGS_append("-x", optarg);
@@ -903,6 +916,7 @@ main(int argc, char **argv)
 	beSilent = FALSE;		/* Print commands as executed */
 	ignoreErrors = FALSE;		/* Pay attention to non-zero returns */
 	noExecute = FALSE;		/* Execute all commands */
+	printGraphOnly = FALSE;		/* Don't stop after printing graph */
 	keepgoing = FALSE;		/* Stop on error */
 	allPrecious = FALSE;		/* Remove targets when interrupted */
 	queryFlag = FALSE;		/* This is not just a check-run */
@@ -933,14 +947,13 @@ main(int argc, char **argv)
 #endif
 
 	/*
-	 * FreeBSD/pc98 kernel used to set the utsname.machine to
-	 * "i386", and MACHINE was defined as "i386", so it could
-	 * not be distinguished from FreeBSD/i386.  Therefore, we
-	 * had to check machine.ispc98 and adjust the MACHINE
-	 * variable.
-	 * NOTE: The code is still here to be able to compile new
-	 * make binary on old FreeBSD/pc98 systems, and have the
-	 * MACHINE variable set properly.
+	 * Prior to 7.0, FreeBSD/pc98 kernel used to set the
+	 * utsname.machine to "i386", and MACHINE was defined as
+	 * "i386", so it could not be distinguished from FreeBSD/i386.
+	 * Therefore, we had to check machine.ispc98 and adjust the
+	 * MACHINE variable.  NOTE: The code is still here to be able
+	 * to compile new make binary on old FreeBSD/pc98 systems, and
+	 * have the MACHINE variable set properly.
 	 */
 	if ((machine = getenv("MACHINE")) == NULL) {
 		int	ispc98;
@@ -1023,6 +1036,16 @@ main(int argc, char **argv)
 #ifdef MAKE_VERSION
 	Var_SetGlobal("MAKE_VERSION", MAKE_VERSION);
 #endif
+	Var_SetGlobal(".newline", "\n");	/* handy for :@ loops */
+	{
+		char tmp[64];
+
+		snprintf(tmp, sizeof(tmp), "%u", getpid());
+		Var_SetGlobal(".MAKE.PID", tmp);
+		snprintf(tmp, sizeof(tmp), "%u", getppid());
+		Var_SetGlobal(".MAKE.PPID", tmp);
+	}
+	Job_SetPrefix();
 
 	/*
 	 * First snag things out of the MAKEFLAGS environment
@@ -1243,7 +1266,7 @@ main(int argc, char **argv)
 		Targ_PrintGraph(1);
 
 	/* print the values of any variables requested by the user */
-	if (Lst_IsEmpty(&variables)) {
+	if (Lst_IsEmpty(&variables) && !printGraphOnly) {
 		/*
 		 * Since the user has not requested that any variables
 		 * be printed, we can build targets.
@@ -1306,9 +1329,11 @@ main(int argc, char **argv)
 	if (DEBUG(GRAPH2))
 		Targ_PrintGraph(2);
 
-	if (queryFlag && outOfDate)
-		return (1);
-	else
-		return (0);
-}
+	if (queryFlag)
+		return (outOfDate);
 
+	if (makeErrors != 0)
+		Finish(makeErrors);
+
+	return (0);
+}

Modified: stable/7/usr.bin/make/make.1
==============================================================================
--- stable/7/usr.bin/make/make.1	Mon Mar 23 23:43:07 2009	(r190344)
+++ stable/7/usr.bin/make/make.1	Tue Mar 24 00:07:17 2009	(r190345)
@@ -32,7 +32,7 @@
 .\"	@(#)make.1	8.8 (Berkeley) 6/13/95
 .\" $FreeBSD$
 .\"
-.Dd March 24, 2008
+.Dd December 29, 2008
 .Dt MAKE 1
 .Os
 .Sh NAME
@@ -40,7 +40,7 @@
 .Nd maintain program dependencies
 .Sh SYNOPSIS
 .Nm
-.Op Fl ABPSXeiknqrstv
+.Op Fl ABPSXeiknpqrstv
 .Op Fl C Ar directory
 .Op Fl D Ar variable
 .Op Fl d Ar flags
@@ -249,6 +249,18 @@ instead of mixing the output of parallel
 This option has no effect unless
 .Fl j
 is used too.
+.It Fl p
+Only print the input graph, not executing any commands.
+The output is the same as
+.Fl d Ar g1 .
+When combined with
+.Fl f Pa /dev/null ,
+only the builtin rules of
+.Nm
+are displayed.
+.It Fl Q
+Be extra quiet.
+For multi-job makes, this will cause file banners not to be generated.
 .It Fl q
 Do not execute any commands, but exit 0 if the specified targets are
 up-to-date and 1, otherwise.
@@ -280,7 +292,7 @@ the variables will be printed one per li
 with a blank line for each null or undefined variable.
 .It Fl v
 Be extra verbose.
-For multi-job makes, this will cause file banners to be generated.
+Print any extra information.
 .It Fl X
 When using the
 .Fl V
@@ -754,6 +766,31 @@ contains all the options from the
 environment variable plus any options specified on
 .Nm Ns 's
 command line.
+.It Va .MAKE.PID
+The process-id of
+.Nm .
+.It Va .MAKE.PPID
+The parent process-id of
+.Nm .
+.It Va .MAKE.JOB.PREFIX
+If
+.Nm
+is run with
+.Fl j Fl v
+then output for each target is prefixed with a token
+.Ql --- target ---
+the first part of which can be controlled via
+.Va .MAKE.JOB.PREFIX .
+.br
+For example:
+.Li .MAKE.JOB.PREFIX=${.newline}---${MAKE:T}[${.MAKE.PID}]
+would produce tokens like
+.Ql ---make[1234] target ---
+or
+.Li .MAKE.JOB.PREFIX=---pid[${.MAKE.PID}],ppid[${.MAKE.PPID}]
+would produce tokens like
+.Ql ---pid[56789],ppid[1234] target ---
+making it easier to track the degree of parallelism being achieved.
 .It Va .TARGETS
 List of targets
 .Nm
@@ -1121,24 +1158,34 @@ has been defined.
 .Pp
 An
 .Ar expression
-may also be an arithmetic or string comparison, with the left-hand side
-being a variable expansion.
-Variable expansion is
-performed on both sides of the comparison, after which the integral
+may also be a numeric or string comparison:
+in this case, the left-hand side
+.Ar must be
+a variable expansion, whereas the right-hand side can be a
+constant or a variable expansion.
+Variable expansion is performed on both sides, after which the resulting
 values are compared.
 A value is interpreted as hexadecimal if it is
 preceded by 0x, otherwise it is decimal; octal numbers are not supported.
-The standard C relational operators are all supported.
-If after
-variable expansion, either the left or right hand side of a
+.Pp
+String comparison can only use the
 .Sq Ic ==
 or
 .Sq Ic !=
-operator is not an integral value, then
-string comparison is performed between the expanded
-variables.
-If no relational operator is given, it is assumed that the expanded
-variable is being compared against 0.
+operators, whereas numeric values (both integer and floating point)
+can also be compared using the
+.Sq Ic > ,
+.Sq Ic >= ,
+.Sq Ic <
+and
+.Sq Ic <=
+operators.
+.Pp
+If no relational operator (and right-hand value) are given, an implicit
+.Sq Ic != 0
+is used.
+However be very careful in using this feature especially
+when the left-hand side variable expansion returns a string.
 .Pp
 When
 .Nm

Modified: stable/7/usr.bin/make/make.c
==============================================================================
--- stable/7/usr.bin/make/make.c	Mon Mar 23 23:43:07 2009	(r190344)
+++ stable/7/usr.bin/make/make.c	Tue Mar 24 00:07:17 2009	(r190345)
@@ -713,7 +713,6 @@ Make_Run(Lst *targs)
 	GNode	*gn;		/* a temporary pointer */
 	GNode	*cgn;
 	Lst	examine;	/* List of targets to examine */
-	int	errors;		/* Number of errors the Job module reports */
 	LstNode	*ln;
 
 	Lst_Init(&examine);
@@ -793,15 +792,14 @@ Make_Run(Lst *targs)
 		MakeStartJobs();
 	}
 
-	errors = Job_Finish();
+	Job_Finish();
 
 	/*
 	 * Print the final status of each target. E.g. if it wasn't made
 	 * because some inferior reported an error.
 	 */
-	errors = ((errors == 0) && (numNodes != 0));
 	LST_FOREACH(ln, targs)
-		MakePrintStatus(Lst_Datum(ln), errors);
+		MakePrintStatus(Lst_Datum(ln), (makeErrors == 0) && (numNodes != 0));
 
 	return (TRUE);
 }

Modified: stable/7/usr.bin/make/make.h
==============================================================================
--- stable/7/usr.bin/make/make.h	Mon Mar 23 23:43:07 2009	(r190344)
+++ stable/7/usr.bin/make/make.h	Tue Mar 24 00:07:17 2009	(r190345)
@@ -49,6 +49,8 @@
 
 #include "util.h"
 
+#define	MAKE_JOB_PREFIX	".MAKE.JOB.PREFIX"
+
 struct GNode;
 struct Lst;
 struct Buffer;

Modified: stable/7/usr.bin/make/parse.c
==============================================================================
--- stable/7/usr.bin/make/parse.c	Mon Mar 23 23:43:07 2009	(r190344)
+++ stable/7/usr.bin/make/parse.c	Tue Mar 24 00:07:17 2009	(r190345)
@@ -1076,7 +1076,7 @@ ParseDoDependency(char *line)
 			break;
 		  case Posix:
 			is_posix = TRUE;
-			Var_Set("%POSIX", "1003.2", VAR_GLOBAL);
+			Var_SetGlobal("%POSIX", "1003.2");
 			break;
 		  default:
 			break;
@@ -1533,6 +1533,8 @@ Parse_DoVar(char *line, GNode *ctxt)
 		 */
 		Var_Set(line, cp, ctxt);
 	}
+	if (strcmp(line, MAKE_JOB_PREFIX) == 0)
+		Job_SetPrefix();
 }
 
 /*-

Modified: stable/7/usr.bin/make/suff.c
==============================================================================
--- stable/7/usr.bin/make/suff.c	Mon Mar 23 23:43:07 2009	(r190344)
+++ stable/7/usr.bin/make/suff.c	Tue Mar 24 00:07:17 2009	(r190345)
@@ -514,6 +514,7 @@ Suff_AddTransform(char *line)
 	Suff	*s;	/* source suffix */
 	Suff	*t;	/* target suffix */
 
+	s = t = NULL;	/* silence gcc */
 	gn = SuffTransFind(line);
 	if (gn == NULL) {
 		/*
@@ -785,11 +786,11 @@ Suff_DoPaths(void)
 	}
 
 	ptr = Path_MakeFlags("-I", &inIncludes);
-	Var_Set(".INCLUDES", ptr, VAR_GLOBAL);
+	Var_SetGlobal(".INCLUDES", ptr);
 	free(ptr);
 
 	ptr = Path_MakeFlags("-L", &inLibs);
-	Var_Set(".LIBS", ptr, VAR_GLOBAL);
+	Var_SetGlobal(".LIBS", ptr);
 	free(ptr);
 
 	Path_Clear(&inIncludes);

Modified: stable/7/usr.bin/make/var.c
==============================================================================
--- stable/7/usr.bin/make/var.c	Mon Mar 23 23:43:07 2009	(r190344)
+++ stable/7/usr.bin/make/var.c	Tue Mar 24 00:07:17 2009	(r190345)
@@ -946,12 +946,14 @@ VarFindAny(const char name[], GNode *ctx
  *	The name and val arguments are duplicated so they may
  *	safely be freed.
  */
-static void
+static Var *
 VarAdd(const char *name, const char *val, GNode *ctxt)
 {
+	Var *v;
 
-	Lst_AtFront(&ctxt->context, VarCreate(name, val, 0));
+	Lst_AtFront(&ctxt->context, v = VarCreate(name, val, 0));
 	DEBUGF(VAR, ("%s:%s = %s\n", ctxt->name, name, val));
+	return (v);
 }
 
 /**
@@ -1004,30 +1006,22 @@ Var_Set(const char *name, const char *va
 	n = VarPossiblyExpand(name, ctxt);
 	v = VarFindOnly(n, ctxt);
 	if (v == NULL) {
-		VarAdd(n, val, ctxt);
-		if (ctxt == VAR_CMD) {
-			/*
-			 * Any variables given on the command line
-			 * are automatically exported to the
-			 * environment (as per POSIX standard)
-			 */
-			setenv(n, val, 1);
-		}
+		v = VarAdd(n, val, ctxt);
 	} else {
 		Buf_Clear(v->val);
 		Buf_Append(v->val, val);
-
-		if (ctxt == VAR_CMD || (v->flags & VAR_TO_ENV)) {
-			/*
-			 * Any variables given on the command line
-			 * are automatically exported to the
-			 * environment (as per POSIX standard)
-			 */
-			setenv(n, val, 1);
-		}
 		DEBUGF(VAR, ("%s:%s = %s\n", ctxt->name, n, val));
 	}
 
+	if (ctxt == VAR_CMD || (v->flags & VAR_TO_ENV)) {
+		/*
+		 * Any variables given on the command line
+		 * are automatically exported to the
+		 * environment (as per POSIX standard)
+		 */
+		setenv(n, val, 1);
+	}
+
 	free(n);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 00:09:00 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 00:09:35 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 00:30:07 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 410C2106564A;
	Tue, 24 Mar 2009 00:30:07 +0000 (UTC)
	(envelope-from obrien@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2EA248FC0A;
	Tue, 24 Mar 2009 00:30:07 +0000 (UTC)
	(envelope-from obrien@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 n2O0U7Kn026149;
	Tue, 24 Mar 2009 00:30:07 GMT (envelope-from obrien@svn.freebsd.org)
Received: (from obrien@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2O0U74q026148;
	Tue, 24 Mar 2009 00:30:07 GMT (envelope-from obrien@svn.freebsd.org)
Message-Id: <200903240030.n2O0U74q026148@svn.freebsd.org>
From: "David E. O'Brien" 
Date: Tue, 24 Mar 2009 00:30:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190348 - stable/7/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 00:30:07 -0000

Author: obrien
Date: Tue Mar 24 00:30:06 2009
New Revision: 190348
URL: http://svn.freebsd.org/changeset/base/190348

Log:
  MFC: r187724 / r187969: unsplit _PATH_SYSPATH & _PATH_STDPATH.

Modified:
  stable/7/include/paths.h

Modified: stable/7/include/paths.h
==============================================================================
--- stable/7/include/paths.h	Tue Mar 24 00:09:35 2009	(r190347)
+++ stable/7/include/paths.h	Tue Mar 24 00:30:06 2009	(r190348)
@@ -42,11 +42,9 @@
 /* Default search path. */
 #define	_PATH_DEFPATH	"/usr/bin:/bin"
 /* All standard utilities path. */
-#define	_PATH_STDPATH \
-	"/usr/bin:/bin:/usr/sbin:/sbin:"
-/* Locate system binaries */
-#define _PATH_SYSPATH	\
-	"/sbin:/usr/sbin"
+#define	_PATH_STDPATH	"/usr/bin:/bin:/usr/sbin:/sbin:"
+/* Locate system binaries. */
+#define	_PATH_SYSPATH	"/sbin:/usr/sbin"
 
 #define	_PATH_AUTHCONF	"/etc/auth.conf"
 #define	_PATH_BSHELL	"/bin/sh"

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 00:34:55 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BC7F0106566B;
	Tue, 24 Mar 2009 00:34:55 +0000 (UTC)
	(envelope-from obrien@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A12218FC28;
	Tue, 24 Mar 2009 00:34:55 +0000 (UTC)
	(envelope-from obrien@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 n2O0YtB4026298;
	Tue, 24 Mar 2009 00:34:55 GMT (envelope-from obrien@svn.freebsd.org)
Received: (from obrien@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2O0Ytwe026295;
	Tue, 24 Mar 2009 00:34:55 GMT (envelope-from obrien@svn.freebsd.org)
Message-Id: <200903240034.n2O0Ytwe026295@svn.freebsd.org>
From: "David E. O'Brien" 
Date: Tue, 24 Mar 2009 00:34:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190349 - in stable/7/usr.sbin/crunch: crunchgen
	crunchide
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 00:34:56 -0000

Author: obrien
Date: Tue Mar 24 00:34:55 2009
New Revision: 190349
URL: http://svn.freebsd.org/changeset/base/190349

Log:
  MFC:
  r173412: Cleanup of userland __P use.
  r187943: Run with -B and just .POSIX.
  r173067: Include  for the right prototype for exit(3).
  r173065: Set the program name if the crunched program is selected
  	 through argv[1] to mimic crt0 behaviour.

Modified:
  stable/7/usr.sbin/crunch/crunchgen/crunched_main.c
  stable/7/usr.sbin/crunch/crunchgen/crunchgen.c
  stable/7/usr.sbin/crunch/crunchide/crunchide.c

Modified: stable/7/usr.sbin/crunch/crunchgen/crunched_main.c
==============================================================================
--- stable/7/usr.sbin/crunch/crunchgen/crunched_main.c	Tue Mar 24 00:30:06 2009	(r190348)
+++ stable/7/usr.sbin/crunch/crunchgen/crunched_main.c	Tue Mar 24 00:34:55 2009	(r190349)
@@ -34,6 +34,7 @@
  *	the crunched binary without creating all the links.
  */
 #include 
+#include 
 #include 
 
 struct stub {
@@ -41,6 +42,7 @@ struct stub {
     int (*f)();
 };
 
+extern char *__progname;
 extern struct stub entry_points[];
 
 int main(int argc, char **argv, char **envp)
@@ -83,12 +85,16 @@ int crunched_here(char *path)
 
 int crunched_main(int argc, char **argv, char **envp)
 {
+    char *slash;
     struct stub *ep;
     int columns, len;
 
     if(argc <= 1)
 	crunched_usage();
 
+    slash = strrchr(argv[1], '/');
+    __progname = slash? slash+1 : argv[1];
+
     return main(--argc, ++argv, envp);
 }
 

Modified: stable/7/usr.sbin/crunch/crunchgen/crunchgen.c
==============================================================================
--- stable/7/usr.sbin/crunch/crunchgen/crunchgen.c	Tue Mar 24 00:30:06 2009	(r190348)
+++ stable/7/usr.sbin/crunch/crunchgen/crunchgen.c	Tue Mar 24 00:34:55 2009	(r190349)
@@ -709,12 +709,13 @@ void fillin_program_objs(prog_t *p, char
 	if (outhdrname[0] != '\0')
 		fprintf(f, ".include \"%s\"\n", outhdrname);
 	fprintf(f, ".include \"%s\"\n", path);
+	fprintf(f, ".POSIX:\n");
 	if (buildopts) {
 		fprintf(f, "BUILDOPTS+=");
 		output_strlst(f, buildopts);
 	}
-	fprintf(f, ".if defined(PROG) && !defined(%s)\n", objvar);
-	fprintf(f, "%s=${PROG}.o\n", objvar);
+	fprintf(f, ".if defined(PROG)\n");
+	fprintf(f, "%s?=${PROG}.o\n", objvar);
 	fprintf(f, ".endif\n");
 	fprintf(f, "loop:\n\t@echo 'OBJS= '${%s}\n", objvar);
 
@@ -727,7 +728,7 @@ void fillin_program_objs(prog_t *p, char
 
 	fclose(f);
 
-	snprintf(line, MAXLINELEN, "cd %s && make -f %s crunchgen_objs",
+	snprintf(line, MAXLINELEN, "cd %s && make -f %s -B crunchgen_objs",
 	    p->srcdir, tempfname);
 	if ((f = popen(line, "r")) == NULL) {
 		warn("submake pipe");

Modified: stable/7/usr.sbin/crunch/crunchide/crunchide.c
==============================================================================
--- stable/7/usr.sbin/crunch/crunchide/crunchide.c	Tue Mar 24 00:30:06 2009	(r190348)
+++ stable/7/usr.sbin/crunch/crunchide/crunchide.c	Tue Mar 24 00:34:55 2009	(r190349)
@@ -87,7 +87,7 @@ int hide_syms(const char *filename);
 
 int verbose;
 
-int main __P((int, char *[]));
+int main(int, char *[]);
 
 int main(argc, argv)
 int argc;

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 00:43:12 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A22721065674;
	Tue, 24 Mar 2009 00:43:12 +0000 (UTC)
	(envelope-from obrien@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8E3A58FC22;
	Tue, 24 Mar 2009 00:43:12 +0000 (UTC)
	(envelope-from obrien@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 n2O0hCaN026547;
	Tue, 24 Mar 2009 00:43:12 GMT (envelope-from obrien@svn.freebsd.org)
Received: (from obrien@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2O0hCtb026540;
	Tue, 24 Mar 2009 00:43:12 GMT (envelope-from obrien@svn.freebsd.org)
Message-Id: <200903240043.n2O0hCtb026540@svn.freebsd.org>
From: "David E. O'Brien" 
Date: Tue, 24 Mar 2009 00:43:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190350 - in stable/7/sbin: fsck fsck_ffs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 00:43:13 -0000

Author: obrien
Date: Tue Mar 24 00:43:12 2009
New Revision: 190350
URL: http://svn.freebsd.org/changeset/base/190350

Log:
  MFC: r187931: Add the '-C' "check clean" flag.

Modified:
  stable/7/sbin/fsck/fsck.8
  stable/7/sbin/fsck/fsck.c
  stable/7/sbin/fsck/fsutil.h
  stable/7/sbin/fsck_ffs/fsck.h
  stable/7/sbin/fsck_ffs/fsck_ffs.8
  stable/7/sbin/fsck_ffs/main.c
  stable/7/sbin/fsck_ffs/setup.c

Modified: stable/7/sbin/fsck/fsck.8
==============================================================================
--- stable/7/sbin/fsck/fsck.8	Tue Mar 24 00:34:55 2009	(r190349)
+++ stable/7/sbin/fsck/fsck.8	Tue Mar 24 00:43:12 2009	(r190350)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 25, 2001
+.Dd January 25, 2009
 .Dt FSCK 8
 .Os
 .Sh NAME
@@ -37,7 +37,7 @@
 .Nd file system consistency check and interactive repair
 .Sh SYNOPSIS
 .Nm
-.Op Fl dfnpvy
+.Op Fl Cdfnpvy
 .Op Fl B | F
 .Op Fl T Ar fstype : Ns Ar fsoptions
 .Op Fl t Ar fstype
@@ -112,6 +112,11 @@ to be the partition and slice designator
 .Pp
 The options are as follows:
 .Bl -tag -width indent
+.It Fl C
+Check if the
+.Dq clean
+flag is set in the superblock and skip file system checks if file system was
+properly dismounted and marked clean.
 .It Fl d
 Debugging mode.
 Just print the commands without executing them.

Modified: stable/7/sbin/fsck/fsck.c
==============================================================================
--- stable/7/sbin/fsck/fsck.c	Tue Mar 24 00:34:55 2009	(r190349)
+++ stable/7/sbin/fsck/fsck.c	Tue Mar 24 00:43:12 2009	(r190350)
@@ -103,7 +103,7 @@ main(int argc, char *argv[])
 	TAILQ_INIT(&selhead);
 	TAILQ_INIT(&opthead);
 
-	while ((i = getopt(argc, argv, "BdvpfFnyl:t:T:")) != -1)
+	while ((i = getopt(argc, argv, "BCdvpfFnyl:t:T:")) != -1)
 		switch (i) {
 		case 'B':
 			if (flags & CHECK_BACKGRD)
@@ -128,6 +128,9 @@ main(int argc, char *argv[])
 		case 'p':
 			flags |= CHECK_PREEN;
 			/*FALLTHROUGH*/
+		case 'C':
+			flags |= CHECK_CLEAN;
+			/*FALLTHROUGH*/
 		case 'n':
 		case 'y':
 			globopt[1] = i;
@@ -566,7 +569,7 @@ static void
 usage(void)
 {
 	static const char common[] =
-	    "[-dfnpvy] [-B | -F] [-T fstype:fsoptions] [-t fstype]";
+	    "[-Cdfnpvy] [-B | -F] [-T fstype:fsoptions] [-t fstype]";
 
 	(void)fprintf(stderr, "usage: %s %s [special | node] ...\n",
 	    getprogname(), common);

Modified: stable/7/sbin/fsck/fsutil.h
==============================================================================
--- stable/7/sbin/fsck/fsutil.h	Tue Mar 24 00:34:55 2009	(r190349)
+++ stable/7/sbin/fsck/fsutil.h	Tue Mar 24 00:43:12 2009	(r190350)
@@ -48,6 +48,7 @@ char *estrdup(const char *);
 #define	CHECK_DEBUG	0x0004
 #define	CHECK_BACKGRD	0x0008
 #define	DO_BACKGRD	0x0010
+#define	CHECK_CLEAN	0x0020
 
 struct fstab;
 int checkfstab(int, int (*)(struct fstab *), 

Modified: stable/7/sbin/fsck_ffs/fsck.h
==============================================================================
--- stable/7/sbin/fsck_ffs/fsck.h	Tue Mar 24 00:34:55 2009	(r190349)
+++ stable/7/sbin/fsck_ffs/fsck.h	Tue Mar 24 00:43:12 2009	(r190350)
@@ -271,6 +271,7 @@ int	bkgrdflag;		/* use a snapshot to run
 int	bflag;			/* location of alternate super block */
 int	debug;			/* output debugging info */
 char	damagedflag;		/* run in damaged mode */
+char	ckclean;		/* only do work if not cleanly unmounted */
 int	cvtlevel;		/* convert to newer file system format */
 int	bkgrdcheck;		/* determine if background check is possible */
 int	bkgrdsumadj;		/* whether the kernel have ability to adjust superblock summary */

Modified: stable/7/sbin/fsck_ffs/fsck_ffs.8
==============================================================================
--- stable/7/sbin/fsck_ffs/fsck_ffs.8	Tue Mar 24 00:34:55 2009	(r190349)
+++ stable/7/sbin/fsck_ffs/fsck_ffs.8	Tue Mar 24 00:43:12 2009	(r190350)
@@ -29,7 +29,7 @@
 .\"	@(#)fsck.8	8.4 (Berkeley) 5/9/95
 .\" $FreeBSD$
 .\"
-.Dd January 20, 2009
+.Dd January 25, 2009
 .Dt FSCK_FFS 8
 .Os
 .Sh NAME
@@ -46,9 +46,9 @@
 .Ar ...
 .Sh DESCRIPTION
 The specified disk partitions and/or file systems are checked.
-In "preen" mode the clean flag of each file system's superblock is examined
-and only those file systems that
-are not marked clean are checked.
+In "preen" or "check clean" mode the clean flag of each file system's
+superblock is examined and only those file systems that are not marked clean
+are checked.
 File systems are marked clean when they are unmounted,
 when they have been mounted read-only, or when
 .Nm
@@ -175,6 +175,14 @@ Use the block specified immediately afte
 the super block for the file system.
 An alternate super block is usually located at block 32 for UFS1,
 and block 160 for UFS2.
+.It Fl C
+Check if file system was dismouted cleanly.
+If so, skip file system checks (like "preen").
+However, if the file system was not cleanly dismounted, do full checks,
+is if
+.Nm
+was invoked without
+.Fl C .
 .It Fl c
 Convert the file system to the specified level.
 Note that the level of a file system can only be raised.

Modified: stable/7/sbin/fsck_ffs/main.c
==============================================================================
--- stable/7/sbin/fsck_ffs/main.c	Tue Mar 24 00:34:55 2009	(r190349)
+++ stable/7/sbin/fsck_ffs/main.c	Tue Mar 24 00:43:12 2009	(r190350)
@@ -82,7 +82,7 @@ main(int argc, char *argv[])
 	sync();
 	skipclean = 1;
 	damagedflag = 0;
-	while ((ch = getopt(argc, argv, "b:Bc:dDfFm:npy")) != -1) {
+	while ((ch = getopt(argc, argv, "b:Bc:CdDfFm:npy")) != -1) {
 		switch (ch) {
 		case 'b':
 			skipclean = 0;
@@ -132,6 +132,10 @@ main(int argc, char *argv[])
 
 		case 'p':
 			preen++;
+			/*FALLTHROUGH*/
+
+		case 'C':
+			ckclean++;
 			break;
 
 		case 'y':
@@ -151,7 +155,7 @@ main(int argc, char *argv[])
 
 	if (signal(SIGINT, SIG_IGN) != SIG_IGN)
 		(void)signal(SIGINT, catch);
-	if (preen)
+	if (ckclean)
 		(void)signal(SIGQUIT, catchquit);
 	signal(SIGINFO, infohandler);
 	if (bkgrdflag) {
@@ -216,7 +220,7 @@ checkfilesys(char *filesys)
 	errmsg[0] = '\0';
 
 	cdevname = filesys;
-	if (debug && preen)
+	if (debug && ckclean)
 		pwarn("starting\n");
 	/*
 	 * Make best effort to get the disk name. Check first to see
@@ -251,7 +255,7 @@ checkfilesys(char *filesys)
 			exit(7);	/* Filesystem clean, report it now */
 		exit(0);
 	}
-	if (preen && skipclean) {
+	if (ckclean && skipclean) {
 		/*
 		 * If file system is gjournaled, check it here.
 		 */
@@ -302,7 +306,7 @@ checkfilesys(char *filesys)
 					    "CANNOT RUN IN BACKGROUND\n");
 				}
 				if ((sblock.fs_flags & FS_UNCLEAN) == 0 &&
-				    skipclean && preen) {
+				    skipclean && ckclean) {
 					/*
 					 * file system is clean;
 					 * skip snapshot and report it clean

Modified: stable/7/sbin/fsck_ffs/setup.c
==============================================================================
--- stable/7/sbin/fsck_ffs/setup.c	Tue Mar 24 00:34:55 2009	(r190349)
+++ stable/7/sbin/fsck_ffs/setup.c	Tue Mar 24 00:43:12 2009	(r190350)
@@ -65,7 +65,7 @@ static struct disklabel *getdisklabel(ch
 /*
  * Read in a superblock finding an alternate if necessary.
  * Return 1 if successful, 0 if unsuccessful, -1 if file system
- * is already clean (preen mode only).
+ * is already clean (ckclean and preen mode only).
  */
 int
 setup(char *dev)
@@ -201,7 +201,7 @@ setup(char *dev)
 		pwarn("USING ALTERNATE SUPERBLOCK AT %d\n", bflag);
 		bflag = 0;
 	}
-	if (skipclean && preen && sblock.fs_clean) {
+	if (skipclean && ckclean && sblock.fs_clean) {
 		pwarn("FILE SYSTEM CLEAN; SKIPPING CHECKS\n");
 		return (-1);
 	}

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 00:44:30 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EEC48106566B;
	Tue, 24 Mar 2009 00:44:30 +0000 (UTC)
	(envelope-from obrien@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DBFD58FC26;
	Tue, 24 Mar 2009 00:44:30 +0000 (UTC)
	(envelope-from obrien@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 n2O0iUWV026630;
	Tue, 24 Mar 2009 00:44:30 GMT (envelope-from obrien@svn.freebsd.org)
Received: (from obrien@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2O0iU62026629;
	Tue, 24 Mar 2009 00:44:30 GMT (envelope-from obrien@svn.freebsd.org)
Message-Id: <200903240044.n2O0iU62026629@svn.freebsd.org>
From: "David E. O'Brien" 
Date: Tue, 24 Mar 2009 00:44:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190351 - stable/7/gnu/usr.bin/grep
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 00:44:31 -0000

Author: obrien
Date: Tue Mar 24 00:44:30 2009
New Revision: 190351
URL: http://svn.freebsd.org/changeset/base/190351

Log:
  MFC: r187907: For files not named on the command line, only the basename is
  compared to the exclude pattern.

Modified:
  stable/7/gnu/usr.bin/grep/savedir.c

Modified: stable/7/gnu/usr.bin/grep/savedir.c
==============================================================================
--- stable/7/gnu/usr.bin/grep/savedir.c	Tue Mar 24 00:43:12 2009	(r190350)
+++ stable/7/gnu/usr.bin/grep/savedir.c	Tue Mar 24 00:44:30 2009	(r190351)
@@ -17,6 +17,9 @@
 
 /* Written by David MacKenzie . */
 
+#include 
+__FBSDID("$FreeBSD$");
+
 #if HAVE_CONFIG_H
 # include 
 #endif
@@ -137,10 +140,10 @@ savedir (const char *dir, off_t name_siz
 	      && !isdir1 (dir, dp->d_name))
 	    {
 	      if (included_patterns
-		  && !excluded_filename (included_patterns, dp->d_name, 0))
+		  && !excluded_filename (included_patterns, path, 0))
 		continue;
 	      if (excluded_patterns
-		  && excluded_filename (excluded_patterns, dp->d_name, 0))
+		  && excluded_filename (excluded_patterns, path, 0))
 		continue;
 	    }
 

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 00:46:44 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C327E1065678;
	Tue, 24 Mar 2009 00:46:44 +0000 (UTC)
	(envelope-from obrien@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AD5958FC0A;
	Tue, 24 Mar 2009 00:46:44 +0000 (UTC)
	(envelope-from obrien@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 n2O0kia9026726;
	Tue, 24 Mar 2009 00:46:44 GMT (envelope-from obrien@svn.freebsd.org)
Received: (from obrien@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2O0ki43026725;
	Tue, 24 Mar 2009 00:46:44 GMT (envelope-from obrien@svn.freebsd.org)
Message-Id: <200903240046.n2O0ki43026725@svn.freebsd.org>
From: "David E. O'Brien" 
Date: Tue, 24 Mar 2009 00:46:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190352 - stable/7/usr.bin/gprof
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 00:46:46 -0000

Author: obrien
Date: Tue Mar 24 00:46:44 2009
New Revision: 190352
URL: http://svn.freebsd.org/changeset/base/190352

Log:
  MFC: r187116: If running with "-K" really do not information about symbols
  from the a.out argument.

Modified:
  stable/7/usr.bin/gprof/gprof.c

Modified: stable/7/usr.bin/gprof/gprof.c
==============================================================================
--- stable/7/usr.bin/gprof/gprof.c	Tue Mar 24 00:44:30 2009	(r190351)
+++ stable/7/usr.bin/gprof/gprof.c	Tue Mar 24 00:46:44 2009	(r190352)
@@ -165,7 +165,7 @@ main(argc, argv)
 	 *	get information from the executable file.
 	 */
     if ((Kflag && kernel_getnfile(a_outname, &defaultEs) == -1) ||
-      (elf_getnfile(a_outname, &defaultEs) == -1 &&
+      (!Kflag && elf_getnfile(a_outname, &defaultEs) == -1 &&
       aout_getnfile(a_outname, &defaultEs) == -1))
 	errx(1, "%s: bad format", a_outname);
 	/*

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 01:18:35 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6ABD410656D5;
	Tue, 24 Mar 2009 01:18:35 +0000 (UTC)
	(envelope-from obrien@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5795E8FC24;
	Tue, 24 Mar 2009 01:18:35 +0000 (UTC)
	(envelope-from obrien@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 n2O1IZH5027411;
	Tue, 24 Mar 2009 01:18:35 GMT (envelope-from obrien@svn.freebsd.org)
Received: (from obrien@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2O1IZLl027410;
	Tue, 24 Mar 2009 01:18:35 GMT (envelope-from obrien@svn.freebsd.org)
Message-Id: <200903240118.n2O1IZLl027410@svn.freebsd.org>
From: "David E. O'Brien" 
Date: Tue, 24 Mar 2009 01:18:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190353 - stable/7/tools/tools/usb
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 01:18:36 -0000

Author: obrien
Date: Tue Mar 24 01:18:35 2009
New Revision: 190353
URL: http://svn.freebsd.org/changeset/base/190353

Log:
  MFC: r187102 / r187107: Update fech URL.

Modified:
  stable/7/tools/tools/usb/   (props changed)
  stable/7/tools/tools/usb/print-usb-if-vids.sh

Modified: stable/7/tools/tools/usb/print-usb-if-vids.sh
==============================================================================
--- stable/7/tools/tools/usb/print-usb-if-vids.sh	Tue Mar 24 00:46:44 2009	(r190352)
+++ stable/7/tools/tools/usb/print-usb-if-vids.sh	Tue Mar 24 01:18:35 2009	(r190353)
@@ -27,5 +27,5 @@
 # $FreeBSD$
 
 
-fetch -o /tmp/usb.if http://www.usb.org/app/pub/dump/comp_dump/
+fetch -o /tmp/usb.if http://www.usb.org/developers/tools/comp_dump/
 awk -F '|' '{ printf "%#06x\t%s\n", $1, $2 }' < /tmp/usb.if | sort

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 01:22:12 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 01:31:42 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 992501065677;
	Tue, 24 Mar 2009 01:31:42 +0000 (UTC)
	(envelope-from obrien@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 84CA78FC18;
	Tue, 24 Mar 2009 01:31:42 +0000 (UTC)
	(envelope-from obrien@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 n2O1Vgn9027853;
	Tue, 24 Mar 2009 01:31:42 GMT (envelope-from obrien@svn.freebsd.org)
Received: (from obrien@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2O1Vgts027851;
	Tue, 24 Mar 2009 01:31:42 GMT (envelope-from obrien@svn.freebsd.org)
Message-Id: <200903240131.n2O1Vgts027851@svn.freebsd.org>
From: "David E. O'Brien" 
Date: Tue, 24 Mar 2009 01:31:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190355 - stable/7/sbin/mount
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 01:31:43 -0000

Author: obrien
Date: Tue Mar 24 01:31:42 2009
New Revision: 190355
URL: http://svn.freebsd.org/changeset/base/190355

Log:
  MFC:
  r189397: Add a -o mountprog parameter to mount which explicitly allows an
  	 alternative program to be used for mounting a file system.
  r187035/r187093/r187130: Don't overflow buffers when processing -o options.

Modified:
  stable/7/sbin/mount/   (props changed)
  stable/7/sbin/mount/mount.8
  stable/7/sbin/mount/mount.c

Modified: stable/7/sbin/mount/mount.8
==============================================================================
--- stable/7/sbin/mount/mount.8	Tue Mar 24 01:22:12 2009	(r190354)
+++ stable/7/sbin/mount/mount.8	Tue Mar 24 01:31:42 2009	(r190355)
@@ -28,7 +28,7 @@
 .\"     @(#)mount.8	8.8 (Berkeley) 6/16/94
 .\" $FreeBSD$
 .\"
-.Dd July 12, 2006
+.Dd March 11, 2008
 .Dt MOUNT 8
 .Os
 .Sh NAME
@@ -163,6 +163,15 @@ is run with the
 flag but without the
 .Fl l
 flag.
+.It Cm mountprog Ns = Ns Aq Ar program
+Force
+.Nm
+to use the specified program to mount the file system, instead of calling
+.Xr nmount 2
+directly.  For example:
+.Bd -literal
+mount -t foofs -o mountprog=/mydir/fooprog /dev/acd0 /mnt
+.Ed
 .It Cm multilabel
 Enable multi-label Mandatory Access Control, or MAC, on the specified file
 system.
@@ -335,14 +344,14 @@ For example, the
 .Nm
 command:
 .Bd -literal -offset indent
-mount -t unionfs -o -b /sys $HOME/sys
+mount -t cd9660 -o -e /dev/cd0 /cdrom
 .Ed
 .Pp
 causes
 .Nm
 to execute the equivalent of:
 .Bd -literal -offset indent
-/sbin/mount_unionfs -b /sys $HOME/sys
+/sbin/mount_cd9660 -e /dev/cd0 /cdrom
 .Ed
 .Pp
 Additional options specific to file system types
@@ -510,7 +519,6 @@ support for a particular file system mig
 .Xr mount_nwfs 8 ,
 .Xr mount_portalfs 8 ,
 .Xr mount_smbfs 8 ,
-.Xr mount_std 8 ,
 .Xr mount_udf 8 ,
 .Xr mount_unionfs 8 ,
 .Xr umount 8

Modified: stable/7/sbin/mount/mount.c
==============================================================================
--- stable/7/sbin/mount/mount.c	Tue Mar 24 01:22:12 2009	(r190354)
+++ stable/7/sbin/mount/mount.c	Tue Mar 24 01:31:42 2009	(r190355)
@@ -31,16 +31,14 @@
 static const char copyright[] =
 "@(#) Copyright (c) 1980, 1989, 1993, 1994\n\
 	The Regents of the University of California.  All rights reserved.\n";
-#endif /* not lint */
-
-#ifndef lint
 #if 0
 static char sccsid[] = "@(#)mount.c	8.25 (Berkeley) 5/8/95";
 #endif
-static const char rcsid[] =
-  "$FreeBSD$";
 #endif /* not lint */
 
+#include 
+__FBSDID("$FreeBSD$");
+
 #include 
 #include 
 #include 
@@ -70,12 +68,18 @@ static const char rcsid[] =
 
 int debug, fstab_style, verbose;
 
+struct cpa {
+	char	**a;
+	ssize_t	sz;
+	int	c;
+};
+
 char   *catopt(char *, const char *);
 struct statfs *getmntpt(const char *);
 int	hasopt(const char *, const char *);
 int	ismounted(struct fstab *, struct statfs *, int);
 int	isremountable(const char *);
-void	mangle(char *, int *, char *[]);
+void	mangle(char *, struct cpa *);
 char   *update_options(char *, char *, int);
 int	mountfs(const char *, const char *, const char *,
 			int, const char *, const char *);
@@ -125,6 +129,8 @@ remountable_fs_names[] = {
 static const char userquotaeq[] = "userquota=";
 static const char groupquotaeq[] = "groupquota=";
 
+static char *mountprog = NULL;
+
 static int
 use_mountprog(const char *vfstype)
 {
@@ -139,11 +145,14 @@ use_mountprog(const char *vfstype)
 	NULL
 	};
 
+	if (mountprog != NULL)
+		return (1);
+
 	for (i = 0; fs[i] != NULL; ++i) {
 		if (strcmp(vfstype, fs[i]) == 0)
 			return (1);
 	}
-	
+
 	return (0);
 }
 
@@ -161,8 +170,10 @@ exec_mountprog(const char *name, const c
 		/* Go find an executable. */
 		execvP(execname, _PATH_SYSPATH, argv);
 		if (errno == ENOENT) {
-			warn("exec %s not found in %s", execname,
-			    _PATH_SYSPATH);
+			warn("exec %s not found", execname);
+			if (execname[0] != '/') {
+				warnx("in path: %s", _PATH_SYSPATH);
+			}
 		}
 		exit(1);
 	default:				/* Parent. */
@@ -208,7 +219,7 @@ static void
 restart_mountd(void)
 {
 	struct pidfh *pfh;
-	pid_t mountdpid; 
+	pid_t mountdpid;
 
 	pfh = pidfile_open(_PATH_MOUNTDPID, 0600, &mountdpid);
 	if (pfh != NULL) {
@@ -300,7 +311,7 @@ main(int argc, char *argv[])
 
 	if ((init_flags & MNT_UPDATE) && (ro == 0))
 		options = catopt(options, "noro");
- 
+
 	rval = 0;
 	switch (argc) {
 	case 0:
@@ -497,14 +508,26 @@ hasopt(const char *mntopts, const char *
 	return (found);
 }
 
+static void
+append_arg(struct cpa *sa, char *arg)
+{
+	if (sa->c + 1 == sa->sz) {
+		sa->sz = sa->sz == 0 ? 8 : sa->sz * 2;
+		sa->a = realloc(sa->a, sizeof(sa->a) * sa->sz);
+		if (sa->a == NULL)
+			errx(1, "realloc failed");
+	}
+	sa->a[++sa->c] = arg;
+}
+
 int
 mountfs(const char *vfstype, const char *spec, const char *name, int flags,
 	const char *options, const char *mntopts)
 {
-	char *argv[100];
 	struct statfs sf;
-	int argc, i, ret;
+	int i, ret;
 	char *optbuf, execname[PATH_MAX], mntpath[PATH_MAX];
+	static struct cpa mnt_argv;
 
 	/* resolve the mountpoint with realpath(3) */
 	(void)checkpath(name, mntpath);
@@ -539,28 +562,31 @@ mountfs(const char *vfstype, const char 
 	/* Construct the name of the appropriate mount command */
 	(void)snprintf(execname, sizeof(execname), "mount_%s", vfstype);
 
-	argc = 0;
-	argv[argc++] = execname;
-	mangle(optbuf, &argc, argv);
-	argv[argc++] = strdup(spec);
-	argv[argc++] = strdup(name);
-	argv[argc] = NULL;
+	mnt_argv.c = -1;
+	append_arg(&mnt_argv, execname);
+	mangle(optbuf, &mnt_argv);
+	if (mountprog != NULL)
+		strcpy(execname, mountprog);
+
+	append_arg(&mnt_argv, strdup(spec));
+	append_arg(&mnt_argv, strdup(name));
+	append_arg(&mnt_argv, NULL);
 
 	if (debug) {
 		if (use_mountprog(vfstype))
-			printf("exec: mount_%s", vfstype);
+			printf("exec: %s", execname);
 		else
 			printf("mount -t %s", vfstype);
-		for (i = 1; i < argc; i++)
-			(void)printf(" %s", argv[i]);
+		for (i = 1; i < mnt_argv.c; i++)
+			(void)printf(" %s", mnt_argv.a[i]);
 		(void)printf("\n");
 		return (0);
 	}
 
 	if (use_mountprog(vfstype)) {
-		ret = exec_mountprog(name, execname, argv);
+		ret = exec_mountprog(name, execname, mnt_argv.a);
 	} else {
-		ret = mount_fs(vfstype, argc, argv); 
+		ret = mount_fs(vfstype, mnt_argv.c, mnt_argv.a);
 	}
 
 	free(optbuf);
@@ -663,12 +689,10 @@ catopt(char *s0, const char *s1)
 }
 
 void
-mangle(char *options, int *argcp, char *argv[])
+mangle(char *options, struct cpa *a)
 {
-	char *p, *s;
-	int argc;
+	char *p, *s, *val;
 
-	argc = *argcp;
 	for (s = options; (p = strsep(&s, ",")) != NULL;)
 		if (*p != '\0') {
 			if (strcmp(p, "noauto") == 0) {
@@ -689,6 +713,22 @@ mangle(char *options, int *argcp, char *
 				 * before mountd starts.
 				 */
 				continue;
+			} else if (strncmp(p, "mountprog", 9) == 0) {
+				/*
+				 * "mountprog" is used to force the use of
+				 * userland mount programs.
+				 */
+				val = strchr(p, '=');
+                        	if (val != NULL) {
+                                	++val;
+					if (*val != '\0')
+						mountprog = strdup(val);
+				}
+
+				if (mountprog == NULL) {
+					errx(1, "Need value for -o mountprog");
+				}
+				continue;
 			} else if (strcmp(p, "userquota") == 0) {
 				continue;
 			} else if (strncmp(p, userquotaeq,
@@ -700,19 +740,17 @@ mangle(char *options, int *argcp, char *
 			    sizeof(groupquotaeq) - 1) == 0) {
 				continue;
 			} else if (*p == '-') {
-				argv[argc++] = p;
+				append_arg(a, p);
 				p = strchr(p, '=');
 				if (p != NULL) {
 					*p = '\0';
-					argv[argc++] = p+1;
+					append_arg(a, p + 1);
 				}
 			} else {
-				argv[argc++] = strdup("-o");
-				argv[argc++] = p;
+				append_arg(a, strdup("-o"));
+				append_arg(a, p);
 			}
 		}
-
-	*argcp = argc;
 }
 
 

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 01:32:32 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: obrien@freebsd.org
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 01:35:59 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4315C106566C;
	Tue, 24 Mar 2009 01:35:59 +0000 (UTC)
	(envelope-from obrien@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 261178FC0A;
	Tue, 24 Mar 2009 01:35:59 +0000 (UTC)
	(envelope-from obrien@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 n2O1Zxcn028001;
	Tue, 24 Mar 2009 01:35:59 GMT (envelope-from obrien@svn.freebsd.org)
Received: (from obrien@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2O1ZxP4027999;
	Tue, 24 Mar 2009 01:35:59 GMT (envelope-from obrien@svn.freebsd.org)
Message-Id: <200903240135.n2O1ZxP4027999@svn.freebsd.org>
From: "David E. O'Brien" 
Date: Tue, 24 Mar 2009 01:35:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190356 - stable/7/usr.sbin/burncd
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 01:35:59 -0000

Author: obrien
Date: Tue Mar 24 01:35:58 2009
New Revision: 190356
URL: http://svn.freebsd.org/changeset/base/190356

Log:
  MFC: r186337/r186444/186784: burncd(8) doesn't handle signals and interrupting
  burncd during operation.  Add signal handling by doing a CDRIOCFLUSH ioctl
  to attempt to leave burner in a sane state when burning is interrupted with
  SIGHUP, SIGINT, SIGTERM, or in case an I/O error occurs during write.

Modified:
  stable/7/usr.sbin/burncd/   (props changed)
  stable/7/usr.sbin/burncd/Makefile
  stable/7/usr.sbin/burncd/burncd.c

Modified: stable/7/usr.sbin/burncd/Makefile
==============================================================================
--- stable/7/usr.sbin/burncd/Makefile	Tue Mar 24 01:31:42 2009	(r190355)
+++ stable/7/usr.sbin/burncd/Makefile	Tue Mar 24 01:35:58 2009	(r190356)
@@ -3,6 +3,6 @@
 PROG=	burncd
 MAN=	burncd.8
 
-WARNS?=	5
+WARNS?=	6
 
 .include 

Modified: stable/7/usr.sbin/burncd/burncd.c
==============================================================================
--- stable/7/usr.sbin/burncd/burncd.c	Tue Mar 24 01:31:42 2009	(r190355)
+++ stable/7/usr.sbin/burncd/burncd.c	Tue Mar 24 01:35:58 2009	(r190356)
@@ -29,6 +29,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -57,7 +58,8 @@ struct track_info {
 	int	addr;
 };
 static struct track_info tracks[100];
-static int global_fd_for_cleanup, quiet, verbose, saved_block_size, notracks;
+static int quiet, verbose, saved_block_size, notracks;
+static volatile sig_atomic_t global_fd_for_cleanup;
 
 void add_track(char *, int, int, int);
 void do_DAO(int fd, int, int);
@@ -67,6 +69,8 @@ int write_file(int fd, struct track_info
 int roundup_blocks(struct track_info *);
 void cue_ent(struct cdr_cue_entry *, int, int, int, int, int, int, int);
 void cleanup(int);
+void cleanup_flush(void);
+void cleanup_signal(int);
 void usage(void);
 
 int
@@ -157,6 +161,9 @@ main(int argc, char **argv)
 
 	global_fd_for_cleanup = fd;
 	err_set_exit(cleanup);
+	signal(SIGHUP, cleanup_signal);
+	signal(SIGINT, cleanup_signal);
+	signal(SIGTERM, cleanup_signal);
 
 	for (arg = 0; arg < argc; arg++) {
 		if (!strcasecmp(argv[arg], "fixate")) {
@@ -319,6 +326,10 @@ main(int argc, char **argv)
 	if (eject)
 		if (ioctl(fd, CDIOCEJECT) < 0)
 			err(EX_IOERR, "ioctl(CDIOCEJECT)");
+
+	signal(SIGHUP, SIG_DFL);
+	signal(SIGINT, SIG_DFL);
+	signal(SIGTERM, SIG_DFL);
 	close(fd);
 	exit(EX_OK);
 }
@@ -469,8 +480,10 @@ do_DAO(int fd, int test_write, int multi
 		err(EX_IOERR, "ioctl(CDRIOCSENDCUE)");
 
 	for (i = 0; i < notracks; i++) {
-		if (write_file(fd, &tracks[i]))
+		if (write_file(fd, &tracks[i])) {
+			cleanup_flush();
 			err(EX_IOERR, "write_file");
+		}
 	}
 
 	ioctl(fd, CDRIOCFLUSH);
@@ -499,8 +512,10 @@ do_TAO(int fd, int test_write, int preem
 		if (!quiet)
 			fprintf(stderr, "next writeable LBA %d\n",
 				tracks[i].addr);
-		if (write_file(fd, &tracks[i]))
+		if (write_file(fd, &tracks[i])) {
+			cleanup_flush();
 			err(EX_IOERR, "write_file");
+		}
 		if (ioctl(fd, CDRIOCFLUSH) < 0)
 			err(EX_IOERR, "ioctl(CDRIOCFLUSH)");
 	}
@@ -630,9 +645,11 @@ write_file(int fd, struct track_info *tr
 				track_info->block_size;
 		}
 		if ((res = write(fd, buf, count)) != count) {
-			if (res == -1)
-				fprintf(stderr, "\n%s\n", strerror(errno));
-			else
+			if (res == -1) {
+				fprintf(stderr, "\n");
+				close(track_info->file);
+				return errno;
+			} else
 				fprintf(stderr, "\nonly wrote %d of %jd"
 				    " bytes\n", res, (intmax_t)count);
 			break;
@@ -693,6 +710,22 @@ cleanup(int dummy __unused)
 }
 
 void
+cleanup_flush(void)
+{
+	if (ioctl(global_fd_for_cleanup, CDRIOCFLUSH) < 0)
+		err(EX_IOERR, "ioctl(CDRIOCFLUSH)");
+}
+
+void
+cleanup_signal(int sig)
+{
+	signal(sig, SIG_IGN);
+	ioctl(global_fd_for_cleanup, CDRIOCFLUSH);
+	write(STDERR_FILENO, "\nAborted\n", 10);
+	_exit(EXIT_FAILURE);
+}
+
+void
 usage(void)
 {
 	fprintf(stderr,

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 01:50:34 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 01:51:42 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D29101065670;
	Tue, 24 Mar 2009 01:51:42 +0000 (UTC)
	(envelope-from obrien@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BC25D8FC0C;
	Tue, 24 Mar 2009 01:51:42 +0000 (UTC)
	(envelope-from obrien@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 n2O1pgEG028703;
	Tue, 24 Mar 2009 01:51:42 GMT (envelope-from obrien@svn.freebsd.org)
Received: (from obrien@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2O1pgT0028693;
	Tue, 24 Mar 2009 01:51:42 GMT (envelope-from obrien@svn.freebsd.org)
Message-Id: <200903240151.n2O1pgT0028693@svn.freebsd.org>
From: "David E. O'Brien" 
Date: Tue, 24 Mar 2009 01:51:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190357 - in stable/7: gnu/usr.bin/grep include
	lib/libelf sbin/fsck sbin/fsck_ffs sbin/mount usr.bin/gprof
	usr.bin/make usr.sbin/crunch usr.sbin/sade usr.sbin/sysinstall
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 01:51:43 -0000

Author: obrien
Date: Tue Mar 24 01:51:42 2009
New Revision: 190357
URL: http://svn.freebsd.org/changeset/base/190357

Log:
  MFC: r186581: Sound less scary about errorousous disk geometry.

Modified:
  stable/7/gnu/usr.bin/grep/   (props changed)
  stable/7/include/   (props changed)
  stable/7/lib/libelf/   (props changed)
  stable/7/sbin/fsck/   (props changed)
  stable/7/sbin/fsck/fsck.8
  stable/7/sbin/fsck/fsck.c
  stable/7/sbin/fsck/fsutil.h
  stable/7/sbin/fsck_ffs/   (props changed)
  stable/7/sbin/fsck_ffs/fsck.h
  stable/7/sbin/fsck_ffs/fsck_ffs.8
  stable/7/sbin/fsck_ffs/main.c
  stable/7/sbin/fsck_ffs/setup.c
  stable/7/sbin/mount/   (props changed)
  stable/7/usr.bin/gprof/   (props changed)
  stable/7/usr.bin/make/   (props changed)
  stable/7/usr.sbin/crunch/   (props changed)
  stable/7/usr.sbin/sade/   (props changed)
  stable/7/usr.sbin/sade/disks.c
  stable/7/usr.sbin/sysinstall/   (props changed)
  stable/7/usr.sbin/sysinstall/disks.c
  stable/7/usr.sbin/sysinstall/sysinstall.8

Modified: stable/7/sbin/fsck/fsck.8
==============================================================================
--- stable/7/sbin/fsck/fsck.8	Tue Mar 24 01:35:58 2009	(r190356)
+++ stable/7/sbin/fsck/fsck.8	Tue Mar 24 01:51:42 2009	(r190357)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 25, 2009
+.Dd April 25, 2001
 .Dt FSCK 8
 .Os
 .Sh NAME
@@ -37,7 +37,7 @@
 .Nd file system consistency check and interactive repair
 .Sh SYNOPSIS
 .Nm
-.Op Fl Cdfnpvy
+.Op Fl dfnpvy
 .Op Fl B | F
 .Op Fl T Ar fstype : Ns Ar fsoptions
 .Op Fl t Ar fstype
@@ -112,11 +112,6 @@ to be the partition and slice designator
 .Pp
 The options are as follows:
 .Bl -tag -width indent
-.It Fl C
-Check if the
-.Dq clean
-flag is set in the superblock and skip file system checks if file system was
-properly dismounted and marked clean.
 .It Fl d
 Debugging mode.
 Just print the commands without executing them.

Modified: stable/7/sbin/fsck/fsck.c
==============================================================================
--- stable/7/sbin/fsck/fsck.c	Tue Mar 24 01:35:58 2009	(r190356)
+++ stable/7/sbin/fsck/fsck.c	Tue Mar 24 01:51:42 2009	(r190357)
@@ -103,7 +103,7 @@ main(int argc, char *argv[])
 	TAILQ_INIT(&selhead);
 	TAILQ_INIT(&opthead);
 
-	while ((i = getopt(argc, argv, "BCdvpfFnyl:t:T:")) != -1)
+	while ((i = getopt(argc, argv, "BdvpfFnyl:t:T:")) != -1)
 		switch (i) {
 		case 'B':
 			if (flags & CHECK_BACKGRD)
@@ -128,9 +128,6 @@ main(int argc, char *argv[])
 		case 'p':
 			flags |= CHECK_PREEN;
 			/*FALLTHROUGH*/
-		case 'C':
-			flags |= CHECK_CLEAN;
-			/*FALLTHROUGH*/
 		case 'n':
 		case 'y':
 			globopt[1] = i;
@@ -569,7 +566,7 @@ static void
 usage(void)
 {
 	static const char common[] =
-	    "[-Cdfnpvy] [-B | -F] [-T fstype:fsoptions] [-t fstype]";
+	    "[-dfnpvy] [-B | -F] [-T fstype:fsoptions] [-t fstype]";
 
 	(void)fprintf(stderr, "usage: %s %s [special | node] ...\n",
 	    getprogname(), common);

Modified: stable/7/sbin/fsck/fsutil.h
==============================================================================
--- stable/7/sbin/fsck/fsutil.h	Tue Mar 24 01:35:58 2009	(r190356)
+++ stable/7/sbin/fsck/fsutil.h	Tue Mar 24 01:51:42 2009	(r190357)
@@ -48,7 +48,6 @@ char *estrdup(const char *);
 #define	CHECK_DEBUG	0x0004
 #define	CHECK_BACKGRD	0x0008
 #define	DO_BACKGRD	0x0010
-#define	CHECK_CLEAN	0x0020
 
 struct fstab;
 int checkfstab(int, int (*)(struct fstab *), 

Modified: stable/7/sbin/fsck_ffs/fsck.h
==============================================================================
--- stable/7/sbin/fsck_ffs/fsck.h	Tue Mar 24 01:35:58 2009	(r190356)
+++ stable/7/sbin/fsck_ffs/fsck.h	Tue Mar 24 01:51:42 2009	(r190357)
@@ -271,7 +271,6 @@ int	bkgrdflag;		/* use a snapshot to run
 int	bflag;			/* location of alternate super block */
 int	debug;			/* output debugging info */
 char	damagedflag;		/* run in damaged mode */
-char	ckclean;		/* only do work if not cleanly unmounted */
 int	cvtlevel;		/* convert to newer file system format */
 int	bkgrdcheck;		/* determine if background check is possible */
 int	bkgrdsumadj;		/* whether the kernel have ability to adjust superblock summary */

Modified: stable/7/sbin/fsck_ffs/fsck_ffs.8
==============================================================================
--- stable/7/sbin/fsck_ffs/fsck_ffs.8	Tue Mar 24 01:35:58 2009	(r190356)
+++ stable/7/sbin/fsck_ffs/fsck_ffs.8	Tue Mar 24 01:51:42 2009	(r190357)
@@ -29,7 +29,7 @@
 .\"	@(#)fsck.8	8.4 (Berkeley) 5/9/95
 .\" $FreeBSD$
 .\"
-.Dd January 25, 2009
+.Dd January 20, 2009
 .Dt FSCK_FFS 8
 .Os
 .Sh NAME
@@ -46,9 +46,9 @@
 .Ar ...
 .Sh DESCRIPTION
 The specified disk partitions and/or file systems are checked.
-In "preen" or "check clean" mode the clean flag of each file system's
-superblock is examined and only those file systems that are not marked clean
-are checked.
+In "preen" mode the clean flag of each file system's superblock is examined
+and only those file systems that
+are not marked clean are checked.
 File systems are marked clean when they are unmounted,
 when they have been mounted read-only, or when
 .Nm
@@ -175,14 +175,6 @@ Use the block specified immediately afte
 the super block for the file system.
 An alternate super block is usually located at block 32 for UFS1,
 and block 160 for UFS2.
-.It Fl C
-Check if file system was dismouted cleanly.
-If so, skip file system checks (like "preen").
-However, if the file system was not cleanly dismounted, do full checks,
-is if
-.Nm
-was invoked without
-.Fl C .
 .It Fl c
 Convert the file system to the specified level.
 Note that the level of a file system can only be raised.

Modified: stable/7/sbin/fsck_ffs/main.c
==============================================================================
--- stable/7/sbin/fsck_ffs/main.c	Tue Mar 24 01:35:58 2009	(r190356)
+++ stable/7/sbin/fsck_ffs/main.c	Tue Mar 24 01:51:42 2009	(r190357)
@@ -82,7 +82,7 @@ main(int argc, char *argv[])
 	sync();
 	skipclean = 1;
 	damagedflag = 0;
-	while ((ch = getopt(argc, argv, "b:Bc:CdDfFm:npy")) != -1) {
+	while ((ch = getopt(argc, argv, "b:Bc:dDfFm:npy")) != -1) {
 		switch (ch) {
 		case 'b':
 			skipclean = 0;
@@ -132,10 +132,6 @@ main(int argc, char *argv[])
 
 		case 'p':
 			preen++;
-			/*FALLTHROUGH*/
-
-		case 'C':
-			ckclean++;
 			break;
 
 		case 'y':
@@ -155,7 +151,7 @@ main(int argc, char *argv[])
 
 	if (signal(SIGINT, SIG_IGN) != SIG_IGN)
 		(void)signal(SIGINT, catch);
-	if (ckclean)
+	if (preen)
 		(void)signal(SIGQUIT, catchquit);
 	signal(SIGINFO, infohandler);
 	if (bkgrdflag) {
@@ -220,7 +216,7 @@ checkfilesys(char *filesys)
 	errmsg[0] = '\0';
 
 	cdevname = filesys;
-	if (debug && ckclean)
+	if (debug && preen)
 		pwarn("starting\n");
 	/*
 	 * Make best effort to get the disk name. Check first to see
@@ -255,7 +251,7 @@ checkfilesys(char *filesys)
 			exit(7);	/* Filesystem clean, report it now */
 		exit(0);
 	}
-	if (ckclean && skipclean) {
+	if (preen && skipclean) {
 		/*
 		 * If file system is gjournaled, check it here.
 		 */
@@ -306,7 +302,7 @@ checkfilesys(char *filesys)
 					    "CANNOT RUN IN BACKGROUND\n");
 				}
 				if ((sblock.fs_flags & FS_UNCLEAN) == 0 &&
-				    skipclean && ckclean) {
+				    skipclean && preen) {
 					/*
 					 * file system is clean;
 					 * skip snapshot and report it clean

Modified: stable/7/sbin/fsck_ffs/setup.c
==============================================================================
--- stable/7/sbin/fsck_ffs/setup.c	Tue Mar 24 01:35:58 2009	(r190356)
+++ stable/7/sbin/fsck_ffs/setup.c	Tue Mar 24 01:51:42 2009	(r190357)
@@ -65,7 +65,7 @@ static struct disklabel *getdisklabel(ch
 /*
  * Read in a superblock finding an alternate if necessary.
  * Return 1 if successful, 0 if unsuccessful, -1 if file system
- * is already clean (ckclean and preen mode only).
+ * is already clean (preen mode only).
  */
 int
 setup(char *dev)
@@ -201,7 +201,7 @@ setup(char *dev)
 		pwarn("USING ALTERNATE SUPERBLOCK AT %d\n", bflag);
 		bflag = 0;
 	}
-	if (skipclean && ckclean && sblock.fs_clean) {
+	if (skipclean && preen && sblock.fs_clean) {
 		pwarn("FILE SYSTEM CLEAN; SKIPPING CHECKS\n");
 		return (-1);
 	}

Modified: stable/7/usr.sbin/sade/disks.c
==============================================================================
--- stable/7/usr.sbin/sade/disks.c	Tue Mar 24 01:35:58 2009	(r190356)
+++ stable/7/usr.sbin/sade/disks.c	Tue Mar 24 01:51:42 2009	(r190357)
@@ -103,6 +103,47 @@ record_chunks(Disk *d)
 static daddr_t Total;
 
 static void
+check_geometry(Disk *d)
+{
+    int sg;
+
+#ifdef PC98
+    if (d->bios_cyl >= 65536 || d->bios_hd > 256 || d->bios_sect >= 256)
+#else
+    if (d->bios_cyl > 65536 || d->bios_hd > 256 || d->bios_sect >= 64)
+#endif
+    {
+	dialog_clear_norefresh();
+	sg = msgYesNo("WARNING:  It is safe to use a geometry of %lu/%lu/%lu for %s on\n"
+		      "computers with modern BIOS versions.  If this disk is to be used\n"
+		      "on rather old machines, however, it is recommended to ensure that\n"
+		      "it does not have more than 65535 cylinders, or more than 255 heads\n"
+		      "or more than "
+#ifdef PC98
+		      "255"
+#else
+		      "63"
+#endif
+		      " sectors per track.\n"
+		      "\n"
+		      "Would you like that to keep using the current geometry?\n",
+		      d->bios_cyl, d->bios_hd, d->bios_sect, d->name);
+	if (sg == 1) {
+	    Sanitize_Bios_Geom(d);
+	    msgConfirm("A geometry of %lu/%lu/%lu was calculated for %s.\n"
+		       "\n"
+		       "If you are not sure about this, please consult the Hardware Guide\n"
+		       "in the Documentation submenu or use the (G)eometry command to\n"
+		       "change it.  Remember: you need to enter whatever your BIOS thinks\n"
+		       "the geometry is!  For IDE, it's what you were told in the BIOS\n"
+		       "setup.  For SCSI, it's the translation mode your controller is\n"
+		       "using.  Do NOT use a ``physical geometry''.\n",
+		       d->bios_cyl, d->bios_hd, d->bios_sect, d->name);
+	}
+    }
+}
+
+static void
 print_chunks(Disk *d, int u)
 {
     int row;
@@ -116,26 +157,6 @@ print_chunks(Disk *d, int u)
     Total = 0;
     for (i = 0; chunk_info[i]; i++)
 	Total += chunk_info[i]->size;
-#ifdef PC98
-    if (d->bios_cyl >= 65536 || d->bios_hd > 256 || d->bios_sect >= 256) {
-#else
-    if (d->bios_cyl > 65536 || d->bios_hd > 256 || d->bios_sect >= 64) {
-#endif
-	dialog_clear_norefresh();
-	msgConfirm("WARNING:  A geometry of %lu/%lu/%lu for %s is incorrect.  Using\n"
-		   "a more likely geometry.  If this geometry is incorrect or you\n"
-		   "are unsure as to whether or not it's correct, please consult\n"
-		   "the Hardware Guide in the Documentation submenu or use the\n"
-		   "(G)eometry command to change it now.\n\n"
-		   "Remember: you need to enter whatever your BIOS thinks the\n"
-		   "geometry is!  For IDE, it's what you were told in the BIOS\n"
-		   "setup. For SCSI, it's the translation mode your controller is\n"
-		   "using.  Do NOT use a ``physical geometry''.",
-	  d->bios_cyl, d->bios_hd, d->bios_sect, d->name);
-	Sanitize_Bios_Geom(d);
-	msgDebug("Sanitized geometry for %s is %lu/%lu/%lu.\n",
-	    d->name, d->bios_cyl, d->bios_hd, d->bios_sect);
-    }
     attrset(A_NORMAL);
     mvaddstr(0, 0, "Disk name:\t");
     clrtobot();
@@ -339,6 +360,9 @@ diskPartition(Device *dev)
     /* Set up the chunk array */
     record_chunks(d);
 
+    /* Give the user a chance to sanitize the disk geometry, if necessary */
+    check_geometry(d);
+
     while (chunking) {
 	char *val, geometry[80];
 	    
@@ -909,22 +933,25 @@ diskPartitionNonInteractive(Device *dev)
     record_chunks(d);
     cp = variable_get(VAR_GEOMETRY);
     if (cp) {
-	msgDebug("Setting geometry from script to: %s\n", cp);
-	d->bios_cyl = strtol(cp, &cp, 0);
-	d->bios_hd = strtol(cp + 1, &cp, 0);
-	d->bios_sect = strtol(cp + 1, 0, 0);
-    }
-
+	if (!strcasecmp(cp, "sane")) {
 #ifdef PC98
-    if (d->bios_cyl >= 65536 || d->bios_hd > 256 || d->bios_sect >= 256) {
+	    if (d->bios_cyl >= 65536 || d->bios_hd > 256 || d->bios_sect >= 256)
 #else
-    if (d->bios_cyl > 65536 || d->bios_hd > 256 || d->bios_sect >= 64) {
+	    if (d->bios_cyl > 65536 || d->bios_hd > 256 || d->bios_sect >= 64)
 #endif
-	msgDebug("Warning:  A geometry of %lu/%lu/%lu for %s is incorrect.\n",
-	    d->bios_cyl, d->bios_hd, d->bios_sect, d->name);
-	Sanitize_Bios_Geom(d);
-	msgDebug("Sanitized geometry for %s is %lu/%lu/%lu.\n",
-	    d->name, d->bios_cyl, d->bios_hd, d->bios_sect);
+	    {
+		msgDebug("Warning:  A geometry of %lu/%lu/%lu for %s is incorrect.\n",
+		    d->bios_cyl, d->bios_hd, d->bios_sect, d->name);
+		Sanitize_Bios_Geom(d);
+		msgDebug("Sanitized geometry for %s is %lu/%lu/%lu.\n",
+		    d->name, d->bios_cyl, d->bios_hd, d->bios_sect);
+	    }
+	} else {
+	    msgDebug("Setting geometry from script to: %s\n", cp);
+	    d->bios_cyl = strtol(cp, &cp, 0);
+	    d->bios_hd = strtol(cp + 1, &cp, 0);
+	    d->bios_sect = strtol(cp + 1, 0, 0);
+	}
     }
 
     cp = variable_get(VAR_PARTITION);

Modified: stable/7/usr.sbin/sysinstall/disks.c
==============================================================================
--- stable/7/usr.sbin/sysinstall/disks.c	Tue Mar 24 01:35:58 2009	(r190356)
+++ stable/7/usr.sbin/sysinstall/disks.c	Tue Mar 24 01:51:42 2009	(r190357)
@@ -106,6 +106,47 @@ record_chunks(Disk *d)
 static daddr_t Total;
 
 static void
+check_geometry(Disk *d)
+{
+    int sg;
+
+#ifdef PC98
+    if (d->bios_cyl >= 65536 || d->bios_hd > 256 || d->bios_sect >= 256)
+#else
+    if (d->bios_cyl > 65536 || d->bios_hd > 256 || d->bios_sect >= 64)
+#endif
+    {
+	dialog_clear_norefresh();
+	sg = msgYesNo("WARNING:  It is safe to use a geometry of %lu/%lu/%lu for %s on\n"
+		      "computers with modern BIOS versions.  If this disk is to be used\n"
+		      "on rather old machines, however, it is recommended to ensure that\n"
+		      "it does not have more than 65535 cylinders, or more than 255 heads\n"
+		      "or more than "
+#ifdef PC98
+		      "255"
+#else
+		      "63"
+#endif
+		      " sectors per track.\n"
+		      "\n"
+		      "Would you like that to keep using the current geometry?\n",
+		      d->bios_cyl, d->bios_hd, d->bios_sect, d->name);
+	if (sg == 1) {
+	    Sanitize_Bios_Geom(d);
+	    msgConfirm("A geometry of %lu/%lu/%lu was calculated for %s.\n"
+		       "\n"
+		       "If you are not sure about this, please consult the Hardware Guide\n"
+		       "in the Documentation submenu or use the (G)eometry command to\n"
+		       "change it.  Remember: you need to enter whatever your BIOS thinks\n"
+		       "the geometry is!  For IDE, it's what you were told in the BIOS\n"
+		       "setup.  For SCSI, it's the translation mode your controller is\n"
+		       "using.  Do NOT use a ``physical geometry''.\n",
+		       d->bios_cyl, d->bios_hd, d->bios_sect, d->name);
+	}
+    }
+}
+
+static void
 print_chunks(Disk *d, int u)
 {
     int row;
@@ -119,24 +160,6 @@ print_chunks(Disk *d, int u)
     Total = 0;
     for (i = 0; chunk_info[i]; i++)
 	Total += chunk_info[i]->size;
-#ifdef PC98
-    if (d->bios_cyl >= 65536 || d->bios_hd > 256 || d->bios_sect >= 256) {
-#else
-    if (d->bios_cyl > 65536 || d->bios_hd > 256 || d->bios_sect >= 64) {
-#endif
-	dialog_clear_norefresh();
-	msgConfirm("WARNING:  A geometry of %lu/%lu/%lu for %s is incorrect.  Using\n"
-		   "a more likely geometry.  If this geometry is incorrect or you\n"
-		   "are unsure as to whether or not it's correct, please consult\n"
-		   "the Hardware Guide in the Documentation submenu or use the\n"
-		   "(G)eometry command to change it now.\n\n"
-		   "Remember: you need to enter whatever your BIOS thinks the\n"
-		   "geometry is!  For IDE, it's what you were told in the BIOS\n"
-		   "setup. For SCSI, it's the translation mode your controller is\n"
-		   "using.  Do NOT use a ``physical geometry''.",
-	  d->bios_cyl, d->bios_hd, d->bios_sect, d->name);
-	Sanitize_Bios_Geom(d);
-    }
     attrset(A_NORMAL);
     mvaddstr(0, 0, "Disk name:\t");
     clrtobot();
@@ -341,6 +364,9 @@ diskPartition(Device *dev)
     /* Set up the chunk array */
     record_chunks(d);
 
+    /* Give the user a chance to sanitize the disk geometry, if necessary */
+    check_geometry(d);
+
     while (chunking) {
 	char *val, geometry[80];
 	    
@@ -916,21 +942,24 @@ diskPartitionNonInteractive(Device *dev)
     record_chunks(d);
     cp = variable_get(VAR_GEOMETRY);
     if (cp) {
-	msgDebug("Setting geometry from script to: %s\n", cp);
-	d->bios_cyl = strtol(cp, &cp, 0);
-	d->bios_hd = strtol(cp + 1, &cp, 0);
-	d->bios_sect = strtol(cp + 1, 0, 0);
-    } else {
+	if (!strcasecmp(cp, "sane")) {
 #ifdef PC98
-	if (d->bios_cyl >= 65536 || d->bios_hd > 256 || d->bios_sect >= 256) {
+	    if (d->bios_cyl >= 65536 || d->bios_hd > 256 || d->bios_sect >= 256)
 #else
-	if (d->bios_cyl > 65536 || d->bios_hd > 256 || d->bios_sect >= 64) {
+	    if (d->bios_cyl > 65536 || d->bios_hd > 256 || d->bios_sect >= 64)
 #endif
-	    msgDebug("Warning:  A geometry of %lu/%lu/%lu for %s is incorrect.\n",
-		d->bios_cyl, d->bios_hd, d->bios_sect, d->name);
-	    Sanitize_Bios_Geom(d);
-	    msgDebug("Sanitized geometry for %s is %lu/%lu/%lu.\n",
-		d->name, d->bios_cyl, d->bios_hd, d->bios_sect);
+	    {
+		msgDebug("Warning:  A geometry of %lu/%lu/%lu for %s is incorrect.\n",
+		    d->bios_cyl, d->bios_hd, d->bios_sect, d->name);
+		Sanitize_Bios_Geom(d);
+		msgDebug("Sanitized geometry for %s is %lu/%lu/%lu.\n",
+		    d->name, d->bios_cyl, d->bios_hd, d->bios_sect);
+	    }
+	} else {
+	    msgDebug("Setting geometry from script to: %s\n", cp);
+	    d->bios_cyl = strtol(cp, &cp, 0);
+	    d->bios_hd = strtol(cp + 1, &cp, 0);
+	    d->bios_sect = strtol(cp + 1, 0, 0);
 	}
     }
 

Modified: stable/7/usr.sbin/sysinstall/sysinstall.8
==============================================================================
--- stable/7/usr.sbin/sysinstall/sysinstall.8	Tue Mar 24 01:35:58 2009	(r190356)
+++ stable/7/usr.sbin/sysinstall/sysinstall.8	Tue Mar 24 01:51:42 2009	(r190357)
@@ -249,6 +249,12 @@ Invokes the disk partition (MBR) editor.
 .Bl -tag -width findx
 .It geometry
 The disk geometry, as a cyls/heads/sectors formatted string.
+The word "sane" instructs
+.Nm
+to calculate a safe (not necessarily optimal) geometry if the
+current one has more than 65535 cylinders, more than 256 heads or
+more than 63 sectors per track (255 sectors on the PC98
+architecture).
 Default: no
 change to geometry.
 .It partition

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 01:54:17 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D1661106566B;
	Tue, 24 Mar 2009 01:54:17 +0000 (UTC)
	(envelope-from obrien@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BCFA48FC0C;
	Tue, 24 Mar 2009 01:54:17 +0000 (UTC)
	(envelope-from obrien@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 n2O1sHFj028847;
	Tue, 24 Mar 2009 01:54:17 GMT (envelope-from obrien@svn.freebsd.org)
Received: (from obrien@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2O1sHqE028846;
	Tue, 24 Mar 2009 01:54:17 GMT (envelope-from obrien@svn.freebsd.org)
Message-Id: <200903240154.n2O1sHqE028846@svn.freebsd.org>
From: "David E. O'Brien" 
Date: Tue, 24 Mar 2009 01:54:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190358 - stable/7/sbin/mount
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 01:54:18 -0000

Author: obrien
Date: Tue Mar 24 01:54:17 2009
New Revision: 190358
URL: http://svn.freebsd.org/changeset/base/190358

Log:
  MFC: 186291: Use strlcpy().

Modified:
  stable/7/sbin/mount/   (props changed)
  stable/7/sbin/mount/mount_fs.c   (contents, props changed)

Modified: stable/7/sbin/mount/mount_fs.c
==============================================================================
--- stable/7/sbin/mount/mount_fs.c	Tue Mar 24 01:51:42 2009	(r190357)
+++ stable/7/sbin/mount/mount_fs.c	Tue Mar 24 01:54:17 2009	(r190358)
@@ -88,7 +88,7 @@ mount_fs(const char *vfstype, int argc, 
 	char *p, *val;
 	int ret;
 
-	strncpy(fstype, vfstype, sizeof(fstype));
+	strlcpy(fstype, vfstype, sizeof(fstype));
 	memset(errmsg, 0, sizeof(errmsg));
 
 	getmnt_silent = 1;

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 01:56:16 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 99467106566B;
	Tue, 24 Mar 2009 01:56:16 +0000 (UTC)
	(envelope-from obrien@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 85AC18FC18;
	Tue, 24 Mar 2009 01:56:16 +0000 (UTC)
	(envelope-from obrien@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 n2O1uGMs028960;
	Tue, 24 Mar 2009 01:56:16 GMT (envelope-from obrien@svn.freebsd.org)
Received: (from obrien@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2O1uGXF028958;
	Tue, 24 Mar 2009 01:56:16 GMT (envelope-from obrien@svn.freebsd.org)
Message-Id: <200903240156.n2O1uGXF028958@svn.freebsd.org>
From: "David E. O'Brien" 
Date: Tue, 24 Mar 2009 01:56:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190359 - stable/7/usr.sbin/syslogd
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 01:56:17 -0000

Author: obrien
Date: Tue Mar 24 01:56:16 2009
New Revision: 190359
URL: http://svn.freebsd.org/changeset/base/190359

Log:
  MFC: r186234/r186236: Use passed parameter rather than a hard coded value.
  Bump WARNS to 3.

Modified:
  stable/7/usr.sbin/syslogd/   (props changed)
  stable/7/usr.sbin/syslogd/Makefile
  stable/7/usr.sbin/syslogd/syslogd.c

Modified: stable/7/usr.sbin/syslogd/Makefile
==============================================================================
--- stable/7/usr.sbin/syslogd/Makefile	Tue Mar 24 01:54:17 2009	(r190358)
+++ stable/7/usr.sbin/syslogd/Makefile	Tue Mar 24 01:56:16 2009	(r190359)
@@ -12,7 +12,7 @@ SRCS=	syslogd.c ttymsg.c
 DPADD=	${LIBUTIL}
 LDADD=	-lutil
 
-WARNS?=	1
+WARNS?=	3
 
 .if ${MK_INET6_SUPPORT} != "no"
 CFLAGS+= -DINET6

Modified: stable/7/usr.sbin/syslogd/syslogd.c
==============================================================================
--- stable/7/usr.sbin/syslogd/syslogd.c	Tue Mar 24 01:54:17 2009	(r190358)
+++ stable/7/usr.sbin/syslogd/syslogd.c	Tue Mar 24 01:56:16 2009	(r190359)
@@ -330,7 +330,7 @@ static void	reapchild(int);
 static void	usage(void);
 static int	validate(struct sockaddr *, const char *);
 static void	unmapped(struct sockaddr *);
-static void	wallmsg(struct filed *, struct iovec *);
+static void	wallmsg(struct filed *, struct iovec *, const int iovlen);
 static int	waitdaemon(int, int, int);
 static void	timedout(int);
 static void	double_rbuf(int);
@@ -1060,10 +1060,11 @@ dofsync(void)
 	}
 }
 
+#define IOV_SIZE 7
 static void
 fprintlog(struct filed *f, int flags, const char *msg)
 {
-	struct iovec iov[7];
+	struct iovec iov[IOV_SIZE];
 	struct iovec *v;
 	struct addrinfo *r;
 	int i, l, lsent = 0;
@@ -1248,7 +1249,7 @@ fprintlog(struct filed *f, int flags, co
 		dprintf(" %s\n", f->f_un.f_fname);
 		v->iov_base = lf;
 		v->iov_len = 1;
-		if (writev(f->f_file, iov, 7) < 0) {
+		if (writev(f->f_file, iov, IOV_SIZE) < 0) {
 			/*
 			 * If writev(2) fails for potentially transient errors
 			 * like the filesystem being full, ignore it.
@@ -1279,7 +1280,7 @@ fprintlog(struct filed *f, int flags, co
 				break;
 			}
 		}
-		if (writev(f->f_file, iov, 7) < 0) {
+		if (writev(f->f_file, iov, IOV_SIZE) < 0) {
 			int e = errno;
 			(void)close(f->f_file);
 			if (f->f_un.f_pipe.f_pid > 0)
@@ -1304,7 +1305,7 @@ fprintlog(struct filed *f, int flags, co
 		v->iov_len = 2;
 
 		errno = 0;	/* ttymsg() only sometimes returns an errno */
-		if ((msgret = ttymsg(iov, 7, f->f_un.f_fname, 10))) {
+		if ((msgret = ttymsg(iov, IOV_SIZE, f->f_un.f_fname, 10))) {
 			f->f_type = F_UNUSED;
 			logerror(msgret);
 		}
@@ -1315,7 +1316,7 @@ fprintlog(struct filed *f, int flags, co
 		dprintf("\n");
 		v->iov_base = crlf;
 		v->iov_len = 2;
-		wallmsg(f, iov);
+		wallmsg(f, iov, IOV_SIZE);
 		break;
 	}
 	f->f_prevcount = 0;
@@ -1329,7 +1330,7 @@ fprintlog(struct filed *f, int flags, co
  *	world, or a list of approved users.
  */
 static void
-wallmsg(struct filed *f, struct iovec *iov)
+wallmsg(struct filed *f, struct iovec *iov, const int iovlen)
 {
 	static int reenter;			/* avoid calling ourselves */
 	FILE *uf;
@@ -1353,7 +1354,8 @@ wallmsg(struct filed *f, struct iovec *i
 		strncpy(line, ut.ut_line, sizeof(line) - 1);
 		line[sizeof(line) - 1] = '\0';
 		if (f->f_type == F_WALL) {
-			if ((p = ttymsg(iov, 7, line, TTYMSGTIME)) != NULL) {
+			if ((p = ttymsg(iov, iovlen, line, TTYMSGTIME)) !=
+			    NULL) {
 				errno = 0;	/* already in msg */
 				logerror(p);
 			}
@@ -1365,8 +1367,8 @@ wallmsg(struct filed *f, struct iovec *i
 				break;
 			if (!strncmp(f->f_un.f_uname[i], ut.ut_name,
 			    UT_NAMESIZE)) {
-				if ((p = ttymsg(iov, 7, line, TTYMSGTIME))
-								!= NULL) {
+				if ((p = ttymsg(iov, iovlen, line, TTYMSGTIME))
+				    != NULL) {
 					errno = 0;	/* already in msg */
 					logerror(p);
 				}

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 02:09:48 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6EFDC106564A;
	Tue, 24 Mar 2009 02:09:48 +0000 (UTC)
	(envelope-from obrien@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 51B438FC0C;
	Tue, 24 Mar 2009 02:09:48 +0000 (UTC)
	(envelope-from obrien@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 n2O29mB8029267;
	Tue, 24 Mar 2009 02:09:48 GMT (envelope-from obrien@svn.freebsd.org)
Received: (from obrien@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2O29mPB029266;
	Tue, 24 Mar 2009 02:09:48 GMT (envelope-from obrien@svn.freebsd.org)
Message-Id: <200903240209.n2O29mPB029266@svn.freebsd.org>
From: "David E. O'Brien" 
Date: Tue, 24 Mar 2009 02:09:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190360 - in stable/7/sys: . amd64/linux32 contrib/pf
	dev/ath/ath_hal dev/cxgb
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 02:09:49 -0000

Author: obrien
Date: Tue Mar 24 02:09:48 2009
New Revision: 190360
URL: http://svn.freebsd.org/changeset/base/190360

Log:
  MFC: r187964: Fix the inconsistent tabbing.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/amd64/linux32/linux32_sysvec.c
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)

Modified: stable/7/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- stable/7/sys/amd64/linux32/linux32_sysvec.c	Tue Mar 24 01:56:16 2009	(r190359)
+++ stable/7/sys/amd64/linux32/linux32_sysvec.c	Tue Mar 24 02:09:48 2009	(r190360)
@@ -353,11 +353,11 @@ linux_rt_sendsig(sig_t catcher, ksiginfo
 	bsd_to_linux_sigset(mask, &frame.sf_sc.uc_sigmask);
 
 	frame.sf_sc.uc_mcontext.sc_mask   = frame.sf_sc.uc_sigmask.__bits[0];
-        frame.sf_sc.uc_mcontext.sc_gs     = rgs();
-        frame.sf_sc.uc_mcontext.sc_fs     = rfs();
-        __asm __volatile("movl %%es,%0" :
+	frame.sf_sc.uc_mcontext.sc_gs     = rgs();
+	frame.sf_sc.uc_mcontext.sc_fs     = rfs();
+	__asm __volatile("movl %%es,%0" :
 	    "=rm" (frame.sf_sc.uc_mcontext.sc_es));
-        __asm __volatile("movl %%ds,%0" :
+	__asm __volatile("movl %%ds,%0" :
 	    "=rm" (frame.sf_sc.uc_mcontext.sc_ds));
 	frame.sf_sc.uc_mcontext.sc_edi    = regs->tf_rdi;
 	frame.sf_sc.uc_mcontext.sc_esi    = regs->tf_rsi;
@@ -487,10 +487,10 @@ linux_sendsig(sig_t catcher, ksiginfo_t 
 	 * Build the signal context to be used by sigreturn.
 	 */
 	frame.sf_sc.sc_mask   = lmask.__bits[0];
-        frame.sf_sc.sc_gs     = rgs();
-        frame.sf_sc.sc_fs     = rfs();
-        __asm __volatile("movl %%es,%0" : "=rm" (frame.sf_sc.sc_es));
-        __asm __volatile("movl %%ds,%0" : "=rm" (frame.sf_sc.sc_ds));
+	frame.sf_sc.sc_gs     = rgs();
+	frame.sf_sc.sc_fs     = rfs();
+	__asm __volatile("movl %%es,%0" : "=rm" (frame.sf_sc.sc_es));
+	__asm __volatile("movl %%ds,%0" : "=rm" (frame.sf_sc.sc_ds));
 	frame.sf_sc.sc_edi    = regs->tf_rdi;
 	frame.sf_sc.sc_esi    = regs->tf_rsi;
 	frame.sf_sc.sc_ebp    = regs->tf_rbp;
@@ -772,35 +772,36 @@ static int	exec_linux_imgact_try(struct 
 static int
 exec_linux_imgact_try(struct image_params *imgp)
 {
-    const char *head = (const char *)imgp->image_header;
-    char *rpath;
-    int error = -1, len;
-
-    /*
-     * The interpreter for shell scripts run from a linux binary needs
-     * to be located in /compat/linux if possible in order to recursively
-     * maintain linux path emulation.
-     */
-    if (((const short *)head)[0] == SHELLMAGIC) {
-	    /*
-	     * Run our normal shell image activator.  If it succeeds attempt
-	     * to use the alternate path for the interpreter.  If an alternate
-	     * path is found, use our stringspace to store it.
-	     */
-	    if ((error = exec_shell_imgact(imgp)) == 0) {
-		    linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc),
-			imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0);
-		    if (rpath != NULL) {
-			    len = strlen(rpath) + 1;
-
-			    if (len <= MAXSHELLCMDLEN) {
-				    memcpy(imgp->interpreter_name, rpath, len);
-			    }
-			    free(rpath, M_TEMP);
-		    }
-	    }
-    }
-    return(error);
+	const char *head = (const char *)imgp->image_header;
+	char *rpath;
+	int error = -1, len;
+
+	/*
+	 * The interpreter for shell scripts run from a linux binary needs
+	 * to be located in /compat/linux if possible in order to recursively
+	 * maintain linux path emulation.
+	 */
+	if (((const short *)head)[0] == SHELLMAGIC) {
+		/*
+		 * Run our normal shell image activator.  If it succeeds
+		 * attempt to use the alternate path for the interpreter.  If
+		 * an alternate path is found, use our stringspace to store it.
+		 */
+		if ((error = exec_shell_imgact(imgp)) == 0) {
+			linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc),
+			    imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0);
+			if (rpath != NULL) {
+				len = strlen(rpath) + 1;
+
+				if (len <= MAXSHELLCMDLEN) {
+					memcpy(imgp->interpreter_name, rpath,
+					    len);
+				}
+				free(rpath, M_TEMP);
+			}
+		}
+	}
+	return(error);
 }
 
 /*
@@ -868,7 +869,7 @@ linux_copyout_strings(struct image_param
 	arginfo = (struct linux32_ps_strings *)LINUX32_PS_STRINGS;
 	sigcodesz = *(imgp->proc->p_sysent->sv_szsigcode);
 	destp =	(caddr_t)arginfo - sigcodesz - SPARE_USRSPACE -
-		roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *));
+	    roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *));
 
 	/*
 	 * install sigcode
@@ -886,23 +887,24 @@ linux_copyout_strings(struct image_param
 		 * 'AT_COUNT*2' is size for the ELF Auxargs data. This is for
 		 * lower compatibility.
 		 */
-		imgp->auxarg_size = (imgp->auxarg_size) ? imgp->auxarg_size
-			: (AT_COUNT * 2);
+		imgp->auxarg_size = (imgp->auxarg_size) ? imgp->auxarg_size :
+		    (AT_COUNT * 2);
 		/*
 		 * The '+ 2' is for the null pointers at the end of each of
 		 * the arg and env vector sets,and imgp->auxarg_size is room
 		 * for argument of Runtime loader.
 		 */
-		vectp = (u_int32_t *) (destp - (imgp->args->argc + imgp->args->envc + 2 +
-				       imgp->auxarg_size) * sizeof(u_int32_t));
+		vectp = (u_int32_t *)(destp - (imgp->args->argc +
+		    imgp->args->envc + 2 + imgp->auxarg_size) *
+		    sizeof(u_int32_t));
 
 	} else
 		/*
 		 * The '+ 2' is for the null pointers at the end of each of
 		 * the arg and env vector sets
 		 */
-		vectp = (u_int32_t *)
-			(destp - (imgp->args->argc + imgp->args->envc + 2) * sizeof(u_int32_t));
+		vectp = (u_int32_t *)(destp - (imgp->args->argc +
+		    imgp->args->envc + 2) * sizeof(u_int32_t));
 
 	/*
 	 * vectp also becomes our initial stack base
@@ -974,7 +976,7 @@ linux32_fixlimit(struct rlimit *rl, int 
 
 	switch (which) {
 	case RLIMIT_DATA:
-		if (linux32_maxdsiz != 0) {			
+		if (linux32_maxdsiz != 0) {
 			if (rl->rlim_cur > linux32_maxdsiz)
 				rl->rlim_cur = linux32_maxdsiz;
 			if (rl->rlim_max > linux32_maxdsiz)
@@ -1083,12 +1085,12 @@ linux_elf_modevent(module_t mod, int typ
 			sx_init(&emul_shared_lock, "emuldata->shared lock");
 			LIST_INIT(&futex_list);
 			sx_init(&futex_sx, "futex protection lock");
-			linux_exit_tag = EVENTHANDLER_REGISTER(process_exit, linux_proc_exit,
-			      NULL, 1000);
-			linux_schedtail_tag = EVENTHANDLER_REGISTER(schedtail, linux_schedtail,
-			      NULL, 1000);
-			linux_exec_tag = EVENTHANDLER_REGISTER(process_exec, linux_proc_exec,
-			      NULL, 1000);
+			linux_exit_tag = EVENTHANDLER_REGISTER(process_exit,
+			    linux_proc_exit, NULL, 1000);
+			linux_schedtail_tag = EVENTHANDLER_REGISTER(schedtail,
+			    linux_schedtail, NULL, 1000);
+			linux_exec_tag = EVENTHANDLER_REGISTER(process_exec,
+			    linux_proc_exec, NULL, 1000);
 			if (bootverbose)
 				printf("Linux ELF exec handler installed\n");
 		} else

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 02:25:42 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AC4CE106566B;
	Tue, 24 Mar 2009 02:25:42 +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 7B0258FC13;
	Tue, 24 Mar 2009 02:25:42 +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 n2O2PfaC030869
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 23 Mar 2009 19:25:41 -0700 (PDT) (envelope-from sam@freebsd.org)
Message-ID: <49C844A5.5080506@freebsd.org>
Date: Mon, 23 Mar 2009 19:25:41 -0700
From: Sam Leffler 
Organization: FreeBSD Project
User-Agent: Thunderbird 2.0.0.18 (X11/20081209)
MIME-Version: 1.0
To: "David E. O'Brien" 
References: <200903240151.n2O1pgT0028693@svn.freebsd.org>
In-Reply-To: <200903240151.n2O1pgT0028693@svn.freebsd.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-DCC-sonic.net-Metrics: ebb.errno.com; whitelist
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-7@freebsd.org
Subject: Re: svn commit: r190357 - in stable/7: gnu/usr.bin/grep include
 lib/libelf
 sbin/fsck sbin/fsck_ffs sbin/mount usr.bin/gprof usr.bin/make
 usr.sbin/crunch usr.sbin/sade usr.sbin/sysinstall
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 02:25:42 -0000

David E. O'Brien wrote:
> Author: obrien
> Date: Tue Mar 24 01:51:42 2009
> New Revision: 190357
> URL: http://svn.freebsd.org/changeset/base/190357
>
> Log:
>   MFC: r186581: Sound less scary about errorousous disk geometry.
>
> Modified:
>   stable/7/gnu/usr.bin/grep/   (props changed)
>   stable/7/include/   (props changed)
>   stable/7/lib/libelf/   (props changed)
>   stable/7/sbin/fsck/   (props changed)
>   stable/7/sbin/fsck/fsck.8
>   stable/7/sbin/fsck/fsck.c
>   stable/7/sbin/fsck/fsutil.h
>   stable/7/sbin/fsck_ffs/   (props changed)
>   stable/7/sbin/fsck_ffs/fsck.h
>   stable/7/sbin/fsck_ffs/fsck_ffs.8
>   stable/7/sbin/fsck_ffs/main.c
>   stable/7/sbin/fsck_ffs/setup.c
>   stable/7/sbin/mount/   (props changed)
>   stable/7/usr.bin/gprof/   (props changed)
>   stable/7/usr.bin/make/   (props changed)
>   stable/7/usr.sbin/crunch/   (props changed)
>   stable/7/usr.sbin/sade/   (props changed)
>   stable/7/usr.sbin/sade/disks.c
>   stable/7/usr.sbin/sysinstall/   (props changed)
>   stable/7/usr.sbin/sysinstall/disks.c
>   stable/7/usr.sbin/sysinstall/sysinstall.8
>
>   

This looks to have many changes unrelated to r186581.  For example you 
just removed the -C option to fsck.

    Sam


From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 02:28:47 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A14F1106566B;
	Tue, 24 Mar 2009 02:28:47 +0000 (UTC)
	(envelope-from obrien@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 73C548FC18;
	Tue, 24 Mar 2009 02:28:47 +0000 (UTC)
	(envelope-from obrien@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 n2O2SlrX029745;
	Tue, 24 Mar 2009 02:28:47 GMT (envelope-from obrien@svn.freebsd.org)
Received: (from obrien@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2O2Slgr029742;
	Tue, 24 Mar 2009 02:28:47 GMT (envelope-from obrien@svn.freebsd.org)
Message-Id: <200903240228.n2O2Slgr029742@svn.freebsd.org>
From: "David E. O'Brien" 
Date: Tue, 24 Mar 2009 02:28:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190361 - stable/7/sbin/fsck
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 02:28:48 -0000

Author: obrien
Date: Tue Mar 24 02:28:46 2009
New Revision: 190361
URL: http://svn.freebsd.org/changeset/base/190361

Log:
  Revert r190357, in which I was just trying to get the merge info set at
  the src level.
  (turns out svn+ssh://obrien@svn.freebsd.org/base/head and
  svn+ssh://svn.freebsd.org/base/stable/7 are seen as two totally different
  repositories... Jeez subversion can be dumb...)

Modified:
  stable/7/sbin/fsck/fsck.8
  stable/7/sbin/fsck/fsck.c
  stable/7/sbin/fsck/fsutil.h

Modified: stable/7/sbin/fsck/fsck.8
==============================================================================
--- stable/7/sbin/fsck/fsck.8	Tue Mar 24 02:09:48 2009	(r190360)
+++ stable/7/sbin/fsck/fsck.8	Tue Mar 24 02:28:46 2009	(r190361)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 25, 2001
+.Dd January 25, 2009
 .Dt FSCK 8
 .Os
 .Sh NAME
@@ -37,7 +37,7 @@
 .Nd file system consistency check and interactive repair
 .Sh SYNOPSIS
 .Nm
-.Op Fl dfnpvy
+.Op Fl Cdfnpvy
 .Op Fl B | F
 .Op Fl T Ar fstype : Ns Ar fsoptions
 .Op Fl t Ar fstype
@@ -112,6 +112,11 @@ to be the partition and slice designator
 .Pp
 The options are as follows:
 .Bl -tag -width indent
+.It Fl C
+Check if the
+.Dq clean
+flag is set in the superblock and skip file system checks if file system was
+properly dismounted and marked clean.
 .It Fl d
 Debugging mode.
 Just print the commands without executing them.

Modified: stable/7/sbin/fsck/fsck.c
==============================================================================
--- stable/7/sbin/fsck/fsck.c	Tue Mar 24 02:09:48 2009	(r190360)
+++ stable/7/sbin/fsck/fsck.c	Tue Mar 24 02:28:46 2009	(r190361)
@@ -103,7 +103,7 @@ main(int argc, char *argv[])
 	TAILQ_INIT(&selhead);
 	TAILQ_INIT(&opthead);
 
-	while ((i = getopt(argc, argv, "BdvpfFnyl:t:T:")) != -1)
+	while ((i = getopt(argc, argv, "BCdvpfFnyl:t:T:")) != -1)
 		switch (i) {
 		case 'B':
 			if (flags & CHECK_BACKGRD)
@@ -128,6 +128,9 @@ main(int argc, char *argv[])
 		case 'p':
 			flags |= CHECK_PREEN;
 			/*FALLTHROUGH*/
+		case 'C':
+			flags |= CHECK_CLEAN;
+			/*FALLTHROUGH*/
 		case 'n':
 		case 'y':
 			globopt[1] = i;
@@ -566,7 +569,7 @@ static void
 usage(void)
 {
 	static const char common[] =
-	    "[-dfnpvy] [-B | -F] [-T fstype:fsoptions] [-t fstype]";
+	    "[-Cdfnpvy] [-B | -F] [-T fstype:fsoptions] [-t fstype]";
 
 	(void)fprintf(stderr, "usage: %s %s [special | node] ...\n",
 	    getprogname(), common);

Modified: stable/7/sbin/fsck/fsutil.h
==============================================================================
--- stable/7/sbin/fsck/fsutil.h	Tue Mar 24 02:09:48 2009	(r190360)
+++ stable/7/sbin/fsck/fsutil.h	Tue Mar 24 02:28:46 2009	(r190361)
@@ -48,6 +48,7 @@ char *estrdup(const char *);
 #define	CHECK_DEBUG	0x0004
 #define	CHECK_BACKGRD	0x0008
 #define	DO_BACKGRD	0x0010
+#define	CHECK_CLEAN	0x0020
 
 struct fstab;
 int checkfstab(int, int (*)(struct fstab *), 

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 02:29:03 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CBE601065677;
	Tue, 24 Mar 2009 02:29:03 +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 9ED4E8FC1F;
	Tue, 24 Mar 2009 02:29:03 +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 n2O2T3qI030896
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 23 Mar 2009 19:29:03 -0700 (PDT) (envelope-from sam@freebsd.org)
Message-ID: <49C8456E.2000903@freebsd.org>
Date: Mon, 23 Mar 2009 19:29:02 -0700
From: Sam Leffler 
Organization: FreeBSD Project
User-Agent: Thunderbird 2.0.0.18 (X11/20081209)
MIME-Version: 1.0
To: "David E. O'Brien" 
References: <200903240007.n2O07H1w025582@svn.freebsd.org>
In-Reply-To: <200903240007.n2O07H1w025582@svn.freebsd.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-DCC-sonic.net-Metrics: ebb.errno.com; whitelist
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-7@freebsd.org
Subject: Re: svn commit: r190345 - stable/7/usr.bin/make
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 02:29:04 -0000

David E. O'Brien wrote:
> Author: obrien
> Date: Tue Mar 24 00:07:17 2009
> New Revision: 190345
> URL: http://svn.freebsd.org/changeset/base/190345
>
> Log:
>   MFC:
>   r187475: Remove inlining of functions that are used mostly in different
>   	 object files.  This lets use to remove NO_WERROR.
>   r186558: Consistently use Var_SetGlobal().
>   r186713: Add the -Q be-quiet flag for parallel jobs.
>   r186279: Exit with error code 2 when run with -k (continue if errors)
>   	 and build failed.
>   r186559: Add the ability to tweak the token output before targets in job mode.
>   r181021: Add POSIX -p flag to make(1).
>   r186502: Clarify the behaviour of conditionals when dealing with comparisons.
>
>   

I find this combination of unrelated changes worrisome; especially the 
day the tree is supposed to freeze for release.  Please make changes 
separately so any problems can be cross-referenced against limited commits.

     Sam


From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 02:48:56 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B00161065674;
	Tue, 24 Mar 2009 02:48:56 +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 9BF878FC1A;
	Tue, 24 Mar 2009 02:48:56 +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 n2O2muKg030284;
	Tue, 24 Mar 2009 02:48:56 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2O2mt6p030250;
	Tue, 24 Mar 2009 02:48:55 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <200903240248.n2O2mt6p030250@svn.freebsd.org>
From: Doug Barton 
Date: Tue, 24 Mar 2009 02:48:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190362 - in stable/7/etc: . rc.d
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 02:48:57 -0000

Author: dougb
Date: Tue Mar 24 02:48:54 2009
New Revision: 190362
URL: http://svn.freebsd.org/changeset/base/190362

Log:
  MFC r180564, addition of the SHUTDOWN keyword to those scripts that
  start persistent services.

Modified:
  stable/7/etc/   (props changed)
  stable/7/etc/rc.d/amd
  stable/7/etc/rc.d/apmd
  stable/7/etc/rc.d/bsnmpd
  stable/7/etc/rc.d/bthidd
  stable/7/etc/rc.d/devd
  stable/7/etc/rc.d/ftp-proxy
  stable/7/etc/rc.d/ftpd
  stable/7/etc/rc.d/hcsecd
  stable/7/etc/rc.d/idmapd
  stable/7/etc/rc.d/keyserv
  stable/7/etc/rc.d/lockd
  stable/7/etc/rc.d/lpd
  stable/7/etc/rc.d/mountd
  stable/7/etc/rc.d/moused
  stable/7/etc/rc.d/nfsd
  stable/7/etc/rc.d/nscd
  stable/7/etc/rc.d/ntpd
  stable/7/etc/rc.d/powerd
  stable/7/etc/rc.d/rpcbind
  stable/7/etc/rc.d/rtadvd
  stable/7/etc/rc.d/rwho
  stable/7/etc/rc.d/sdpd
  stable/7/etc/rc.d/sendmail
  stable/7/etc/rc.d/sshd
  stable/7/etc/rc.d/statd
  stable/7/etc/rc.d/timed
  stable/7/etc/rc.d/ugidfw
  stable/7/etc/rc.d/watchdogd
  stable/7/etc/rc.d/ypbind
  stable/7/etc/rc.d/yppasswdd
  stable/7/etc/rc.d/ypserv
  stable/7/etc/rc.d/ypset
  stable/7/etc/rc.d/ypupdated
  stable/7/etc/rc.d/ypxfrd

Modified: stable/7/etc/rc.d/amd
==============================================================================
--- stable/7/etc/rc.d/amd	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/amd	Tue Mar 24 02:48:54 2009	(r190362)
@@ -6,7 +6,7 @@
 # PROVIDE: amd
 # REQUIRE: rpcbind ypbind nfsclient cleanvar ldconfig
 # BEFORE: DAEMON
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/apmd
==============================================================================
--- stable/7/etc/rc.d/apmd	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/apmd	Tue Mar 24 02:48:54 2009	(r190362)
@@ -6,7 +6,7 @@
 # PROVIDE: apmd
 # REQUIRE: DAEMON apm
 # BEFORE:  LOGIN
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/bsnmpd
==============================================================================
--- stable/7/etc/rc.d/bsnmpd	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/bsnmpd	Tue Mar 24 02:48:54 2009	(r190362)
@@ -5,7 +5,7 @@
 
 # PROVIDE: bsnmpd
 # REQUIRE: NETWORKING syslogd
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/bthidd
==============================================================================
--- stable/7/etc/rc.d/bthidd	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/bthidd	Tue Mar 24 02:48:54 2009	(r190362)
@@ -6,7 +6,7 @@
 # PROVIDE: bthidd
 # REQUIRE: DAEMON hcsecd
 # BEFORE: LOGIN
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/devd
==============================================================================
--- stable/7/etc/rc.d/devd	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/devd	Tue Mar 24 02:48:54 2009	(r190362)
@@ -6,7 +6,7 @@
 # PROVIDE: devd
 # REQUIRE: netif network_ipv6
 # BEFORE: NETWORKING mountcritremote
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/ftp-proxy
==============================================================================
--- stable/7/etc/rc.d/ftp-proxy	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/ftp-proxy	Tue Mar 24 02:48:54 2009	(r190362)
@@ -5,6 +5,7 @@
 
 # PROVIDE: ftp-proxy
 # REQUIRE: DAEMON pf
+# KEYWORD: shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/ftpd
==============================================================================
--- stable/7/etc/rc.d/ftpd	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/ftpd	Tue Mar 24 02:48:54 2009	(r190362)
@@ -5,6 +5,7 @@
 
 # PROVIDE: ftpd
 # REQUIRE: LOGIN cleanvar
+# KEYWORD: shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/hcsecd
==============================================================================
--- stable/7/etc/rc.d/hcsecd	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/hcsecd	Tue Mar 24 02:48:54 2009	(r190362)
@@ -6,7 +6,7 @@
 # PROVIDE: hcsecd
 # REQUIRE: DAEMON
 # BEFORE: LOGIN
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/idmapd
==============================================================================
--- stable/7/etc/rc.d/idmapd	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/idmapd	Tue Mar 24 02:48:54 2009	(r190362)
@@ -5,7 +5,7 @@
 
 # PROVIDE: idmapd
 # REQUIRE: rpcbind
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/keyserv
==============================================================================
--- stable/7/etc/rc.d/keyserv	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/keyserv	Tue Mar 24 02:48:54 2009	(r190362)
@@ -8,6 +8,7 @@
 # PROVIDE: keyserv
 # REQUIRE: ypbind
 # BEFORE: DAEMON
+# KEYWORD: shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/lockd
==============================================================================
--- stable/7/etc/rc.d/lockd	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/lockd	Tue Mar 24 02:48:54 2009	(r190362)
@@ -7,7 +7,7 @@
 # PROVIDE: lockd
 # REQUIRE: nfsserver nfsclient nfsd rpcbind statd
 # BEFORE:  DAEMON
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/lpd
==============================================================================
--- stable/7/etc/rc.d/lpd	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/lpd	Tue Mar 24 02:48:54 2009	(r190362)
@@ -6,6 +6,7 @@
 # PROVIDE: lpd
 # REQUIRE: DAEMON
 # BEFORE:  LOGIN
+# KEYWORD: shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/mountd
==============================================================================
--- stable/7/etc/rc.d/mountd	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/mountd	Tue Mar 24 02:48:54 2009	(r190362)
@@ -5,7 +5,7 @@
 
 # PROVIDE: mountd
 # REQUIRE: NETWORKING nfsserver rpcbind quota
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/moused
==============================================================================
--- stable/7/etc/rc.d/moused	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/moused	Tue Mar 24 02:48:54 2009	(r190362)
@@ -5,7 +5,7 @@
 
 # PROVIDE: moused
 # REQUIRE: DAEMON cleanvar
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/nfsd
==============================================================================
--- stable/7/etc/rc.d/nfsd	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/nfsd	Tue Mar 24 02:48:54 2009	(r190362)
@@ -5,7 +5,7 @@
 
 # PROVIDE: nfsd
 # REQUIRE: mountd
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/nscd
==============================================================================
--- stable/7/etc/rc.d/nscd	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/nscd	Tue Mar 24 02:48:54 2009	(r190362)
@@ -6,6 +6,7 @@
 # PROVIDE: nscd
 # REQUIRE: DAEMON
 # BEFORE: LOGIN
+# KEYWORD: shutdown
 
 #
 # Add the following lines to /etc/rc.conf to enable nscd:

Modified: stable/7/etc/rc.d/ntpd
==============================================================================
--- stable/7/etc/rc.d/ntpd	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/ntpd	Tue Mar 24 02:48:54 2009	(r190362)
@@ -6,7 +6,7 @@
 # PROVIDE: ntpd
 # REQUIRE: DAEMON ntpdate cleanvar devfs
 # BEFORE:  LOGIN
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/powerd
==============================================================================
--- stable/7/etc/rc.d/powerd	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/powerd	Tue Mar 24 02:48:54 2009	(r190362)
@@ -6,7 +6,7 @@
 # PROVIDE: powerd
 # REQUIRE: DAEMON
 # BEFORE: LOGIN
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/rpcbind
==============================================================================
--- stable/7/etc/rc.d/rpcbind	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/rpcbind	Tue Mar 24 02:48:54 2009	(r190362)
@@ -5,6 +5,7 @@
 
 # PROVIDE: rpcbind
 # REQUIRE: NETWORKING ntpdate syslogd named
+# KEYWORD: shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/rtadvd
==============================================================================
--- stable/7/etc/rc.d/rtadvd	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/rtadvd	Tue Mar 24 02:48:54 2009	(r190362)
@@ -6,7 +6,7 @@
 # PROVIDE: rtadvd
 # REQUIRE: DAEMON
 # BEFORE:  LOGIN
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/rwho
==============================================================================
--- stable/7/etc/rc.d/rwho	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/rwho	Tue Mar 24 02:48:54 2009	(r190362)
@@ -6,6 +6,7 @@
 # PROVIDE: rwho
 # REQUIRE: DAEMON
 # BEFORE:  LOGIN
+# KEYWORD: shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/sdpd
==============================================================================
--- stable/7/etc/rc.d/sdpd	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/sdpd	Tue Mar 24 02:48:54 2009	(r190362)
@@ -6,7 +6,7 @@
 # PROVIDE: sdpd
 # REQUIRE: DAEMON
 # BEFORE: LOGIN
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/sendmail
==============================================================================
--- stable/7/etc/rc.d/sendmail	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/sendmail	Tue Mar 24 02:48:54 2009	(r190362)
@@ -7,6 +7,7 @@
 # REQUIRE: LOGIN cleanvar
 #	we make mail start late, so that things like .forward's are not
 #	processed until the system is fully operational
+# KEYWORD: shutdown
 
 # XXX - Get together with sendmail mantainer to figure out how to
 #	better handle SENDMAIL_ENABLE and 3rd party MTAs.

Modified: stable/7/etc/rc.d/sshd
==============================================================================
--- stable/7/etc/rc.d/sshd	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/sshd	Tue Mar 24 02:48:54 2009	(r190362)
@@ -5,6 +5,7 @@
 
 # PROVIDE: sshd
 # REQUIRE: LOGIN cleanvar
+# KEYWORD: shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/statd
==============================================================================
--- stable/7/etc/rc.d/statd	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/statd	Tue Mar 24 02:48:54 2009	(r190362)
@@ -7,7 +7,7 @@
 # PROVIDE: statd
 # REQUIRE: nfsserver nfsclient nfsd rpcbind
 # BEFORE:  DAEMON
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/timed
==============================================================================
--- stable/7/etc/rc.d/timed	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/timed	Tue Mar 24 02:48:54 2009	(r190362)
@@ -6,7 +6,7 @@
 # PROVIDE: timed
 # REQUIRE: DAEMON
 # BEFORE:  LOGIN
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/ugidfw
==============================================================================
--- stable/7/etc/rc.d/ugidfw	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/ugidfw	Tue Mar 24 02:48:54 2009	(r190362)
@@ -4,7 +4,7 @@
 
 # PROVIDE: ugidfw
 # BEFORE: LOGIN
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/watchdogd
==============================================================================
--- stable/7/etc/rc.d/watchdogd	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/watchdogd	Tue Mar 24 02:48:54 2009	(r190362)
@@ -29,7 +29,7 @@
 
 # PROVIDE: watchdogd
 # REQUIRE: DAEMON cleanvar
-# KEYWORD: nojail
+# KEYWORD: nojail shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/ypbind
==============================================================================
--- stable/7/etc/rc.d/ypbind	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/ypbind	Tue Mar 24 02:48:54 2009	(r190362)
@@ -6,6 +6,7 @@
 # PROVIDE: ypbind
 # REQUIRE: ypserv
 # BEFORE:  DAEMON
+# KEYWORD: shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/yppasswdd
==============================================================================
--- stable/7/etc/rc.d/yppasswdd	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/yppasswdd	Tue Mar 24 02:48:54 2009	(r190362)
@@ -6,6 +6,7 @@
 # PROVIDE: yppasswdd
 # REQUIRE: ypserv ypbind
 # BEFORE:  LOGIN
+# KEYWORD: shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/ypserv
==============================================================================
--- stable/7/etc/rc.d/ypserv	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/ypserv	Tue Mar 24 02:48:54 2009	(r190362)
@@ -5,6 +5,7 @@
 
 # PROVIDE: ypserv
 # REQUIRE: rpcbind
+# KEYWORD: shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/ypset
==============================================================================
--- stable/7/etc/rc.d/ypset	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/ypset	Tue Mar 24 02:48:54 2009	(r190362)
@@ -5,6 +5,7 @@
 
 # PROVIDE: ypset
 # REQUIRE: ypbind
+# KEYWORD: shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/ypupdated
==============================================================================
--- stable/7/etc/rc.d/ypupdated	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/ypupdated	Tue Mar 24 02:48:54 2009	(r190362)
@@ -5,6 +5,7 @@
 
 # PROVIDE: ypupdated
 # REQUIRE: rpcbind ypserv
+# KEYWORD: shutdown
 
 . /etc/rc.subr
 

Modified: stable/7/etc/rc.d/ypxfrd
==============================================================================
--- stable/7/etc/rc.d/ypxfrd	Tue Mar 24 02:28:46 2009	(r190361)
+++ stable/7/etc/rc.d/ypxfrd	Tue Mar 24 02:48:54 2009	(r190362)
@@ -5,6 +5,7 @@
 
 # PROVIDE: ypxfrd
 # REQUIRE: rpcbind ypserv
+# KEYWORD: shutdown
 
 . /etc/rc.subr
 

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 02:54:15 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9E304106564A;
	Tue, 24 Mar 2009 02:54:15 +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 710ED8FC0A;
	Tue, 24 Mar 2009 02:54:15 +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 n2O2sFMs030456;
	Tue, 24 Mar 2009 02:54:15 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2O2sFNp030455;
	Tue, 24 Mar 2009 02:54:15 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <200903240254.n2O2sFNp030455@svn.freebsd.org>
From: Doug Barton 
Date: Tue, 24 Mar 2009 02:54:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190363 - in stable/7/etc: . rc.d
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 02:54:16 -0000

Author: dougb
Date: Tue Mar 24 02:54:15 2009
New Revision: 190363
URL: http://svn.freebsd.org/changeset/base/190363

Log:
  MFC r181114, make sure services and protocols are in the chroot /etc
  MFC r188293, improve handling of chroot inside of a jail

Modified:
  stable/7/etc/   (props changed)
  stable/7/etc/rc.d/named

Modified: stable/7/etc/rc.d/named
==============================================================================
--- stable/7/etc/rc.d/named	Tue Mar 24 02:48:54 2009	(r190362)
+++ stable/7/etc/rc.d/named	Tue Mar 24 02:54:15 2009	(r190363)
@@ -32,6 +32,8 @@ stop_postcmd="named_poststop"
 #
 chroot_autoupdate()
 {
+	local file
+
 	# Create (or update) the chroot directory structure
 	#
 	if [ -r /etc/mtree/BIND.chroot.dist ]; then
@@ -59,17 +61,32 @@ chroot_autoupdate()
 
 	# Mount a devfs in the chroot directory if needed
 	#
-	umount ${named_chrootdir}/dev 2>/dev/null
-	devfs_domount ${named_chrootdir}/dev devfsrules_hide_all
-	devfs -m ${named_chrootdir}/dev rule apply path null unhide
-	devfs -m ${named_chrootdir}/dev rule apply path random unhide
-
-	# Copy local timezone information if it is not up to date.
-	#
-	if [ -r /etc/localtime ]; then
-		cmp -s /etc/localtime "${named_chrootdir}/etc/localtime" ||
-		    cp -p /etc/localtime "${named_chrootdir}/etc/localtime"
+	if [ `${SYSCTL_N} security.jail.jailed` -eq 0 ]; then
+		umount ${named_chrootdir}/dev 2>/dev/null
+		devfs_domount ${named_chrootdir}/dev devfsrules_hide_all
+		devfs -m ${named_chrootdir}/dev rule apply path null unhide
+		devfs -m ${named_chrootdir}/dev rule apply path random unhide
+	else
+		if [ -c ${named_chrootdir}/dev/null -a \
+		    -c ${named_chrootdir}/dev/random ]; then
+			info "named chroot: using pre-mounted devfs."
+		else
+			err 1 "named chroot: devfs cannot be mounted from" \
+			    "within a jail. Thus a chrooted named cannot" \
+			    "be run from within a jail." \
+			    "To run named without chrooting it, set" \
+			    "named_chrootdir=\"\" in /etc/rc.conf."
+		fi
 	fi
+
+	# Copy and/or update key files to the chroot /etc 
+	#
+	for file in localtime protocols services; do
+		if [ -r /etc/$file ]; then
+			cmp -s /etc/$file "${named_chrootdir}/etc/$file" ||
+			    cp -p /etc/$file "${named_chrootdir}/etc/$file"
+		fi
+	done
 }
 
 # Make symlinks to the correct pid file
@@ -109,7 +126,12 @@ named_stop()
 named_poststop()
 {
 	if [ -n "${named_chrootdir}" -a -c ${named_chrootdir}/dev/null ]; then
-		umount ${named_chrootdir}/dev 2>/dev/null || true
+		if [ `${SYSCTL_N} security.jail.jailed` -eq 0 ]; then
+			umount ${named_chrootdir}/dev 2>/dev/null || true
+		else
+			warn "named chroot:" \
+			    "cannot unmount devfs from inside jail!"
+		fi
 	fi
 }
 

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 02:56:50 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C7D031065670;
	Tue, 24 Mar 2009 02:56:50 +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 B52C88FC12;
	Tue, 24 Mar 2009 02:56:50 +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 n2O2uo5S030600;
	Tue, 24 Mar 2009 02:56:50 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2O2uolg030599;
	Tue, 24 Mar 2009 02:56:50 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <200903240256.n2O2uolg030599@svn.freebsd.org>
From: Doug Barton 
Date: Tue, 24 Mar 2009 02:56:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190364 - in stable/7/etc: . defaults
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 02:56:51 -0000

Author: dougb
Date: Tue Mar 24 02:56:50 2009
New Revision: 190364
URL: http://svn.freebsd.org/changeset/base/190364

Log:
  MFC r181113, -c named_flags example and capitalization fix

Modified:
  stable/7/etc/   (props changed)
  stable/7/etc/defaults/rc.conf

Modified: stable/7/etc/defaults/rc.conf
==============================================================================
--- stable/7/etc/defaults/rc.conf	Tue Mar 24 02:54:15 2009	(r190363)
+++ stable/7/etc/defaults/rc.conf	Tue Mar 24 02:56:50 2009	(r190364)
@@ -239,8 +239,8 @@ inetd_flags="-wW -C 60"		# Optional flag
 # details.
 #
 named_enable="NO"		# Run named, the DNS server (or NO).
-named_program="/usr/sbin/named"	# path to named, if you want a different one.
-#named_flags="" 		# Flags for named
+named_program="/usr/sbin/named" # Path to named, if you want a different one.
+#named_flags="-c /etc/namedb/named.conf" # Uncomment for named not in /usr/sbin
 named_pidfile="/var/run/named/pid" # Must set this in named.conf as well
 named_uid="bind" 		# User to run named as
 named_chrootdir="/var/named"	# Chroot directory (or "" not to auto-chroot it)

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 03:05:41 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B56B3106564A;
	Tue, 24 Mar 2009 03:05: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 884658FC13;
	Tue, 24 Mar 2009 03:05: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 n2O35fpc030963;
	Tue, 24 Mar 2009 03:05:41 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2O35fVX030962;
	Tue, 24 Mar 2009 03:05:41 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <200903240305.n2O35fVX030962@svn.freebsd.org>
From: Doug Barton 
Date: Tue, 24 Mar 2009 03:05:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
X-SVN-Group: stable-6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190365 - in stable/6/etc: . rc.d
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 03:05:42 -0000

Author: dougb
Date: Tue Mar 24 03:05:41 2009
New Revision: 190365
URL: http://svn.freebsd.org/changeset/base/190365

Log:
  MFC r181114, make sure services and protocols are in the chroot /etc
  MFC r188293, improve handling of chroot inside of a jail

Modified:
  stable/6/etc/   (props changed)
  stable/6/etc/rc.d/named

Modified: stable/6/etc/rc.d/named
==============================================================================
--- stable/6/etc/rc.d/named	Tue Mar 24 02:56:50 2009	(r190364)
+++ stable/6/etc/rc.d/named	Tue Mar 24 03:05:41 2009	(r190365)
@@ -32,6 +32,8 @@ stop_postcmd="named_poststop"
 #
 chroot_autoupdate()
 {
+	local file
+
 	# Create (or update) the chroot directory structure
 	#
 	if [ -r /etc/mtree/BIND.chroot.dist ]; then
@@ -59,17 +61,32 @@ chroot_autoupdate()
 
 	# Mount a devfs in the chroot directory if needed
 	#
-	umount ${named_chrootdir}/dev 2>/dev/null
-	devfs_domount ${named_chrootdir}/dev devfsrules_hide_all
-	devfs -m ${named_chrootdir}/dev rule apply path null unhide
-	devfs -m ${named_chrootdir}/dev rule apply path random unhide
-
-	# Copy local timezone information if it is not up to date.
-	#
-	if [ -r /etc/localtime ]; then
-		cmp -s /etc/localtime "${named_chrootdir}/etc/localtime" ||
-		    cp -p /etc/localtime "${named_chrootdir}/etc/localtime"
+	if [ `${SYSCTL_N} security.jail.jailed` -eq 0 ]; then
+		umount ${named_chrootdir}/dev 2>/dev/null
+		devfs_domount ${named_chrootdir}/dev devfsrules_hide_all
+		devfs -m ${named_chrootdir}/dev rule apply path null unhide
+		devfs -m ${named_chrootdir}/dev rule apply path random unhide
+	else
+		if [ -c ${named_chrootdir}/dev/null -a \
+		    -c ${named_chrootdir}/dev/random ]; then
+			info "named chroot: using pre-mounted devfs."
+		else
+			err 1 "named chroot: devfs cannot be mounted from" \
+			    "within a jail. Thus a chrooted named cannot" \
+			    "be run from within a jail." \
+			    "To run named without chrooting it, set" \
+			    "named_chrootdir=\"\" in /etc/rc.conf."
+		fi
 	fi
+
+	# Copy and/or update key files to the chroot /etc 
+	#
+	for file in localtime protocols services; do
+		if [ -r /etc/$file ]; then
+			cmp -s /etc/$file "${named_chrootdir}/etc/$file" ||
+			    cp -p /etc/$file "${named_chrootdir}/etc/$file"
+		fi
+	done
 }
 
 # Make symlinks to the correct pid file
@@ -109,7 +126,12 @@ named_stop()
 named_poststop()
 {
 	if [ -n "${named_chrootdir}" -a -c ${named_chrootdir}/dev/null ]; then
-		umount ${named_chrootdir}/dev 2>/dev/null || true
+		if [ `${SYSCTL_N} security.jail.jailed` -eq 0 ]; then
+			umount ${named_chrootdir}/dev 2>/dev/null || true
+		else
+			warn "named chroot:" \
+			    "cannot unmount devfs from inside jail!"
+		fi
 	fi
 }
 

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 03:08:09 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ABD43106564A;
	Tue, 24 Mar 2009 03:08:09 +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 98E8B8FC15;
	Tue, 24 Mar 2009 03:08:09 +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 n2O389Vx031081;
	Tue, 24 Mar 2009 03:08:09 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2O3895E031080;
	Tue, 24 Mar 2009 03:08:09 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <200903240308.n2O3895E031080@svn.freebsd.org>
From: Doug Barton 
Date: Tue, 24 Mar 2009 03:08:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
X-SVN-Group: stable-6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190366 - in stable/6/etc: . defaults
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 03:08:10 -0000

Author: dougb
Date: Tue Mar 24 03:08:09 2009
New Revision: 190366
URL: http://svn.freebsd.org/changeset/base/190366

Log:
  MFC r181113, -c named_flags example and capitalization fix

Modified:
  stable/6/etc/   (props changed)
  stable/6/etc/defaults/rc.conf

Modified: stable/6/etc/defaults/rc.conf
==============================================================================
--- stable/6/etc/defaults/rc.conf	Tue Mar 24 03:05:41 2009	(r190365)
+++ stable/6/etc/defaults/rc.conf	Tue Mar 24 03:08:09 2009	(r190366)
@@ -220,8 +220,8 @@ inetd_flags="-wW -C 60"		# Optional flag
 # details.
 #
 named_enable="NO"		# Run named, the DNS server (or NO).
-named_program="/usr/sbin/named"	# path to named, if you want a different one.
-#named_flags="" 		# Flags for named
+named_program="/usr/sbin/named" # Path to named, if you want a different one.
+#named_flags="-c /etc/namedb/named.conf" # Uncomment for named not in /usr/sbin
 named_pidfile="/var/run/named/pid" # Must set this in named.conf as well
 named_uid="bind" 		# User to run named as
 named_chrootdir="/var/named"	# Chroot directory (or "" not to auto-chroot it)

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 04:20:18 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 04:36:32 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 65AB4106566C;
	Tue, 24 Mar 2009 04:36: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 40FB28FC0A;
	Tue, 24 Mar 2009 04:36: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 n2O4aPGl038999;
	Mon, 23 Mar 2009 21:36:25 -0700 (PDT)
	(envelope-from obrien@dragon.nuxi.org)
Received: (from obrien@localhost)
	by dragon.nuxi.org (8.14.3/8.14.2/Submit) id n2O4aONf038998;
	Mon, 23 Mar 2009 21:36:24 -0700 (PDT) (envelope-from obrien)
Date: Mon, 23 Mar 2009 21:36:24 -0700
From: "David O'Brien" 
To: Sam Leffler 
Message-ID: <20090324043624.GB34952@dragon.NUXI.org>
References: <200903240151.n2O1pgT0028693@svn.freebsd.org>
	<49C844A5.5080506@freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <49C844A5.5080506@freebsd.org>
X-Operating-System: FreeBSD 8.0-CURRENT
User-Agent: Mutt/1.5.16 (2007-06-09)
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-7@freebsd.org
Subject: Re: svn commit: r190357 - in stable/7: gnu/usr.bin/grep include
	lib/libelf sbin/fsck sbin/fsck_ffs sbin/mount usr.bin/gprof
	usr.bin/make usr.sbin/crunch usr.sbin/sade usr.sbin/sysinstall
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: obrien@freebsd.org
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 04:36:32 -0000

On Mon, Mar 23, 2009 at 07:25:41PM -0700, Sam Leffler wrote:
> David E. O'Brien wrote:
>> Author: obrien
>> Date: Tue Mar 24 01:51:42 2009
>> New Revision: 190357
>> URL: http://svn.freebsd.org/changeset/base/190357
>> 
>> Log:
>>   MFC: r186581: Sound less scary about errorousous disk geometry.
..
> This looks to have many changes unrelated to r186581.  For example you
> just removed the -C option to fsck.

I found out that Subversion wasn't getting the mergeinfo right.
It considers svn+ssh://obrien@svn.freebsd.org/base/ and
svn+ssh://svn.freebsd.org/base/ to be two totally seperate repositories.

So I did some 'merge -c ... --record-only' to get the earlier merges.
I fat fingered the ones for fsck, forgetting the --record-only the
first time.  Not sure where 'svn revert -R sbin/fsck*' went wrong when I
did that before doing the merge again with '--record-only'.

Subversions merge handling seems to be one of its warts.

-- 
-- David  (obrien@FreeBSD.org)

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 05:05:54 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6CD3E106566C;
	Tue, 24 Mar 2009 05:05:54 +0000 (UTC)
	(envelope-from kensmith@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5AE878FC17;
	Tue, 24 Mar 2009 05:05:54 +0000 (UTC)
	(envelope-from kensmith@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 n2O55sdp033467;
	Tue, 24 Mar 2009 05:05:54 GMT
	(envelope-from kensmith@svn.freebsd.org)
Received: (from kensmith@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2O55sHl033466;
	Tue, 24 Mar 2009 05:05:54 GMT
	(envelope-from kensmith@svn.freebsd.org)
Message-Id: <200903240505.n2O55sHl033466@svn.freebsd.org>
From: Ken Smith 
Date: Tue, 24 Mar 2009 05:05:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-svnadmin@freebsd.org
X-SVN-Group: svnadmin
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190368 - svnadmin/conf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 05:05:54 -0000

Author: kensmith
Date: Tue Mar 24 05:05:53 2009
New Revision: 190368
URL: http://svn.freebsd.org/changeset/base/190368

Log:
  Enter stable/7 code freeze for the upcoming 7.2-RELEASE.  While here
  switch 7.0/7.1 entries to match the others.
  
  Approved by:	core (implicit)

Modified:
  svnadmin/conf/approvers

Modified: svnadmin/conf/approvers
==============================================================================
--- svnadmin/conf/approvers	Tue Mar 24 04:20:17 2009	(r190367)
+++ svnadmin/conf/approvers	Tue Mar 24 05:05:53 2009	(r190368)
@@ -17,10 +17,9 @@
 # $FreeBSD$
 #
 #^head/				re
-#^stable/7/			re
+^stable/7/			re
 #^stable/6/			re
-^releng/7.1/			(security-officer|so)
-^releng/7.0/			(security-officer|so)
+^releng/7.[0-1]/		(security-officer|so)
 ^releng/6.[0-4]/		(security-officer|so)
 ^releng/5.[0-5]/		(security-officer|so)
 ^releng/4.[3-9]/		(security-officer|so)

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 10:15:36 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4DD2010656C1;
	Tue, 24 Mar 2009 10:15:36 +0000 (UTC)
	(envelope-from obrien@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3AEE18FC2D;
	Tue, 24 Mar 2009 10:15:36 +0000 (UTC)
	(envelope-from obrien@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 n2OAFabl039705;
	Tue, 24 Mar 2009 10:15:36 GMT (envelope-from obrien@svn.freebsd.org)
Received: (from obrien@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2OAFaWu039704;
	Tue, 24 Mar 2009 10:15:36 GMT (envelope-from obrien@svn.freebsd.org)
Message-Id: <200903241015.n2OAFaWu039704@svn.freebsd.org>
From: "David E. O'Brien" 
Date: Tue, 24 Mar 2009 10:15:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
X-SVN-Group: stable-6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190369 - stable/6/sys/netinet
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 10:15:38 -0000

Author: obrien
Date: Tue Mar 24 10:15:35 2009
New Revision: 190369
URL: http://svn.freebsd.org/changeset/base/190369

Log:
  Follow the lead of r164728 and grab the pcbinfo lock for some additional
  dereferences of so_pcb.
  
  Reviewed by:	rwatson

Modified:
  stable/6/sys/netinet/ip_output.c

Modified: stable/6/sys/netinet/ip_output.c
==============================================================================
--- stable/6/sys/netinet/ip_output.c	Tue Mar 24 05:05:53 2009	(r190368)
+++ stable/6/sys/netinet/ip_output.c	Tue Mar 24 10:15:35 2009	(r190369)
@@ -1322,6 +1322,7 @@ ip_ctloutput_pcbinfo(so, sopt, pcbinfo)
 
 			INP_INFO_WLOCK(pcbinfo);
 			if (so->so_pcb == NULL) {
+				INP_INFO_WUNLOCK(pcbinfo);
 				error = EINVAL;
 				break;
 			}
@@ -1368,7 +1369,9 @@ ip_ctloutput_pcbinfo(so, sopt, pcbinfo)
 			req = mtod(m, caddr_t);
 			len = m->m_len;
 			optname = sopt->sopt_name;
+			INP_INFO_WLOCK(pcbinfo);
 			if (so->so_pcb == NULL) {
+				INP_INFO_WUNLOCK(pcbinfo);
 				m_free(m);
 				error = EINVAL;
 				break;

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 10:47:54 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7873A1065672;
	Tue, 24 Mar 2009 10:47:54 +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 63DFF8FC18;
	Tue, 24 Mar 2009 10:47:54 +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 n2OAlsrr043811;
	Tue, 24 Mar 2009 10:47:54 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2OAlrSu043808;
	Tue, 24 Mar 2009 10:47:53 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <200903241047.n2OAlrSu043808@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 24 Mar 2009 10:47:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-vendor@freebsd.org
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190370 - vendor/tzdata/dist
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 10:47:55 -0000

Author: edwin
Date: Tue Mar 24 10:47:53 2009
New Revision: 190370
URL: http://svn.freebsd.org/changeset/base/190370

Log:
  Vendor import 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

Modified:
  vendor/tzdata/dist/africa
  vendor/tzdata/dist/asia
  vendor/tzdata/dist/southamerica

Modified: vendor/tzdata/dist/africa
==============================================================================
--- vendor/tzdata/dist/africa	Tue Mar 24 10:15:35 2009	(r190369)
+++ vendor/tzdata/dist/africa	Tue Mar 24 10:47:53 2009	(r190370)
@@ -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: vendor/tzdata/dist/asia
==============================================================================
--- vendor/tzdata/dist/asia	Tue Mar 24 10:15:35 2009	(r190369)
+++ vendor/tzdata/dist/asia	Tue Mar 24 10:47:53 2009	(r190370)
@@ -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: vendor/tzdata/dist/southamerica
==============================================================================
--- vendor/tzdata/dist/southamerica	Tue Mar 24 10:15:35 2009	(r190369)
+++ vendor/tzdata/dist/southamerica	Tue Mar 24 10:47:53 2009	(r190370)
@@ -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-all@FreeBSD.ORG  Tue Mar 24 10:48:33 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 502B1106568B;
	Tue, 24 Mar 2009 10:48:33 +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 23A068FC25;
	Tue, 24 Mar 2009 10:48:33 +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 n2OAmXuc043863;
	Tue, 24 Mar 2009 10:48:33 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2OAmXJh043862;
	Tue, 24 Mar 2009 10:48:33 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <200903241048.n2OAmXJh043862@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 24 Mar 2009 10:48:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-vendor@freebsd.org
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190371 - vendor/tzdata/tzdata2009d
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 10:48:34 -0000

Author: edwin
Date: Tue Mar 24 10:48:32 2009
New Revision: 190371
URL: http://svn.freebsd.org/changeset/base/190371

Log:
  Tag of tzdata2009d

Added:
  vendor/tzdata/tzdata2009d/
     - copied from r190370, vendor/tzdata/dist/

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 10:50:31 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 13:11:16 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 14:47:11 2009
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CD4A61065688;
	Tue, 24 Mar 2009 14:47:11 +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 814EB8FC18;
	Tue, 24 Mar 2009 14:47:11 +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 n2OEj41h092883;
	Tue, 24 Mar 2009 08:45:04 -0600 (MDT) (envelope-from imp@bsdimp.com)
Date: Tue, 24 Mar 2009 08:45:40 -0600 (MDT)
Message-Id: <20090324.084540.796901802.imp@bsdimp.com>
To: obrien@FreeBSD.org
From: "M. Warner Losh" 
In-Reply-To: <20090324043624.GB34952@dragon.NUXI.org>
References: <200903240151.n2O1pgT0028693@svn.freebsd.org>
	<49C844A5.5080506@freebsd.org>
	<20090324043624.GB34952@dragon.NUXI.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-stable-7@FreeBSD.org, svn-src-stable@FreeBSD.org,
	svn-src-all@FreeBSD.org, sam@FreeBSD.org, src-committers@FreeBSD.org
Subject: Re: svn commit: r190357 - in stable/7: gnu/usr.bin/grep include
 lib/libelf sbin/fsck sbin/fsck_ffs sbin/mount usr.bin/gprof usr.bin/make
 usr.sbin/crunch usr.sbin/sade usr.sbin/sysinstall
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 14:47:12 -0000

In message: <20090324043624.GB34952@dragon.NUXI.org>
            "David O'Brien"  writes:
: On Mon, Mar 23, 2009 at 07:25:41PM -0700, Sam Leffler wrote:
: > David E. O'Brien wrote:
: >> Author: obrien
: >> Date: Tue Mar 24 01:51:42 2009
: >> New Revision: 190357
: >> URL: http://svn.freebsd.org/changeset/base/190357
: >> 
: >> Log:
: >>   MFC: r186581: Sound less scary about errorousous disk geometry.
: ..
: > This looks to have many changes unrelated to r186581.  For example you
: > just removed the -C option to fsck.
: 
: I found out that Subversion wasn't getting the mergeinfo right.
: It considers svn+ssh://obrien@svn.freebsd.org/base/ and
: svn+ssh://svn.freebsd.org/base/ to be two totally seperate repositories.

This is documented in the wiki page where the base name must be
identical.

Warner

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 15:48:35 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 15:52:46 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 15:56:15 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 15:57:35 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 16:03:47 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 16:44:02 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 16:53:55 2009
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A2A9410657CA;
	Tue, 24 Mar 2009 16:53:55 +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 7263E8FC23;
	Tue, 24 Mar 2009 16:53:55 +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 1FDEE46B09;
	Tue, 24 Mar 2009 12:53:55 -0400 (EDT)
Date: Tue, 24 Mar 2009 16:53:55 +0000 (GMT)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: "M. Warner Losh" 
In-Reply-To: <20090324.084540.796901802.imp@bsdimp.com>
Message-ID: 
References: <200903240151.n2O1pgT0028693@svn.freebsd.org>
	<49C844A5.5080506@freebsd.org>
	<20090324043624.GB34952@dragon.NUXI.org>
	<20090324.084540.796901802.imp@bsdimp.com>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-stable-7@FreeBSD.org, svn-src-stable@FreeBSD.org,
	svn-src-all@FreeBSD.org, obrien@FreeBSD.org, sam@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r190357 - in stable/7: gnu/usr.bin/grep include
 lib/libelf sbin/fsck sbin/fsck_ffs sbin/mount usr.bin/gprof usr.bin/make
 usr.sbin/crunch usr.sbin/sade usr.sbin/sysinstall
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 16:53:59 -0000

On Tue, 24 Mar 2009, M. Warner Losh wrote:

> In message: <20090324043624.GB34952@dragon.NUXI.org>
>            "David O'Brien"  writes:
> : On Mon, Mar 23, 2009 at 07:25:41PM -0700, Sam Leffler wrote:
> : > David E. O'Brien wrote:
> : >> Author: obrien
> : >> Date: Tue Mar 24 01:51:42 2009
> : >> New Revision: 190357
> : >> URL: http://svn.freebsd.org/changeset/base/190357
> : >>
> : >> Log:
> : >>   MFC: r186581: Sound less scary about errorousous disk geometry.
> : ..
> : > This looks to have many changes unrelated to r186581.  For example you
> : > just removed the -C option to fsck.
> :
> : I found out that Subversion wasn't getting the mergeinfo right.
> : It considers svn+ssh://obrien@svn.freebsd.org/base/ and
> : svn+ssh://svn.freebsd.org/base/ to be two totally seperate repositories.
>
> This is documented in the wiki page where the base name must be identical.

And for those of us with over-eager shift keys, FreeBSD.org != freebsd.org 
according to svn.  I usually do an "svn info" and just copy and paste the base 
to avoid getting confusing errors.

Robert N M Watson
Computer Laboratory
University of Cambridge

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 17:10:42 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 17:13:36 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 17:14:34 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 17:22:11 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 17:39:08 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 17:47:25 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 17:47:50 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 17:57:49 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 18:02:35 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 18:09:40 2009
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B042D1065688
	for ; Tue, 24 Mar 2009 18:09:40 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from mail2.fluidhosting.com (mx22.fluidhosting.com [204.14.89.5])
	by mx1.freebsd.org (Postfix) with ESMTP id 367188FC17
	for ; Tue, 24 Mar 2009 18:09:39 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: (qmail 29274 invoked by uid 399); 24 Mar 2009 17:42:58 -0000
Received: from localhost (HELO lap.dougb.net) (dougb@dougbarton.us@127.0.0.1)
	by localhost with ESMTPAM; 24 Mar 2009 17:42:58 -0000
X-Originating-IP: 127.0.0.1
X-Sender: dougb@dougbarton.us
Message-ID: <49C91BA0.1040306@FreeBSD.org>
Date: Tue, 24 Mar 2009 10:42:56 -0700
From: Doug Barton 
Organization: http://www.FreeBSD.org/
User-Agent: Thunderbird 2.0.0.21 (X11/20090321)
MIME-Version: 1.0
To: Robert Watson 
References: <200903240151.n2O1pgT0028693@svn.freebsd.org>
	<49C844A5.5080506@freebsd.org>
	<20090324043624.GB34952@dragon.NUXI.org>
	<20090324.084540.796901802.imp@bsdimp.com>
	
In-Reply-To: 
X-Enigmail-Version: 0.95.7
OpenPGP: id=D5B2F0FB
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Cc: src-committers@FreeBSD.org, svn-src-stable@FreeBSD.org,
	svn-src-all@FreeBSD.org, obrien@FreeBSD.org, sam@FreeBSD.org,
	svn-src-stable-7@FreeBSD.org, "M. Warner Losh" 
Subject: Re: svn commit: r190357 - in stable/7: gnu/usr.bin/grep include
 lib/libelf
 sbin/fsck sbin/fsck_ffs sbin/mount usr.bin/gprof usr.bin/make
 usr.sbin/crunch usr.sbin/sade usr.sbin/sysinstall
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 18:09:42 -0000

Robert Watson wrote:
> On Tue, 24 Mar 2009, M. Warner Losh wrote:
>> This is documented in the wiki page where the base name must be
>> identical.
> 
> And for those of us with over-eager shift keys, FreeBSD.org !=
> freebsd.org according to svn.  I usually do an "svn info" and just copy
> and paste the base to avoid getting confusing errors.

Since a lot of our documentation for svn refers to "$REPO" I set that
variable in my shell thusly: REPO=svn+ssh://svn.freebsd.org/base/

That is easier to type, allows me to copy and paste from a lot of our
examples, and avoids the inconsistent fReEBSd.oRG issues.


hth,

Doug

-- 

    This .signature sanitized for your protection


From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 18:10:23 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 18:16:43 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 18:34:20 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0252A106566C;
	Tue, 24 Mar 2009 18:34:20 +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 E45F78FC16;
	Tue, 24 Mar 2009 18:34:19 +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 n2OIYJ4A053677;
	Tue, 24 Mar 2009 18:34:19 GMT (envelope-from luigi@svn.freebsd.org)
Received: (from luigi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2OIYJTu053676;
	Tue, 24 Mar 2009 18:34:19 GMT (envelope-from luigi@svn.freebsd.org)
Message-Id: <200903241834.n2OIYJTu053676@svn.freebsd.org>
From: Luigi Rizzo 
Date: Tue, 24 Mar 2009 18:34:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190388 - stable/7/release/picobsd/bridge
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 18:34:20 -0000

Author: luigi
Date: Tue Mar 24 18:34:19 2009
New Revision: 190388
URL: http://svn.freebsd.org/changeset/base/190388

Log:
  make the mfs larger to give room for shared libs.
  Build /dev/random so ssh can find it
  
  Approved by:	re (blanket on picobsd)

Modified:
  stable/7/release/picobsd/bridge/PICOBSD

Modified: stable/7/release/picobsd/bridge/PICOBSD
==============================================================================
--- stable/7/release/picobsd/bridge/PICOBSD	Tue Mar 24 18:16:42 2009	(r190387)
+++ stable/7/release/picobsd/bridge/PICOBSD	Tue Mar 24 18:34:19 2009	(r190388)
@@ -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	5000	init	8192		32768
+options MD_ROOT_SIZE=5000      # same as def_sz
 
 hints	"PICOBSD.hints"
 
@@ -45,6 +45,7 @@ options		DUMMYNET
 device		if_bridge
 options		HZ=1000
 
+device		random	# ssh needs /dev/random
 device		pci
 
 # Floppy drives

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 18:35:01 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B8EF010656C0;
	Tue, 24 Mar 2009 18:35:01 +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 4ACD38FC17;
	Tue, 24 Mar 2009 18:35:01 +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 n2OIZ1jL053731;
	Tue, 24 Mar 2009 18:35:01 GMT (envelope-from luigi@svn.freebsd.org)
Received: (from luigi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2OIZ1ep053730;
	Tue, 24 Mar 2009 18:35:01 GMT (envelope-from luigi@svn.freebsd.org)
Message-Id: <200903241835.n2OIZ1ep053730@svn.freebsd.org>
From: Luigi Rizzo 
Date: Tue, 24 Mar 2009 18:35:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190389 - stable/7/release/picobsd/bridge
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 18:35:03 -0000

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

Log:
  remove unused entries and stale comments on the size of objects
  
  Approved by:	re (blanket on picobsd)

Modified:
  stable/7/release/picobsd/bridge/crunch.conf

Modified: stable/7/release/picobsd/bridge/crunch.conf
==============================================================================
--- stable/7/release/picobsd/bridge/crunch.conf	Tue Mar 24 18:34:19 2009	(r190388)
+++ stable/7/release/picobsd/bridge/crunch.conf	Tue Mar 24 18:35:01 2009	(r190389)
@@ -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,117 +64,96 @@ 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
-#ln less more
-#progs more # 12KB
-special more srcdir /usr/ports/misc/44bsd-more/work
+progs reboot
+progs less
+ln less more
 
 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 # ??
 # 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 mdconfig # 0KB.
+progs bsdlabel
+progs fdisk
+progs mdconfig
 
 progs kldload kldunload kldstat kldxref
-#progs grep # 16KB.
-progs date # 4KB.
-#progs mount_nfs # 0KB.
+#progs grep
+progs date
+#progs mount_nfs
 ln mount_nfs nfs
-progs ping # 4KB.
-#progs routed # 32KB.
-progs ipfw # 12KB.
-progs traceroute # 0KB.
+progs ping
+#progs routed
+progs ipfw
+progs traceroute
 progs mdmfs
 ln mdmfs mount_mfs
-# progs mount_cd9660 # 4KB.
+# progs mount_cd9660
 # ln mount_cd9660 cd9660
 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
+# For a small ssh client/server use dropbear
 
 libs -ll       # used by sh
 libs -lufs     # used by mount

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 20:00:28 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 20:39:09 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 20:57:11 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 64D501065674;
	Tue, 24 Mar 2009 20:57:11 +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 4E94C8FC30;
	Tue, 24 Mar 2009 20:57:11 +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 n2OKvBxX056722;
	Tue, 24 Mar 2009 20:57:11 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2OKvAFb056699;
	Tue, 24 Mar 2009 20:57:10 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200903242057.n2OKvAFb056699@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 24 Mar 2009 20:57:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190393 - in stable/7: include lib/libc/gen
	lib/libc/include lib/libc/stdlib lib/libthr
	lib/libthr/arch/amd64/include lib/libthr/arch/i386
	lib/libthr/thread libexec/rtld-elf sys/kern sy...
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 24 Mar 2009 20:57:13 -0000

Author: kib
Date: Tue Mar 24 20:57:10 2009
New Revision: 190393
URL: http://svn.freebsd.org/changeset/base/190393

Log:
  Mostly synchronize  lib/libthr and sys/kern/kern_umtx.c with the code
  from HEAD.
  
  Since libkse is still built on RELENG_7, pthread_cleanup_push/pop
  are left as the functions, but the support code in libthr is present for
  the macro versions.
  
  Malloc in RELENG_7 does not require thread exit hook, but I decided
  to add empty handler for it, instead of removing callback from thr_exit().
  
  No mergeinfo since this change is prepared by patching libthr and then
  bringing in required missed bits.
  
  Requested by:	bms
  Reviewed by:	davidxu
  Tested by:	bms, Mykola Dzham 
  Approved by:	re (kensmith)

Added:
  stable/7/lib/libthr/thread/thr_affinity.c   (contents, props changed)
  stable/7/lib/libthr/thread/thr_getcpuclockid.c   (contents, props changed)
Modified:
  stable/7/include/pthread.h
  stable/7/include/pthread_np.h
  stable/7/lib/libc/gen/Symbol.map
  stable/7/lib/libc/gen/dlfcn.c
  stable/7/lib/libc/include/libc_private.h
  stable/7/lib/libc/stdlib/Symbol.map
  stable/7/lib/libc/stdlib/malloc.c
  stable/7/lib/libthr/Makefile
  stable/7/lib/libthr/arch/amd64/include/pthread_md.h
  stable/7/lib/libthr/arch/i386/Makefile.inc
  stable/7/lib/libthr/pthread.map
  stable/7/lib/libthr/thread/Makefile.inc
  stable/7/lib/libthr/thread/thr_attr.c
  stable/7/lib/libthr/thread/thr_clean.c
  stable/7/lib/libthr/thread/thr_create.c
  stable/7/lib/libthr/thread/thr_event.c
  stable/7/lib/libthr/thread/thr_exit.c
  stable/7/lib/libthr/thread/thr_fork.c
  stable/7/lib/libthr/thread/thr_init.c
  stable/7/lib/libthr/thread/thr_mutex.c
  stable/7/lib/libthr/thread/thr_once.c
  stable/7/lib/libthr/thread/thr_private.h
  stable/7/lib/libthr/thread/thr_pspinlock.c
  stable/7/lib/libthr/thread/thr_resume_np.c
  stable/7/lib/libthr/thread/thr_rtld.c
  stable/7/lib/libthr/thread/thr_sem.c
  stable/7/lib/libthr/thread/thr_sig.c
  stable/7/lib/libthr/thread/thr_spinlock.c
  stable/7/lib/libthr/thread/thr_suspend_np.c
  stable/7/lib/libthr/thread/thr_syscalls.c
  stable/7/lib/libthr/thread/thr_umtx.c
  stable/7/lib/libthr/thread/thr_umtx.h
  stable/7/libexec/rtld-elf/Symbol.map
  stable/7/libexec/rtld-elf/rtld.c
  stable/7/libexec/rtld-elf/rtld_lock.c
  stable/7/libexec/rtld-elf/rtld_lock.h
  stable/7/sys/kern/kern_thr.c
  stable/7/sys/kern/kern_umtx.c
  stable/7/sys/sys/umtx.h

Modified: stable/7/include/pthread.h
==============================================================================
--- stable/7/include/pthread.h	Tue Mar 24 20:46:02 2009	(r190392)
+++ stable/7/include/pthread.h	Tue Mar 24 20:57:10 2009	(r190393)
@@ -135,6 +135,10 @@ enum pthread_mutextype {
 
 #define PTHREAD_MUTEX_DEFAULT		PTHREAD_MUTEX_ERRORCHECK
 
+struct _pthread_cleanup_info {
+	__uintptr_t	pthread_cleanup_pad[8];
+};
+
 /*
  * Thread function prototype definitions:
  */
@@ -185,6 +189,7 @@ int		pthread_detach(pthread_t);
 int		pthread_equal(pthread_t, pthread_t);
 void		pthread_exit(void *) __dead2;
 void		*pthread_getspecific(pthread_key_t);
+int		pthread_getcpuclockid(pthread_t, clockid_t *);
 int		pthread_join(pthread_t, void **);
 int		pthread_key_create(pthread_key_t *,
 			void (*) (void *));
@@ -267,6 +272,10 @@ int		pthread_setschedparam(pthread_t, in
 			const struct sched_param *);
 int		pthread_getconcurrency(void);
 int		pthread_setconcurrency(int);
+
+void		__pthread_cleanup_push_imp(void (*)(void *), void *,
+			struct _pthread_cleanup_info *);
+void		__pthread_cleanup_pop_imp(int);
 __END_DECLS
 
 #endif

Modified: stable/7/include/pthread_np.h
==============================================================================
--- stable/7/include/pthread_np.h	Tue Mar 24 20:46:02 2009	(r190392)
+++ stable/7/include/pthread_np.h	Tue Mar 24 20:57:10 2009	(r190393)
@@ -10,10 +10,7 @@
  * 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.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by John Birrell.
- * 4. Neither the name of the author nor the names of any co-contributors
+ * 3. Neither the name of the author nor the names of any co-contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  *
@@ -34,6 +31,9 @@
 #ifndef _PTHREAD_NP_H_
 #define _PTHREAD_NP_H_
 
+#include 
+#include 
+
 /*
  * Non-POSIX type definitions:
  */
@@ -45,6 +45,9 @@ typedef void	(*pthread_switch_routine_t)
 __BEGIN_DECLS
 int pthread_attr_setcreatesuspend_np(pthread_attr_t *);
 int pthread_attr_get_np(pthread_t, pthread_attr_t *);
+int pthread_attr_getaffinity_np(const pthread_attr_t *, size_t, cpuset_t *);
+int pthread_attr_setaffinity_np(pthread_attr_t *, size_t, const cpuset_t *);
+int pthread_getaffinity_np(pthread_t, size_t, cpuset_t *);
 int pthread_main_np(void);
 int pthread_multi_np(void);
 int pthread_mutexattr_getkind_np(pthread_mutexattr_t);
@@ -52,6 +55,12 @@ int pthread_mutexattr_setkind_np(pthread
 void pthread_resume_all_np(void);
 int pthread_resume_np(pthread_t);
 void pthread_set_name_np(pthread_t, const char *);
+int pthread_mutex_getspinloops_np(pthread_mutex_t *mutex, int *count);
+int pthread_mutex_setspinloops_np(pthread_mutex_t *mutex, int count);
+int pthread_mutex_getyieldloops_np(pthread_mutex_t *mutex, int *count);
+int pthread_mutex_setyieldloops_np(pthread_mutex_t *mutex, int count);
+int pthread_mutex_isowned_np(pthread_mutex_t *mutex);
+int pthread_setaffinity_np(pthread_t, size_t, const cpuset_t *);
 int pthread_single_np(void);
 void pthread_suspend_all_np(void);
 int pthread_suspend_np(pthread_t);

Modified: stable/7/lib/libc/gen/Symbol.map
==============================================================================
--- stable/7/lib/libc/gen/Symbol.map	Tue Mar 24 20:46:02 2009	(r190392)
+++ stable/7/lib/libc/gen/Symbol.map	Tue Mar 24 20:57:10 2009	(r190393)
@@ -403,6 +403,8 @@ FBSDprivate_1.0 {
 	_spinlock;
 	_spinlock_debug;
 	_spinunlock;
+	_rtld_atfork_pre;
+	_rtld_atfork_post;
 	_rtld_error;		/* for private use */
 	_rtld_thread_init;	/* for private use */
 	_err;

Modified: stable/7/lib/libc/gen/dlfcn.c
==============================================================================
--- stable/7/lib/libc/gen/dlfcn.c	Tue Mar 24 20:46:02 2009	(r190392)
+++ stable/7/lib/libc/gen/dlfcn.c	Tue Mar 24 20:57:10 2009	(r190393)
@@ -137,3 +137,15 @@ dl_iterate_phdr(int (*callback)(struct d
 	_rtld_error(sorry);
 	return 0;
 }
+
+#pragma weak _rtld_atfork_pre
+void
+_rtld_atfork_pre(int *locks)
+{
+}
+
+#pragma weak _rtld_atfork_post
+void
+_rtld_atfork_post(int *locks)
+{
+}

Modified: stable/7/lib/libc/include/libc_private.h
==============================================================================
--- stable/7/lib/libc/include/libc_private.h	Tue Mar 24 20:46:02 2009	(r190392)
+++ stable/7/lib/libc/include/libc_private.h	Tue Mar 24 20:57:10 2009	(r190393)
@@ -158,6 +158,12 @@ void _set_tp(void *tp);
 extern const char *__progname;
 
 /*
+ * This function is used by the threading libraries to notify malloc that a
+ * thread is exiting.
+ */
+void _malloc_thread_cleanup(void);
+
+/*
  * These functions are used by the threading libraries in order to protect
  * malloc across fork().
  */

Modified: stable/7/lib/libc/stdlib/Symbol.map
==============================================================================
--- stable/7/lib/libc/stdlib/Symbol.map	Tue Mar 24 20:46:02 2009	(r190392)
+++ stable/7/lib/libc/stdlib/Symbol.map	Tue Mar 24 20:57:10 2009	(r190393)
@@ -95,6 +95,7 @@ FBSD_1.0 {
 
 FBSDprivate_1.0 {
 	__use_pts;
+	_malloc_thread_cleanup;
 	_malloc_prefork;
 	_malloc_postfork;
 	__system;

Modified: stable/7/lib/libc/stdlib/malloc.c
==============================================================================
--- stable/7/lib/libc/stdlib/malloc.c	Tue Mar 24 20:46:02 2009	(r190392)
+++ stable/7/lib/libc/stdlib/malloc.c	Tue Mar 24 20:57:10 2009	(r190393)
@@ -4693,6 +4693,17 @@ malloc_usable_size(const void *ptr)
 /*
  * End non-standard functions.
  */
+
+/*
+ * We provide an unpublished interface in order to receive notifications from
+ * the pthreads library whenever a thread exits.  This allows us to clean up
+ * thread caches.
+ */
+void
+_malloc_thread_cleanup(void)
+{
+}
+
 /******************************************************************************/
 /*
  * Begin library-private functions, used by threading libraries for protection

Modified: stable/7/lib/libthr/Makefile
==============================================================================
--- stable/7/lib/libthr/Makefile	Tue Mar 24 20:46:02 2009	(r190392)
+++ stable/7/lib/libthr/Makefile	Tue Mar 24 20:57:10 2009	(r190393)
@@ -9,6 +9,7 @@
 # system call stubs.
 
 .include 
+MK_SSP=	no
 
 .if (${DEFAULT_THREAD_LIB} == "libthr" || ${MK_LIBKSE} == "no") && \
     ${SHLIBDIR} == "/usr/lib"
@@ -17,7 +18,7 @@ SHLIBDIR= /lib
 
 LIB=thr
 SHLIB_MAJOR= 3
-WARNS?= 2
+WARNS?=	3
 CFLAGS+=-DPTHREAD_KERNEL
 CFLAGS+=-I${.CURDIR}/../libc/include -I${.CURDIR}/thread \
 	-I${.CURDIR}/../../include
@@ -28,9 +29,8 @@ CFLAGS+=-I${.CURDIR}/../../libexec/rtld-
 CFLAGS+=-I${.CURDIR}/../libthread_db
 CFLAGS+=-Winline
 
-# CFLAGS+=-DSYSTEM_SCOPE_ONLY
-
-VERSION_MAP=${.CURDIR}/pthread.map
+VERSION_DEF=${.CURDIR}/../libc/Versions.def
+SYMBOL_MAPS=${.CURDIR}/pthread.map
 
 MAN=	libthr.3
 
@@ -54,4 +54,8 @@ SYMLINKS+=lib${LIB}_p.a ${LIBDIR}/libpth
 .endif
 .endif
 
+.if !defined(WITHOUT_SYSCALL_COMPAT)
+CFLAGS+=-DSYSCALL_COMPAT
+.endif
+
 .include 

Modified: stable/7/lib/libthr/arch/amd64/include/pthread_md.h
==============================================================================
--- stable/7/lib/libthr/arch/amd64/include/pthread_md.h	Tue Mar 24 20:46:02 2009	(r190392)
+++ stable/7/lib/libthr/arch/amd64/include/pthread_md.h	Tue Mar 24 20:57:10 2009	(r190393)
@@ -98,6 +98,6 @@ _get_curthread(void)
 	return (TCB_GET64(tcb_thread));
 }
 
-#define HAS__UMTX_OP_ERR	1
+#define	HAS__UMTX_OP_ERR	1
 
 #endif

Modified: stable/7/lib/libthr/arch/i386/Makefile.inc
==============================================================================
--- stable/7/lib/libthr/arch/i386/Makefile.inc	Tue Mar 24 20:46:02 2009	(r190392)
+++ stable/7/lib/libthr/arch/i386/Makefile.inc	Tue Mar 24 20:57:10 2009	(r190393)
@@ -2,4 +2,4 @@
 
 .PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
 
-SRCS+=	pthread_md.c  _umtx_op_err.S
+SRCS+=	pthread_md.c _umtx_op_err.S

Modified: stable/7/lib/libthr/pthread.map
==============================================================================
--- stable/7/lib/libthr/pthread.map	Tue Mar 24 20:46:02 2009	(r190392)
+++ stable/7/lib/libthr/pthread.map	Tue Mar 24 20:57:10 2009	(r190393)
@@ -6,7 +6,6 @@
  * Use the same naming scheme as libc.
  */
 FBSD_1.0 {
-global:
 	__error;
 	accept;
 	aio_suspend;
@@ -118,8 +117,8 @@ global:
 	pthread_rwlockattr_getpshared;
 	pthread_rwlockattr_init;
 	pthread_rwlockattr_setpshared;
-	pthread_self;
 	pthread_set_name_np;
+	pthread_self;
 	pthread_setcancelstate;
 	pthread_setcanceltype;
 	pthread_setconcurrency;
@@ -165,15 +164,12 @@ global:
 	system;
 	tcdrain;
 	usleep;
-	vfork;
 	wait;
 	wait3;
 	wait4;
 	waitpid;
 	write;
 	writev;
-local:
-	*;
 };
 
 /*
@@ -181,7 +177,6 @@ local:
  * These are not part of our application ABI.
  */
 FBSDprivate_1.0 {
-global:
 	___creat;
 	___pause;
 	___pselect;
@@ -233,6 +228,7 @@ global:
 	_pthread_barrierattr_setpshared;
 	_pthread_attr_destroy;
 	_pthread_attr_get_np;
+	_pthread_attr_getaffinity_np;
 	_pthread_attr_getdetachstate;
 	_pthread_attr_getguardsize;
 	_pthread_attr_getinheritsched;
@@ -243,6 +239,7 @@ global:
 	_pthread_attr_getstackaddr;
 	_pthread_attr_getstacksize;
 	_pthread_attr_init;
+	_pthread_attr_setaffinity_np;
 	_pthread_attr_setcreatesuspend_np;
 	_pthread_attr_setdetachstate;
 	_pthread_attr_setguardsize;
@@ -272,7 +269,9 @@ global:
 	_pthread_detach;
 	_pthread_equal;
 	_pthread_exit;
+	_pthread_getaffinity_np;
 	_pthread_getconcurrency;
+	_pthread_getcpuclockid;
 	_pthread_getprio;
 	_pthread_getschedparam;
 	_pthread_getspecific;
@@ -284,10 +283,15 @@ global:
 	_pthread_multi_np;
 	_pthread_mutex_destroy;
 	_pthread_mutex_getprioceiling;
+	_pthread_mutex_getspinloops_np;
+	_pthread_mutex_getyieldloops_np;
 	_pthread_mutex_init;
 	_pthread_mutex_init_calloc_cb;
+	_pthread_mutex_isowned_np;
 	_pthread_mutex_lock;
 	_pthread_mutex_setprioceiling;
+	_pthread_mutex_setspinloops_np;
+	_pthread_mutex_setyieldloops_np;
 	_pthread_mutex_timedlock;
 	_pthread_mutex_trylock;
 	_pthread_mutex_unlock;
@@ -321,6 +325,7 @@ global:
 	_pthread_rwlockattr_setpshared;
 	_pthread_self;
 	_pthread_set_name_np;
+	_pthread_setaffinity_np;
 	_pthread_setcancelstate;
 	_pthread_setcanceltype;
 	_pthread_setconcurrency;
@@ -358,7 +363,6 @@ global:
 	_spinlock;
 	_spinlock_debug;
 	_spinunlock;
-	_vfork;
 
 	/* Debugger needs these. */
 	_libthr_debug;
@@ -386,6 +390,19 @@ global:
 	_thread_size_key;
 	_thread_state_running;
 	_thread_state_zoombie;
-local:
-	*;
+};
+
+FBSD_1.1 {
+	__pthread_cleanup_pop_imp;
+	__pthread_cleanup_push_imp;
+	pthread_attr_getaffinity_np;
+	pthread_attr_setaffinity_np;
+	pthread_getaffinity_np;
+	pthread_getcpuclockid;
+	pthread_setaffinity_np;
+	pthread_mutex_getspinloops_np;
+	pthread_mutex_getyieldloops_np;
+	pthread_mutex_isowned_np;
+	pthread_mutex_setspinloops_np;
+	pthread_mutex_setyieldloops_np;
 };

Modified: stable/7/lib/libthr/thread/Makefile.inc
==============================================================================
--- stable/7/lib/libthr/thread/Makefile.inc	Tue Mar 24 20:46:02 2009	(r190392)
+++ stable/7/lib/libthr/thread/Makefile.inc	Tue Mar 24 20:57:10 2009	(r190393)
@@ -4,6 +4,7 @@
 .PATH: ${.CURDIR}/thread
 
 SRCS+= \
+	thr_affinity.c \
 	thr_attr.c \
 	thr_barrier.c \
 	thr_barrierattr.c \
@@ -19,6 +20,7 @@ SRCS+= \
 	thr_exit.c \
 	thr_fork.c \
 	thr_getprio.c \
+	thr_getcpuclockid.c \
 	thr_getschedparam.c \
 	thr_info.c \
 	thr_init.c \

Added: stable/7/lib/libthr/thread/thr_affinity.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/7/lib/libthr/thread/thr_affinity.c	Tue Mar 24 20:57:10 2009	(r190393)
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2008, David Xu 
+ * 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 unmodified, 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.
+ *
+ * $FreeBSD$
+ *
+ */
+
+#include "namespace.h"
+#include 
+#include 
+#include 
+#include "un-namespace.h"
+
+#include "thr_private.h"
+
+__weak_reference(_pthread_getaffinity_np, pthread_getaffinity_np);
+__weak_reference(_pthread_setaffinity_np, pthread_setaffinity_np);
+
+int
+_pthread_setaffinity_np(pthread_t td, size_t cpusetsize, const cpuset_t *cpusetp)
+{
+	struct pthread	*curthread = _get_curthread();
+	lwpid_t		tid;
+	int		error;
+
+	if (td == curthread) {
+		error = cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID,
+			-1, cpusetsize, cpusetp);
+		if (error == -1)
+			error = errno;
+	} else {
+		THR_THREAD_LOCK(curthread, td);
+		if (td->state == PS_DEAD) {
+			THR_THREAD_UNLOCK(curthread, td);
+			return (EINVAL);
+		}
+		tid = TID(td);
+		error = cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID, tid,
+			cpusetsize, cpusetp);
+		if (error == -1)
+			error = errno;
+		THR_THREAD_UNLOCK(curthread, td);
+	}
+	return (error);
+}
+
+int
+_pthread_getaffinity_np(pthread_t td, size_t cpusetsize, cpuset_t *cpusetp)
+{
+	struct pthread	*curthread = _get_curthread();
+	lwpid_t tid;
+	int error;
+
+	tid = TID(td);
+	error = cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID,
+		(td == curthread) ? -1 : tid, cpusetsize, cpusetp);
+	if (error == -1)
+		error = errno;
+	return (error);
+}

Modified: stable/7/lib/libthr/thread/thr_attr.c
==============================================================================
--- stable/7/lib/libthr/thread/thr_attr.c	Tue Mar 24 20:46:02 2009	(r190392)
+++ stable/7/lib/libthr/thread/thr_attr.c	Tue Mar 24 20:57:10 2009	(r190393)
@@ -99,6 +99,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "un-namespace.h"
 
 #include "thr_private.h"
@@ -148,7 +149,9 @@ _pthread_attr_get_np(pthread_t pid, pthr
 		attr.flags |= PTHREAD_DETACHED;
 	_thr_ref_delete(curthread, pid);
 	memcpy(*dst, &attr, sizeof(struct pthread_attr));
-
+	/* XXX */
+	(*dst)->cpuset = NULL;
+	(*dst)->cpusetsize = 0;
 	return (0);
 }
 
@@ -543,3 +546,92 @@ _pthread_attr_setstacksize(pthread_attr_
 	}
 	return(ret);
 }
+
+static size_t
+_get_kern_cpuset_size(void)
+{
+	static int kern_cpuset_size = 0;
+
+	if (kern_cpuset_size == 0) {
+		size_t len;
+
+		len = sizeof(kern_cpuset_size);
+		if (sysctlbyname("kern.smp.maxcpus", &kern_cpuset_size,
+		    &len, NULL, 0))
+			PANIC("failed to get sysctl kern.smp.maxcpus");
+
+		kern_cpuset_size = (kern_cpuset_size + 7) / 8;
+	}
+
+	return (kern_cpuset_size);
+}
+
+__weak_reference(_pthread_attr_setaffinity_np, pthread_attr_setaffinity_np);
+int
+_pthread_attr_setaffinity_np(pthread_attr_t *pattr, size_t cpusetsize,
+	const cpuset_t *cpusetp)
+{
+	pthread_attr_t attr;
+	int ret;
+
+	if (pattr == NULL || (attr = (*pattr)) == NULL)
+		ret = EINVAL;
+	else {
+		if (cpusetsize == 0 || cpusetp == NULL) {
+			if (attr->cpuset != NULL) {
+				free(attr->cpuset);
+				attr->cpuset = NULL;
+				attr->cpusetsize = 0;
+			}
+			return (0);
+		}
+			
+		if (cpusetsize > attr->cpusetsize) {
+			size_t kern_size = _get_kern_cpuset_size();
+			if (cpusetsize > kern_size) {
+				size_t i;
+				for (i = kern_size; i < cpusetsize; ++i) {
+					if (((char *)cpusetp)[i])
+						return (EINVAL);
+				}
+			}
+			void *newset = realloc(attr->cpuset, cpusetsize);
+       			if (newset == NULL)
+		            return (ENOMEM);
+			attr->cpuset = newset;
+			attr->cpusetsize = cpusetsize;
+		} else {
+			memset(((char *)attr->cpuset) + cpusetsize, 0,
+				attr->cpusetsize - cpusetsize);
+			attr->cpusetsize = cpusetsize;
+		}
+		memcpy(attr->cpuset, cpusetp, cpusetsize);
+		ret = 0;
+	}
+	return (ret);
+}
+
+__weak_reference(_pthread_attr_getaffinity_np, pthread_attr_getaffinity_np);
+int
+_pthread_attr_getaffinity_np(const pthread_attr_t *pattr, size_t cpusetsize,
+	cpuset_t *cpusetp)
+{
+	pthread_attr_t attr;
+	int ret = 0;
+
+	if (pattr == NULL || (attr = (*pattr)) == NULL)
+		ret = EINVAL;
+	else if (attr->cpuset != NULL) {
+		memcpy(cpusetp, attr->cpuset, MIN(cpusetsize, attr->cpusetsize));
+		if (cpusetsize > attr->cpusetsize)
+			memset(((char *)cpusetp) + attr->cpusetsize, 0, 
+				cpusetsize - attr->cpusetsize);
+	} else {
+		size_t kern_size = _get_kern_cpuset_size();
+		memset(cpusetp, -1, MIN(cpusetsize, kern_size));
+		if (cpusetsize > kern_size)
+			memset(((char *)cpusetp) + kern_size, 0,
+				cpusetsize - kern_size);
+	}
+	return (ret);
+}

Modified: stable/7/lib/libthr/thread/thr_clean.c
==============================================================================
--- stable/7/lib/libthr/thread/thr_clean.c	Tue Mar 24 20:46:02 2009	(r190392)
+++ stable/7/lib/libthr/thread/thr_clean.c	Tue Mar 24 20:57:10 2009	(r190393)
@@ -38,38 +38,61 @@
 
 #include "thr_private.h"
 
+#undef pthread_cleanup_push
+#undef pthread_cleanup_pop
+
+/* old binary compatible interfaces */
 __weak_reference(_pthread_cleanup_push, pthread_cleanup_push);
 __weak_reference(_pthread_cleanup_pop, pthread_cleanup_pop);
 
 void
-_pthread_cleanup_push(void (*routine) (void *), void *routine_arg)
+__pthread_cleanup_push_imp(void (*routine)(void *), void *arg,
+	struct _pthread_cleanup_info *info)
 {
 	struct pthread	*curthread = _get_curthread();
-	struct pthread_cleanup *new;
-
-	if ((new = (struct pthread_cleanup *)
-	    malloc(sizeof(struct pthread_cleanup))) != NULL) {
-		new->routine = routine;
-		new->routine_arg = routine_arg;
-		new->onstack = 0;
-		new->next = curthread->cleanup;
+	struct pthread_cleanup *newbuf;
 
-		curthread->cleanup = new;
-	}
+	newbuf = (void *)info;
+	newbuf->routine = routine;
+	newbuf->routine_arg = arg;
+	newbuf->onheap = 0;
+	newbuf->prev = curthread->cleanup;
+	curthread->cleanup = newbuf;
 }
 
 void
-_pthread_cleanup_pop(int execute)
+__pthread_cleanup_pop_imp(int execute)
 {
 	struct pthread	*curthread = _get_curthread();
 	struct pthread_cleanup *old;
 
 	if ((old = curthread->cleanup) != NULL) {
-		curthread->cleanup = old->next;
-		if (execute) {
+		curthread->cleanup = old->prev;
+		if (execute)
 			old->routine(old->routine_arg);
-		}
-		if (old->onstack == 0)
+		if (old->onheap)
 			free(old);
 	}
 }
+
+void
+_pthread_cleanup_push(void (*routine) (void *), void *arg)
+{
+	struct pthread	*curthread = _get_curthread();
+	struct pthread_cleanup *newbuf;
+
+	if ((newbuf = (struct pthread_cleanup *)
+	    malloc(sizeof(struct _pthread_cleanup_info))) != NULL) {
+		newbuf->routine = routine;
+		newbuf->routine_arg = arg;
+		newbuf->onheap = 1;
+		newbuf->prev = curthread->cleanup;
+		curthread->cleanup = newbuf;
+	}
+}
+
+void
+_pthread_cleanup_pop(int execute)
+{
+	__pthread_cleanup_pop_imp(execute);
+}

Modified: stable/7/lib/libthr/thread/thr_create.c
==============================================================================
--- stable/7/lib/libthr/thread/thr_create.c	Tue Mar 24 20:46:02 2009	(r190392)
+++ stable/7/lib/libthr/thread/thr_create.c	Tue Mar 24 20:57:10 2009	(r190393)
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "un-namespace.h"
 
 #include "thr_private.h"
@@ -55,6 +56,8 @@ _pthread_create(pthread_t * thread, cons
 	struct rtprio rtp;
 	int ret = 0, locked, create_suspended;
 	sigset_t set, oset;
+	cpuset_t *cpusetp = NULL;
+	int cpusetsize = 0;
 
 	_thr_check_init();
 
@@ -73,8 +76,13 @@ _pthread_create(pthread_t * thread, cons
 	if (attr == NULL || *attr == NULL)
 		/* Use the default thread attributes: */
 		new_thread->attr = _pthread_attr_default;
-	else
+	else {
 		new_thread->attr = *(*attr);
+		cpusetp = new_thread->attr.cpuset;
+		cpusetsize = new_thread->attr.cpusetsize;
+		new_thread->attr.cpuset = NULL;
+		new_thread->attr.cpusetsize = 0;
+	}
 	if (new_thread->attr.sched_inherit == PTHREAD_INHERIT_SCHED) {
 		/* inherit scheduling contention scope */
 		if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM)
@@ -129,7 +137,7 @@ _pthread_create(pthread_t * thread, cons
 	_thr_link(curthread, new_thread);
 	/* Return thread pointer eariler so that new thread can use it. */
 	(*thread) = new_thread;
-	if (SHOULD_REPORT_EVENT(curthread, TD_CREATE)) {
+	if (SHOULD_REPORT_EVENT(curthread, TD_CREATE) || cpusetp != NULL) {
 		THR_THREAD_LOCK(curthread, new_thread);
 		locked = 1;
 	} else
@@ -147,7 +155,7 @@ _pthread_create(pthread_t * thread, cons
 		param.flags |= THR_SYSTEM_SCOPE;
 	if (new_thread->attr.sched_inherit == PTHREAD_INHERIT_SCHED)
 		param.rtp = NULL;
-	else {
+	else { 	 
 		sched_param.sched_priority = new_thread->attr.prio;
 		_schedparam_to_rtp(new_thread->attr.sched_policy,
 			&sched_param, &rtp);
@@ -160,6 +168,7 @@ _pthread_create(pthread_t * thread, cons
 		SIGDELSET(set, SIGTRAP);
 		__sys_sigprocmask(SIG_SETMASK, &set, &oset);
 		new_thread->sigmask = oset;
+		SIGDELSET(new_thread->sigmask, SIGCANCEL);
 	}
 
 	ret = thr_new(¶m, sizeof(param));
@@ -183,7 +192,7 @@ _pthread_create(pthread_t * thread, cons
 		new_thread->tid = TID_TERMINATED;
 		if (new_thread->flags & THR_FLAGS_NEED_SUSPEND) {
 			new_thread->cycle++;
-			_thr_umtx_wake(&new_thread->cycle, INT_MAX);
+			_thr_umtx_wake(&new_thread->cycle, INT_MAX, 0);
 		}
 		THR_THREAD_UNLOCK(curthread, new_thread);
 		THREAD_LIST_LOCK(curthread);
@@ -191,11 +200,31 @@ _pthread_create(pthread_t * thread, cons
 		new_thread->tlflags |= TLFLAGS_DETACHED;
 		_thr_ref_delete_unlocked(curthread, new_thread);
 		THREAD_LIST_UNLOCK(curthread);
-		(*thread) = 0;
 	} else if (locked) {
+		if (cpusetp != NULL) {
+			if (cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID,
+				TID(new_thread), cpusetsize, cpusetp)) {
+				ret = errno;
+				/* kill the new thread */
+				new_thread->force_exit = 1;
+				THR_THREAD_UNLOCK(curthread, new_thread);
+				goto out;
+			}
+		}
+
 		_thr_report_creation(curthread, new_thread);
 		THR_THREAD_UNLOCK(curthread, new_thread);
+out:
+		if (ret) {
+			THREAD_LIST_LOCK(curthread);
+			new_thread->tlflags |= TLFLAGS_DETACHED;
+			THR_GCLIST_ADD(new_thread);
+			THREAD_LIST_UNLOCK(curthread);
+		}
 	}
+
+	if (ret)
+		(*thread) = 0;
 	return (ret);
 }
 
@@ -231,6 +260,9 @@ thread_start(struct pthread *curthread)
 	THR_LOCK(curthread);
 	THR_UNLOCK(curthread);
 
+	if (curthread->force_exit)
+		_pthread_exit(PTHREAD_CANCELED);
+
 	if (curthread->unblock_sigcancel) {
 		sigset_t set1;
 

Modified: stable/7/lib/libthr/thread/thr_event.c
==============================================================================
--- stable/7/lib/libthr/thread/thr_event.c	Tue Mar 24 20:46:02 2009	(r190392)
+++ stable/7/lib/libthr/thread/thr_event.c	Tue Mar 24 20:57:10 2009	(r190393)
@@ -42,7 +42,7 @@ void
 _thr_report_creation(struct pthread *curthread, struct pthread *newthread)
 {
 	curthread->event_buf.event = TD_CREATE;
-	curthread->event_buf.th_p = (td_thrhandle_t *)newthread;
+	curthread->event_buf.th_p = (uintptr_t)newthread;
 	curthread->event_buf.data = 0;
 	THR_UMUTEX_LOCK(curthread, &_thr_event_lock);
 	_thread_last_event = curthread;
@@ -55,7 +55,7 @@ void
 _thr_report_death(struct pthread *curthread)
 {
 	curthread->event_buf.event = TD_DEATH;
-	curthread->event_buf.th_p = (td_thrhandle_t *)curthread;
+	curthread->event_buf.th_p = (uintptr_t)curthread;
 	curthread->event_buf.data = 0;
 	THR_UMUTEX_LOCK(curthread, &_thr_event_lock);
 	_thread_last_event = curthread;

Modified: stable/7/lib/libthr/thread/thr_exit.c
==============================================================================
--- stable/7/lib/libthr/thread/thr_exit.c	Tue Mar 24 20:46:02 2009	(r190392)
+++ stable/7/lib/libthr/thread/thr_exit.c	Tue Mar 24 20:57:10 2009	(r190393)
@@ -29,11 +29,14 @@
  * $FreeBSD$
  */
 
+#include "namespace.h"
 #include 
 #include 
 #include 
 #include 
+#include "un-namespace.h"
 
+#include "libc_private.h"
 #include "thr_private.h"
 
 void	_pthread_exit(void *status);
@@ -60,22 +63,6 @@ _thread_exit(const char *fname, int line
 void
 _thr_exit_cleanup(void)
 {
-	struct pthread	*curthread = _get_curthread();
-
-	/*
-	 * POSIX states that cancellation/termination of a thread should
-	 * not release any visible resources (such as mutexes) and that
-	 * it is the applications responsibility.  Resources that are
-	 * internal to the threads library, including file and fd locks,
-	 * are not visible to the application and need to be released.
-	 */
-	/* Unlock all private mutexes: */
-	_mutex_unlock_private(curthread);
-
-	/*
-	 * This still isn't quite correct because we don't account
-	 * for held spinlocks (see libc/stdlib/malloc.c).
-	 */
 }
 
 void
@@ -100,7 +87,7 @@ _pthread_exit(void *status)
 	/* Save the return value: */
 	curthread->ret = status;
 	while (curthread->cleanup != NULL) {
-		pthread_cleanup_pop(1);
+		_pthread_cleanup_pop(1);
 	}
 
 	/* Check if there is thread specific data: */
@@ -119,8 +106,18 @@ _pthread_exit(void *status)
 		exit(0);
 		/* Never reach! */
 	}
+	THREAD_LIST_UNLOCK(curthread);
+
+	/* Tell malloc that the thread is exiting. */
+	_malloc_thread_cleanup();
+
+	THREAD_LIST_LOCK(curthread);
 	THR_LOCK(curthread);
 	curthread->state = PS_DEAD;
+	if (curthread->flags & THR_FLAGS_NEED_SUSPEND) {
+		curthread->cycle++;
+		_thr_umtx_wake(&curthread->cycle, INT_MAX, 0);
+	}
 	THR_UNLOCK(curthread);
 	/*
 	 * Thread was created with initial refcount 1, we drop the
@@ -130,7 +127,7 @@ _pthread_exit(void *status)
 	if (curthread->tlflags & TLFLAGS_DETACHED)
 		THR_GCLIST_ADD(curthread);
 	THREAD_LIST_UNLOCK(curthread);
-	if (SHOULD_REPORT_EVENT(curthread, TD_DEATH))
+	if (!curthread->force_exit && SHOULD_REPORT_EVENT(curthread, TD_DEATH))
 		_thr_report_death(curthread);
 
 	/*

Modified: stable/7/lib/libthr/thread/thr_fork.c
==============================================================================
--- stable/7/lib/libthr/thread/thr_fork.c	Tue Mar 24 20:46:02 2009	(r190392)
+++ stable/7/lib/libthr/thread/thr_fork.c	Tue Mar 24 20:57:10 2009	(r190393)
@@ -67,6 +67,7 @@
 #include "un-namespace.h"
 
 #include "libc_private.h"
+#include "rtld_lock.h"
 #include "thr_private.h"
 
 __weak_reference(_pthread_atfork, pthread_atfork);
@@ -105,6 +106,7 @@ _fork(void)
 	pid_t ret;
 	int errsave;
 	int unlock_malloc;
+	int rtld_locks[MAX_RTLD_LOCKS];
 
 	if (!_thr_is_inited())
 		return (__sys_fork());
@@ -127,6 +129,7 @@ _fork(void)
 	if (_thr_isthreaded() != 0) {
 		unlock_malloc = 1;
 		_malloc_prefork();
+		_rtld_atfork_pre(rtld_locks);
 	} else {
 		unlock_malloc = 0;
 	}
@@ -155,6 +158,9 @@ _fork(void)
 		/* clear other threads locked us. */
 		_thr_umutex_init(&curthread->lock);
 		_thr_umutex_init(&_thr_atfork_lock);
+
+		if (unlock_malloc)
+			_rtld_atfork_post(rtld_locks);
 		_thr_setthreaded(0);
 
 		/* reinitialize libc spinlocks. */
@@ -167,6 +173,12 @@ _fork(void)
 		/* Ready to continue, unblock signals. */ 
 		_thr_signal_unblock(curthread);
 
+		if (unlock_malloc) {
+			__isthreaded = 1;
+			_malloc_postfork();
+			__isthreaded = 0;
+		}
+
 		/* Run down atfork child handlers. */
 		TAILQ_FOREACH(af, &_thr_atfork_list, qe) {
 			if (af->child != NULL)
@@ -179,8 +191,10 @@ _fork(void)
 		/* Ready to continue, unblock signals. */ 
 		_thr_signal_unblock(curthread);
 
-		if (unlock_malloc)
+		if (unlock_malloc) {
+			_rtld_atfork_post(rtld_locks);
 			_malloc_postfork();
+		}
 
 		/* Run down atfork parent handlers. */
 		TAILQ_FOREACH(af, &_thr_atfork_list, qe) {

Added: stable/7/lib/libthr/thread/thr_getcpuclockid.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/7/lib/libthr/thread/thr_getcpuclockid.c	Tue Mar 24 20:57:10 2009	(r190393)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2008 David Xu 
+ * 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 JOHN BIRRELL 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$
+ */
+
+#include "namespace.h"
+#include 
+#include 
+#include 
+#include "un-namespace.h"
+
+#include "thr_private.h"
+
+__weak_reference(_pthread_getcpuclockid, pthread_getcpuclockid);
+
+int
+_pthread_getcpuclockid(pthread_t pthread, clockid_t *clock_id)
+{
+	if (pthread == NULL)
+		return (EINVAL);
+
+	*clock_id = CLOCK_THREAD_CPUTIME_ID;
+	return (0);
+}

Modified: stable/7/lib/libthr/thread/thr_init.c
==============================================================================
--- stable/7/lib/libthr/thread/thr_init.c	Tue Mar 24 20:46:02 2009	(r190392)
+++ stable/7/lib/libthr/thread/thr_init.c	Tue Mar 24 20:57:10 2009	(r190393)
@@ -75,20 +75,21 @@ struct pthread_prio	_thr_priorities[3] =
 
 struct pthread_attr _pthread_attr_default = {
 	.sched_policy = SCHED_OTHER,
-	.sched_inherit = 0,
+	.sched_inherit = PTHREAD_INHERIT_SCHED,
 	.prio = 0,
 	.suspend = THR_CREATE_RUNNING,
 	.flags = PTHREAD_SCOPE_SYSTEM,
 	.stackaddr_attr = NULL,
 	.stacksize_attr = THR_STACK_DEFAULT,
-	.guardsize_attr = 0
+	.guardsize_attr = 0,
+	.cpusetsize = 0,
+	.cpuset = NULL
 };
 
 struct pthread_mutex_attr _pthread_mutexattr_default = {
 	.m_type = PTHREAD_MUTEX_DEFAULT,
 	.m_protocol = PTHREAD_PRIO_NONE,
-	.m_ceiling = 0,
-	.m_flags = 0
+	.m_ceiling = 0
 };
 
 /* Default condition variable attributes: */
@@ -158,7 +159,6 @@ STATIC_LIB_REQUIRE(_spinlock);
 STATIC_LIB_REQUIRE(_spinlock_debug);
 STATIC_LIB_REQUIRE(_spinunlock);
 STATIC_LIB_REQUIRE(_thread_init_hack);
-STATIC_LIB_REQUIRE(_vfork);
 
 /*
  * These are needed when linking statically.  All references within

Modified: stable/7/lib/libthr/thread/thr_mutex.c
==============================================================================
--- stable/7/lib/libthr/thread/thr_mutex.c	Tue Mar 24 20:46:02 2009	(r190392)
+++ stable/7/lib/libthr/thread/thr_mutex.c	Tue Mar 24 20:57:10 2009	(r190393)
@@ -40,6 +40,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "un-namespace.h"
 
 #include "thr_private.h"
@@ -50,12 +51,12 @@
 	(m)->m_qe.tqe_next = NULL;			\

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

From owner-svn-src-all@FreeBSD.ORG  Tue Mar 24 21:02:19 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 22:35:05 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 23:16:48 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar 24 23:31:41 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 00:57:10 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 01:41:57 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 01:44:17 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 01:50:56 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 03:02:03 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 03:42:49 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 05:10:33 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 06:27:57 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 07:01:46 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 07:05:23 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 07:26:24 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 08:07:53 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 09:55:48 2009
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 52A11106564A
	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 A4E648FC16
	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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 12:36:37 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 12:39:27 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 14:02:27 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 14:11:29 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BE8F91065672;
	Wed, 25 Mar 2009 14:11:29 +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 AB8558FC1F;
	Wed, 25 Mar 2009 14:11:29 +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 n2PEBTgX078638;
	Wed, 25 Mar 2009 14:11:29 GMT (envelope-from vanhu@svn.freebsd.org)
Received: (from vanhu@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2PEBTet078637;
	Wed, 25 Mar 2009 14:11:29 GMT (envelope-from vanhu@svn.freebsd.org)
Message-Id: <200903251411.n2PEBTet078637@svn.freebsd.org>
From: VANHULLEBUS Yvan 
Date: Wed, 25 Mar 2009 14:11:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190412 - stable/7/contrib/libpcap
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 14:11:30 -0000

Author: vanhu
Date: Wed Mar 25 14:11:29 2009
New Revision: 190412
URL: http://svn.freebsd.org/changeset/base/190412

Log:
  MFC: Added DLT_ENC to map list, so it is now possible
  to save dumps on enc0
  
  Approved by:	re (gnn)
  Obtained from:	NETASQ

Modified:
  stable/7/contrib/libpcap/   (props changed)
  stable/7/contrib/libpcap/savefile.c

Modified: stable/7/contrib/libpcap/savefile.c
==============================================================================
--- stable/7/contrib/libpcap/savefile.c	Wed Mar 25 14:02:26 2009	(r190411)
+++ stable/7/contrib/libpcap/savefile.c	Wed Mar 25 14:11:29 2009	(r190412)
@@ -811,6 +811,9 @@ static struct linktype_map {
 	/* IPMB */
 	{ DLT_IPMB,		LINKTYPE_IPMB },
 
+	/* enc0 device */
+	{ DLT_ENC,		LINKTYPE_ENC },
+
 	{ -1,			-1 }
 };
 

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 25 14:17:08 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 14:26:38 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D72F5106564A;
	Wed, 25 Mar 2009 14:26:38 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BB9998FC0A;
	Wed, 25 Mar 2009 14:26:38 +0000 (UTC) (envelope-from mav@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 n2PEQcVe078998;
	Wed, 25 Mar 2009 14:26:38 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2PEQccK078996;
	Wed, 25 Mar 2009 14:26:38 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200903251426.n2PEQccK078996@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 25 Mar 2009 14:26:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190414 - in stable/7/sys: . contrib/pf dev/ata
	dev/ath/ath_hal dev/cxgb
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 14:26:39 -0000

Author: mav
Date: Wed Mar 25 14:26:38 2009
New Revision: 190414
URL: http://svn.freebsd.org/changeset/base/190414

Log:
  MFC rev. 188846:
  
  Handle nForce MCP67 and MCP73 SATA controllers as AHCI. They report
  itself as ATA RAID, but generic ATAPCI driver unable to detect drives
  there. AHCI driver reported to handle them fine. Linux does the same.
  
  Submitted by:	Andrey V. Elsukov on stable@
  PR:		kern/125713
  Approved by:	re (kib)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ata/ata-chipset.c
  stable/7/sys/dev/ata/ata-pci.h
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)

Modified: stable/7/sys/dev/ata/ata-chipset.c
==============================================================================
--- stable/7/sys/dev/ata/ata-chipset.c	Wed Mar 25 14:17:08 2009	(r190413)
+++ stable/7/sys/dev/ata/ata-chipset.c	Wed Mar 25 14:26:38 2009	(r190414)
@@ -3131,7 +3131,31 @@ ata_nvidia_ident(device_t dev)
      { ATA_NFORCE_MCP61_S3, 0, 0,         NV4|NVQ, ATA_SA300, "nForce MCP61" },
      { ATA_NFORCE_MCP65,    0, AMDNVIDIA, NVIDIA,  ATA_UDMA6, "nForce MCP65" },
      { ATA_NFORCE_MCP67,    0, AMDNVIDIA, NVIDIA,  ATA_UDMA6, "nForce MCP67" },
+     { ATA_NFORCE_MCP67_A0, 0, NVAHCI,  0, ATA_SA300, "nForce MCP67" },
+     { ATA_NFORCE_MCP67_A1, 0, NVAHCI,  0, ATA_SA300, "nForce MCP67" },
+     { ATA_NFORCE_MCP67_A2, 0, NVAHCI,  0, ATA_SA300, "nForce MCP67" },
+     { ATA_NFORCE_MCP67_A3, 0, NVAHCI,  0, ATA_SA300, "nForce MCP67" },
+     { ATA_NFORCE_MCP67_A4, 0, NVAHCI,  0, ATA_SA300, "nForce MCP67" },
+     { ATA_NFORCE_MCP67_A5, 0, NVAHCI,  0, ATA_SA300, "nForce MCP67" },
+     { ATA_NFORCE_MCP67_A6, 0, NVAHCI,  0, ATA_SA300, "nForce MCP67" },
+     { ATA_NFORCE_MCP67_A7, 0, NVAHCI,  0, ATA_SA300, "nForce MCP67" },
+     { ATA_NFORCE_MCP67_A8, 0, NVAHCI,  0, ATA_SA300, "nForce MCP67" },
+     { ATA_NFORCE_MCP67_A9, 0, NVAHCI,  0, ATA_SA300, "nForce MCP67" },
+     { ATA_NFORCE_MCP67_AA, 0, NVAHCI,  0, ATA_SA300, "nForce MCP67" },
+     { ATA_NFORCE_MCP67_AB, 0, NVAHCI,  0, ATA_SA300, "nForce MCP67" },
      { ATA_NFORCE_MCP73,    0, AMDNVIDIA, NVIDIA,  ATA_UDMA6, "nForce MCP73" },
+     { ATA_NFORCE_MCP73_A0, 0, NVAHCI,  0, ATA_SA300, "nForce MCP73" },
+     { ATA_NFORCE_MCP73_A1, 0, NVAHCI,  0, ATA_SA300, "nForce MCP73" },
+     { ATA_NFORCE_MCP73_A2, 0, NVAHCI,  0, ATA_SA300, "nForce MCP73" },
+     { ATA_NFORCE_MCP73_A3, 0, NVAHCI,  0, ATA_SA300, "nForce MCP73" },
+     { ATA_NFORCE_MCP73_A4, 0, NVAHCI,  0, ATA_SA300, "nForce MCP73" },
+     { ATA_NFORCE_MCP73_A5, 0, NVAHCI,  0, ATA_SA300, "nForce MCP73" },
+     { ATA_NFORCE_MCP73_A6, 0, NVAHCI,  0, ATA_SA300, "nForce MCP73" },
+     { ATA_NFORCE_MCP73_A7, 0, NVAHCI,  0, ATA_SA300, "nForce MCP73" },
+     { ATA_NFORCE_MCP73_A8, 0, NVAHCI,  0, ATA_SA300, "nForce MCP73" },
+     { ATA_NFORCE_MCP73_A9, 0, NVAHCI,  0, ATA_SA300, "nForce MCP73" },
+     { ATA_NFORCE_MCP73_AA, 0, NVAHCI,  0, ATA_SA300, "nForce MCP73" },
+     { ATA_NFORCE_MCP73_AB, 0, NVAHCI,  0, ATA_SA300, "nForce MCP73" },
      { ATA_NFORCE_MCP77,    0, AMDNVIDIA, NVIDIA,  ATA_UDMA6, "nForce MCP77" },
      { 0, 0, 0, 0, 0, 0}} ;
 
@@ -3139,7 +3163,10 @@ ata_nvidia_ident(device_t dev)
 	return ENXIO;
 
     ata_set_desc(dev);
-    ctlr->chipinit = ata_nvidia_chipinit;
+    if (ctlr->chip->cfg1 & NVAHCI)
+    	ctlr->chipinit = ata_ahci_chipinit;
+    else
+    	ctlr->chipinit = ata_nvidia_chipinit;
     return 0;
 }
 

Modified: stable/7/sys/dev/ata/ata-pci.h
==============================================================================
--- stable/7/sys/dev/ata/ata-pci.h	Wed Mar 25 14:17:08 2009	(r190413)
+++ stable/7/sys/dev/ata/ata-pci.h	Wed Mar 25 14:26:38 2009	(r190414)
@@ -250,8 +250,32 @@ struct ata_connect_task {
 #define ATA_NFORCE_MCP61_S2     0x03f610de
 #define ATA_NFORCE_MCP61_S3     0x03f710de
 #define ATA_NFORCE_MCP65        0x044810de
+#define ATA_NFORCE_MCP67_A0     0x055010de
+#define ATA_NFORCE_MCP67_A1     0x055110de
+#define ATA_NFORCE_MCP67_A2     0x055210de
+#define ATA_NFORCE_MCP67_A3     0x055310de
+#define ATA_NFORCE_MCP67_A4     0x055410de
+#define ATA_NFORCE_MCP67_A5     0x055510de
+#define ATA_NFORCE_MCP67_A6     0x055610de
+#define ATA_NFORCE_MCP67_A7     0x055710de
+#define ATA_NFORCE_MCP67_A8     0x055810de
+#define ATA_NFORCE_MCP67_A9     0x055910de
+#define ATA_NFORCE_MCP67_AA     0x055A10de
+#define ATA_NFORCE_MCP67_AB     0x055B10de
 #define ATA_NFORCE_MCP67        0x056010de
 #define ATA_NFORCE_MCP73        0x056c10de
+#define ATA_NFORCE_MCP73_A0     0x07f010de
+#define ATA_NFORCE_MCP73_A1     0x07f110de
+#define ATA_NFORCE_MCP73_A2     0x07f210de
+#define ATA_NFORCE_MCP73_A3     0x07f310de
+#define ATA_NFORCE_MCP73_A4     0x07f410de
+#define ATA_NFORCE_MCP73_A5     0x07f510de
+#define ATA_NFORCE_MCP73_A6     0x07f610de
+#define ATA_NFORCE_MCP73_A7     0x07f710de
+#define ATA_NFORCE_MCP73_A8     0x07f810de
+#define ATA_NFORCE_MCP73_A9     0x07f910de
+#define ATA_NFORCE_MCP73_AA     0x07fa10de
+#define ATA_NFORCE_MCP73_AB     0x07fb10de
 #define ATA_NFORCE_MCP77        0x075910de
 
 #define ATA_PROMISE_ID          0x105a
@@ -458,6 +482,7 @@ struct ata_connect_task {
 #define NVIDIA          0x0004
 #define NV4             0x0010
 #define NVQ             0x0020
+#define NVAHCI          0x0040
 #define VIACLK          0x0100
 #define VIABUG          0x0200
 #define VIABAR          0x0400

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 25 15:42:07 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EDCF61065670;
	Wed, 25 Mar 2009 15:42:07 +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 DB4678FC08;
	Wed, 25 Mar 2009 15:42:07 +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 n2PFg71L080604;
	Wed, 25 Mar 2009 15:42:07 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2PFg74U080603;
	Wed, 25 Mar 2009 15:42:07 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200903251542.n2PFg74U080603@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 25 Mar 2009 15:42:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190415 - in stable/7/lib/libc: . string
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 15:42:08 -0000

Author: kib
Date: Wed Mar 25 15:42:07 2009
New Revision: 190415
URL: http://svn.freebsd.org/changeset/base/190415

Log:
  MFC r190266:
  7.2 will be the first release where strndup() appears.
  
  Approved by:	re (kensmith)

Modified:
  stable/7/lib/libc/   (props changed)
  stable/7/lib/libc/string/ffsll.c   (props changed)
  stable/7/lib/libc/string/flsll.c   (props changed)
  stable/7/lib/libc/string/strdup.3

Modified: stable/7/lib/libc/string/strdup.3
==============================================================================
--- stable/7/lib/libc/string/strdup.3	Wed Mar 25 14:26:38 2009	(r190414)
+++ stable/7/lib/libc/string/strdup.3	Wed Mar 25 15:42:07 2009	(r190415)
@@ -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-all@FreeBSD.ORG  Wed Mar 25 16:23:43 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 16:42:51 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 16:59:33 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 17:02:05 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 17:04:58 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 17:22:16 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 339AA10656C3;
	Wed, 25 Mar 2009 17:22:16 +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 19A4E8FC20;
	Wed, 25 Mar 2009 17:22:16 +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 n2PHMGSs082670;
	Wed, 25 Mar 2009 17:22:16 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2PHMFLg082656;
	Wed, 25 Mar 2009 17:22:15 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200903251722.n2PHMFLg082656@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 25 Mar 2009 17:22:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190418 - in stable/7/sys: . amd64/amd64 amd64/ia32
	amd64/include amd64/linux32 compat/linux contrib/pf
	dev/ath/ath_hal dev/cxgb i386/i386 i386/include i386/isa i386/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 17:22:20 -0000

Author: jhb
Date: Wed Mar 25 17:22:15 2009
New Revision: 190418
URL: http://svn.freebsd.org/changeset/base/190418

Log:
  Allow different ABIs to use different initial control words for the FPU on
  amd64 and i386.  This fixes a bug were 32-bit binaries would run with a
  different floating point exception mask under FreeBSD/amd64 vs FreeBSD/i386.
  This commit also includes a few other minor changes to keep the code in
  sync with 8.
  
  Approved by:	re (kib)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/amd64/amd64/fpu.c
  stable/7/sys/amd64/amd64/machdep.c
  stable/7/sys/amd64/amd64/trap.c
  stable/7/sys/amd64/ia32/ia32_signal.c
  stable/7/sys/amd64/include/fpu.h
  stable/7/sys/amd64/include/pcb.h
  stable/7/sys/amd64/linux32/linux32_sysvec.c
  stable/7/sys/compat/linux/linux_misc.h
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/i386/i386/machdep.c
  stable/7/sys/i386/i386/mp_machdep.c
  stable/7/sys/i386/include/npx.h
  stable/7/sys/i386/include/pcb.h
  stable/7/sys/i386/isa/npx.c
  stable/7/sys/i386/linux/linux_sysvec.c

Modified: stable/7/sys/amd64/amd64/fpu.c
==============================================================================
--- stable/7/sys/amd64/amd64/fpu.c	Wed Mar 25 17:02:05 2009	(r190417)
+++ stable/7/sys/amd64/amd64/fpu.c	Wed Mar 25 17:22:15 2009	(r190418)
@@ -98,16 +98,15 @@ typedef u_char bool_t;
 
 static	void	fpu_clean_state(void);
 
-int	hw_float = 1;
-SYSCTL_INT(_hw,HW_FLOATINGPT, floatingpoint,
-	CTLFLAG_RD, &hw_float, 0, 
-	"Floatingpoint instructions executed in hardware");
+SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD,
+    NULL, 1, "Floating point instructions executed in hardware");
 
 static	struct savefpu		fpu_cleanstate;
-static	bool_t			fpu_cleanstate_ready;
 
 /*
- * Initialize floating point unit.
+ * Initialize the floating point unit.  On the boot CPU we generate a
+ * clean state that is used to initialize the floating point unit when
+ * it is first used by a process.
  */
 void
 fpuinit(void)
@@ -117,22 +116,22 @@ fpuinit(void)
 	u_short control;
 
 	savecrit = intr_disable();
-	PCPU_SET(fpcurthread, 0);
 	stop_emulating();
 	fninit();
 	control = __INITIAL_FPUCW__;
 	fldcw(&control);
 	mxcsr = __INITIAL_MXCSR__;
 	ldmxcsr(mxcsr);
-	fxsave(&fpu_cleanstate);
-	if (fpu_cleanstate.sv_env.en_mxcsr_mask)
-		cpu_mxcsr_mask = fpu_cleanstate.sv_env.en_mxcsr_mask;
-	else
-		cpu_mxcsr_mask = 0xFFBF;
+	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;
+		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));
+	}
 	start_emulating();
-	bzero(fpu_cleanstate.sv_fp, sizeof(fpu_cleanstate.sv_fp));
-	bzero(fpu_cleanstate.sv_xmm, sizeof(fpu_cleanstate.sv_xmm));
-	fpu_cleanstate_ready = 1;
 	intr_restore(savecrit);
 }
 
@@ -386,8 +385,8 @@ fputrap()
 
 static int err_count = 0;
 
-int
-fpudna()
+void
+fpudna(void)
 {
 	struct pcb *pcb;
 	register_t s;
@@ -396,7 +395,7 @@ fpudna()
 		printf("fpudna: fpcurthread == curthread %d times\n",
 		    ++err_count);
 		stop_emulating();
-		return (1);
+		return;
 	}
 	if (PCPU_GET(fpcurthread) != NULL) {
 		printf("fpudna: fpcurthread = %p (%d), curthread = %p (%d)\n",
@@ -421,12 +420,12 @@ fpudna()
 		 * explicitly load sanitized registers.
 		 */
 		fxrstor(&fpu_cleanstate);
+		if (pcb->pcb_initial_fpucw != __INITIAL_FPUCW__)
+			fldcw(&pcb->pcb_initial_fpucw);
 		pcb->pcb_flags |= PCB_FPUINITDONE;
 	} else
 		fxrstor(&pcb->pcb_save);
 	intr_restore(s);
-
-	return (1);
 }
 
 /*
@@ -454,10 +453,8 @@ fpugetregs(struct thread *td, struct sav
 	register_t s;
 
 	if ((td->td_pcb->pcb_flags & PCB_FPUINITDONE) == 0) {
-		if (fpu_cleanstate_ready)
-			bcopy(&fpu_cleanstate, addr, sizeof(fpu_cleanstate));
-		else
-			bzero(addr, sizeof(*addr));
+		bcopy(&fpu_cleanstate, addr, sizeof(fpu_cleanstate));
+		addr->sv_env.en_cw = td->td_pcb->pcb_initial_fpucw;
 		return (_MC_FPOWNED_NONE);
 	}
 	s = intr_disable();

Modified: stable/7/sys/amd64/amd64/machdep.c
==============================================================================
--- stable/7/sys/amd64/amd64/machdep.c	Wed Mar 25 17:02:05 2009	(r190417)
+++ stable/7/sys/amd64/amd64/machdep.c	Wed Mar 25 17:22:15 2009	(r190418)
@@ -586,7 +586,7 @@ cpu_idle(void)
 void (*cpu_idle_hook)(void) = cpu_idle_default;
 
 /*
- * Clear registers on exec
+ * Reset registers to default values on exec.
  */
 void
 exec_setregs(td, entry, stack, ps_strings)
@@ -613,6 +613,7 @@ exec_setregs(td, entry, stack, ps_string
 	pcb->pcb_es = _udatasel;
 	pcb->pcb_fs = _udatasel;
 	pcb->pcb_gs = _udatasel;
+	pcb->pcb_initial_fpucw = __INITIAL_FPUCW__;
 
 	bzero((char *)regs, sizeof(struct trapframe));
 	regs->tf_rip = entry;

Modified: stable/7/sys/amd64/amd64/trap.c
==============================================================================
--- stable/7/sys/amd64/amd64/trap.c	Wed Mar 25 17:02:05 2009	(r190417)
+++ stable/7/sys/amd64/amd64/trap.c	Wed Mar 25 17:22:15 2009	(r190418)
@@ -421,13 +421,8 @@ trap(struct trapframe *frame)
 
 		case T_DNA:
 			/* transparent fault (due to context switch "late") */
-			if (fpudna())
-				goto userout;
-			printf("pid %d killed due to lack of floating point\n",
-				p->p_pid);
-			i = SIGKILL;
-			ucode = 0;
-			break;
+			fpudna();
+			goto userout;
 
 		case T_FPOPFLT:		/* FPU operand fetch fault */
 			ucode = ILL_COPROC;
@@ -455,11 +450,9 @@ trap(struct trapframe *frame)
 			 * XXX this should be fatal unless the kernel has
 			 * registered such use.
 			 */
-			if (fpudna()) {
-				printf("fpudna in kernel mode!\n");
-				goto out;
-			}
-			break;
+			fpudna();
+			printf("fpudna in kernel mode!\n");
+			goto out;
 
 		case T_STKFLT:		/* stack fault */
 			break;

Modified: stable/7/sys/amd64/ia32/ia32_signal.c
==============================================================================
--- stable/7/sys/amd64/ia32/ia32_signal.c	Wed Mar 25 17:02:05 2009	(r190417)
+++ stable/7/sys/amd64/ia32/ia32_signal.c	Wed Mar 25 17:22:15 2009	(r190418)
@@ -727,6 +727,7 @@ ia32_setregs(td, entry, stack, ps_string
 	pcb->pcb_es = _udatasel;
 	pcb->pcb_fs = _udatasel;
 	pcb->pcb_gs = _udatasel;
+	pcb->pcb_initial_fpucw = __INITIAL_FPUCW_I386__;
 
 	bzero((char *)regs, sizeof(struct trapframe));
 	regs->tf_rip = entry;

Modified: stable/7/sys/amd64/include/fpu.h
==============================================================================
--- stable/7/sys/amd64/include/fpu.h	Wed Mar 25 17:02:05 2009	(r190417)
+++ stable/7/sys/amd64/include/fpu.h	Wed Mar 25 17:22:15 2009	(r190418)
@@ -92,11 +92,12 @@ struct  savefpu {
  * SSE2 based math.  For FreeBSD/amd64, we go with the default settings.
  */
 #define	__INITIAL_FPUCW__	0x037F
+#define	__INITIAL_FPUCW_I386__	0x127F
 #define	__INITIAL_MXCSR__	0x1F80
 #define	__INITIAL_MXCSR_MASK__	0xFFBF
 
 #ifdef _KERNEL
-int	fpudna(void);
+void	fpudna(void);
 void	fpudrop(void);
 void	fpuexit(struct thread *td);
 int	fpuformat(void);

Modified: stable/7/sys/amd64/include/pcb.h
==============================================================================
--- stable/7/sys/amd64/include/pcb.h	Wed Mar 25 17:02:05 2009	(r190417)
+++ stable/7/sys/amd64/include/pcb.h	Wed Mar 25 17:22:15 2009	(r190418)
@@ -55,6 +55,13 @@ struct pcb {
 	register_t	pcb_rip;
 	register_t	pcb_fsbase;
 	register_t	pcb_gsbase;
+	u_long		pcb_flags;
+#define	PCB_DBREGS	0x02	/* process using debug registers */
+#define	PCB_FPUINITDONE	0x08	/* fpu state is initialized */
+#define	PCB_GS32BIT	0x20	/* linux gs switch */
+#define	PCB_32BIT	0x40	/* process has 32 bit context (segs etc) */
+#define	PCB_FULLCTX	0x80	/* full context restore on sysret */
+
 	u_int32_t	pcb_ds;
 	u_int32_t	pcb_es;
 	u_int32_t	pcb_fs;
@@ -67,12 +74,7 @@ struct pcb {
 	u_int64_t	pcb_dr7;
 
 	struct	savefpu	pcb_save;
-	u_long	pcb_flags;
-#define	PCB_DBREGS	0x02	/* process using debug registers */
-#define	PCB_FPUINITDONE	0x08	/* fpu state is initialized */
-#define	PCB_GS32BIT	0x20	/* linux gs switch */
-#define	PCB_32BIT	0x40	/* process has 32 bit context (segs etc) */
-#define	PCB_FULLCTX	0x80	/* full context restore on sysret */
+	uint16_t	pcb_initial_fpucw;
 
 	caddr_t	pcb_onfault;	/* copyin/out fault recovery */
 

Modified: stable/7/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- stable/7/sys/amd64/linux32/linux32_sysvec.c	Wed Mar 25 17:02:05 2009	(r190417)
+++ stable/7/sys/amd64/linux32/linux32_sysvec.c	Wed Mar 25 17:22:15 2009	(r190418)
@@ -832,6 +832,7 @@ exec_linux_setregs(td, entry, stack, ps_
 	pcb->pcb_es = _udatasel;
 	pcb->pcb_fs = _udatasel;
 	pcb->pcb_gs = _udatasel;
+	pcb->pcb_initial_fpucw = __LINUX_NPXCW__;
 
 	bzero((char *)regs, sizeof(struct trapframe));
 	regs->tf_rip = entry;

Modified: stable/7/sys/compat/linux/linux_misc.h
==============================================================================
--- stable/7/sys/compat/linux/linux_misc.h	Wed Mar 25 17:02:05 2009	(r190417)
+++ stable/7/sys/compat/linux/linux_misc.h	Wed Mar 25 17:22:15 2009	(r190418)
@@ -45,4 +45,9 @@
 #define	LINUX_MREMAP_MAYMOVE	1
 #define	LINUX_MREMAP_FIXED	2
 
+/* Linux sets the i387 to extended precision. */
+#if defined(__i386__) || defined(__amd64__)
+#define	__LINUX_NPXCW__		0x37f
+#endif
+
 #endif	/* _LINUX_MISC_H_ */

Modified: stable/7/sys/i386/i386/machdep.c
==============================================================================
--- stable/7/sys/i386/i386/machdep.c	Wed Mar 25 17:02:05 2009	(r190417)
+++ stable/7/sys/i386/i386/machdep.c	Wed Mar 25 17:22:15 2009	(r190418)
@@ -1188,7 +1188,7 @@ cpu_idle(void)
 void (*cpu_idle_hook)(void) = cpu_idle_default;
 
 /*
- * Clear registers on exec
+ * Reset registers to default values on exec.
  */
 void
 exec_setregs(td, entry, stack, ps_strings)
@@ -1253,6 +1253,7 @@ exec_setregs(td, entry, stack, ps_string
 	 * emulators don't provide an entry point for initialization.
 	 */
 	td->td_pcb->pcb_flags &= ~FP_SOFTFP;
+	pcb->pcb_initial_npxcw = __INITIAL_NPXCW__;
 
 	/*
 	 * Drop the FP state if we hold it, so that the process gets a

Modified: stable/7/sys/i386/i386/mp_machdep.c
==============================================================================
--- stable/7/sys/i386/i386/mp_machdep.c	Wed Mar 25 17:02:05 2009	(r190417)
+++ stable/7/sys/i386/i386/mp_machdep.c	Wed Mar 25 17:22:15 2009	(r190418)
@@ -575,7 +575,7 @@ init_secondary(void)
 	cpu_setregs();
 
 	/* set up FPU state on the AP */
-	npxinit(__INITIAL_NPXCW__);
+	npxinit();
 
 	/* set up SSE registers */
 	enable_sse();

Modified: stable/7/sys/i386/include/npx.h
==============================================================================
--- stable/7/sys/i386/include/npx.h	Wed Mar 25 17:02:05 2009	(r190417)
+++ stable/7/sys/i386/include/npx.h	Wed Mar 25 17:22:15 2009	(r190418)
@@ -151,7 +151,7 @@ void	npxdrop(void);
 void	npxexit(struct thread *td);
 int	npxformat(void);
 int	npxgetregs(struct thread *td, union savefpu *addr);
-void	npxinit(u_short control);
+void	npxinit(void);
 void	npxsave(union savefpu *addr);
 void	npxsetregs(struct thread *td, union savefpu *addr);
 int	npxtrap(void);

Modified: stable/7/sys/i386/include/pcb.h
==============================================================================
--- stable/7/sys/i386/include/pcb.h	Wed Mar 25 17:02:05 2009	(r190417)
+++ stable/7/sys/i386/include/pcb.h	Wed Mar 25 17:22:15 2009	(r190418)
@@ -61,6 +61,7 @@ struct pcb {
 	int     pcb_dr7;
 
 	union	savefpu	pcb_save;
+	uint16_t pcb_initial_npxcw;
 	u_int	pcb_flags;
 #define	FP_SOFTFP	0x01	/* process using software fltng pnt emulator */
 #define	PCB_DBREGS	0x02	/* process using debug registers */

Modified: stable/7/sys/i386/isa/npx.c
==============================================================================
--- stable/7/sys/i386/isa/npx.c	Wed Mar 25 17:02:05 2009	(r190417)
+++ stable/7/sys/i386/isa/npx.c	Wed Mar 25 17:22:15 2009	(r190418)
@@ -132,11 +132,19 @@ void	stop_emulating(void);
 	(cpu_fxsr ? \
 		(thread)->td_pcb->pcb_save.sv_xmm.sv_env.en_sw : \
 		(thread)->td_pcb->pcb_save.sv_87.sv_env.en_sw)
+#define SET_FPU_CW(savefpu, value) do { \
+	if (cpu_fxsr) \
+		(savefpu)->sv_xmm.sv_env.en_cw = (value); \
+	else \
+		(savefpu)->sv_87.sv_env.en_cw = (value); \
+} while (0)
 #else /* CPU_ENABLE_SSE */
 #define GET_FPU_CW(thread) \
 	(thread->td_pcb->pcb_save.sv_87.sv_env.en_cw)
 #define GET_FPU_SW(thread) \
 	(thread->td_pcb->pcb_save.sv_87.sv_env.en_sw)
+#define SET_FPU_CW(savefpu, value) \
+	(savefpu)->sv_87.sv_env.en_cw = (value)
 #endif /* CPU_ENABLE_SSE */
 
 typedef u_char bool_t;
@@ -158,15 +166,13 @@ static	long	timezero(const char *funcnam
 
 int	hw_float;		/* XXX currently just alias for npx_exists */
 
-SYSCTL_INT(_hw,HW_FLOATINGPT, floatingpoint,
-	CTLFLAG_RD, &hw_float, 0, 
-	"Floatingpoint instructions executed in hardware");
+SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD,
+    &hw_float, 0, "Floating point instructions executed in hardware");
 
 static	volatile u_int		npx_intrs_while_probing;
 static	volatile u_int		npx_traps_while_probing;
 
 static	union savefpu		npx_cleanstate;
-static	bool_t			npx_cleanstate_ready;
 static	bool_t			npx_ex16;
 static	bool_t			npx_exists;
 static	bool_t			npx_irq13;
@@ -368,19 +374,14 @@ npx_probe(dev)
 				return (0);
 			}
 			/*
-			 * Worse, even IRQ13 is broken.  Use emulator.
+			 * Worse, even IRQ13 is broken.
 			 */
 		}
 	}
-	/*
-	 * Probe failed, but we want to get to npxattach to initialize the
-	 * emulator and say that it has been installed.  XXX handle devices
-	 * that aren't really devices better.
-	 */
-#ifdef SMP
-	if (mp_ncpus > 1)
-		panic("npx0 cannot be emulated on an SMP system");
-#endif
+
+	/* Probe failed.  Floating point simply won't work. */
+	device_printf(dev, "WARNING: no FPU!\n");
+
 	/* FALLTHROUGH */
 no_irq13:
 	idt[IDT_MF] = save_idt_npxtrap;
@@ -389,7 +390,7 @@ no_irq13:
 		bus_release_resource(dev, SYS_RES_IRQ, irq_rid, irq_res);
 	}
 	bus_release_resource(dev, SYS_RES_IOPORT, ioport_rid, ioport_res);
-	return (0);
+	return (npx_exists ? 0 : ENXIO);
 }
 
 /*
@@ -406,32 +407,34 @@ npx_attach(dev)
 
 	if (npx_irq13)
 		device_printf(dev, "IRQ 13 interface\n");
-	else if (!npx_ex16)
-		device_printf(dev, "WARNING: no FPU!\n");
 	else if (!device_is_quiet(dev) || bootverbose)
 		device_printf(dev, "INT 16 interface\n");
 
-	npxinit(__INITIAL_NPXCW__);
+	npxinit();
 
-	if (npx_cleanstate_ready == 0) {
-		s = intr_disable();
-		stop_emulating();
-		fpusave(&npx_cleanstate);
-		start_emulating();
+	s = intr_disable();
+	stop_emulating();
+	fpusave(&npx_cleanstate);
+	start_emulating();
 #ifdef CPU_ENABLE_SSE
-		if (cpu_fxsr) {
-			if (npx_cleanstate.sv_xmm.sv_env.en_mxcsr_mask)
-				cpu_mxcsr_mask = 
-			    	    npx_cleanstate.sv_xmm.sv_env.en_mxcsr_mask;
-			else
-				cpu_mxcsr_mask = 0xFFBF;
-		}
+	if (cpu_fxsr) {
+		if (npx_cleanstate.sv_xmm.sv_env.en_mxcsr_mask)
+			cpu_mxcsr_mask = 
+			    npx_cleanstate.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));
+		/* XXX might need even more zeroing. */
+	} else
 #endif
-		npx_cleanstate_ready = 1;
-		intr_restore(s);
-	}
+		bzero(npx_cleanstate.sv_87.sv_ac,
+		    sizeof(npx_cleanstate.sv_87.sv_ac));
+	intr_restore(s);
 #ifdef I586_CPU_XXX
-	if (cpu_class == CPUCLASS_586 && npx_ex16 && npx_exists &&
+	if (cpu_class == CPUCLASS_586 && npx_ex16 &&
 	    timezero("i586_bzero()", i586_bzero) <
 	    timezero("bzero()", bzero) * 4 / 5) {
 		if (!(flags & NPX_DISABLE_I586_OPTIMIZED_BCOPY))
@@ -452,10 +455,11 @@ npx_attach(dev)
  * Initialize floating point unit.
  */
 void
-npxinit(u_short control)
+npxinit(void)
 {
 	static union savefpu dummy;
 	register_t savecrit;
+	u_short control;
 
 	if (!npx_exists)
 		return;
@@ -472,6 +476,7 @@ npxinit(u_short control)
 	if (cpu_fxsr)
 		fninit();
 #endif
+	control = __INITIAL_NPXCW__;
 	fldcw(&control);
 	start_emulating();
 	intr_restore(savecrit);
@@ -752,14 +757,10 @@ npxtrap()
 static int err_count = 0;
 
 int
-npxdna()
+npxdna(void)
 {
 	struct pcb *pcb;
 	register_t s;
-#ifdef CPU_ENABLE_SSE
-	int mxcsr;
-#endif
-	u_short control;
 
 	if (!npx_exists)
 		return (0);
@@ -788,22 +789,16 @@ npxdna()
 		/*
 		 * This is the first time this thread has used the FPU or
 		 * the PCB doesn't contain a clean FPU state.  Explicitly
-		 * initialize the FPU and load the default control word.
+		 * load sanitized registers.
 		 */
-		fninit();
-		control = __INITIAL_NPXCW__;
-		fldcw(&control);
-#ifdef CPU_ENABLE_SSE
-		if (cpu_fxsr) {
-			mxcsr = __INITIAL_MXCSR__;
-			ldmxcsr(mxcsr);
-		}
-#endif
+		fpurstor(&npx_cleanstate);
+		if (pcb->pcb_initial_npxcw != __INITIAL_NPXCW__)
+			fldcw(&pcb->pcb_initial_npxcw);
 		pcb->pcb_flags |= PCB_NPXINITDONE;
 	} else {
 		/*
-		 * The following frstor may cause an IRQ13 when the state
-		 * being restored has a pending error.  The error will
+		 * The following fpurstor() may cause an IRQ13 when the
+		 * state being restored has a pending error.  The error will
 		 * appear to have been triggered by the current (npx) user
 		 * instruction even when that instruction is a no-wait
 		 * instruction that should not trigger an error (e.g.,
@@ -896,10 +891,8 @@ npxgetregs(td, addr)
 		return (_MC_FPOWNED_NONE);
 
 	if ((td->td_pcb->pcb_flags & PCB_NPXINITDONE) == 0) {
-		if (npx_cleanstate_ready)
-			bcopy(&npx_cleanstate, addr, sizeof(npx_cleanstate));
-		else
-			bzero(addr, sizeof(*addr));
+		bcopy(&npx_cleanstate, addr, sizeof(npx_cleanstate));
+		SET_FPU_CW(addr, td->td_pcb->pcb_initial_npxcw);
 		return (_MC_FPOWNED_NONE);
 	}
 	s = intr_disable();

Modified: stable/7/sys/i386/linux/linux_sysvec.c
==============================================================================
--- stable/7/sys/i386/linux/linux_sysvec.c	Wed Mar 25 17:02:05 2009	(r190417)
+++ stable/7/sys/i386/linux/linux_sysvec.c	Wed Mar 25 17:22:15 2009	(r190418)
@@ -86,9 +86,6 @@ MALLOC_DEFINE(M_LINUX, "linux", "Linux m
 #define	LINUX_SYS_linux_rt_sendsig	0
 #define	LINUX_SYS_linux_sendsig		0
 
-#define	fldcw(addr)		__asm("fldcw %0" : : "m" (*(addr)))
-#define	__LINUX_NPXCW__		0x37f
-
 extern char linux_sigcode[];
 extern int linux_szsigcode;
 
@@ -800,16 +797,15 @@ static void
 exec_linux_setregs(struct thread *td, u_long entry,
 		   u_long stack, u_long ps_strings)
 {
-	static const u_short control = __LINUX_NPXCW__;
 	struct pcb *pcb = td->td_pcb;
 
 	exec_setregs(td, entry, stack, ps_strings);
 
 	/* Linux sets %gs to 0, we default to _udatasel */
-	pcb->pcb_gs = 0; load_gs(0);
+	pcb->pcb_gs = 0;
+	load_gs(0);
 
-	/* Linux sets the i387 to extended precision. */
-	fldcw(&control);
+	pcb->pcb_initial_npxcw = __LINUX_NPXCW__;
 }
 
 struct sysentvec linux_sysvec = {

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 25 17:47:22 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 17:56:28 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 18:48:46 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 19:02:10 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 20:15:48 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7BDE410656DE;
	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 4F0F18FC3C;
	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 n2PKFmMG086535;
	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 n2PKFm39086534;
	Wed, 25 Mar 2009 20:15:48 GMT (envelope-from lulf@svn.freebsd.org)
Message-Id: <200903252015.n2PKFm39086534@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
X-SVN-Group: defaults
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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 20:15:51 -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/   (props changed)

Changes in other areas also in this revision:
Modified:
  head/contrib/csup/rcsfile.c
  head/contrib/csup/rcsfile.h
  head/contrib/csup/rcsparse.c
  head/contrib/csup/updater.c

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 25 20:15:51 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 20:15:53 -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-all@FreeBSD.ORG  Wed Mar 25 20:18:21 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 226A01065673;
	Wed, 25 Mar 2009 20:18:21 +0000 (UTC)
	(envelope-from lulf@freebsd.org)
Received: from bene2.itea.ntnu.no (bene2.itea.ntnu.no
	[IPv6:2001:700:300:3::57])
	by mx1.freebsd.org (Postfix) with ESMTP id 625A68FC1A;
	Wed, 25 Mar 2009 20:18:20 +0000 (UTC)
	(envelope-from lulf@freebsd.org)
Received: from localhost (localhost [127.0.0.1])
	by bene2.itea.ntnu.no (Postfix) with ESMTP id BCB2190012;
	Wed, 25 Mar 2009 21:18:18 +0100 (CET)
Received: from carrot (unknown [IPv6:2001:700:300:3::184])
	by bene2.itea.ntnu.no (Postfix) with ESMTP id 2AA4B90010;
	Wed, 25 Mar 2009 21:18:18 +0100 (CET)
Date: Wed, 25 Mar 2009 21:18:17 +0100
From: Ulf Lilleengen 
To: src-committers@freebsd.org, svn-src-all@freebsd.org
Message-ID: <20090325201816.GA96013@carrot>
References: <200903252015.n2PKFm39086534@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200903252015.n2PKFm39086534@svn.freebsd.org>
User-Agent: Mutt/1.5.19 (2009-01-05)
X-Virus-Scanned: Debian amavisd-new at bene2.itea.ntnu.no
Cc: 
Subject: Re: svn commit: r190422 - in head: . contrib/csup
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 25 Mar 2009 20:18:23 -0000

On ons, mar 25, 2009 at 08:15:48pm +0000, Ulf Lilleengen wrote:
> 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/   (props changed)
> 
> Changes in other areas also in this revision:
> Modified:
>   head/contrib/csup/rcsfile.c
>   head/contrib/csup/rcsfile.h
>   head/contrib/csup/rcsparse.c
>   head/contrib/csup/updater.c
> 

Bah, looks like I screwed up with svk.

-- 
Ulf Lilleengen

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 25 20:38:57 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 20:40:35 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 21:20:16 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 22:08:31 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 22:12:07 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 22:14:47 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 22:20:36 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 22:21:38 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar 25 22:21:53 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 02:10:19 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 02:14:31 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: Weongyo Jeong 
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 02:59:11 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 04:16:41 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 04:17:35 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 06:12:04 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 10:22:41 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 12:13:20 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 34F7310657BB;
	Thu, 26 Mar 2009 12:13:20 +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 166308FC16;
	Thu, 26 Mar 2009 12:13:20 +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 n2QCDJQj016893;
	Thu, 26 Mar 2009 12:13:19 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2QCDJPB016892;
	Thu, 26 Mar 2009 12:13:19 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200903261213.n2QCDJPB016892@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 26 Mar 2009 12:13:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190439 - in stable/7/sys: amd64/linux32 i386/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 12:13:30 -0000

Author: kib
Date: Thu Mar 26 12:13:19 2009
New Revision: 190439
URL: http://svn.freebsd.org/changeset/base/190439

Log:
  Include linux_misc.h to get the definition for __LINUX_NPXCW__.
  
  Approved by:	re (kensmith)

Modified:
  stable/7/sys/amd64/linux32/linux32_sysvec.c
  stable/7/sys/i386/linux/linux_sysvec.c

Modified: stable/7/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- stable/7/sys/amd64/linux32/linux32_sysvec.c	Thu Mar 26 10:22:40 2009	(r190438)
+++ stable/7/sys/amd64/linux32/linux32_sysvec.c	Thu Mar 26 12:13:19 2009	(r190439)
@@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 

Modified: stable/7/sys/i386/linux/linux_sysvec.c
==============================================================================
--- stable/7/sys/i386/linux/linux_sysvec.c	Thu Mar 26 10:22:40 2009	(r190438)
+++ stable/7/sys/i386/linux/linux_sysvec.c	Thu Mar 26 12:13:19 2009	(r190439)
@@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 26 13:22:30 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 00D611065776;
	Thu, 26 Mar 2009 13:22:30 +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 E1F118FC18;
	Thu, 26 Mar 2009 13:22:29 +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 n2QDMTno018790;
	Thu, 26 Mar 2009 13:22:29 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2QDMTF9018789;
	Thu, 26 Mar 2009 13:22:29 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200903261322.n2QDMTF9018789@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Thu, 26 Mar 2009 13:22:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190440 - in stable/7/sys: . contrib/pf dev/cxgb
	netinet6
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 13:22:30 -0000

Author: bz
Date: Thu Mar 26 13:22:29 2009
New Revision: 190440
URL: http://svn.freebsd.org/changeset/base/190440

Log:
  MFC r186393:
  
    Correct variable name in comment.
  
  Approved by:	re (rwatson)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/netinet6/ip6_input.c

Modified: stable/7/sys/netinet6/ip6_input.c
==============================================================================
--- stable/7/sys/netinet6/ip6_input.c	Thu Mar 26 12:13:19 2009	(r190439)
+++ stable/7/sys/netinet6/ip6_input.c	Thu Mar 26 13:22:29 2009	(r190440)
@@ -155,7 +155,7 @@ ip6_init(void)
 	if (pr == 0)
 		panic("ip6_init");
 
-	/* Initialize the entire ip_protox[] array to IPPROTO_RAW. */
+	/* Initialize the entire ip6_protox[] array to IPPROTO_RAW. */
 	for (i = 0; i < IPPROTO_MAX; i++)
 		ip6_protox[i] = pr - inet6sw;
 	/*

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 26 13:27:27 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 05F5F1065674;
	Thu, 26 Mar 2009 13:27:27 +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 E60008FC0A;
	Thu, 26 Mar 2009 13:27:26 +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 n2QDRQAI018935;
	Thu, 26 Mar 2009 13:27:26 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2QDRQEr018934;
	Thu, 26 Mar 2009 13:27:26 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200903261327.n2QDRQEr018934@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Thu, 26 Mar 2009 13:27:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190441 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb netinet
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 13:27:27 -0000

Author: bz
Date: Thu Mar 26 13:27:26 2009
New Revision: 190441
URL: http://svn.freebsd.org/changeset/base/190441

Log:
  MFC r184097:
  
    Update a comment which to my reading had been misplaced in rev. 1.12
    already (but probably had been way above as the code was there twice)
    and describe what was last changed in rev. 1.199 there (which now is
    in sync with in6_src.c r184096(HEAD), r189956(stable/7)).
  
  Approved by:	re (rwatson)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/netinet/in_pcb.c

Modified: stable/7/sys/netinet/in_pcb.c
==============================================================================
--- stable/7/sys/netinet/in_pcb.c	Thu Mar 26 13:22:29 2009	(r190440)
+++ stable/7/sys/netinet/in_pcb.c	Thu Mar 26 13:27:26 2009	(r190441)
@@ -440,8 +440,9 @@ in_pcbbind_setup(struct inpcb *inp, stru
 		if (pcbinfo != &udbinfo)
 			ipport_tcpallocs++;
 		/*
-		 * Simple check to ensure all ports are not used up causing
-		 * a deadlock here.
+		 * Instead of having two loops further down counting up or down
+		 * make sure that first is always <= last and go with only one
+		 * code path implementing all logic.
 		 *
 		 * We split the two cases (up and down) so that the direction
 		 * is not being tested on each round of the loop.

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 26 14:20:17 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E31F51065857;
	Thu, 26 Mar 2009 14:20:16 +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 CC35F8FC19;
	Thu, 26 Mar 2009 14:20:16 +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 n2QEKGDw020149;
	Thu, 26 Mar 2009 14:20:16 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2QEKGrk020147;
	Thu, 26 Mar 2009 14:20:16 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200903261420.n2QEKGrk020147@svn.freebsd.org>
From: Robert Watson 
Date: Thu, 26 Mar 2009 14:20:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190442 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb netinet
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 14:20:22 -0000

Author: rwatson
Date: Thu Mar 26 14:20:16 2009
New Revision: 190442
URL: http://svn.freebsd.org/changeset/base/190442

Log:
  Merge r189657 from head to stable/7:
  
    Add INP_INHASHLIST flag for inpcb->inp_flags to indicate whether
    or not the inpcb is currenty on various hash lookup lists, rather
    than using (lport != 0) to detect this.  This means that the full
    4-tuple of a connection can be retained after close, which should
    lead to more sensible netstat output in the window between TCP
    close and socket close.
  
  Approved by:	re (kib)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/netinet/in_pcb.c
  stable/7/sys/netinet/in_pcb.h

Modified: stable/7/sys/netinet/in_pcb.c
==============================================================================
--- stable/7/sys/netinet/in_pcb.c	Thu Mar 26 13:27:26 2009	(r190441)
+++ stable/7/sys/netinet/in_pcb.c	Thu Mar 26 14:20:16 2009	(r190442)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 1982, 1986, 1991, 1993, 1995
  *	The Regents of the University of California.
- * Copyright (c) 2007 Robert N. M. Watson
+ * Copyright (c) 2007-2009 Robert N. M. Watson
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -955,7 +955,7 @@ in_pcbdrop(struct inpcb *inp)
 	INP_WLOCK_ASSERT(inp);
 
 	inp->inp_vflag |= INP_DROPPED;
-	if (inp->inp_lport) {
+	if (inp->inp_flags & INP_INHASHLIST) {
 		struct inpcbport *phd = inp->inp_phd;
 
 		LIST_REMOVE(inp, inp_hash);
@@ -964,7 +964,7 @@ in_pcbdrop(struct inpcb *inp)
 			LIST_REMOVE(phd, phd_hash);
 			free(phd, M_PCB);
 		}
-		inp->inp_lport = 0;
+		inp->inp_flags &= ~INP_INHASHLIST;
 	}
 }
 
@@ -1344,6 +1344,8 @@ in_pcbinshash(struct inpcb *inp)
 
 	INP_INFO_WLOCK_ASSERT(pcbinfo);
 	INP_WLOCK_ASSERT(inp);
+	KASSERT((inp->inp_flags & INP_INHASHLIST) == 0,
+	    ("in_pcbinshash: INP_INHASHLIST"));
 
 #ifdef INET6
 	if (inp->inp_vflag & INP_IPV6)
@@ -1380,6 +1382,7 @@ in_pcbinshash(struct inpcb *inp)
 	inp->inp_phd = phd;
 	LIST_INSERT_HEAD(&phd->phd_pcblist, inp, inp_portlist);
 	LIST_INSERT_HEAD(pcbhash, inp, inp_hash);
+	inp->inp_flags |= INP_INHASHLIST;
 	return (0);
 }
 
@@ -1398,6 +1401,8 @@ in_pcbrehash(struct inpcb *inp)
 
 	INP_INFO_WLOCK_ASSERT(pcbinfo);
 	INP_WLOCK_ASSERT(inp);
+	KASSERT(inp->inp_flags & INP_INHASHLIST,
+	    ("in_pcbrehash: !INP_INHASHLIST"));
 
 #ifdef INET6
 	if (inp->inp_vflag & INP_IPV6)
@@ -1425,7 +1430,7 @@ in_pcbremlists(struct inpcb *inp)
 	INP_WLOCK_ASSERT(inp);
 
 	inp->inp_gencnt = ++pcbinfo->ipi_gencnt;
-	if (inp->inp_lport) {
+	if (inp->inp_flags & INP_INHASHLIST) {
 		struct inpcbport *phd = inp->inp_phd;
 
 		LIST_REMOVE(inp, inp_hash);
@@ -1434,6 +1439,7 @@ in_pcbremlists(struct inpcb *inp)
 			LIST_REMOVE(phd, phd_hash);
 			free(phd, M_PCB);
 		}
+		inp->inp_flags &= ~INP_INHASHLIST;
 	}
 	LIST_REMOVE(inp, inp_list);
 	pcbinfo->ipi_count--;

Modified: stable/7/sys/netinet/in_pcb.h
==============================================================================
--- stable/7/sys/netinet/in_pcb.h	Thu Mar 26 13:27:26 2009	(r190441)
+++ stable/7/sys/netinet/in_pcb.h	Thu Mar 26 14:20:16 2009	(r190442)
@@ -436,6 +436,7 @@ void 	inp_4tuple_get(struct inpcb *inp, 
 #define	INP_FAITH		0x200	/* accept FAITH'ed connections */
 #define	INP_RECVTTL		0x400	/* receive incoming IP TTL */
 #define	INP_DONTFRAG		0x800	/* don't fragment packet */
+#define	INP_INHASHLIST		0x2000	/* in_pcbinshash() has been called */
 
 #define IN6P_IPV6_V6ONLY	0x008000 /* restrict AF_INET6 socket for v6 */
 

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 26 14:47:03 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 16:42:24 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 17:04:09 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 09061106567F;
	Thu, 26 Mar 2009 17:04:09 +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 E9A788FC20;
	Thu, 26 Mar 2009 17:04:08 +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 n2QH48DB023493;
	Thu, 26 Mar 2009 17:04:08 GMT (envelope-from nyan@svn.freebsd.org)
Received: (from nyan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2QH48O4023492;
	Thu, 26 Mar 2009 17:04:08 GMT (envelope-from nyan@svn.freebsd.org)
Message-Id: <200903261704.n2QH48O4023492@svn.freebsd.org>
From: Takahashi Yoshihiro 
Date: Thu, 26 Mar 2009 17:04:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190444 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb pc98/pc98
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 17:04:10 -0000

Author: nyan
Date: Thu Mar 26 17:04:08 2009
New Revision: 190444
URL: http://svn.freebsd.org/changeset/base/190444

Log:
  MFC: r189446
  
    Allow different ABIs to use different initial control words for the FPU.
  
  Approved by:	re (Kostik Belousov)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/pc98/pc98/machdep.c

Modified: stable/7/sys/pc98/pc98/machdep.c
==============================================================================
--- stable/7/sys/pc98/pc98/machdep.c	Thu Mar 26 16:42:24 2009	(r190443)
+++ stable/7/sys/pc98/pc98/machdep.c	Thu Mar 26 17:04:08 2009	(r190444)
@@ -1155,7 +1155,7 @@ cpu_idle(void)
 void (*cpu_idle_hook)(void) = cpu_idle_default;
 
 /*
- * Clear registers on exec
+ * Reset registers to default values on exec.
  */
 void
 exec_setregs(td, entry, stack, ps_strings)
@@ -1220,6 +1220,7 @@ exec_setregs(td, entry, stack, ps_string
 	 * emulators don't provide an entry point for initialization.
 	 */
 	td->td_pcb->pcb_flags &= ~FP_SOFTFP;
+	pcb->pcb_initial_npxcw = __INITIAL_NPXCW__;
 
 	/*
 	 * Drop the FP state if we hold it, so that the process gets a

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 26 17:14:23 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 17:36:20 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 18:07:13 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 18:54:52 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E0618106567A
	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.171])
	by mx1.freebsd.org (Postfix) with ESMTP id 70B5A8FC13
	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=mreu1) with ESMTP (Nemesis)
	id 0MKv1o-1Lmuj50iWv-000jvR; 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: V01U2FsdGVkX19Ht0p1Qusnl7+zuzw68kX7Ieh7VxGJwrgWX1D
	JuQtefDb5BRwWb9e1/V8uWd1qF3HYY8pXeeGfhI//RZsJ1nmYw
	cM4fyhAMn1JPjwpiU3yVA==
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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 19:04:12 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 19:06:00 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 19:07:56 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 19:13:12 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 19:15:31 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 19:45:50 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 20:23:22 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 20:54:34 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 21:10:37 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 21:20:17 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 21:29:05 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 21:29:39 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 21:29:43 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 21:59:13 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 22:09:24 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 22:29:10 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar 26 22:54:20 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C0CDD1065670;
	Thu, 26 Mar 2009 22:54:20 +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 AAE028FC1D;
	Thu, 26 Mar 2009 22:54:20 +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 n2QMsKxP040895;
	Thu, 26 Mar 2009 22:54:20 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2QMsJfC040883;
	Thu, 26 Mar 2009 22:54:19 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200903262254.n2QMsJfC040883@svn.freebsd.org>
From: Robert Watson 
Date: Thu, 26 Mar 2009 22:54:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190457 - in stable/7: . sys sys/contrib/pf
	sys/dev/ath/ath_hal sys/dev/cxgb sys/netinet sys/netinet6
	usr.bin/netstat usr.bin/sockstat usr.bin/systat
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 26 Mar 2009 22:54:21 -0000

Author: rwatson
Date: Thu Mar 26 22:54:19 2009
New Revision: 190457
URL: http://svn.freebsd.org/changeset/base/190457

Log:
  r189615:
  
    Remove now-unused INP_UNMAPPABLEOPTS.
  
    Discussd with: bz
  
  r189637:
  
    Avoid use of IPv6  macro aliases to inpcb fields and inp_flags; we don't
    remove their defintions as some third-party tools may use them (such as
    net-snmp), unlike in the 8.x change.
  
    References to in6p_lport and in6_fport in sockstat are also replaced with
    normal inp_lport and inp_fport references.
  
    Reviewed by:   bz
  
  r189848:
  
    Correct a number of evolved problems with inp_vflag and inp_flags:
    certain flags that should have been in inp_flags ended up in inp_vflag,
    meaning that they were inconsistently locked, and in one case,
    interpreted.  Move the following flags from inp_vflag to gaps in the
    inp_flags space (and clean up the inp_flags constants to make gaps
    more obvious to future takers):
  
      INP_TIMEWAIT
      INP_SOCKREF
      INP_ONESBCAST
      INP_DROPPED
  
    Some aspects of this change have no effect on kernel ABI at all, as these
    are UDP/TCP/IP-internal uses; however, netstat and sockstat detect
    INP_TIMEWAIT when listing TCP sockets, so any MFC will need to take this
    into account.
  
    MFC after:      1 week (or after dependencies are MFC'd)
    Reviewed by:    bz
  
  Note that this change requires netstat, systat, and sockstat to be
  recompiled in order to properly print TIMEWAIT connection state; this
  minor API change (documented in UPDATING) is considered worth it in
  order to fix the above bugs.  This change fixes the INP_ONESBCAST bug
  describted in kern/124282 by disambiguating flag use.
  
  Approved by:    re (kib)
  PR:             kern/124282
  r189637 discussed with:	pav

Modified:
  stable/7/UPDATING
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/netinet/in_pcb.c
  stable/7/sys/netinet/in_pcb.h
  stable/7/sys/netinet/tcp_input.c
  stable/7/sys/netinet/tcp_subr.c
  stable/7/sys/netinet/tcp_timer.c
  stable/7/sys/netinet/tcp_timewait.c
  stable/7/sys/netinet/tcp_usrreq.c
  stable/7/sys/netinet6/in6_pcb.c
  stable/7/usr.bin/netstat/   (props changed)
  stable/7/usr.bin/netstat/inet.c
  stable/7/usr.bin/sockstat/   (props changed)
  stable/7/usr.bin/sockstat/sockstat.c
  stable/7/usr.bin/systat/   (props changed)
  stable/7/usr.bin/systat/netstat.c

Modified: stable/7/UPDATING
==============================================================================
--- stable/7/UPDATING	Thu Mar 26 21:29:38 2009	(r190456)
+++ stable/7/UPDATING	Thu Mar 26 22:54:19 2009	(r190457)
@@ -8,6 +8,11 @@ Items affecting the ports and packages s
 /usr/ports/UPDATING.  Please read that file before running
 portupgrade.
 
+20090326:
+	Following bug-fixes to TCP connection state flags, netstat, systat,
+	and sockstat will need to be rebuilt in order to properly print
+	connections in the TIMEWAIT state.
+
 20090318:
 	Change IPv6 ephemeral port allocation from sequential to
 	random allocation, like IPv4 has done for more than four years.

Modified: stable/7/sys/netinet/in_pcb.c
==============================================================================
--- stable/7/sys/netinet/in_pcb.c	Thu Mar 26 21:29:38 2009	(r190456)
+++ stable/7/sys/netinet/in_pcb.c	Thu Mar 26 22:54:19 2009	(r190457)
@@ -358,7 +358,7 @@ in_pcbbind_setup(struct inpcb *inp, stru
 	 * This entire block sorely needs a rewrite.
 	 */
 				if (t &&
-				    ((t->inp_vflag & INP_TIMEWAIT) == 0) &&
+				    ((t->inp_flags & INP_TIMEWAIT) == 0) &&
 				    (so->so_type != SOCK_STREAM ||
 				     ntohl(t->inp_faddr.s_addr) == INADDR_ANY) &&
 				    (ntohl(sin->sin_addr.s_addr) != INADDR_ANY ||
@@ -371,7 +371,7 @@ in_pcbbind_setup(struct inpcb *inp, stru
 			}
 			t = in_pcblookup_local(pcbinfo, sin->sin_addr,
 			    lport, wild, cred);
-			if (t && (t->inp_vflag & INP_TIMEWAIT)) {
+			if (t && (t->inp_flags & INP_TIMEWAIT)) {
 				/*
 				 * XXXRW: If an incpb has had its timewait
 				 * state recycled, we treat the address as
@@ -954,7 +954,7 @@ in_pcbdrop(struct inpcb *inp)
 	INP_INFO_WLOCK_ASSERT(inp->inp_pcbinfo);
 	INP_WLOCK_ASSERT(inp);
 
-	inp->inp_vflag |= INP_DROPPED;
+	inp->inp_flags |= INP_DROPPED;
 	if (inp->inp_flags & INP_INHASHLIST) {
 		struct inpcbport *phd = inp->inp_phd;
 
@@ -1746,6 +1746,22 @@ db_print_inpflags(int inp_flags)
 		db_printf("%sIN6P_AUTOFLOWLABEL", comma ? ", " : "");
 		comma = 1;
 	}
+	if (inp_flags & INP_TIMEWAIT) {
+		db_printf("%sINP_TIMEWAIT", comma ? ", " : "");
+		comma  = 1;
+	}
+	if (inp_flags & INP_ONESBCAST) {
+		db_printf("%sINP_ONESBCAST", comma ? ", " : "");
+		comma  = 1;
+	}
+	if (inp_flags & INP_DROPPED) {
+		db_printf("%sINP_DROPPED", comma ? ", " : "");
+		comma  = 1;
+	}
+	if (inp_flags & INP_SOCKREF) {
+		db_printf("%sINP_SOCKREF", comma ? ", " : "");
+		comma  = 1;
+	}
 	if (inp_flags & IN6P_RFC2292) {
 		db_printf("%sIN6P_RFC2292", comma ? ", " : "");
 		comma = 1;
@@ -1774,22 +1790,6 @@ db_print_inpvflag(u_char inp_vflag)
 		db_printf("%sINP_IPV6PROTO", comma ? ", " : "");
 		comma  = 1;
 	}
-	if (inp_vflag & INP_TIMEWAIT) {
-		db_printf("%sINP_TIMEWAIT", comma ? ", " : "");
-		comma  = 1;
-	}
-	if (inp_vflag & INP_ONESBCAST) {
-		db_printf("%sINP_ONESBCAST", comma ? ", " : "");
-		comma  = 1;
-	}
-	if (inp_vflag & INP_DROPPED) {
-		db_printf("%sINP_DROPPED", comma ? ", " : "");
-		comma  = 1;
-	}
-	if (inp_vflag & INP_SOCKREF) {
-		db_printf("%sINP_SOCKREF", comma ? ", " : "");
-		comma  = 1;
-	}
 }
 
 void

Modified: stable/7/sys/netinet/in_pcb.h
==============================================================================
--- stable/7/sys/netinet/in_pcb.h	Thu Mar 26 21:29:38 2009	(r190456)
+++ stable/7/sys/netinet/in_pcb.h	Thu Mar 26 22:54:19 2009	(r190457)
@@ -416,38 +416,38 @@ void 	inp_4tuple_get(struct inpcb *inp, 
 #define	INP_IPV4	0x1
 #define	INP_IPV6	0x2
 #define	INP_IPV6PROTO	0x4		/* opened under IPv6 protocol */
-#define	INP_TIMEWAIT	0x8		/* inpcb in TIMEWAIT, ppcb is tcptw */
-#define	INP_ONESBCAST	0x10		/* send all-ones broadcast */
-#define	INP_DROPPED	0x20		/* protocol drop flag */
-#define	INP_SOCKREF	0x40		/* strong socket reference */
 
 /*
  * Flags for inp_flag.
  */
-#define	INP_RECVOPTS		0x01	/* receive incoming IP options */
-#define	INP_RECVRETOPTS		0x02	/* receive IP options for reply */
-#define	INP_RECVDSTADDR		0x04	/* receive IP dst address */
-#define	INP_HDRINCL		0x08	/* user supplies entire IP header */
-#define	INP_HIGHPORT		0x10	/* user wants "high" port binding */
-#define	INP_LOWPORT		0x20	/* user wants "low" port binding */
-#define	INP_ANONPORT		0x40	/* port chosen for user */
-#define	INP_RECVIF		0x80	/* receive incoming interface */
-#define	INP_MTUDISC		0x100	/* user can do MTU discovery */
-#define	INP_FAITH		0x200	/* accept FAITH'ed connections */
-#define	INP_RECVTTL		0x400	/* receive incoming IP TTL */
-#define	INP_DONTFRAG		0x800	/* don't fragment packet */
-#define	INP_INHASHLIST		0x2000	/* in_pcbinshash() has been called */
-
-#define IN6P_IPV6_V6ONLY	0x008000 /* restrict AF_INET6 socket for v6 */
-
-#define	IN6P_PKTINFO		0x010000 /* receive IP6 dst and I/F */
-#define	IN6P_HOPLIMIT		0x020000 /* receive hoplimit */
-#define	IN6P_HOPOPTS		0x040000 /* receive hop-by-hop options */
-#define	IN6P_DSTOPTS		0x080000 /* receive dst options after rthdr */
-#define	IN6P_RTHDR		0x100000 /* receive routing header */
-#define	IN6P_RTHDRDSTOPTS	0x200000 /* receive dstoptions before rthdr */
-#define	IN6P_TCLASS		0x400000 /* receive traffic class value */
-#define	IN6P_AUTOFLOWLABEL	0x800000 /* attach flowlabel automatically */
+#define	INP_RECVOPTS		0x00000001 /* receive incoming IP options */
+#define	INP_RECVRETOPTS		0x00000002 /* receive IP options for reply */
+#define	INP_RECVDSTADDR		0x00000004 /* receive IP dst address */
+#define	INP_HDRINCL		0x00000008 /* user supplies entire IP header */
+#define	INP_HIGHPORT		0x00000010 /* user wants "high" port binding */
+#define	INP_LOWPORT		0x00000020 /* user wants "low" port binding */
+#define	INP_ANONPORT		0x00000040 /* port chosen for user */
+#define	INP_RECVIF		0x00000080 /* receive incoming interface */
+#define	INP_MTUDISC		0x00000100 /* user can do MTU discovery */
+#define	INP_FAITH		0x00000200 /* accept FAITH'ed connections */
+#define	INP_RECVTTL		0x00000400 /* receive incoming IP TTL */
+#define	INP_DONTFRAG		0x00000800 /* don't fragment packet */
+#define	INP_NONLOCALOK		0x00001000 /* Allow bind to spoof any address */
+					/* - requires options IP_NONLOCALBIND */
+#define	INP_INHASHLIST		0x00002000 /* in_pcbinshash() has been called */
+#define	IN6P_IPV6_V6ONLY	0x00008000 /* restrict AF_INET6 socket for v6 */
+#define	IN6P_PKTINFO		0x00010000 /* receive IP6 dst and I/F */
+#define	IN6P_HOPLIMIT		0x00020000 /* receive hoplimit */
+#define	IN6P_HOPOPTS		0x00040000 /* receive hop-by-hop options */
+#define	IN6P_DSTOPTS		0x00080000 /* receive dst options after rthdr */
+#define	IN6P_RTHDR		0x00100000 /* receive routing header */
+#define	IN6P_RTHDRDSTOPTS	0x00200000 /* receive dstoptions before rthdr */
+#define	IN6P_TCLASS		0x00400000 /* receive traffic class value */
+#define	IN6P_AUTOFLOWLABEL	0x00800000 /* attach flowlabel automatically */
+#define	INP_TIMEWAIT		0x01000000 /* in TIMEWAIT, ppcb is tcptw */
+#define	INP_ONESBCAST		0x02000000 /* send all-ones broadcast */
+#define	INP_DROPPED		0x04000000 /* protocol drop flag */
+#define	INP_SOCKREF		0x08000000 /* strong socket reference */
 #define	IN6P_RFC2292		0x40000000 /* used RFC2292 API on the socket */
 #define	IN6P_MTU		0x80000000 /* receive path MTU */
 
@@ -457,8 +457,6 @@ void 	inp_4tuple_get(struct inpcb *inp, 
 				 IN6P_DSTOPTS|IN6P_RTHDR|IN6P_RTHDRDSTOPTS|\
 				 IN6P_TCLASS|IN6P_AUTOFLOWLABEL|IN6P_RFC2292|\
 				 IN6P_MTU)
-#define	INP_UNMAPPABLEOPTS	(IN6P_HOPOPTS|IN6P_DSTOPTS|IN6P_RTHDR|\
-				 IN6P_TCLASS|IN6P_AUTOFLOWLABEL)
 
  /* for KAME src sync over BSD*'s */
 #define	IN6P_HIGHPORT		INP_HIGHPORT

Modified: stable/7/sys/netinet/tcp_input.c
==============================================================================
--- stable/7/sys/netinet/tcp_input.c	Thu Mar 26 21:29:38 2009	(r190456)
+++ stable/7/sys/netinet/tcp_input.c	Thu Mar 26 22:54:19 2009	(r190457)
@@ -511,7 +511,7 @@ findpcb:
 	 * was a legitimate new connection attempt the old INPCB gets
 	 * removed and we can try again to find a listening socket.
 	 */
-	if (inp->inp_vflag & INP_TIMEWAIT) {
+	if (inp->inp_flags & INP_TIMEWAIT) {
 		if (thflags & TH_SYN)
 			tcp_dooptions(&to, optp, optlen, TO_SYN);
 		/*

Modified: stable/7/sys/netinet/tcp_subr.c
==============================================================================
--- stable/7/sys/netinet/tcp_subr.c	Thu Mar 26 21:29:38 2009	(r190456)
+++ stable/7/sys/netinet/tcp_subr.c	Thu Mar 26 22:54:19 2009	(r190457)
@@ -781,10 +781,10 @@ tcp_close(struct tcpcb *tp)
 	KASSERT(inp->inp_socket != NULL, ("tcp_close: inp_socket NULL"));
 	so = inp->inp_socket;
 	soisdisconnected(so);
-	if (inp->inp_vflag & INP_SOCKREF) {
+	if (inp->inp_flags & INP_SOCKREF) {
 		KASSERT(so->so_state & SS_PROTOREF,
 		    ("tcp_close: !SS_PROTOREF"));
-		inp->inp_vflag &= ~INP_SOCKREF;
+		inp->inp_flags &= ~INP_SOCKREF;
 		INP_WUNLOCK(inp);
 		ACCEPT_LOCK();
 		SOCK_LOCK(so);
@@ -814,7 +814,7 @@ tcp_drain(void)
 	 */
 		INP_INFO_RLOCK(&tcbinfo);
 		LIST_FOREACH(inpb, tcbinfo.ipi_listhead, inp_list) {
-			if (inpb->inp_vflag & INP_TIMEWAIT)
+			if (inpb->inp_flags & INP_TIMEWAIT)
 				continue;
 			INP_WLOCK(inpb);
 			if ((tcpb = intotcpcb(inpb)) != NULL) {
@@ -850,8 +850,8 @@ tcp_notify(struct inpcb *inp, int error)
 	INP_INFO_WLOCK_ASSERT(&tcbinfo);
 	INP_WLOCK_ASSERT(inp);
 
-	if ((inp->inp_vflag & INP_TIMEWAIT) ||
-	    (inp->inp_vflag & INP_DROPPED))
+	if ((inp->inp_flags & INP_TIMEWAIT) ||
+	    (inp->inp_flags & INP_DROPPED))
 		return (inp);
 
 	tp = intotcpcb(inp);
@@ -950,7 +950,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
 			 * TCP state changes, is not quite right, but for
 			 * now, better than nothing.
 			 */
-			if (inp->inp_vflag & INP_TIMEWAIT) {
+			if (inp->inp_flags & INP_TIMEWAIT) {
 				if (intotw(inp) != NULL)
 					error = cr_cansee(req->td->td_ucred,
 					    intotw(inp)->tw_cred);
@@ -981,7 +981,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
 			inp_ppcb = inp->inp_ppcb;
 			if (inp_ppcb == NULL)
 				bzero((char *) &xt.xt_tp, sizeof xt.xt_tp);
-			else if (inp->inp_vflag & INP_TIMEWAIT) {
+			else if (inp->inp_flags & INP_TIMEWAIT) {
 				bzero((char *) &xt.xt_tp, sizeof xt.xt_tp);
 				xt.xt_tp.t_state = TCPS_TIME_WAIT;
 			} else
@@ -1176,8 +1176,8 @@ tcp_ctlinput(int cmd, struct sockaddr *s
 		    ip->ip_src, th->th_sport, 0, NULL);
 		if (inp != NULL)  {
 			INP_WLOCK(inp);
-			if (!(inp->inp_vflag & INP_TIMEWAIT) &&
-			    !(inp->inp_vflag & INP_DROPPED) &&
+			if (!(inp->inp_flags & INP_TIMEWAIT) &&
+			    !(inp->inp_flags & INP_DROPPED) &&
 			    !(inp->inp_socket == NULL)) {
 				icmp_tcp_seq = htonl(th->th_seq);
 				tp = intotcpcb(inp);
@@ -1448,8 +1448,8 @@ tcp_drop_syn_sent(struct inpcb *inp, int
 	INP_INFO_WLOCK_ASSERT(&tcbinfo);
 	INP_WLOCK_ASSERT(inp);
 
-	if ((inp->inp_vflag & INP_TIMEWAIT) ||
-	    (inp->inp_vflag & INP_DROPPED))
+	if ((inp->inp_flags & INP_TIMEWAIT) ||
+	    (inp->inp_flags & INP_DROPPED))
 		return (inp);
 
 	tp = intotcpcb(inp);
@@ -1482,8 +1482,8 @@ tcp_mtudisc(struct inpcb *inp, int errno
 #endif /* INET6 */
 
 	INP_WLOCK_ASSERT(inp);
-	if ((inp->inp_vflag & INP_TIMEWAIT) ||
-	    (inp->inp_vflag & INP_DROPPED))
+	if ((inp->inp_flags & INP_TIMEWAIT) ||
+	    (inp->inp_flags & INP_DROPPED))
 		return (inp);
 
 	tp = intotcpcb(inp);
@@ -2108,7 +2108,7 @@ sysctl_drop(SYSCTL_HANDLER_ARGS)
 	}
 	if (inp != NULL) {
 		INP_WLOCK(inp);
-		if (inp->inp_vflag & INP_TIMEWAIT) {
+		if (inp->inp_flags & INP_TIMEWAIT) {
 			/*
 			 * XXXRW: There currently exists a state where an
 			 * inpcb is present, but its timewait state has been
@@ -2120,7 +2120,7 @@ sysctl_drop(SYSCTL_HANDLER_ARGS)
 				tcp_twclose(tw, 0);
 			else
 				INP_WUNLOCK(inp);
-		} else if (!(inp->inp_vflag & INP_DROPPED) &&
+		} else if (!(inp->inp_flags & INP_DROPPED) &&
 			   !(inp->inp_socket->so_options & SO_ACCEPTCONN)) {
 			tp = intotcpcb(inp);
 			tp = tcp_drop(tp, ECONNABORTED);

Modified: stable/7/sys/netinet/tcp_timer.c
==============================================================================
--- stable/7/sys/netinet/tcp_timer.c	Thu Mar 26 21:29:38 2009	(r190456)
+++ stable/7/sys/netinet/tcp_timer.c	Thu Mar 26 22:54:19 2009	(r190457)
@@ -168,7 +168,7 @@ tcp_timer_delack(void *xtp)
 	}
 	INP_WLOCK(inp);
 	INP_INFO_RUNLOCK(&tcbinfo);
-	if ((inp->inp_vflag & INP_DROPPED) || callout_pending(&tp->t_timers->tt_delack)
+	if ((inp->inp_flags & INP_DROPPED) || callout_pending(&tp->t_timers->tt_delack)
 	    || !callout_active(&tp->t_timers->tt_delack)) {
 		INP_WUNLOCK(inp);
 		return;
@@ -210,7 +210,7 @@ tcp_timer_2msl(void *xtp)
 	}
 	INP_WLOCK(inp);
 	tcp_free_sackholes(tp);
-	if ((inp->inp_vflag & INP_DROPPED) || callout_pending(&tp->t_timers->tt_2msl) ||
+	if ((inp->inp_flags & INP_DROPPED) || callout_pending(&tp->t_timers->tt_2msl) ||
 	    !callout_active(&tp->t_timers->tt_2msl)) {
 		INP_WUNLOCK(tp->t_inpcb);
 		INP_INFO_WUNLOCK(&tcbinfo);
@@ -277,7 +277,7 @@ tcp_timer_keep(void *xtp)
 		return;
 	}
 	INP_WLOCK(inp);
-	if ((inp->inp_vflag & INP_DROPPED) || callout_pending(&tp->t_timers->tt_keep)
+	if ((inp->inp_flags & INP_DROPPED) || callout_pending(&tp->t_timers->tt_keep)
 	    || !callout_active(&tp->t_timers->tt_keep)) {
 		INP_WUNLOCK(inp);
 		INP_INFO_WUNLOCK(&tcbinfo);
@@ -367,7 +367,7 @@ tcp_timer_persist(void *xtp)
 		return;
 	}
 	INP_WLOCK(inp);
-	if ((inp->inp_vflag & INP_DROPPED) || callout_pending(&tp->t_timers->tt_persist)
+	if ((inp->inp_flags & INP_DROPPED) || callout_pending(&tp->t_timers->tt_persist)
 	    || !callout_active(&tp->t_timers->tt_persist)) {
 		INP_WUNLOCK(inp);
 		INP_INFO_WUNLOCK(&tcbinfo);
@@ -436,7 +436,7 @@ tcp_timer_rexmt(void * xtp)
 		return;
 	}
 	INP_WLOCK(inp);
-	if ((inp->inp_vflag & INP_DROPPED) || callout_pending(&tp->t_timers->tt_rexmt)
+	if ((inp->inp_flags & INP_DROPPED) || callout_pending(&tp->t_timers->tt_rexmt)
 	    || !callout_active(&tp->t_timers->tt_rexmt)) {
 		INP_WUNLOCK(inp);
 		INP_INFO_WUNLOCK(&tcbinfo);

Modified: stable/7/sys/netinet/tcp_timewait.c
==============================================================================
--- stable/7/sys/netinet/tcp_timewait.c	Thu Mar 26 21:29:38 2009	(r190456)
+++ stable/7/sys/netinet/tcp_timewait.c	Thu Mar 26 22:54:19 2009	(r190457)
@@ -256,17 +256,17 @@ tcp_twstart(struct tcpcb *tp)
 	if (acknow)
 		tcp_twrespond(tw, TH_ACK);
 	inp->inp_ppcb = tw;
-	inp->inp_vflag |= INP_TIMEWAIT;
+	inp->inp_flags |= INP_TIMEWAIT;
 	tcp_tw_2msl_reset(tw, 0);
 
 	/*
 	 * If the inpcb owns the sole reference to the socket, then we can
 	 * detach and free the socket as it is not needed in time wait.
 	 */
-	if (inp->inp_vflag & INP_SOCKREF) {
+	if (inp->inp_flags & INP_SOCKREF) {
 		KASSERT(so->so_state & SS_PROTOREF,
 		    ("tcp_twstart: !SS_PROTOREF"));
-		inp->inp_vflag &= ~INP_SOCKREF;
+		inp->inp_flags &= ~INP_SOCKREF;
 		INP_WUNLOCK(inp);
 		ACCEPT_LOCK();
 		SOCK_LOCK(so);
@@ -466,7 +466,7 @@ tcp_twclose(struct tcptw *tw, int reuse)
 	 *     notify the socket layer.
 	 */
 	inp = tw->tw_inpcb;
-	KASSERT((inp->inp_vflag & INP_TIMEWAIT), ("tcp_twclose: !timewait"));
+	KASSERT((inp->inp_flags & INP_TIMEWAIT), ("tcp_twclose: !timewait"));
 	KASSERT(intotw(inp) == tw, ("tcp_twclose: inp_ppcb != tw"));
 	INP_INFO_WLOCK_ASSERT(&tcbinfo);	/* tcp_tw_2msl_stop(). */
 	INP_WLOCK_ASSERT(inp);
@@ -484,8 +484,8 @@ tcp_twclose(struct tcptw *tw, int reuse)
 		 * in which case another reference exists (XXXRW: think
 		 * about this more), and we don't need to take action.
 		 */
-		if (inp->inp_vflag & INP_SOCKREF) {
-			inp->inp_vflag &= ~INP_SOCKREF;
+		if (inp->inp_flags & INP_SOCKREF) {
+			inp->inp_flags &= ~INP_SOCKREF;
 			INP_WUNLOCK(inp);
 			ACCEPT_LOCK();
 			SOCK_LOCK(so);

Modified: stable/7/sys/netinet/tcp_usrreq.c
==============================================================================
--- stable/7/sys/netinet/tcp_usrreq.c	Thu Mar 26 21:29:38 2009	(r190456)
+++ stable/7/sys/netinet/tcp_usrreq.c	Thu Mar 26 22:54:19 2009	(r190457)
@@ -164,7 +164,7 @@ tcp_detach(struct socket *so, struct inp
 
 	tp = intotcpcb(inp);
 
-	if (inp->inp_vflag & INP_TIMEWAIT) {
+	if (inp->inp_flags & INP_TIMEWAIT) {
 		/*
 		 * There are two cases to handle: one in which the time wait
 		 * state is being discarded (INP_DROPPED), and one in which
@@ -177,7 +177,7 @@ tcp_detach(struct socket *so, struct inp
 		 *
 		 * XXXRW: Would it be cleaner to free the tcptw here?
 		 */
-		if (inp->inp_vflag & INP_DROPPED) {
+		if (inp->inp_flags & INP_DROPPED) {
 			KASSERT(tp == NULL, ("tcp_detach: INP_TIMEWAIT && "
 			    "INP_DROPPED && tp != NULL"));
 			in_pcbdetach(inp);
@@ -196,7 +196,7 @@ tcp_detach(struct socket *so, struct inp
 		 *
 		 * XXXRW: Does the second case still occur?
 		 */
-		if (inp->inp_vflag & INP_DROPPED ||
+		if (inp->inp_flags & INP_DROPPED ||
 		    tp->t_state < TCPS_SYN_SENT) {
 			tcp_discardcb(tp);
 			in_pcbdetach(inp);
@@ -255,7 +255,7 @@ tcp_usr_bind(struct socket *so, struct s
 	inp = sotoinpcb(so);
 	KASSERT(inp != NULL, ("tcp_usr_bind: inp == NULL"));
 	INP_WLOCK(inp);
-	if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) {
+	if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
 		error = EINVAL;
 		goto out;
 	}
@@ -295,7 +295,7 @@ tcp6_usr_bind(struct socket *so, struct 
 	inp = sotoinpcb(so);
 	KASSERT(inp != NULL, ("tcp6_usr_bind: inp == NULL"));
 	INP_WLOCK(inp);
-	if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) {
+	if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
 		error = EINVAL;
 		goto out;
 	}
@@ -341,7 +341,7 @@ tcp_usr_listen(struct socket *so, int ba
 	inp = sotoinpcb(so);
 	KASSERT(inp != NULL, ("tcp_usr_listen: inp == NULL"));
 	INP_WLOCK(inp);
-	if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) {
+	if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
 		error = EINVAL;
 		goto out;
 	}
@@ -378,7 +378,7 @@ tcp6_usr_listen(struct socket *so, int b
 	inp = sotoinpcb(so);
 	KASSERT(inp != NULL, ("tcp6_usr_listen: inp == NULL"));
 	INP_WLOCK(inp);
-	if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) {
+	if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
 		error = EINVAL;
 		goto out;
 	}
@@ -438,7 +438,7 @@ tcp_usr_connect(struct socket *so, struc
 	inp = sotoinpcb(so);
 	KASSERT(inp != NULL, ("tcp_usr_connect: inp == NULL"));
 	INP_WLOCK(inp);
-	if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) {
+	if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
 		error = EINVAL;
 		goto out;
 	}
@@ -479,7 +479,7 @@ tcp6_usr_connect(struct socket *so, stru
 	inp = sotoinpcb(so);
 	KASSERT(inp != NULL, ("tcp6_usr_connect: inp == NULL"));
 	INP_WLOCK(inp);
-	if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) {
+	if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
 		error = EINVAL;
 		goto out;
 	}
@@ -544,7 +544,7 @@ tcp_usr_disconnect(struct socket *so)
 	inp = sotoinpcb(so);
 	KASSERT(inp != NULL, ("tcp_usr_disconnect: inp == NULL"));
 	INP_WLOCK(inp);
-	if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) {
+	if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
 		error = ECONNRESET;
 		goto out;
 	}
@@ -580,7 +580,7 @@ tcp_usr_accept(struct socket *so, struct
 	KASSERT(inp != NULL, ("tcp_usr_accept: inp == NULL"));
 	INP_INFO_RLOCK(&tcbinfo);
 	INP_WLOCK(inp);
-	if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) {
+	if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
 		error = ECONNABORTED;
 		goto out;
 	}
@@ -623,7 +623,7 @@ tcp6_usr_accept(struct socket *so, struc
 	inp = sotoinpcb(so);
 	KASSERT(inp != NULL, ("tcp6_usr_accept: inp == NULL"));
 	INP_WLOCK(inp);
-	if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) {
+	if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
 		error = ECONNABORTED;
 		goto out;
 	}
@@ -672,7 +672,7 @@ tcp_usr_shutdown(struct socket *so)
 	inp = sotoinpcb(so);
 	KASSERT(inp != NULL, ("inp == NULL"));
 	INP_WLOCK(inp);
-	if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) {
+	if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
 		error = ECONNRESET;
 		goto out;
 	}
@@ -680,7 +680,7 @@ tcp_usr_shutdown(struct socket *so)
 	TCPDEBUG1();
 	socantsendmore(so);
 	tcp_usrclosed(tp);
-	if (!(inp->inp_vflag & INP_DROPPED))
+	if (!(inp->inp_flags & INP_DROPPED))
 		error = tcp_output_disconnect(tp);
 
 out:
@@ -705,7 +705,7 @@ tcp_usr_rcvd(struct socket *so, int flag
 	inp = sotoinpcb(so);
 	KASSERT(inp != NULL, ("tcp_usr_rcvd: inp == NULL"));
 	INP_WLOCK(inp);
-	if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) {
+	if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
 		error = ECONNRESET;
 		goto out;
 	}
@@ -755,7 +755,7 @@ tcp_usr_send(struct socket *so, int flag
 	inp = sotoinpcb(so);
 	KASSERT(inp != NULL, ("tcp_usr_send: inp == NULL"));
 	INP_WLOCK(inp);
-	if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) {
+	if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
 		if (control)
 			m_freem(control);
 		if (m)
@@ -813,7 +813,7 @@ tcp_usr_send(struct socket *so, int flag
 			INP_INFO_WUNLOCK(&tcbinfo);
 			headlocked = 0;
 		}
-		if (!(inp->inp_vflag & INP_DROPPED)) {
+		if (!(inp->inp_flags & INP_DROPPED)) {
 			if (flags & PRUS_MORETOCOME)
 				tp->t_flags |= TF_MORETOCOME;
 			error = tcp_output_send(tp);
@@ -900,18 +900,18 @@ tcp_usr_abort(struct socket *so)
 	/*
 	 * If we still have full TCP state, and we're not dropped, drop.
 	 */
-	if (!(inp->inp_vflag & INP_TIMEWAIT) &&
-	    !(inp->inp_vflag & INP_DROPPED)) {
+	if (!(inp->inp_flags & INP_TIMEWAIT) &&
+	    !(inp->inp_flags & INP_DROPPED)) {
 		tp = intotcpcb(inp);
 		TCPDEBUG1();
 		tcp_drop(tp, ECONNABORTED);
 		TCPDEBUG2(PRU_ABORT);
 	}
-	if (!(inp->inp_vflag & INP_DROPPED)) {
+	if (!(inp->inp_flags & INP_DROPPED)) {
 		SOCK_LOCK(so);
 		so->so_state |= SS_PROTOREF;
 		SOCK_UNLOCK(so);
-		inp->inp_vflag |= INP_SOCKREF;
+		inp->inp_flags |= INP_SOCKREF;
 	}
 	INP_WUNLOCK(inp);
 	INP_INFO_WUNLOCK(&tcbinfo);
@@ -939,18 +939,18 @@ tcp_usr_close(struct socket *so)
 	 * If we still have full TCP state, and we're not dropped, initiate
 	 * a disconnect.
 	 */
-	if (!(inp->inp_vflag & INP_TIMEWAIT) &&
-	    !(inp->inp_vflag & INP_DROPPED)) {
+	if (!(inp->inp_flags & INP_TIMEWAIT) &&
+	    !(inp->inp_flags & INP_DROPPED)) {
 		tp = intotcpcb(inp);
 		TCPDEBUG1();
 		tcp_disconnect(tp);
 		TCPDEBUG2(PRU_CLOSE);
 	}
-	if (!(inp->inp_vflag & INP_DROPPED)) {
+	if (!(inp->inp_flags & INP_DROPPED)) {
 		SOCK_LOCK(so);
 		so->so_state |= SS_PROTOREF;
 		SOCK_UNLOCK(so);
-		inp->inp_vflag |= INP_SOCKREF;
+		inp->inp_flags |= INP_SOCKREF;
 	}
 	INP_WUNLOCK(inp);
 	INP_INFO_WUNLOCK(&tcbinfo);
@@ -970,7 +970,7 @@ tcp_usr_rcvoob(struct socket *so, struct
 	inp = sotoinpcb(so);
 	KASSERT(inp != NULL, ("tcp_usr_rcvoob: inp == NULL"));
 	INP_WLOCK(inp);
-	if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) {
+	if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
 		error = ECONNRESET;
 		goto out;
 	}
@@ -1221,7 +1221,7 @@ tcp_fill_info(struct tcpcb *tp, struct t
  */
 #define INP_WLOCK_RECHECK(inp) do {					\
 	INP_WLOCK(inp);							\
-	if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) {		\
+	if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {		\
 		INP_WUNLOCK(inp);					\
 		return (ECONNRESET);					\
 	}								\
@@ -1254,7 +1254,7 @@ tcp_ctloutput(struct socket *so, struct 
 #endif
 		return (error);
 	}
-	if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) {
+	if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
 		INP_WUNLOCK(inp);
 		return (ECONNRESET);
 	}
@@ -1490,7 +1490,7 @@ tcp_disconnect(struct tcpcb *tp)
 		soisdisconnecting(so);
 		sbflush(&so->so_rcv);
 		tcp_usrclosed(tp);
-		if (!(inp->inp_vflag & INP_DROPPED))
+		if (!(inp->inp_flags & INP_DROPPED))
 			tcp_output_disconnect(tp);
 	}
 }

Modified: stable/7/sys/netinet6/in6_pcb.c
==============================================================================
--- stable/7/sys/netinet6/in6_pcb.c	Thu Mar 26 21:29:38 2009	(r190456)
+++ stable/7/sys/netinet6/in6_pcb.c	Thu Mar 26 22:54:19 2009	(r190457)
@@ -191,7 +191,7 @@ in6_pcbbind(register struct inpcb *inp, 
 				    &sin6->sin6_addr, lport,
 				    INPLOOKUP_WILDCARD, cred);
 				if (t &&
-				    ((t->inp_vflag & INP_TIMEWAIT) == 0) &&
+				    ((t->inp_flags & INP_TIMEWAIT) == 0) &&
 				    (so->so_type != SOCK_STREAM ||
 				     IN6_IS_ADDR_UNSPECIFIED(&t->in6p_faddr)) &&
 				    (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) ||
@@ -209,7 +209,7 @@ in6_pcbbind(register struct inpcb *inp, 
 					    sin.sin_addr, lport,
 					    INPLOOKUP_WILDCARD, cred);
 					if (t &&
-					    ((t->inp_vflag &
+					    ((t->inp_flags &
 					      INP_TIMEWAIT) == 0) &&
 					    (so->so_type != SOCK_STREAM ||
 					     ntohl(t->inp_faddr.s_addr) ==
@@ -221,7 +221,7 @@ in6_pcbbind(register struct inpcb *inp, 
 			}
 			t = in6_pcblookup_local(pcbinfo, &sin6->sin6_addr,
 			    lport, wild, cred);
-			if (t && (reuseport & ((t->inp_vflag & INP_TIMEWAIT) ?
+			if (t && (reuseport & ((t->inp_flags & INP_TIMEWAIT) ?
 			    intotw(t)->tw_so_options :
 			    t->inp_socket->so_options)) == 0)
 				return (EADDRINUSE);
@@ -232,7 +232,7 @@ in6_pcbbind(register struct inpcb *inp, 
 				in6_sin6_2_sin(&sin, sin6);
 				t = in_pcblookup_local(pcbinfo, sin.sin_addr,
 				    lport, wild, cred);
-				if (t && t->inp_vflag & INP_TIMEWAIT) {
+				if (t && t->inp_flags & INP_TIMEWAIT) {
 					if ((reuseport &
 					    intotw(t)->tw_so_options) == 0 &&
 					    (ntohl(t->inp_laddr.s_addr) !=

Modified: stable/7/usr.bin/netstat/inet.c
==============================================================================
--- stable/7/usr.bin/netstat/inet.c	Thu Mar 26 21:29:38 2009	(r190456)
+++ stable/7/usr.bin/netstat/inet.c	Thu Mar 26 22:54:19 2009	(r190457)
@@ -255,7 +255,7 @@ pcblist_kvm(u_long off, char **bufp, int
 		if (istcp) {
 			if (inp->inp_ppcb == NULL)
 				bzero(&xt.xt_tp, sizeof xt.xt_tp);
-			else if (inp->inp_vflag & INP_TIMEWAIT) {
+			else if (inp->inp_flags & INP_TIMEWAIT) {
 				bzero(&xt.xt_tp, sizeof xt.xt_tp);
 				xt.xt_tp.t_state = TCPS_TIME_WAIT;
 			} else

Modified: stable/7/usr.bin/sockstat/sockstat.c
==============================================================================
--- stable/7/usr.bin/sockstat/sockstat.c	Thu Mar 26 21:29:38 2009	(r190456)
+++ stable/7/usr.bin/sockstat/sockstat.c	Thu Mar 26 22:54:19 2009	(r190457)
@@ -343,8 +343,8 @@ gather_inet(int proto)
 			    (inp->inp_fport != 0 && !opt_c))
 				continue;
 		} else if (inp->inp_vflag & INP_IPV6) {
-			if ((inp->in6p_fport == 0 && !opt_l) ||
-			    (inp->in6p_fport != 0 && !opt_c))
+			if ((inp->inp_fport == 0 && !opt_l) ||
+			    (inp->inp_fport != 0 && !opt_c))
 				continue;
 		} else {
 			if (opt_v)
@@ -364,9 +364,9 @@ gather_inet(int proto)
 		} else if (inp->inp_vflag & INP_IPV6) {
 			sock->family = AF_INET6;
 			sockaddr(&sock->laddr, sock->family,
-			    &inp->in6p_laddr, inp->in6p_lport);
+			    &inp->in6p_laddr, inp->inp_lport);
 			sockaddr(&sock->faddr, sock->family,
-			    &inp->in6p_faddr, inp->in6p_fport);
+			    &inp->in6p_faddr, inp->inp_fport);
 		}
 		sock->vflag = inp->inp_vflag;
 		sock->protoname = protoname;

Modified: stable/7/usr.bin/systat/netstat.c
==============================================================================
--- stable/7/usr.bin/systat/netstat.c	Thu Mar 26 21:29:38 2009	(r190456)
+++ stable/7/usr.bin/systat/netstat.c	Thu Mar 26 22:54:19 2009	(r190457)
@@ -223,7 +223,7 @@ again:
 		if (nports && !checkport(&inpcb))
 			continue;
 		if (istcp) {
-			if (inpcb.inp_vflag & INP_TIMEWAIT) {
+			if (inpcb.inp_flags & INP_TIMEWAIT) {
 				bzero(&sockb, sizeof(sockb));
 				enter_kvm(&inpcb, &sockb, TCPS_TIME_WAIT,
 					 "tcp");

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 27 00:09:00 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar 27 03:17:25 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar 27 03:45:42 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar 27 03:52:08 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar 27 05:35:12 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar 27 05:44:53 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar 27 05:48:43 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar 27 06:06:50 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar 27 06:32:53 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: vd@FreeBSD.org
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar 27 11:03:03 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar 27 13:05:29 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8D36C106564A;
	Fri, 27 Mar 2009 13:05:29 +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 7A4098FC23;
	Fri, 27 Mar 2009 13:05:29 +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 n2RD5T3K061797;
	Fri, 27 Mar 2009 13:05:29 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2RD5T83061796;
	Fri, 27 Mar 2009 13:05:29 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200903271305.n2RD5T83061796@svn.freebsd.org>
From: Konstantin Belousov 
Date: Fri, 27 Mar 2009 13:05:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190465 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 13:05:30 -0000

Author: kib
Date: Fri Mar 27 13:05:29 2009
New Revision: 190465
URL: http://svn.freebsd.org/changeset/base/190465

Log:
  MFC r190141:
  When ktracing namei operations, log a result of the __getcwd().
  
  Approved by:	re (kensmith)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/kern/vfs_cache.c

Modified: stable/7/sys/kern/vfs_cache.c
==============================================================================
--- stable/7/sys/kern/vfs_cache.c	Fri Mar 27 11:03:02 2009	(r190464)
+++ stable/7/sys/kern/vfs_cache.c	Fri Mar 27 13:05:29 2009	(r190465)
@@ -35,6 +35,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_ktrace.h"
+
 #include 
 #include 
 #include 
@@ -50,6 +52,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef KTRACE
+#include 
+#endif
 
 #include 
 
@@ -737,6 +742,10 @@ kern___getcwd(struct thread *td, u_char 
 			bcopy(bp, buf, strlen(bp) + 1);
 		else
 			error = copyout(bp, buf, strlen(bp) + 1);
+#ifdef KTRACE
+	if (KTRPOINT(curthread, KTR_NAMEI))
+		ktrnamei(bp);
+#endif
 	}
 	free(tmpbuf, M_TEMP);
 	return (error);

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 27 13:14:00 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar 27 15:19:52 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 84396106564A;
	Fri, 27 Mar 2009 15:19:52 +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 717718FC1B;
	Fri, 27 Mar 2009 15:19:52 +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 n2RFJqR8064324;
	Fri, 27 Mar 2009 15:19:52 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2RFJqA4064323;
	Fri, 27 Mar 2009 15:19:52 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200903271519.n2RFJqA4064323@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 27 Mar 2009 15:19:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190467 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb dev/my
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 15:19:53 -0000

Author: jhb
Date: Fri Mar 27 15:19:51 2009
New Revision: 190467
URL: http://svn.freebsd.org/changeset/base/190467

Log:
  MFC: Release driver lock at the end of the watchdog routine instead of
  trying to acquire it again.
  
  Approved by:	re (kib)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/dev/my/if_my.c

Modified: stable/7/sys/dev/my/if_my.c
==============================================================================
--- stable/7/sys/dev/my/if_my.c	Fri Mar 27 13:13:59 2009	(r190466)
+++ stable/7/sys/dev/my/if_my.c	Fri Mar 27 15:19:51 2009	(r190467)
@@ -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-all@FreeBSD.ORG  Fri Mar 27 15:45:53 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 081B0106567D;
	Fri, 27 Mar 2009 15:45:53 +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 DF6D78FC23;
	Fri, 27 Mar 2009 15:45:52 +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 n2RFjqd2064930;
	Fri, 27 Mar 2009 15:45:52 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2RFjqan064928;
	Fri, 27 Mar 2009 15:45:52 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200903271545.n2RFjqan064928@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 27 Mar 2009 15:45:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190468 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 15:45:53 -0000

Author: jhb
Date: Fri Mar 27 15:45:52 2009
New Revision: 190468
URL: http://svn.freebsd.org/changeset/base/190468

Log:
  MFC: Improve the description of a few sysctls.
  
  Approved by:	re (kib)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/kern/subr_param.c
  stable/7/sys/kern/vfs_bio.c

Modified: stable/7/sys/kern/subr_param.c
==============================================================================
--- stable/7/sys/kern/subr_param.c	Fri Mar 27 15:19:51 2009	(r190467)
+++ stable/7/sys/kern/subr_param.c	Fri Mar 27 15:45:52 2009	(r190468)
@@ -86,29 +86,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_INT(_kern, OID_AUTO, maxswzone, CTLFLAG_RDTUN, &maxswzone, 0,
-    "max swmeta KVA storage");
+    "Maximum memory for swap metadata");
 SYSCTL_INT(_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");
 
 /*
  * These have to be allocated somewhere; allocating

Modified: stable/7/sys/kern/vfs_bio.c
==============================================================================
--- stable/7/sys/kern/vfs_bio.c	Fri Mar 27 15:19:51 2009	(r190467)
+++ stable/7/sys/kern/vfs_bio.c	Fri Mar 27 15:45:52 2009	(r190468)
@@ -117,7 +117,7 @@ SYSCTL_INT(_vfs, OID_AUTO, runningbufspa
     "Amount of presently outstanding async buffer io");
 static int bufspace;
 SYSCTL_INT(_vfs, OID_AUTO, bufspace, CTLFLAG_RD, &bufspace, 0,
-    "KVA memory used for bufs");
+    "Virtual memory used for buffers");
 static int maxbufspace;
 SYSCTL_INT(_vfs, OID_AUTO, maxbufspace, CTLFLAG_RD, &maxbufspace, 0,
     "Maximum allowed value of bufspace (including buf_daemon)");

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 27 15:46:03 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar 27 15:47:03 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar 27 15:57:53 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6D1581065673;
	Fri, 27 Mar 2009 15:57:53 +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 54B2F8FC22;
	Fri, 27 Mar 2009 15:57:53 +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 n2RFvrf6065251;
	Fri, 27 Mar 2009 15:57:53 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2RFvruq065248;
	Fri, 27 Mar 2009 15:57:53 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200903271557.n2RFvruq065248@svn.freebsd.org>
From: Konstantin Belousov 
Date: Fri, 27 Mar 2009 15:57:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190470 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb ufs/ffs ufs/ufs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 15:57:59 -0000

Author: kib
Date: Fri Mar 27 15:57:52 2009
New Revision: 190470
URL: http://svn.freebsd.org/changeset/base/190470

Log:
  MFC r189737:
  The non-modifying EA VOPs are executed with only shared vnode lock taken.
  Provide a custom lock around initializing and tearing down EA area,
  to prevent both memory leaks and double-free of it. Count the number
  of EA area accessors.
  
  Put the new field i_ea_refs to the end of the struct inode to keep
  structure layout stable on releng branch for the benefit of lsof.
  
  MFC r190469:
  Correct typo.
  
  ABI issue pointed out by:	kensmith
  Approved by:	re (kensmith)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/ufs/ffs/ffs_vfsops.c
  stable/7/sys/ufs/ffs/ffs_vnops.c
  stable/7/sys/ufs/ufs/inode.h

Modified: stable/7/sys/ufs/ffs/ffs_vfsops.c
==============================================================================
--- stable/7/sys/ufs/ffs/ffs_vfsops.c	Fri Mar 27 15:46:02 2009	(r190469)
+++ stable/7/sys/ufs/ffs/ffs_vfsops.c	Fri Mar 27 15:57:52 2009	(r190470)
@@ -1451,6 +1451,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags
 	ip->i_fs = fs;
 	ip->i_dev = dev;
 	ip->i_number = ino;
+	ip->i_ea_refs = 0;
 #ifdef QUOTA
 	{
 		int i;

Modified: stable/7/sys/ufs/ffs/ffs_vnops.c
==============================================================================
--- stable/7/sys/ufs/ffs/ffs_vnops.c	Fri Mar 27 15:46:02 2009	(r190469)
+++ stable/7/sys/ufs/ffs/ffs_vnops.c	Fri Mar 27 15:57:52 2009	(r190470)
@@ -1225,6 +1225,35 @@ ffs_rdextattr(u_char **p, struct vnode *
 	return (0);
 }
 
+static void
+ffs_lock_ea(struct vnode *vp)
+{
+	struct inode *ip;
+
+	ip = VTOI(vp);
+	VI_LOCK(vp);
+	while (ip->i_flag & IN_EA_LOCKED) {
+		ip->i_flag |= IN_EA_LOCKWAIT;
+		msleep(&ip->i_ea_refs, &vp->v_interlock, PINOD + 2, "ufs_ea",
+		    0);
+	}
+	ip->i_flag |= IN_EA_LOCKED;
+	VI_UNLOCK(vp);
+}
+
+static void
+ffs_unlock_ea(struct vnode *vp)
+{
+	struct inode *ip;
+
+	ip = VTOI(vp);
+	VI_LOCK(vp);
+	if (ip->i_flag & IN_EA_LOCKWAIT)
+		wakeup(&ip->i_ea_refs);
+	ip->i_flag &= ~(IN_EA_LOCKED | IN_EA_LOCKWAIT);
+	VI_UNLOCK(vp);
+}
+
 static int
 ffs_open_ea(struct vnode *vp, struct ucred *cred, struct thread *td)
 {
@@ -1234,14 +1263,22 @@ ffs_open_ea(struct vnode *vp, struct ucr
 
 	ip = VTOI(vp);
 
-	if (ip->i_ea_area != NULL)
-		return (EBUSY);
+	ffs_lock_ea(vp);
+	if (ip->i_ea_area != NULL) {
+		ip->i_ea_refs++;
+		ffs_unlock_ea(vp);
+		return (0);
+	}
 	dp = ip->i_din2;
 	error = ffs_rdextattr(&ip->i_ea_area, vp, td, 0);
-	if (error)
+	if (error) {
+		ffs_unlock_ea(vp);
 		return (error);
+	}
 	ip->i_ea_len = dp->di_extsize;
 	ip->i_ea_error = 0;
+	ip->i_ea_refs++;
+	ffs_unlock_ea(vp);
 	return (0);
 }
 
@@ -1258,11 +1295,16 @@ ffs_close_ea(struct vnode *vp, int commi
 	struct ufs2_dinode *dp;
 
 	ip = VTOI(vp);
-	if (ip->i_ea_area == NULL)
+
+	ffs_lock_ea(vp);
+	if (ip->i_ea_area == NULL) {
+		ffs_unlock_ea(vp);
 		return (EINVAL);
+	}
 	dp = ip->i_din2;
 	error = ip->i_ea_error;
 	if (commit && error == 0) {
+		ASSERT_VOP_ELOCKED(vp, "ffs_close_ea commit");
 		if (cred == NOCRED)
 			cred =  vp->v_mount->mnt_cred;
 		liovec.iov_base = ip->i_ea_area;
@@ -1279,10 +1321,13 @@ ffs_close_ea(struct vnode *vp, int commi
 			error = ffs_truncate(vp, 0, IO_EXT, cred, td);
 		error = ffs_extwrite(vp, &luio, IO_EXT | IO_SYNC, cred);
 	}
-	free(ip->i_ea_area, M_TEMP);
-	ip->i_ea_area = NULL;
-	ip->i_ea_len = 0;
-	ip->i_ea_error = 0;
+	if (--ip->i_ea_refs == 0) {
+		free(ip->i_ea_area, M_TEMP);
+		ip->i_ea_area = NULL;
+		ip->i_ea_len = 0;
+		ip->i_ea_error = 0;
+	}
+	ffs_unlock_ea(vp);
 	return (error);
 }
 
@@ -1392,7 +1437,6 @@ vop_deleteextattr {
 	uint32_t ealength, ul;
 	int ealen, olen, eapad1, eapad2, error, i, easize;
 	u_char *eae, *p;
-	int stand_alone;
 
 	ip = VTOI(ap->a_vp);
 	fs = ip->i_fs;
@@ -1409,19 +1453,19 @@ vop_deleteextattr {
 	error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace,
 	    ap->a_cred, ap->a_td, IWRITE);
 	if (error) {
+
+		/*
+		 * ffs_lock_ea is not needed there, because the vnode
+		 * must be exclusively locked.
+		 */
 		if (ip->i_ea_area != NULL && ip->i_ea_error == 0)
 			ip->i_ea_error = error;
 		return (error);
 	}
 
-	if (ip->i_ea_area == NULL) {
-		error = ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td);
-		if (error)
-			return (error);
-		stand_alone = 1;
-	} else {
-		stand_alone = 0;
-	}
+	error = ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td);
+	if (error)
+		return (error);
 
 	ealength = eapad1 = ealen = eapad2 = 0;
 
@@ -1434,8 +1478,7 @@ vop_deleteextattr {
 	if (olen == -1) {
 		/* delete but nonexistent */
 		free(eae, M_TEMP);
-		if (stand_alone)
-			ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td);
+		ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td);
 		return(ENOATTR);
 	}
 	bcopy(p, &ul, sizeof ul);
@@ -1446,9 +1489,8 @@ vop_deleteextattr {
 	}
 	if (easize > NXADDR * fs->fs_bsize) {
 		free(eae, M_TEMP);
-		if (stand_alone)
-			ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td);
-		else if (ip->i_ea_error == 0)
+		ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td);
+		if (ip->i_ea_area != NULL && ip->i_ea_error == 0)
 			ip->i_ea_error = ENOSPC;
 		return(ENOSPC);
 	}
@@ -1456,8 +1498,7 @@ vop_deleteextattr {
 	ip->i_ea_area = eae;
 	ip->i_ea_len = easize;
 	free(p, M_TEMP);
-	if (stand_alone)
-		error = ffs_close_ea(ap->a_vp, 1, ap->a_cred, ap->a_td);
+	error = ffs_close_ea(ap->a_vp, 1, ap->a_cred, ap->a_td);
 	return(error);
 }
 
@@ -1482,7 +1523,7 @@ vop_getextattr {
 	struct fs *fs;
 	u_char *eae, *p;
 	unsigned easize;
-	int error, ealen, stand_alone;
+	int error, ealen;
 
 	ip = VTOI(ap->a_vp);
 	fs = ip->i_fs;
@@ -1495,14 +1536,10 @@ vop_getextattr {
 	if (error)
 		return (error);
 
-	if (ip->i_ea_area == NULL) {
-		error = ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td);
-		if (error)
-			return (error);
-		stand_alone = 1;
-	} else {
-		stand_alone = 0;
-	}
+	error = ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td);
+	if (error)
+		return (error);
+
 	eae = ip->i_ea_area;
 	easize = ip->i_ea_len;
 
@@ -1516,8 +1553,8 @@ vop_getextattr {
 			error = uiomove(p, ealen, ap->a_uio);
 	} else
 		error = ENOATTR;
-	if (stand_alone)
-		ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td);
+
+	ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td);
 	return(error);
 }
 
@@ -1542,7 +1579,7 @@ vop_listextattr {
 	u_char *eae, *p, *pe, *pn;
 	unsigned easize;
 	uint32_t ul;
-	int error, ealen, stand_alone;
+	int error, ealen;
 
 	ip = VTOI(ap->a_vp);
 	fs = ip->i_fs;
@@ -1555,14 +1592,9 @@ vop_listextattr {
 	if (error)
 		return (error);
 
-	if (ip->i_ea_area == NULL) {
-		error = ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td);
-		if (error)
-			return (error);
-		stand_alone = 1;
-	} else {
-		stand_alone = 0;
-	}
+	error = ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td);
+	if (error)
+		return (error);
 	eae = ip->i_ea_area;
 	easize = ip->i_ea_len;
 
@@ -1586,8 +1618,7 @@ vop_listextattr {
 			error = uiomove(p, ealen + 1, ap->a_uio);
 		}
 	}
-	if (stand_alone)
-		ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td);
+	ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td);
 	return(error);
 }
 
@@ -1612,7 +1643,6 @@ vop_setextattr {
 	uint32_t ealength, ul;
 	int ealen, olen, eapad1, eapad2, error, i, easize;
 	u_char *eae, *p;
-	int stand_alone;
 
 	ip = VTOI(ap->a_vp);
 	fs = ip->i_fs;
@@ -1633,19 +1663,19 @@ vop_setextattr {
 	error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace,
 	    ap->a_cred, ap->a_td, IWRITE);
 	if (error) {
+
+		/*
+		 * ffs_lock_ea is not needed there, because the vnode
+		 * must be exclusively locked.
+		 */
 		if (ip->i_ea_area != NULL && ip->i_ea_error == 0)
 			ip->i_ea_error = error;
 		return (error);
 	}
 
-	if (ip->i_ea_area == NULL) {
-		error = ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td);
-		if (error)
-			return (error);
-		stand_alone = 1;
-	} else {
-		stand_alone = 0;
-	}
+	error = ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td);
+	if (error)
+		return (error);
 
 	ealen = ap->a_uio->uio_resid;
 	ealength = sizeof(uint32_t) + 3 + strlen(ap->a_name);
@@ -1677,9 +1707,8 @@ vop_setextattr {
 	}
 	if (easize > NXADDR * fs->fs_bsize) {
 		free(eae, M_TEMP);
-		if (stand_alone)
-			ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td);
-		else if (ip->i_ea_error == 0)
+		ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td);
+		if (ip->i_ea_area != NULL && ip->i_ea_error == 0)
 			ip->i_ea_error = ENOSPC;
 		return(ENOSPC);
 	}
@@ -1695,9 +1724,8 @@ vop_setextattr {
 	error = uiomove(p, ealen, ap->a_uio);
 	if (error) {
 		free(eae, M_TEMP);
-		if (stand_alone)
-			ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td);
-		else if (ip->i_ea_error == 0)
+		ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td);
+		if (ip->i_ea_area != NULL && ip->i_ea_error == 0)
 			ip->i_ea_error = error;
 		return(error);
 	}
@@ -1708,8 +1736,7 @@ vop_setextattr {
 	ip->i_ea_area = eae;
 	ip->i_ea_len = easize;
 	free(p, M_TEMP);
-	if (stand_alone)
-		error = ffs_close_ea(ap->a_vp, 1, ap->a_cred, ap->a_td);
+	error = ffs_close_ea(ap->a_vp, 1, ap->a_cred, ap->a_td);
 	return(error);
 }
 

Modified: stable/7/sys/ufs/ufs/inode.h
==============================================================================
--- stable/7/sys/ufs/ufs/inode.h	Fri Mar 27 15:46:02 2009	(r190469)
+++ stable/7/sys/ufs/ufs/inode.h	Fri Mar 27 15:57:52 2009	(r190470)
@@ -112,6 +112,12 @@ struct inode {
 		struct ufs1_dinode *din1;	/* UFS1 on-disk dinode. */
 		struct ufs2_dinode *din2;	/* UFS2 on-disk dinode. */
 	} dinode_u;
+
+	/*
+	 * i_ea_refs is added at the end of the structure to
+	 * keep struct inode layout on releng branch.
+	 */
+	int	  i_ea_refs;	/* Number of users of EA area */
 };
 /*
  * These flags are kept in i_flag.
@@ -125,6 +131,8 @@ struct inode {
 #define	IN_SPACECOUNTED	0x0080		/* Blocks to be freed in free count. */
 #define	IN_LAZYACCESS	0x0100		/* Process IN_ACCESS after the
 					   suspension finished */
+#define	IN_EA_LOCKED	0x0200
+#define	IN_EA_LOCKWAIT	0x0400
 
 #define i_devvp i_ump->um_devvp
 #define i_umbufobj i_ump->um_bo

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 27 16:01:17 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar 27 16:31:16 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar 27 16:45:39 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar 27 16:56:02 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar 27 17:00:50 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar 27 19:08:16 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar 27 19:13:36 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar 27 19:15:28 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar 27 20:40:18 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar 27 21:13:14 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar 27 21:21:23 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 15895106566B;
	Fri, 27 Mar 2009 21:21:23 +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 DA1548FC1B;
	Fri, 27 Mar 2009 21:21:22 +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 n2RLLM8o071688;
	Fri, 27 Mar 2009 21:21:22 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2RLLMQW071686;
	Fri, 27 Mar 2009 21:21:22 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903272121.n2RLLMQW071686@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 27 Mar 2009 21:21:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190478 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/bge dev/cxgb
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 21:21:24 -0000

Author: marius
Date: Fri Mar 27 21:21:22 2009
New Revision: 190478
URL: http://svn.freebsd.org/changeset/base/190478

Log:
  MFC: r190319
  
  - 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 r189568.
  - Remove a comment which no longer applies since r190335.
  
  Approved by:	re (kib)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/bge/if_bge.c
  stable/7/sys/dev/bge/if_bgereg.h
  stable/7/sys/dev/cxgb/   (props changed)

Modified: stable/7/sys/dev/bge/if_bge.c
==============================================================================
--- stable/7/sys/dev/bge/if_bge.c	Fri Mar 27 21:13:14 2009	(r190477)
+++ stable/7/sys/dev/bge/if_bge.c	Fri Mar 27 21:21:22 2009	(r190478)
@@ -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: stable/7/sys/dev/bge/if_bgereg.h
==============================================================================
--- stable/7/sys/dev/bge/if_bgereg.h	Fri Mar 27 21:13:14 2009	(r190477)
+++ stable/7/sys/dev/bge/if_bgereg.h	Fri Mar 27 21:21:22 2009	(r190478)
@@ -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-all@FreeBSD.ORG  Fri Mar 27 21:21:36 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D789510656BB;
	Fri, 27 Mar 2009 21:21:36 +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 475688FC1F;
	Fri, 27 Mar 2009 21:21:36 +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 n2RLLaTr071728;
	Fri, 27 Mar 2009 21:21:36 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2RLLakg071726;
	Fri, 27 Mar 2009 21:21:36 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903272121.n2RLLakg071726@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 27 Mar 2009 21:21:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
X-SVN-Group: stable-6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190479 - in stable/6/sys: . contrib/pf dev/bge dev/cxgb
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 21:21:39 -0000

Author: marius
Date: Fri Mar 27 21:21:35 2009
New Revision: 190479
URL: http://svn.freebsd.org/changeset/base/190479

Log:
  MFC: r190319
  
  - Ensure that INTx isn't disabled, as these chips apparently have a
    quirk requiring it to be enabled even when using MSI.
  - Remove a comment which no longer applies since r190336.

Modified:
  stable/6/sys/   (props changed)
  stable/6/sys/contrib/pf/   (props changed)
  stable/6/sys/dev/bge/if_bge.c
  stable/6/sys/dev/bge/if_bgereg.h
  stable/6/sys/dev/cxgb/   (props changed)

Modified: stable/6/sys/dev/bge/if_bge.c
==============================================================================
--- stable/6/sys/dev/bge/if_bge.c	Fri Mar 27 21:21:22 2009	(r190478)
+++ stable/6/sys/dev/bge/if_bge.c	Fri Mar 27 21:21:35 2009	(r190479)
@@ -1278,8 +1278,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)
@@ -1387,9 +1386,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);
 
 #ifdef __brokenalpha__
 	/*

Modified: stable/6/sys/dev/bge/if_bgereg.h
==============================================================================
--- stable/6/sys/dev/bge/if_bgereg.h	Fri Mar 27 21:21:22 2009	(r190478)
+++ stable/6/sys/dev/bge/if_bgereg.h	Fri Mar 27 21:21:35 2009	(r190479)
@@ -402,6 +402,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-all@FreeBSD.ORG  Fri Mar 27 21:41:09 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CF1AA10656BB;
	Fri, 27 Mar 2009 21:41: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 61A948FC1B;
	Fri, 27 Mar 2009 21:41: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 n2RLf9Ui072121;
	Fri, 27 Mar 2009 21:41:09 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2RLf9Cn072119;
	Fri, 27 Mar 2009 21:41:09 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200903272141.n2RLf9Cn072119@svn.freebsd.org>
From: Konstantin Belousov 
Date: Fri, 27 Mar 2009 21:41:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-svnadmin@freebsd.org
X-SVN-Group: svnadmin
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190480 - svnadmin/conf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 27 Mar 2009 21:41:10 -0000

Author: kib
Date: Fri Mar 27 21:41:07 2009
New Revision: 190480
URL: http://svn.freebsd.org/changeset/base/190480

Log:
  Add Rick Macklem.
  
  Approved by:	core

Modified:
  svnadmin/conf/access
  svnadmin/conf/mentors

Modified: svnadmin/conf/access
==============================================================================
--- svnadmin/conf/access	Fri Mar 27 21:21:35 2009	(r190479)
+++ svnadmin/conf/access	Fri Mar 27 21:41:07 2009	(r190480)
@@ -173,6 +173,7 @@ rdivacky
 remko
 rik
 rink
+rmacklem
 rnoland
 roberto
 rodrigc

Modified: svnadmin/conf/mentors
==============================================================================
--- svnadmin/conf/mentors	Fri Mar 27 21:21:35 2009	(r190479)
+++ svnadmin/conf/mentors	Fri Mar 27 21:41:07 2009	(r190480)
@@ -21,6 +21,7 @@ jinmei		gnn
 lstewart	gnn
 rdivacky	ed
 remko		imp
+rmacklem	rwatson		Co-mentor: kib
 sbruno		scottl
 sson		jb
 trasz		rwatson

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 27 21:47:57 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 04:00:47 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 04:56:57 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 05:45:30 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 05:57:27 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 06:05:54 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 06:12:39 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 06:22:11 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 06:23:10 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 06:25:33 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 06:25:33 -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-all@FreeBSD.ORG  Sat Mar 28 06:30:43 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 06:38:32 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 06:40:49 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 06:47:05 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 07:09:51 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 07:20:39 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 07:26:00 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 07:31:03 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 07:39:36 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 07:44:08 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 08:54:48 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 15:54:09 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 16:12:32 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E4E641065673;
	Sat, 28 Mar 2009 16:12:32 +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 D20368FC16;
	Sat, 28 Mar 2009 16:12:32 +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 n2SGCW7V006722;
	Sat, 28 Mar 2009 16:12:32 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2SGCW0I006721;
	Sat, 28 Mar 2009 16:12:32 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200903281612.n2SGCW0I006721@svn.freebsd.org>
From: Robert Watson 
Date: Sat, 28 Mar 2009 16:12:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190506 - stable/7/sys/netinet
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 16:12:33 -0000

Author: rwatson
Date: Sat Mar 28 16:12:32 2009
New Revision: 190506
URL: http://svn.freebsd.org/changeset/base/190506

Log:
  Enable soreceive_dgram() use by UDP by default in 7.x.  This can lead
  to a significant performance improvement for multi-threaded UDP socket
  receive, such as found in BIND, memcached, VoIP applications, etc.
  
  Requested by:	Florian Smeets 
  Approved by:	re (kib)

Modified:
  stable/7/sys/netinet/udp_usrreq.c

Modified: stable/7/sys/netinet/udp_usrreq.c
==============================================================================
--- stable/7/sys/netinet/udp_usrreq.c	Sat Mar 28 15:54:08 2009	(r190505)
+++ stable/7/sys/netinet/udp_usrreq.c	Sat Mar 28 16:12:32 2009	(r190506)
@@ -131,7 +131,7 @@ u_long	udp_recvspace = 40 * (1024 +
 SYSCTL_ULONG(_net_inet_udp, UDPCTL_RECVSPACE, recvspace, CTLFLAG_RW,
     &udp_recvspace, 0, "Maximum space for incoming UDP datagrams");
 
-static int udp_soreceive_dgram;
+static int udp_soreceive_dgram = 1;
 SYSCTL_INT(_net_inet_udp, OID_AUTO, soreceive_dgram_enabled,
     CTLFLAG_RD | CTLFLAG_TUN, &udp_soreceive_dgram, 0,
     "Use experimental optimized datagram receive");

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 28 17:20:08 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 17:36:56 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 19:17:39 2009
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E1364106567A
	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 270588FC2C
	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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 19:23:10 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D80D3106564A;
	Sat, 28 Mar 2009 19:23:10 +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 C49FC8FC1E;
	Sat, 28 Mar 2009 19:23:10 +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 n2SJNAQv010615;
	Sat, 28 Mar 2009 19:23:10 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2SJNAkH010614;
	Sat, 28 Mar 2009 19:23:10 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903281923.n2SJNAkH010614@svn.freebsd.org>
From: Marius Strobl 
Date: Sat, 28 Mar 2009 19:23:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190510 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb modules/opensolaris
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 19:23:11 -0000

Author: marius
Date: Sat Mar 28 19:23:10 2009
New Revision: 190510
URL: http://svn.freebsd.org/changeset/base/190510

Log:
  MFC: r190374
  
  As with ZFS use real atomic operations for sparc64.
  
  Approved by:	re (kib)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/modules/opensolaris/Makefile

Modified: stable/7/sys/modules/opensolaris/Makefile
==============================================================================
--- stable/7/sys/modules/opensolaris/Makefile	Sat Mar 28 19:09:30 2009	(r190509)
+++ stable/7/sys/modules/opensolaris/Makefile	Sat Mar 28 19:23:10 2009	(r190510)
@@ -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-all@FreeBSD.ORG  Sat Mar 28 19:47:46 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ED5E3106566B;
	Sat, 28 Mar 2009 19:47: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 DA2C48FC08;
	Sat, 28 Mar 2009 19:47:46 +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 n2SJlkkb011097;
	Sat, 28 Mar 2009 19:47:46 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2SJlkFH011096;
	Sat, 28 Mar 2009 19:47:46 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200903281947.n2SJlkFH011096@svn.freebsd.org>
From: Marius Strobl 
Date: Sat, 28 Mar 2009 19:47:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190511 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb modules
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 28 Mar 2009 19:47:47 -0000

Author: marius
Date: Sat Mar 28 19:47:46 2009
New Revision: 190511
URL: http://svn.freebsd.org/changeset/base/190511

Log:
  MFC: r190375, r190376
  
  Given that zfs.ko depends on opensolaris.ko also build the latter by
  default on sparc64.
  
  Approved by:	re (kib)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/modules/Makefile

Modified: stable/7/sys/modules/Makefile
==============================================================================
--- stable/7/sys/modules/Makefile	Sat Mar 28 19:23:10 2009	(r190510)
+++ stable/7/sys/modules/Makefile	Sat Mar 28 19:47:46 2009	(r190511)
@@ -624,6 +624,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-all@FreeBSD.ORG  Sat Mar 28 20:59:26 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 21:06:59 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 23:17:21 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar 28 23:24:34 2009
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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,