From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 00:00:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0777106566B; Sun, 21 Feb 2010 00:00:55 +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 E062A8FC08; Sun, 21 Feb 2010 00:00:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1L00tDW057430; Sun, 21 Feb 2010 00:00:55 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1L00tnG057428; Sun, 21 Feb 2010 00:00:55 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002210000.o1L00tnG057428@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 21 Feb 2010 00:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204155 - head/sys/dev/re X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 00:00:56 -0000 Author: yongari Date: Sun Feb 21 00:00:55 2010 New Revision: 204155 URL: http://svn.freebsd.org/changeset/base/204155 Log: Increase PCIe maximuim read request size to 2048. Because re(4) uses Tx DMA burst size 2048, I beleive PCIe maximum read request size also should match to the value of Tx DMA burst size. With this change I can get more than 800Mbps for TCP bulk transfers. Previously I was not able to get more than 700Mbps. If I enable TSO it now shows 927Mbps. Modified: head/sys/dev/re/if_re.c Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Sat Feb 20 23:48:04 2010 (r204154) +++ head/sys/dev/re/if_re.c Sun Feb 21 00:00:55 2010 (r204155) @@ -1162,6 +1162,9 @@ re_attach(device_t dev) msic = 0; if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) { sc->rl_flags |= RL_FLAG_PCIE; + /* Set PCIe maximum read request size to 2048. */ + if (pci_get_max_read_req(dev) < 2048) + pci_set_max_read_req(dev, 2048); msic = pci_msi_count(dev); if (bootverbose) device_printf(dev, "MSI count : %d\n", msic); From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 00:07:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B4F6106566B; Sun, 21 Feb 2010 00:07: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 6B4E28FC14; Sun, 21 Feb 2010 00:07:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1L07job058945; Sun, 21 Feb 2010 00:07:45 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1L07jXQ058943; Sun, 21 Feb 2010 00:07:45 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002210007.o1L07jXQ058943@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 21 Feb 2010 00:07: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: r204156 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 00:07:45 -0000 Author: yongari Date: Sun Feb 21 00:07:45 2010 New Revision: 204156 URL: http://svn.freebsd.org/changeset/base/204156 Log: Add __FBSDID. Reviewed by: sam Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Sun Feb 21 00:00:55 2010 (r204155) +++ head/sys/net/if_vlan.c Sun Feb 21 00:07:45 2010 (r204156) @@ -25,8 +25,6 @@ * 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$ */ /* @@ -41,6 +39,9 @@ * and ask it to send them. */ +#include +__FBSDID("$FreeBSD$"); + #include "opt_vlan.h" #include From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 01:06:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39677106566C; Sun, 21 Feb 2010 01:06:08 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 291398FC08; Sun, 21 Feb 2010 01:06:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1L168dC071721; Sun, 21 Feb 2010 01:06:08 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1L168SQ071719; Sun, 21 Feb 2010 01:06:08 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201002210106.o1L168SQ071719@svn.freebsd.org> From: Kip Macy Date: Sun, 21 Feb 2010 01:06: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: r204157 - head/sys/i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 01:06:08 -0000 Author: kmacy Date: Sun Feb 21 01:06:07 2010 New Revision: 204157 URL: http://svn.freebsd.org/changeset/base/204157 Log: remove atkbd from default config to avoid pulling in real-mode bios emulation Modified: head/sys/i386/conf/XEN Modified: head/sys/i386/conf/XEN ============================================================================== --- head/sys/i386/conf/XEN Sun Feb 21 00:07:45 2010 (r204156) +++ head/sys/i386/conf/XEN Sun Feb 21 01:06:07 2010 (r204157) @@ -67,12 +67,12 @@ options SMP # Symmetric MultiProcesso device apic # I/O APIC -device atkbdc # AT keyboard controller -device atkbd # AT keyboard +#device atkbdc # AT keyboard controller +#device atkbd # AT keyboard device psm # PS/2 mouse device pci -device kbdmux # keyboard multiplexer +#device kbdmux # keyboard multiplexer # Pseudo devices. device loop # Network loopback From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 01:11:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68806106568D; Sun, 21 Feb 2010 01:11:39 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 581508FC0A; Sun, 21 Feb 2010 01:11:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1L1Bdqj072972; Sun, 21 Feb 2010 01:11:39 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1L1BdaQ072970; Sun, 21 Feb 2010 01:11:39 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201002210111.o1L1BdaQ072970@svn.freebsd.org> From: Kip Macy Date: Sun, 21 Feb 2010 01:11: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: r204158 - head/sys/dev/xen/netfront X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 01:11:39 -0000 Author: kmacy Date: Sun Feb 21 01:11:39 2010 New Revision: 204158 URL: http://svn.freebsd.org/changeset/base/204158 Log: - make printf conditional - fix witness warnings by making configuration lock a mutex Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Sun Feb 21 01:06:07 2010 (r204157) +++ head/sys/dev/xen/netfront/netfront.c Sun Feb 21 01:11:39 2010 (r204158) @@ -81,7 +81,7 @@ __FBSDID("$FreeBSD$"); #include "xenbus_if.h" -#define XN_CSUM_FEATURES (CSUM_TCP | CSUM_UDP | CSUM_TSO) +#define XN_CSUM_FEATURES (CSUM_TCP | CSUM_UDP) #define GRANT_INVALID_REF 0 @@ -233,7 +233,7 @@ struct netfront_info { struct mtx tx_lock; struct mtx rx_lock; - struct sx sc_lock; + struct mtx sc_lock; u_int handle; u_int irq; @@ -280,7 +280,7 @@ struct netfront_info { #define XN_LOCK_INIT(_sc, _name) \ mtx_init(&(_sc)->tx_lock, #_name"_tx", "network transmit lock", MTX_DEF); \ mtx_init(&(_sc)->rx_lock, #_name"_rx", "network receive lock", MTX_DEF); \ - sx_init(&(_sc)->sc_lock, #_name"_rx") + mtx_init(&(_sc)->sc_lock, #_name"_sc", "netfront softc lock", MTX_DEF) #define XN_RX_LOCK(_sc) mtx_lock(&(_sc)->rx_lock) #define XN_RX_UNLOCK(_sc) mtx_unlock(&(_sc)->rx_lock) @@ -288,15 +288,15 @@ struct netfront_info { #define XN_TX_LOCK(_sc) mtx_lock(&(_sc)->tx_lock) #define XN_TX_UNLOCK(_sc) mtx_unlock(&(_sc)->tx_lock) -#define XN_LOCK(_sc) sx_xlock(&(_sc)->sc_lock); -#define XN_UNLOCK(_sc) sx_xunlock(&(_sc)->sc_lock); +#define XN_LOCK(_sc) mtx_lock(&(_sc)->sc_lock); +#define XN_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_lock); -#define XN_LOCK_ASSERT(_sc) sx_assert(&(_sc)->sc_lock, SX_LOCKED); +#define XN_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_lock, MA_OWNED); #define XN_RX_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->rx_lock, MA_OWNED); #define XN_TX_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->tx_lock, MA_OWNED); #define XN_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->rx_lock); \ mtx_destroy(&(_sc)->tx_lock); \ - sx_destroy(&(_sc)->sc_lock); + mtx_destroy(&(_sc)->sc_lock); struct netfront_rx_info { struct netif_rx_response rx; @@ -361,9 +361,13 @@ xennet_get_rx_ref(struct netfront_info * #define IPRINTK(fmt, args...) \ printf("[XEN] " fmt, ##args) +#ifdef INVARIANTS #define WPRINTK(fmt, args...) \ printf("[XEN] " fmt, ##args) -#if 0 +#else +#define WPRINTK(fmt, args...) +#endif +#ifdef DEBUG #define DPRINTK(fmt, args...) \ printf("[XEN] %s: " fmt, __func__, ##args) #else @@ -1085,7 +1089,7 @@ xn_txeof(struct netfront_info *np) ifp->if_opackets++; if (unlikely(gnttab_query_foreign_access( np->grant_tx_ref[id]) != 0)) { - printf("network_tx_buf_gc: warning " + WPRINTK("network_tx_buf_gc: warning " "-- grant still in use by backend " "domain.\n"); goto out; @@ -1260,7 +1264,7 @@ xennet_get_responses(struct netfront_inf u_long mfn; #if 0 - printf("rx->status=%hd rx->offset=%hu frags=%u\n", + DPRINTK("rx->status=%hd rx->offset=%hu frags=%u\n", rx->status, rx->offset, frags); #endif if (unlikely(rx->status < 0 || @@ -1474,7 +1478,7 @@ xn_start_locked(struct ifnet *ifp) * slot [0] free for the freelist head */ if (sc->xn_cdata.xn_tx_chain_cnt + nfrags >= NET_TX_RING_SIZE) { - printf("xn_start_locked: xn_tx_chain_cnt (%d) + nfrags %d >= NET_TX_RING_SIZE (%d); must be full!\n", + WPRINTK("xn_start_locked: xn_tx_chain_cnt (%d) + nfrags %d >= NET_TX_RING_SIZE (%d); must be full!\n", (int) sc->xn_cdata.xn_tx_chain_cnt, (int) nfrags, (int) NET_TX_RING_SIZE); IF_PREPEND(&ifp->if_snd, m_head); @@ -1490,7 +1494,7 @@ xn_start_locked(struct ifnet *ifp) * the required size. */ if (RING_FREE_REQUESTS(&sc->tx) < (nfrags + 1)) { - printf("xn_start_locked: free ring slots (%d) < (nfrags + 1) (%d); must be full!\n", + WPRINTK("xn_start_locked: free ring slots (%d) < (nfrags + 1) (%d); must be full!\n", (int) RING_FREE_REQUESTS(&sc->tx), (int) (nfrags + 1)); IF_PREPEND(&ifp->if_snd, m_head); @@ -1821,7 +1825,6 @@ network_connect(struct netfront_info *np np->copying_receiver = ((MODPARM_rx_copy && feature_rx_copy) || (MODPARM_rx_flip && !feature_rx_flip)); - XN_LOCK(np); /* Recovery procedure: */ error = talk_to_backend(np->xbdev, np); if (error) @@ -1871,7 +1874,6 @@ network_connect(struct netfront_info *np xn_txeof(np); XN_TX_UNLOCK(np); network_alloc_rx_buffers(np); - XN_UNLOCK(np); return (0); } @@ -1932,14 +1934,14 @@ create_netdev(device_t dev) /* A grant for every tx ring slot */ if (gnttab_alloc_grant_references(TX_MAX_TARGET, &np->gref_tx_head) < 0) { - printf("#### netfront can't alloc tx grant refs\n"); + IPRINTK("#### netfront can't alloc tx grant refs\n"); err = ENOMEM; goto exit; } /* A grant for every rx ring slot */ if (gnttab_alloc_grant_references(RX_MAX_TARGET, &np->gref_rx_head) < 0) { - printf("#### netfront can't alloc rx grant refs\n"); + WPRINTK("#### netfront can't alloc rx grant refs\n"); gnttab_free_grant_references(np->gref_tx_head); err = ENOMEM; goto exit; @@ -1960,6 +1962,9 @@ create_netdev(device_t dev) ifp->if_ioctl = xn_ioctl; ifp->if_output = ether_output; ifp->if_start = xn_start; +#ifdef notyet + ifp->if_watchdog = xn_watchdog; +#endif ifp->if_init = xn_ifinit; ifp->if_mtu = ETHERMTU; ifp->if_snd.ifq_maxlen = NET_TX_RING_SIZE - 1; @@ -1967,7 +1972,6 @@ create_netdev(device_t dev) ifp->if_hwassist = XN_CSUM_FEATURES; ifp->if_capabilities = IFCAP_HWCSUM; #if __FreeBSD_version >= 700000 - ifp->if_capabilities |= IFCAP_TSO4; if (xn_enable_lro) { int err = tcp_lro_init(&np->xn_lro); if (err) { From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 01:12:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4921106568F; Sun, 21 Feb 2010 01:12:18 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D46848FC1F; Sun, 21 Feb 2010 01:12:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1L1CIBJ073145; Sun, 21 Feb 2010 01:12:18 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1L1CIkE073143; Sun, 21 Feb 2010 01:12:18 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201002210112.o1L1CIkE073143@svn.freebsd.org> From: Kip Macy Date: Sun, 21 Feb 2010 01:12: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: r204159 - head/sys/xen/evtchn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 01:12:19 -0000 Author: kmacy Date: Sun Feb 21 01:12:18 2010 New Revision: 204159 URL: http://svn.freebsd.org/changeset/base/204159 Log: don't hold spin lock across free Modified: head/sys/xen/evtchn/evtchn_dev.c Modified: head/sys/xen/evtchn/evtchn_dev.c ============================================================================== --- head/sys/xen/evtchn/evtchn_dev.c Sun Feb 21 01:11:39 2010 (r204158) +++ head/sys/xen/evtchn/evtchn_dev.c Sun Feb 21 01:12:18 2010 (r204159) @@ -302,11 +302,11 @@ evtchn_close(struct cdev *dev, int flag, { int i; - mtx_lock_spin(&lock); if (ring != NULL) { free(ring, M_DEVBUF); ring = NULL; } + mtx_lock_spin(&lock); for ( i = 0; i < NR_EVENT_CHANNELS; i++ ) if ( synch_test_and_clear_bit(i, &bound_ports[0]) ) mask_evtchn(i); From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 01:13:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74455106566B; Sun, 21 Feb 2010 01:13:35 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63AAA8FC12; Sun, 21 Feb 2010 01:13:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1L1DZD5073441; Sun, 21 Feb 2010 01:13:35 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1L1DZG7073438; Sun, 21 Feb 2010 01:13:35 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201002210113.o1L1DZG7073438@svn.freebsd.org> From: Kip Macy Date: Sun, 21 Feb 2010 01:13: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: r204160 - head/sys/i386/xen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 01:13:35 -0000 Author: kmacy Date: Sun Feb 21 01:13:34 2010 New Revision: 204160 URL: http://svn.freebsd.org/changeset/base/204160 Log: - fix bootstrap for variable KVA_PAGES - remove unused CADDR1 - hold lock across page table update MFC after: 3 days Modified: head/sys/i386/xen/pmap.c head/sys/i386/xen/xen_machdep.c Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Sun Feb 21 01:12:18 2010 (r204159) +++ head/sys/i386/xen/pmap.c Sun Feb 21 01:13:34 2010 (r204160) @@ -251,9 +251,8 @@ struct sysmaps { caddr_t CADDR2; }; static struct sysmaps sysmaps_pcpu[MAXCPU]; -pt_entry_t *CMAP1 = 0; static pt_entry_t *CMAP3; -caddr_t CADDR1 = 0, ptvmmap = 0; +caddr_t ptvmmap = 0; static caddr_t CADDR3; struct msgbuf *msgbufp = 0; @@ -454,8 +453,9 @@ pmap_bootstrap(vm_paddr_t firstaddr) mtx_init(&sysmaps->lock, "SYSMAPS", NULL, MTX_DEF); SYSMAP(caddr_t, sysmaps->CMAP1, sysmaps->CADDR1, 1) SYSMAP(caddr_t, sysmaps->CMAP2, sysmaps->CADDR2, 1) + PT_SET_MA(sysmaps->CADDR1, 0); + PT_SET_MA(sysmaps->CADDR2, 0); } - SYSMAP(caddr_t, CMAP1, CADDR1, 1) SYSMAP(caddr_t, CMAP3, CADDR3, 1) PT_SET_MA(CADDR3, 0); @@ -483,7 +483,6 @@ pmap_bootstrap(vm_paddr_t firstaddr) mtx_init(&PMAP2mutex, "PMAP2", NULL, MTX_DEF); virtual_avail = va; - PT_SET_MA(CADDR1, 0); /* * Leave in place an identity mapping (virt == phys) for the low 1 MB @@ -1061,7 +1060,9 @@ pmap_pte(pmap_t pmap, vm_offset_t va) mtx_lock(&PMAP2mutex); newpf = *pde & PG_FRAME; if ((*PMAP2 & PG_FRAME) != newpf) { + vm_page_lock_queues(); PT_SET_MA(PADDR2, newpf | PG_V | PG_A | PG_M); + vm_page_unlock_queues(); CTR3(KTR_PMAP, "pmap_pte: pmap=%p va=0x%x newpte=0x%08x", pmap, va, (*PMAP2 & 0xffffffff)); } Modified: head/sys/i386/xen/xen_machdep.c ============================================================================== --- head/sys/i386/xen/xen_machdep.c Sun Feb 21 01:12:18 2010 (r204159) +++ head/sys/i386/xen/xen_machdep.c Sun Feb 21 01:13:34 2010 (r204160) @@ -869,23 +869,25 @@ extern unsigned long physfree; int pdir, curoffset; extern int nkpt; +extern uint32_t kernbase; + void initvalues(start_info_t *startinfo) { - int l3_pages, l2_pages, l1_pages, offset; vm_offset_t cur_space, cur_space_pt; struct physdev_set_iopl set_iopl; - vm_paddr_t KPTphys, IdlePTDma; + int l3_pages, l2_pages, l1_pages, offset; vm_paddr_t console_page_ma, xen_store_ma; - vm_offset_t KPTphysoff, tmpva; + vm_offset_t tmpva; vm_paddr_t shinfo; #ifdef PAE vm_paddr_t IdlePDPTma, IdlePDPTnewma; vm_paddr_t IdlePTDnewma[4]; pd_entry_t *IdlePDPTnew, *IdlePTDnew; + vm_paddr_t IdlePTDma[4]; #else - vm_paddr_t pdir_shadow_ma; + vm_paddr_t IdlePTDma[1]; #endif unsigned long i; int ncpus = MAXCPU; @@ -921,11 +923,9 @@ initvalues(start_info_t *startinfo) * Note that only one page directory has been allocated at this point. * Thus, if KERNBASE */ -#if 0 for (i = 0; i < l2_pages; i++) IdlePTDma[i] = xpmap_ptom(VTOP(IdlePTD + i*PAGE_SIZE)); -#endif - + l2_pages = (l2_pages == 0) ? 1 : l2_pages; #else l3_pages = 0; @@ -938,10 +938,11 @@ initvalues(start_info_t *startinfo) break; l1_pages++; } - + /* number of pages allocated after the pts + 1*/; cur_space = xen_start_info->pt_base + - ((xen_start_info->nr_pt_frames) + 3 )*PAGE_SIZE; + (l3_pages + l2_pages + l1_pages + 1)*PAGE_SIZE; + printk("initvalues(): wooh - availmem=%x,%x\n", avail_space, cur_space); printk("KERNBASE=%x,pt_base=%x, VTOPFN(base)=%x, nr_pt_frames=%x\n", @@ -949,72 +950,15 @@ initvalues(start_info_t *startinfo) xen_start_info->nr_pt_frames); xendebug_flags = 0; /* 0xffffffff; */ - /* allocate 4 pages for bootmem allocator */ - bootmem_start = bootmem_current = (char *)cur_space; - cur_space += (4 * PAGE_SIZE); - bootmem_end = (char *)cur_space; - - /* allocate page for gdt */ - gdt = (union descriptor *)cur_space; - cur_space += PAGE_SIZE*ncpus; - - /* allocate page for ldt */ - ldt = (union descriptor *)cur_space; cur_space += PAGE_SIZE; - cur_space += PAGE_SIZE; - - HYPERVISOR_shared_info = (shared_info_t *)cur_space; - cur_space += PAGE_SIZE; - - xen_store = (struct ringbuf_head *)cur_space; - cur_space += PAGE_SIZE; - - console_page = (char *)cur_space; - cur_space += PAGE_SIZE; - #ifdef ADD_ISA_HOLE shift_phys_machine(xen_phys_machine, xen_start_info->nr_pages); #endif - /* - * pre-zero unused mapped pages - mapped on 4MB boundary - */ -#ifdef PAE - IdlePDPT = (pd_entry_t *)startinfo->pt_base; - IdlePDPTma = xpmap_ptom(VTOP(startinfo->pt_base)); - /* - * Note that only one page directory has been allocated at this point. - * Thus, if KERNBASE - */ - IdlePTD = (pd_entry_t *)((uint8_t *)startinfo->pt_base + PAGE_SIZE); - IdlePTDma = xpmap_ptom(VTOP(IdlePTD)); - l3_pages = 1; -#else - IdlePTD = (pd_entry_t *)startinfo->pt_base; - IdlePTDma = xpmap_ptom(VTOP(startinfo->pt_base)); - l3_pages = 0; -#endif - l2_pages = 1; - l1_pages = xen_start_info->nr_pt_frames - l2_pages - l3_pages; - - KPTphysoff = (l2_pages + l3_pages)*PAGE_SIZE; - - KPTphys = xpmap_ptom(VTOP(startinfo->pt_base + KPTphysoff)); XENPRINTF("IdlePTD %p\n", IdlePTD); XENPRINTF("nr_pages: %ld shared_info: 0x%lx flags: 0x%lx pt_base: 0x%lx " "mod_start: 0x%lx mod_len: 0x%lx\n", xen_start_info->nr_pages, xen_start_info->shared_info, xen_start_info->flags, xen_start_info->pt_base, xen_start_info->mod_start, xen_start_info->mod_len); - /* Map proc0's KSTACK */ - - proc0kstack = cur_space; cur_space += (KSTACK_PAGES * PAGE_SIZE); - printk("proc0kstack=%u\n", proc0kstack); - - /* vm86/bios stack */ - cur_space += PAGE_SIZE; - - /* Map space for the vm86 region */ - vm86paddr = (vm_offset_t)cur_space; - cur_space += (PAGE_SIZE * 3); #ifdef PAE IdlePDPTnew = (pd_entry_t *)cur_space; cur_space += PAGE_SIZE; @@ -1047,26 +991,42 @@ initvalues(start_info_t *startinfo) * Unpin the current PDPT */ xen_pt_unpin(IdlePDPTma); - - for (i = 0; i < 20; i++) { - int startidx = ((KERNBASE >> 18) & PAGE_MASK) >> 3; - - if (IdlePTD[startidx + i] == 0) { - l1_pages = i; - break; - } - } #endif /* PAE */ + + /* Map proc0's KSTACK */ + proc0kstack = cur_space; cur_space += (KSTACK_PAGES * PAGE_SIZE); + printk("proc0kstack=%u\n", proc0kstack); + + /* vm86/bios stack */ + cur_space += PAGE_SIZE; + + /* Map space for the vm86 region */ + vm86paddr = (vm_offset_t)cur_space; + cur_space += (PAGE_SIZE * 3); + + /* allocate 4 pages for bootmem allocator */ + bootmem_start = bootmem_current = (char *)cur_space; + cur_space += (4 * PAGE_SIZE); + bootmem_end = (char *)cur_space; + + /* allocate pages for gdt */ + gdt = (union descriptor *)cur_space; + cur_space += PAGE_SIZE*ncpus; + + /* allocate page for ldt */ + ldt = (union descriptor *)cur_space; cur_space += PAGE_SIZE; + cur_space += PAGE_SIZE; - /* unmap remaining pages from initial 4MB chunk + /* unmap remaining pages from initial chunk * */ - for (tmpva = cur_space; (tmpva & ((1<<22)-1)) != 0; tmpva += PAGE_SIZE) { + for (tmpva = cur_space; tmpva < (((uint32_t)&kernbase) + (l1_pages<> 18)), @@ -1093,10 +1053,10 @@ initvalues(start_info_t *startinfo) * make sure that all the initial page table pages * have been zeroed */ - PT_SET_MA(cur_space_pt, + PT_SET_MA(cur_space, xpmap_ptom(VTOP(cur_space)) | PG_V | PG_RW); - bzero((char *)cur_space_pt, PAGE_SIZE); - PT_SET_MA(cur_space_pt, (vm_paddr_t)0); + bzero((char *)cur_space, PAGE_SIZE); + PT_SET_MA(cur_space, (vm_paddr_t)0); xen_pt_pin(xpmap_ptom(VTOP(cur_space))); xen_queue_pt_update((vm_paddr_t)(IdlePTDnewma[pdir] + curoffset*sizeof(vm_paddr_t)), @@ -1119,6 +1079,15 @@ initvalues(start_info_t *startinfo) IdlePDPT = IdlePDPTnew; IdlePDPTma = IdlePDPTnewma; + HYPERVISOR_shared_info = (shared_info_t *)cur_space; + cur_space += PAGE_SIZE; + + xen_store = (struct ringbuf_head *)cur_space; + cur_space += PAGE_SIZE; + + console_page = (char *)cur_space; + cur_space += PAGE_SIZE; + /* * shared_info is an unsigned long so this will randomly break if * it is allocated above 4GB - I guess people are used to that From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 01:55:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7ECC1065672; Sun, 21 Feb 2010 01:55:03 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id A7B9D8FC13; Sun, 21 Feb 2010 01:55:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 7AF017BC6C; Sun, 21 Feb 2010 14:55:02 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0XJjvjLGrLjD; Sun, 21 Feb 2010 14:54:57 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Sun, 21 Feb 2010 14:54:57 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 7FBEC11432; Sun, 21 Feb 2010 14:54:57 +1300 (NZDT) Date: Sun, 21 Feb 2010 14:54:57 +1300 From: Andrew Thompson To: "Bjoern A. Zeeb" Message-ID: <20100221015457.GA57032@citylink.fud.org.nz> References: <201002202209.o1KM9mNe032343@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201002202209.o1KM9mNe032343@svn.freebsd.org> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r204145 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 01:55:04 -0000 On Sat, Feb 20, 2010 at 10:09:48PM +0000, Bjoern A. Zeeb wrote: > Author: bz > Date: Sat Feb 20 22:09:48 2010 > New Revision: 204145 > URL: http://svn.freebsd.org/changeset/base/204145 > > Log: > Start to implement ifnet DDB support: > - 'show ifnets' prints a list of ifnet *s per virtual network stack, > - 'show ifnet ' prints fields matching the given ifp. The existing style for this is 'show all xxx', maybe you want to follow that. > We do not yet print the complete set of fields and might want to > factor this out to an extra if_debug.c file in case this grows > a lot[1]. We may also want to grow 'show ifnet ' support[1]. > > Sponsored by: ISPsystem > Suggested by: rwatson [1] > Reviewed by: rwatson > MFC after: 5 days > > Modified: > head/sys/net/if.c > From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 03:49:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0590E106566B; Sun, 21 Feb 2010 03:49:40 +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 E91E28FC0A; Sun, 21 Feb 2010 03:49:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1L3nd9a007841; Sun, 21 Feb 2010 03:49:39 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1L3ndrO007839; Sun, 21 Feb 2010 03:49:39 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201002210349.o1L3ndrO007839@svn.freebsd.org> From: Alan Cox Date: Sun, 21 Feb 2010 03:49: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: r204161 - head/sys/amd64/amd64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 03:49:40 -0000 Author: alc Date: Sun Feb 21 03:49:39 2010 New Revision: 204161 URL: http://svn.freebsd.org/changeset/base/204161 Log: Since create_pagetables() zeroes the page tables, pmap_bootstrap() needn't zero *CMAP1. Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Feb 21 01:13:34 2010 (r204160) +++ head/sys/amd64/amd64/pmap.c Sun Feb 21 03:49:39 2010 (r204161) @@ -573,8 +573,6 @@ pmap_bootstrap(vm_paddr_t *firstaddr) virtual_avail = va; - *CMAP1 = 0; - invltlb(); /* Initialize the PAT MSR. */ From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 08:45:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28FC1106566B; Sun, 21 Feb 2010 08:45:09 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id B063F8FC15; Sun, 21 Feb 2010 08:45:08 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id B2E9E41C74D; Sun, 21 Feb 2010 09:45:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id DdVUPR8u3O3n; Sun, 21 Feb 2010 09:45:06 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 0F62A41C707; Sun, 21 Feb 2010 09:45:06 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 59BE64448EC; Sun, 21 Feb 2010 08:40:16 +0000 (UTC) Date: Sun, 21 Feb 2010 08:40:16 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Andrew Thompson In-Reply-To: <20100221015457.GA57032@citylink.fud.org.nz> Message-ID: <20100221083437.J27327@maildrop.int.zabbadoz.net> References: <201002202209.o1KM9mNe032343@svn.freebsd.org> <20100221015457.GA57032@citylink.fud.org.nz> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r204145 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 08:45:09 -0000 On Sun, 21 Feb 2010, Andrew Thompson wrote: > On Sat, Feb 20, 2010 at 10:09:48PM +0000, Bjoern A. Zeeb wrote: >> Author: bz >> Date: Sat Feb 20 22:09:48 2010 >> New Revision: 204145 >> URL: http://svn.freebsd.org/changeset/base/204145 >> >> Log: >> Start to implement ifnet DDB support: >> - 'show ifnets' prints a list of ifnet *s per virtual network stack, >> - 'show ifnet ' prints fields matching the given ifp. > > The existing style for this is 'show all xxx', maybe you want to follow > that. show allxxx, yeah I can do that, along with fixing the overlong show vnet_sysuninit. I'll need to update the man page after that as well. >> We do not yet print the complete set of fields and might want to >> factor this out to an extra if_debug.c file in case this grows >> a lot[1]. We may also want to grow 'show ifnet ' support[1]. >> >> Sponsored by: ISPsystem >> Suggested by: rwatson [1] >> Reviewed by: rwatson >> MFC after: 5 days >> >> Modified: >> head/sys/net/if.c >> > -- Bjoern A. Zeeb It will not break if you know what you are doing. From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 09:25:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 143D4106566B; Sun, 21 Feb 2010 09:25: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 015338FC19; Sun, 21 Feb 2010 09:25:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1L9PrBq081585; Sun, 21 Feb 2010 09:25:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1L9PriJ081584; Sun, 21 Feb 2010 09:25:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201002210925.o1L9PriJ081584@svn.freebsd.org> From: Marius Strobl Date: Sun, 21 Feb 2010 09:25: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: r204164 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 09:25:54 -0000 Author: marius Date: Sun Feb 21 09:25:53 2010 New Revision: 204164 URL: http://svn.freebsd.org/changeset/base/204164 Log: Some machines can not only consist of CPUs running at different speeds but also of different types, f.e. Sun Fire V890 can be equipped with a mix of UltraSPARC IV and IV+ CPUs, requiring different MMU initialization and different workarounds for model specific errata. Therefore move the CPU implementation number from a global variable to the per-CPU data. Functions which are called before the latter is available are passed the implementation number as a parameter now. This file was missed in r204152. Modified: head/sys/sparc64/include/tick.h Modified: head/sys/sparc64/include/tick.h ============================================================================== --- head/sys/sparc64/include/tick.h Sun Feb 21 04:41:28 2010 (r204163) +++ head/sys/sparc64/include/tick.h Sun Feb 21 09:25:53 2010 (r204164) @@ -31,8 +31,8 @@ extern u_int hardclock_use_stick; -void tick_clear(void); +void tick_clear(u_int cpu_impl); void tick_start(void); -void tick_stop(void); +void tick_stop(u_int cpu_impl); #endif From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 09:41:18 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82C5D1065694; Sun, 21 Feb 2010 09:41:18 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from mail-gw0.york.ac.uk (mail-gw0.york.ac.uk [144.32.128.245]) by mx1.freebsd.org (Postfix) with ESMTP id 14A748FC1B; Sun, 21 Feb 2010 09:41:17 +0000 (UTC) Received: from mail-gw7.york.ac.uk (mail-gw7.york.ac.uk [144.32.129.30]) by mail-gw0.york.ac.uk (8.13.6/8.13.6) with ESMTP id o1L9fFaJ014959; Sun, 21 Feb 2010 09:41:15 GMT Received: from ury.york.ac.uk ([144.32.108.81]) by mail-gw7.york.ac.uk with esmtps (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1Nj8JP-0001HP-1V; Sun, 21 Feb 2010 09:41:15 +0000 Received: from ury.york.ac.uk (localhost.york.ac.uk [127.0.0.1]) by ury.york.ac.uk (8.14.3/8.14.3) with ESMTP id o1L9fEov033589; Sun, 21 Feb 2010 09:41:14 GMT (envelope-from gavin@FreeBSD.org) Received: from localhost (gavin@localhost) by ury.york.ac.uk (8.14.3/8.14.3/Submit) with ESMTP id o1L9fEYR033586; Sun, 21 Feb 2010 09:41:14 GMT (envelope-from gavin@FreeBSD.org) X-Authentication-Warning: ury.york.ac.uk: gavin owned process doing -bs Date: Sun, 21 Feb 2010 09:41:14 +0000 (GMT) From: Gavin Atkinson X-X-Sender: gavin@ury.york.ac.uk To: Randall Stewart In-Reply-To: <201002201719.o1KHJHt3068093@svn.freebsd.org> Message-ID: References: <201002201719.o1KHJHt3068093@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-York-MailScanner: Found to be clean X-York-MailScanner-From: gavin@freebsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r204136 - head/sys/mips/rmi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 09:41:18 -0000 On Sat, 20 Feb 2010, Randall Stewart wrote: > Author: rrs > Date: Sat Feb 20 17:19:16 2010 > New Revision: 204136 > URL: http://svn.freebsd.org/changeset/base/204136 > > Log: > Changes for pci and pci-e support > - add bus_space_rmi_pci.c for PCI bus space [snip] > > Modified: > head/sys/mips/rmi/bus_space_rmi_pci.c This file now appears to contain two copies of the same text. Gavin From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 10:14:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5A451065670; Sun, 21 Feb 2010 10:14:06 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C36E28FC17; Sun, 21 Feb 2010 10:14:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1LAE67W092151; Sun, 21 Feb 2010 10:14:06 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1LAE6gw092147; Sun, 21 Feb 2010 10:14:06 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002211014.o1LAE6gw092147@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 21 Feb 2010 10:14: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: r204165 - head/usr.sbin/chown X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 10:14:07 -0000 Author: gavin Date: Sun Feb 21 10:14:06 2010 New Revision: 204165 URL: http://svn.freebsd.org/changeset/base/204165 Log: Add a "-x" option to chown(8)/chgrp(1) similar to the same option in du(1), cp(1) etc, to prevent the crossing of mountpoints whilst using the commands recursively. PR: bin/130855 Submitted by: keramida MFC after: 1 month Modified: head/usr.sbin/chown/chgrp.1 head/usr.sbin/chown/chown.8 head/usr.sbin/chown/chown.c Modified: head/usr.sbin/chown/chgrp.1 ============================================================================== --- head/usr.sbin/chown/chgrp.1 Sun Feb 21 09:25:53 2010 (r204164) +++ head/usr.sbin/chown/chgrp.1 Sun Feb 21 10:14:06 2010 (r204165) @@ -31,7 +31,7 @@ .\" @(#)chgrp.1 8.3 (Berkeley) 3/31/94 .\" $FreeBSD$ .\" -.Dd April 25, 2003 +.Dd February 21, 2010 .Dt CHGRP 1 .Os .Sh NAME @@ -39,7 +39,7 @@ .Nd change group .Sh SYNOPSIS .Nm -.Op Fl fhv +.Op Fl fhvx .Oo .Fl R .Op Fl H | Fl L | Fl P @@ -89,6 +89,8 @@ If the flag is specified more than once, .Nm will print the filename, followed by the old and new numeric group ID. +.It Fl x +File system mount points are not traversed. .El .Pp The @@ -125,7 +127,9 @@ In previous versions of this system, sym .Pp The .Fl v -option is non-standard and its use in scripts is not recommended. +and +.Fl x +options are non-standard and their use in scripts is not recommended. .Sh SEE ALSO .Xr chown 2 , .Xr fts 3 , Modified: head/usr.sbin/chown/chown.8 ============================================================================== --- head/usr.sbin/chown/chown.8 Sun Feb 21 09:25:53 2010 (r204164) +++ head/usr.sbin/chown/chown.8 Sun Feb 21 10:14:06 2010 (r204165) @@ -28,7 +28,7 @@ .\" @(#)chown.8 8.3 (Berkeley) 3/31/94 .\" $FreeBSD$ .\" -.Dd April 25, 2003 +.Dd February 21, 2010 .Dt CHOWN 8 .Os .Sh NAME @@ -36,7 +36,7 @@ .Nd change file owner and group .Sh SYNOPSIS .Nm -.Op Fl fhv +.Op Fl fhvx .Oo .Fl R .Op Fl H | Fl L | Fl P @@ -44,7 +44,7 @@ .Ar owner Ns Op : Ns Ar group .Ar .Nm -.Op Fl fhv +.Op Fl fhvx .Oo .Fl R .Op Fl H | Fl L | Fl P @@ -97,6 +97,8 @@ If the flag is specified more than once, .Nm will print the filename, followed by the old and new numeric user/group ID. +.It Fl x +File system mount points are not traversed. .El .Pp The @@ -146,7 +148,9 @@ owners. .Pp The .Fl v -option is non-standard and its use in scripts is not recommended. +and +.Fl x +options are non-standard and their use in scripts is not recommended. .Sh SEE ALSO .Xr chgrp 1 , .Xr find 1 , Modified: head/usr.sbin/chown/chown.c ============================================================================== --- head/usr.sbin/chown/chown.c Sun Feb 21 09:25:53 2010 (r204164) +++ head/usr.sbin/chown/chown.c Sun Feb 21 10:14:06 2010 (r204165) @@ -73,14 +73,14 @@ main(int argc, char **argv) { FTS *ftsp; FTSENT *p; - int Hflag, Lflag, Rflag, fflag, hflag, vflag; + int Hflag, Lflag, Rflag, fflag, hflag, vflag, xflag; int ch, fts_options, rval; char *cp; ischown = (strcmp(basename(argv[0]), "chown") == 0); - Hflag = Lflag = Rflag = fflag = hflag = vflag = 0; - while ((ch = getopt(argc, argv, "HLPRfhv")) != -1) + Hflag = Lflag = Rflag = fflag = hflag = vflag = xflag = 0; + while ((ch = getopt(argc, argv, "HLPRfhvx")) != -1) switch (ch) { case 'H': Hflag = 1; @@ -105,6 +105,9 @@ main(int argc, char **argv) case 'v': vflag++; break; + case 'x': + xflag = 1; + break; case '?': default: usage(); @@ -128,6 +131,8 @@ main(int argc, char **argv) } } else fts_options = hflag ? FTS_PHYSICAL : FTS_LOGICAL; + if (xflag) + fts_options |= FTS_XDEV; uid = (uid_t)-1; gid = (gid_t)-1; @@ -301,11 +306,11 @@ usage(void) if (ischown) (void)fprintf(stderr, "%s\n%s\n", - "usage: chown [-fhv] [-R [-H | -L | -P]] owner[:group]" + "usage: chown [-fhvx] [-R [-H | -L | -P]] owner[:group]" " file ...", - " chown [-fhv] [-R [-H | -L | -P]] :group file ..."); + " chown [-fhvx] [-R [-H | -L | -P]] :group file ..."); else (void)fprintf(stderr, "%s\n", - "usage: chgrp [-fhv] [-R [-H | -L | -P]] group file ..."); + "usage: chgrp [-fhvx] [-R [-H | -L | -P]] group file ..."); exit(1); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 10:29:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E44410656FB; Sun, 21 Feb 2010 10:29:46 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B7FA8FC13; Sun, 21 Feb 2010 10:29:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1LATjnh095669; Sun, 21 Feb 2010 10:29:45 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1LATjpF095666; Sun, 21 Feb 2010 10:29:45 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002211029.o1LATjpF095666@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 21 Feb 2010 10:29: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: r204166 - in head: sbin/devfs share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 10:29:46 -0000 Author: gavin Date: Sun Feb 21 10:29:45 2010 New Revision: 204166 URL: http://svn.freebsd.org/changeset/base/204166 Log: Document the interaction between /etc/devfs.conf and /etc/defaults/devfs.conf PR: docs/117308 Submitted by: Mel (partially) MFC after: 1 week Modified: head/sbin/devfs/devfs.8 head/share/man/man5/devfs.rules.5 Modified: head/sbin/devfs/devfs.8 ============================================================================== --- head/sbin/devfs/devfs.8 Sun Feb 21 10:14:06 2010 (r204165) +++ head/sbin/devfs/devfs.8 Sun Feb 21 10:29:45 2010 (r204166) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 27, 2008 +.Dd February 21, 2010 .Dt DEVFS 8 .Os .Sh NAME @@ -196,6 +196,9 @@ Apply all the rules in ruleset number to the node. This does not necessarily result in any changes to the node (e.g., if none of the rules in the included ruleset match). +Include commands in the referenced +.Ar ruleset +are not resolved. .It Cm mode Ar filemode Set the file mode to .Ar filemode , @@ -243,7 +246,9 @@ configuration file. .It Pa /etc/devfs.rules Local .Nm -configuration file. +configuration file. Rulesets in here override those in +.Pa /etc/defaults/devfs.rules +with the same ruleset number, otherwise the two files are effectively merged. .It Pa /etc/devfs.conf Boot-time .Nm Modified: head/share/man/man5/devfs.rules.5 ============================================================================== --- head/share/man/man5/devfs.rules.5 Sun Feb 21 10:14:06 2010 (r204165) +++ head/share/man/man5/devfs.rules.5 Sun Feb 21 10:29:45 2010 (r204166) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 30, 2006 +.Dd February 21, 2010 .Dt DEVFS.RULES 5 .Os .Sh NAME @@ -83,8 +83,16 @@ devfs_system_ruleset="localrules" .Ed .Sh FILES .Bl -tag -compact -.It Pa /etc/devfs.rules .It Pa /etc/defaults/devfs.rules +Default +.Nm +configuration file. +.It Pa /etc/devfs.rules +Local +.Nm +configuration file. Rulesets in here override those in +.Pa /etc/defaults/devfs.rules +with the same ruleset number, otherwise the two files are effectively merged. .El .Sh EXAMPLES To make all the partitions of From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 12:49:24 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C087F106566B; Sun, 21 Feb 2010 12:49:24 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from poseidon.ceid.upatras.gr (poseidon.ceid.upatras.gr [150.140.141.169]) by mx1.freebsd.org (Postfix) with ESMTP id 685398FC19; Sun, 21 Feb 2010 12:49:24 +0000 (UTC) Received: from mail.ceid.upatras.gr (unknown [10.1.0.143]) by poseidon.ceid.upatras.gr (Postfix) with ESMTP id 49EEEEB4861; Sun, 21 Feb 2010 14:49:23 +0200 (EET) Received: from localhost (europa.ceid.upatras.gr [127.0.0.1]) by mail.ceid.upatras.gr (Postfix) with ESMTP id 07122160CF4; Sun, 21 Feb 2010 14:49:23 +0200 (EET) X-Virus-Scanned: amavisd-new at ceid.upatras.gr Received: from mail.ceid.upatras.gr ([127.0.0.1]) by localhost (europa.ceid.upatras.gr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MaFIrkIC22c1; Sun, 21 Feb 2010 14:49:22 +0200 (EET) Received: from kobe.laptop (ppp-94-64-192-20.home.otenet.gr [94.64.192.20]) by mail.ceid.upatras.gr (Postfix) with ESMTP id BD823160CE1; Sun, 21 Feb 2010 14:49:22 +0200 (EET) Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.4/8.14.4) with ESMTP id o1LCnLjP073826 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 21 Feb 2010 14:49:21 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.4/8.14.4/Submit) id o1LCnLVg073823; Sun, 21 Feb 2010 14:49:21 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Gavin Atkinson References: <201002211014.o1LAE6gw092147@svn.freebsd.org> Date: Sun, 21 Feb 2010 14:49:20 +0200 In-Reply-To: <201002211014.o1LAE6gw092147@svn.freebsd.org> (Gavin Atkinson's message of "Sun, 21 Feb 2010 10:14:06 +0000 (UTC)") Message-ID: <87vddqu52n.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.92 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r204165 - head/usr.sbin/chown X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 12:49:24 -0000 On Sun, 21 Feb 2010 10:14:06 +0000 (UTC), Gavin Atkinson wrote: > Author: gavin > Date: Sun Feb 21 10:14:06 2010 > New Revision: 204165 > URL: http://svn.freebsd.org/changeset/base/204165 > > Log: > Add a "-x" option to chown(8)/chgrp(1) similar to the same option in > du(1), cp(1) etc, to prevent the crossing of mountpoints whilst using the > commands recursively. > > PR: bin/130855 > Submitted by: keramida > MFC after: 1 month Thanks. I've only used this a few times, but it's good to see the patch committed :-) From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 13:57:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 070861065672; Sun, 21 Feb 2010 13:57:03 +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 EAC598FC1B; Sun, 21 Feb 2010 13:57:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1LDv217043618; Sun, 21 Feb 2010 13:57:02 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1LDv236043612; Sun, 21 Feb 2010 13:57:02 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201002211357.o1LDv236043612@svn.freebsd.org> From: Ed Schouten Date: Sun, 21 Feb 2010 13:57: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: r204170 - in head: lib/libc/gen sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 13:57:03 -0000 Author: ed Date: Sun Feb 21 13:57:02 2010 New Revision: 204170 URL: http://svn.freebsd.org/changeset/base/204170 Log: Add proper const keywords to sysctl(3) parameters. The `name' and `newp' arguments can be marked const, because the buffers they refer to are never changed. While there, perform some other cleanups: - Remove K&R from sysctl.c. - Implement sysctlbyname() using sysctlnametomib() to prevent duplication of an undocumented kernel interface. - Fix some whitespace nits. It seems the prototypes are now in sync with NetBSD as well. Modified: head/lib/libc/gen/sysctl.3 head/lib/libc/gen/sysctl.c head/lib/libc/gen/sysctlbyname.c head/lib/libc/gen/sysctlnametomib.c head/sys/sys/sysctl.h Modified: head/lib/libc/gen/sysctl.3 ============================================================================== --- head/lib/libc/gen/sysctl.3 Sun Feb 21 13:17:35 2010 (r204169) +++ head/lib/libc/gen/sysctl.3 Sun Feb 21 13:57:02 2010 (r204170) @@ -28,7 +28,7 @@ .\" @(#)sysctl.3 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd January 28, 2009 +.Dd February 21, 2010 .Dt SYSCTL 3 .Os .Sh NAME @@ -42,9 +42,9 @@ .In sys/types.h .In sys/sysctl.h .Ft int -.Fn sysctl "int *name" "u_int namelen" "void *oldp" "size_t *oldlenp" "void *newp" "size_t newlen" +.Fn sysctl "const int *name" "u_int namelen" "void *oldp" "size_t *oldlenp" "const void *newp" "size_t newlen" .Ft int -.Fn sysctlbyname "const char *name" "void *oldp" "size_t *oldlenp" "void *newp" "size_t newlen" +.Fn sysctlbyname "const char *name" "void *oldp" "size_t *oldlenp" "const void *newp" "size_t newlen" .Ft int .Fn sysctlnametomib "const char *name" "int *mibp" "size_t *sizep" .Sh DESCRIPTION Modified: head/lib/libc/gen/sysctl.c ============================================================================== --- head/lib/libc/gen/sysctl.c Sun Feb 21 13:17:35 2010 (r204169) +++ head/lib/libc/gen/sysctl.c Sun Feb 21 13:57:02 2010 (r204170) @@ -43,15 +43,12 @@ __FBSDID("$FreeBSD$"); #include #include -extern int __sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, - void *newp, size_t newlen); +extern int __sysctl(const int *name, u_int namelen, void *oldp, + size_t *oldlenp, const void *newp, size_t newlen); int -sysctl(name, namelen, oldp, oldlenp, newp, newlen) - int *name; - u_int namelen; - void *oldp, *newp; - size_t *oldlenp, newlen; +sysctl(const int *name, u_int namelen, void *oldp, size_t *oldlenp, + const void *newp, size_t newlen) { if (name[0] != CTL_USER) return (__sysctl(name, namelen, oldp, oldlenp, newp, newlen)); Modified: head/lib/libc/gen/sysctlbyname.c ============================================================================== --- head/lib/libc/gen/sysctlbyname.c Sun Feb 21 13:17:35 2010 (r204169) +++ head/lib/libc/gen/sysctlbyname.c Sun Feb 21 13:57:02 2010 (r204170) @@ -13,26 +13,19 @@ __FBSDID("$FreeBSD$"); #include #include -#include int -sysctlbyname(const char *name, void *oldp, size_t *oldlenp, void *newp, - size_t newlen) +sysctlbyname(const char *name, void *oldp, size_t *oldlenp, + const void *newp, size_t newlen) { - int name2oid_oid[2]; int real_oid[CTL_MAXNAME+2]; int error; size_t oidlen; - name2oid_oid[0] = 0; /* This is magic & undocumented! */ - name2oid_oid[1] = 3; - - oidlen = sizeof(real_oid); - error = sysctl(name2oid_oid, 2, real_oid, &oidlen, (void *)name, - strlen(name)); + oidlen = sizeof(real_oid) / sizeof(int); + error = sysctlnametomib(name, real_oid, &oidlen); if (error < 0) - return error; - oidlen /= sizeof (int); + return (error); error = sysctl(real_oid, oidlen, oldp, oldlenp, newp, newlen); return (error); } Modified: head/lib/libc/gen/sysctlnametomib.c ============================================================================== --- head/lib/libc/gen/sysctlnametomib.c Sun Feb 21 13:17:35 2010 (r204169) +++ head/lib/libc/gen/sysctlnametomib.c Sun Feb 21 13:57:02 2010 (r204170) @@ -48,8 +48,8 @@ sysctlnametomib(const char *name, int *m oid[0] = 0; oid[1] = 3; - *sizep *= sizeof (int); - error = sysctl(oid, 2, mibp, sizep, (void *)name, strlen(name)); - *sizep /= sizeof (int); + *sizep *= sizeof(int); + error = sysctl(oid, 2, mibp, sizep, name, strlen(name)); + *sizep /= sizeof(int); return (error); } Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Sun Feb 21 13:17:35 2010 (r204169) +++ head/sys/sys/sysctl.h Sun Feb 21 13:57:02 2010 (r204170) @@ -714,8 +714,8 @@ int sysctl_wire_old_buffer(struct sysctl #include __BEGIN_DECLS -int sysctl(int *, u_int, void *, size_t *, void *, size_t); -int sysctlbyname(const char *, void *, size_t *, void *, size_t); +int sysctl(const int *, u_int, void *, size_t *, const void *, size_t); +int sysctlbyname(const char *, void *, size_t *, const void *, size_t); int sysctlnametomib(const char *, int *, size_t *); __END_DECLS #endif /* _KERNEL */ From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 14:28:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 040FD106566C; Sun, 21 Feb 2010 14:28:04 +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 CECE88FC0A; Sun, 21 Feb 2010 14:28:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1LES3Ij050477; Sun, 21 Feb 2010 14:28:03 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1LES3Pg050476; Sun, 21 Feb 2010 14:28:03 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201002211428.o1LES3Pg050476@svn.freebsd.org> From: Gabor Kovesdan Date: Sun, 21 Feb 2010 14:28: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: r204171 - in head: contrib/bc gnu/usr.bin/bc gnu/usr.bin/dc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 14:28:04 -0000 Author: gabor Date: Sun Feb 21 14:28:03 2010 New Revision: 204171 URL: http://svn.freebsd.org/changeset/base/204171 Log: - Remove GNU bc/dc bits. There has not been any regressions seen after BSD bc/dc import. It has been tested with make universe that this code is not used by anything any more. Approved by: delphij (mentor) Deleted: head/contrib/bc/ head/gnu/usr.bin/bc/ head/gnu/usr.bin/dc/ From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 14:58:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25B08106566B; Sun, 21 Feb 2010 14:58:02 +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 F0D308FC0A; Sun, 21 Feb 2010 14:58:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1LEw1XM057086; Sun, 21 Feb 2010 14:58:01 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1LEw19q057084; Sun, 21 Feb 2010 14:58:01 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201002211458.o1LEw19q057084@svn.freebsd.org> From: Ed Schouten Date: Sun, 21 Feb 2010 14:58: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: r204172 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 14:58:02 -0000 Author: ed Date: Sun Feb 21 14:58:01 2010 New Revision: 204172 URL: http://svn.freebsd.org/changeset/base/204172 Log: While there, trim some trailing whitespace. Modified: head/lib/libc/gen/sysctlbyname.c Modified: head/lib/libc/gen/sysctlbyname.c ============================================================================== --- head/lib/libc/gen/sysctlbyname.c Sun Feb 21 14:28:03 2010 (r204171) +++ head/lib/libc/gen/sysctlbyname.c Sun Feb 21 14:58:01 2010 (r204172) @@ -29,4 +29,3 @@ sysctlbyname(const char *name, void *old error = sysctl(real_oid, oidlen, oldp, oldlenp, newp, newlen); return (error); } - From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 15:25:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAF99106566C; Sun, 21 Feb 2010 15:25:47 +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 BAFEE8FC0C; Sun, 21 Feb 2010 15:25:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1LFPlOg063194; Sun, 21 Feb 2010 15:25:47 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1LFPlth063192; Sun, 21 Feb 2010 15:25:47 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201002211525.o1LFPlth063192@svn.freebsd.org> From: Robert Watson Date: Sun, 21 Feb 2010 15:25: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: r204173 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 15:25:47 -0000 Author: rwatson Date: Sun Feb 21 15:25:47 2010 New Revision: 204173 URL: http://svn.freebsd.org/changeset/base/204173 Log: ifconfig(8) expects interface fooX to be supported by the module if_foo, and will try to load it if it's not present. To better meet these expectations, change the module name for the loopback interface from 'loop' to 'if_lo'. The loopback interface is always compiled into the base kernel, so there are no resulting changes in kld files, etc. Discussed with: brooks (ages ago) MFC after: 1 week Modified: head/sys/net/if_loop.c Modified: head/sys/net/if_loop.c ============================================================================== --- head/sys/net/if_loop.c Sun Feb 21 14:58:01 2010 (r204172) +++ head/sys/net/if_loop.c Sun Feb 21 15:25:47 2010 (r204173) @@ -200,12 +200,12 @@ loop_modevent(module_t mod, int type, vo } static moduledata_t loop_mod = { - "loop", + "if_lo", loop_modevent, 0 }; -DECLARE_MODULE(loop, loop_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY); +DECLARE_MODULE(if_lo, loop_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY); int looutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 17:25:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3980C1065693; Sun, 21 Feb 2010 17:25:01 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26CC68FC15; Sun, 21 Feb 2010 17:25:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1LHP1pg089371; Sun, 21 Feb 2010 17:25:01 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1LHP1Gq089365; Sun, 21 Feb 2010 17:25:01 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201002211725.o1LHP1Gq089365@svn.freebsd.org> From: Randall Stewart Date: Sun, 21 Feb 2010 17:25: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: r204174 - in head/contrib/gdb/gdb: . config/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 17:25:01 -0000 Author: rrs Date: Sun Feb 21 17:25:00 2010 New Revision: 204174 URL: http://svn.freebsd.org/changeset/base/204174 Log: Adds the missing mips gdb files that I foobar'd on my last commit.. Sorry about that JC.. my fault. Obtained from: JC Added: head/contrib/gdb/gdb/config/mips/nm-fbsd.h head/contrib/gdb/gdb/config/mips/tm-fbsd.h head/contrib/gdb/gdb/mipsfbsd-nat.c head/contrib/gdb/gdb/mipsfbsd-tdep.c head/contrib/gdb/gdb/mipsfbsd-tdep.h Added: head/contrib/gdb/gdb/config/mips/nm-fbsd.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/gdb/gdb/config/mips/nm-fbsd.h Sun Feb 21 17:25:00 2010 (r204174) @@ -0,0 +1,48 @@ +/*********************************************************************** +Copyright 2003-2006 Raza Microelectronics, Inc.(RMI). +This is a derived work from software originally provided by the external +entity identified below. The licensing terms and warranties specified in +the header of the original work apply to this derived work. +Contribution by RMI: +*****************************#RMI_1#**********************************/ +/* Native-dependent definitions for NetBSD/mips. + Copyright 2002 Free Software Foundation, Inc. + Contributed by Wasabi Systems, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef NM_FBSD_H +#define NM_FBSD_H + +/* Override child_pid_to_exec_file in 'inftarg.c'. */ +#define CHILD_PID_TO_EXEC_FILE + +/* Type of the third argument to the `ptrace' system call. */ +#define PTRACE_ARG3_TYPE caddr_t + +/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */ +#define FETCH_INFERIOR_REGISTERS + +/* We can attach and detach. */ +#define ATTACH_DETACH + +/* Shared library support. */ + +#include "solib.h" + +#endif /* NM_FBSD_H */ Added: head/contrib/gdb/gdb/config/mips/tm-fbsd.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/gdb/gdb/config/mips/tm-fbsd.h Sun Feb 21 17:25:00 2010 (r204174) @@ -0,0 +1,43 @@ +/*********************************************************************** +Copyright 2003-2006 Raza Microelectronics, Inc.(RMI). +This is a derived work from software originally provided by the external +entity identified below. The licensing terms and warranties specified in +the header of the original work apply to this derived work. +Contribution by RMI: +*****************************#RMI_1#**********************************/ +/* Target-dependent definitions for NetBSD/mips. + Copyright 2002 Free Software Foundation, Inc. + Contributed by Wasabi Systems, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef TM_FBSD_H +#define TM_FBSD_H + +#include "mips/tm-mips.h" +#include "solib.h" + +/* We don't want to inherit tm-mips.h's shared library trampoline code. */ +#undef IN_SOLIB_CALL_TRAMPOLINE +#undef IN_SOLIB_RETURN_TRAMPOLINE +#undef SKIP_TRAMPOLINE_CODE +#undef IGNORE_HELPER_CALL + +/* XXX undef a bunch of stuff we want to use multi-arch */ +#undef IN_SIGTRAMP +#endif /* TM_FBSD_H */ Added: head/contrib/gdb/gdb/mipsfbsd-nat.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/gdb/gdb/mipsfbsd-nat.c Sun Feb 21 17:25:00 2010 (r204174) @@ -0,0 +1,108 @@ +/*********************************************************************** +Copyright 2003-2006 Raza Microelectronics, Inc.(RMI). +This is a derived work from software originally provided by the external +entity identified below. The licensing terms and warranties specified in +the header of the original work apply to this derived work. +Contribution by RMI: +*****************************#RMI_1#**********************************/ +/* Native-dependent code for MIPS systems running NetBSD. + Copyright 2000, 2001, 2002 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "inferior.h" +#include "regcache.h" + +#include "mipsfbsd-tdep.h" + +#include +#include +#include + +/* Determine if PT_GETREGS fetches this register. */ +static int +getregs_supplies (int regno) +{ + return ((regno) >= ZERO_REGNUM && (regno) <= PC_REGNUM); +} + +void +fetch_inferior_registers (int regno) +{ + if (regno == -1 || getregs_supplies (regno)) + { + struct reg regs; + + if (ptrace (PT_GETREGS, PIDGET (inferior_ptid), + (PTRACE_ARG3_TYPE) ®s, 0) == -1) + perror_with_name ("Couldn't get registers"); + + mipsfbsd_supply_reg ((char *) ®s, regno); + if (regno != -1) + return; + } + + if (regno == -1 || regno >= FP0_REGNUM) + { + struct fpreg fpregs; + + if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid), + (PTRACE_ARG3_TYPE) &fpregs, 0) == -1) + perror_with_name ("Couldn't get floating point status"); + + mipsfbsd_supply_fpreg ((char *) &fpregs, regno); + } +} + +void +store_inferior_registers (int regno) +{ + if (regno == -1 || getregs_supplies (regno)) + { + struct reg regs; + + if (ptrace (PT_GETREGS, PIDGET (inferior_ptid), + (PTRACE_ARG3_TYPE) ®s, 0) == -1) + perror_with_name ("Couldn't get registers"); + + mipsfbsd_fill_reg ((char *) ®s, regno); + + if (ptrace (PT_SETREGS, PIDGET (inferior_ptid), + (PTRACE_ARG3_TYPE) ®s, 0) == -1) + perror_with_name ("Couldn't write registers"); + + if (regno != -1) + return; + } + + if (regno == -1 || regno >= FP0_REGNUM) + { + struct fpreg fpregs; + + if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid), + (PTRACE_ARG3_TYPE) &fpregs, 0) == -1) + perror_with_name ("Couldn't get floating point status"); + + mipsfbsd_fill_fpreg ((char *) &fpregs, regno); + + if (ptrace (PT_SETFPREGS, PIDGET (inferior_ptid), + (PTRACE_ARG3_TYPE) &fpregs, 0) == -1) + perror_with_name ("Couldn't write floating point status"); + } +} Added: head/contrib/gdb/gdb/mipsfbsd-tdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/gdb/gdb/mipsfbsd-tdep.c Sun Feb 21 17:25:00 2010 (r204174) @@ -0,0 +1,579 @@ +/*********************************************************************** +Copyright 2003-2006 Raza Microelectronics, Inc.(RMI). +This is a derived work from software originally provided by the external +entity identified below. The licensing terms and warranties specified in +the header of the original work apply to this derived work. +Contribution by RMI: +*****************************#RMI_1#**********************************/ +/* Target-dependent code for MIPS systems running NetBSD. + Copyright 2002, 2003 Free Software Foundation, Inc. + Contributed by Wasabi Systems, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "gdbcore.h" +#include "regcache.h" +#include "target.h" +#include "value.h" +#include "osabi.h" + +#include "nbsd-tdep.h" +#include "mipsfbsd-tdep.h" +#include "mips-tdep.h" + +#include "solib-svr4.h" + +#include +#include "gregset.h" +#include "trad-frame.h" +#include "frame.h" +#include "frame-unwind.h" +#include "bfd.h" +#include "objfiles.h" + +/* Conveniently, GDB uses the same register numbering as the + ptrace register structure used by NetBSD/mips. */ + +void +mipsfbsd_supply_reg (char *regs, int regno) +{ + int i; + + for (i = 0; i <= PC_REGNUM; i++) + { + if (regno == i || regno == -1) + { + if (CANNOT_FETCH_REGISTER (i)) + supply_register (i, NULL); + else + supply_register (i, regs + (i * mips_regsize (current_gdbarch))); + } + } +} +void +supply_gregset (gdb_gregset_t *gregs) +{ + mipsfbsd_supply_reg((char *)gregs, -1); +} + +void +mipsfbsd_fill_reg (char *regs, int regno) +{ + int i; + + for (i = 0; i <= PC_REGNUM; i++) + if ((regno == i || regno == -1) && ! CANNOT_STORE_REGISTER (i)) + regcache_collect (i, regs + (i * mips_regsize (current_gdbarch))); +} + +void +fill_gregset (gdb_gregset_t *gregs, int regno) +{ + mipsfbsd_fill_reg ((char *)gregs, regno); +} + +void +mipsfbsd_supply_fpreg (char *fpregs, int regno) +{ + int i; + + for (i = FP0_REGNUM; + i <= mips_regnum (current_gdbarch)->fp_implementation_revision; + i++) + { + if (regno == i || regno == -1) + { + if (CANNOT_FETCH_REGISTER (i)) + supply_register (i, NULL); + else + supply_register (i, + fpregs + ((i - FP0_REGNUM) * mips_regsize (current_gdbarch))); + } + } +} + +void +supply_fpregset (gdb_fpregset_t *fpregs) +{ + mipsfbsd_supply_fpreg((char *)fpregs, -1); +} + +void +mipsfbsd_fill_fpreg (char *fpregs, int regno) +{ + int i; + + for (i = FP0_REGNUM; i <= mips_regnum (current_gdbarch)->fp_control_status; + i++) + if ((regno == i || regno == -1) && ! CANNOT_STORE_REGISTER (i)) + regcache_collect (i, + fpregs + ((i - FP0_REGNUM) * mips_regsize (current_gdbarch))); +} + +void +fill_fpregset (gdb_fpregset_t *fpregs, int regno) +{ + mipsfbsd_fill_fpreg ((char *)fpregs, regno); +} + +static void +fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which, + CORE_ADDR ignore) +{ + char *regs, *fpregs; + + /* We get everything from one section. */ + if (which != 0) + return; + + regs = core_reg_sect; + fpregs = core_reg_sect + SIZEOF_STRUCT_REG; + + /* Integer registers. */ + mipsfbsd_supply_reg (regs, -1); + + /* Floating point registers. */ + mipsfbsd_supply_fpreg (fpregs, -1); +} + +static void +fetch_elfcore_registers (char *core_reg_sect, unsigned core_reg_size, int which, + CORE_ADDR ignore) +{ + switch (which) + { + case 0: /* Integer registers. */ + if (core_reg_size != SIZEOF_STRUCT_REG) + warning ("Wrong size register set in core file."); + else + mipsfbsd_supply_reg (core_reg_sect, -1); + break; + + case 2: /* Floating point registers. */ + if (core_reg_size != SIZEOF_STRUCT_FPREG) + warning ("Wrong size register set in core file."); + else + mipsfbsd_supply_fpreg (core_reg_sect, -1); + break; + + default: + /* Don't know what kind of register request this is; just ignore it. */ + break; + } +} + +static struct core_fns mipsfbsd_core_fns = +{ + bfd_target_unknown_flavour, /* core_flavour */ + default_check_format, /* check_format */ + default_core_sniffer, /* core_sniffer */ + fetch_core_registers, /* core_read_registers */ + NULL /* next */ +}; + + +/* + * MIPSFBSD Offsets + * 0x7fff0000 User high mem -> USRSTACK [64K] + * + * 0x7ffefff0 ps_strings -> 16 bytes + * + * 0x7ffeffec sigcode -> 44 bytes + * + * 0x7ffeffc4 sigcode end env strings etc start + */ +#define MIPS_FBSD_SIGTRAMP_START (0x7ffeffc4) +#define MIPS_FBSD_SIGTRAMP_END (0x7ffeffec) +#define MIPS_FBSD_SIGTRAMP_STACK_MOD_START (0x7ffeffc8) +#define MIPS_FBSD_SIGTRAMP_STACK_MOD_END (0x7ffeffd8) + +static LONGEST +mipsfbsd_sigtramp_offset (CORE_ADDR pc) +{ + return pc < MIPS_FBSD_SIGTRAMP_END && + pc >= MIPS_FBSD_SIGTRAMP_START ? 1 : -1; +} + +static int +fbsd_pc_in_sigtramp (CORE_ADDR pc, char *name) +{ + return (name && strcmp (name, "__sigtramp") == 0); +} + +static int +mipsfbsd_pc_in_sigtramp (CORE_ADDR pc, char *func_name) +{ + return (fbsd_pc_in_sigtramp (pc, func_name) + || mipsfbsd_sigtramp_offset (pc) >= 0); +} + +static int +is_sigtramp_sp_modified (CORE_ADDR pc) +{ + return (pc >= MIPS_FBSD_SIGTRAMP_STACK_MOD_START && + pc <= MIPS_FBSD_SIGTRAMP_STACK_MOD_END); +} + + +/* Figure out where the longjmp will land. We expect that we have + just entered longjmp and haven't yet setup the stack frame, so + the args are still in the argument regs. A0_REGNUM points at the + jmp_buf structure from which we extract the PC that we will land + at. The PC is copied into *pc. This routine returns true on + success. */ + +#define FBSD_MIPS_JB_PC (12) +#define FBSD_MIPS_JB_ELEMENT_SIZE mips_regsize (current_gdbarch) +#define FBSD_MIPS_JB_OFFSET (FBSD_MIPS_JB_PC * \ + FBSD_MIPS_JB_ELEMENT_SIZE) + +static int +mipsfbsd_get_longjmp_target (CORE_ADDR *pc) +{ + CORE_ADDR jb_addr; + char *buf; + + buf = alloca (FBSD_MIPS_JB_ELEMENT_SIZE); + + jb_addr = read_register (A0_REGNUM); + + if (target_read_memory (jb_addr + FBSD_MIPS_JB_OFFSET, buf, + FBSD_MIPS_JB_ELEMENT_SIZE)) + return 0; + + *pc = extract_unsigned_integer (buf, FBSD_MIPS_JB_ELEMENT_SIZE); + + return 1; +} + +static int +mipsfbsd_cannot_fetch_register (int regno) +{ + return (regno == ZERO_REGNUM + || regno == mips_regnum (current_gdbarch)->fp_implementation_revision); + /* XXX TODO: Are there other registers that we cannot fetch ? */ +} + +static int +mipsfbsd_cannot_store_register (int regno) +{ + return (regno == ZERO_REGNUM + || regno == mips_regnum (current_gdbarch)->fp_implementation_revision); + /* XXX TODO: Are there other registers that we cannot write ? */ +} + +/* + * This structure is defined in mips-tdep.c. + */ +struct mips_frame_cache +{ + CORE_ADDR base; + struct trad_frame_saved_reg *saved_regs; +}; + +/* + * Prologue cache for sigtramp frame + * When we land in sigtramp, sigcontext is saved on the + * stack just below the sigtramp's stack frame. We have + * the Registers saved at fixed offsets on the stack. + */ + +#define MIPS_FBSD_SIGTRAMP_STACK_SIZE (48) +#define MIPS_FBSD_SIGCONTEXT_REG_OFFSET (32) + +static struct mips_frame_cache * +mipsfbsd_sigtramp_frame_cache (struct frame_info *next_frame, + void **this_cache) +{ + struct mips_frame_cache *cache; + CORE_ADDR gregs_addr, sp, pc; + int regnum; + int sigtramp_stack_size; + + if (*this_cache) + return *this_cache; + + cache = FRAME_OBSTACK_ZALLOC (struct mips_frame_cache); + *this_cache = cache; + + cache->saved_regs = trad_frame_alloc_saved_regs (next_frame); + + /* + * Get sp of next frame which is the adjusted sp of + * tramp code. + */ + sp = frame_unwind_register_unsigned(next_frame, NUM_REGS + SP_REGNUM); + pc = frame_unwind_register_unsigned(next_frame, NUM_REGS + PC_REGNUM); + sigtramp_stack_size = is_sigtramp_sp_modified(pc) ? + MIPS_FBSD_SIGTRAMP_STACK_SIZE : 0; + gregs_addr = sp + sigtramp_stack_size + MIPS_FBSD_SIGCONTEXT_REG_OFFSET; + + for (regnum = 0; regnum < PC_REGNUM; regnum++) { + cache->saved_regs[NUM_REGS + regnum].addr = gregs_addr + + regnum * mips_regsize (current_gdbarch); + } + /* Only retrieve PC and SP */ + cache->saved_regs[NUM_REGS + SP_REGNUM].addr = gregs_addr + + SP_REGNUM * ( mips_regsize (current_gdbarch)); + + cache->saved_regs[NUM_REGS + RA_REGNUM].addr = gregs_addr + + RA_REGNUM * ( mips_regsize (current_gdbarch)); + + cache->base = get_frame_memory_unsigned (next_frame, + cache->saved_regs[NUM_REGS + SP_REGNUM].addr, + mips_regsize (current_gdbarch)); + + /* Todo: Floating point registers */ + + cache->saved_regs[NUM_REGS + mips_regnum (current_gdbarch)->pc] + = cache->saved_regs[NUM_REGS + RA_REGNUM]; + + return *this_cache; +} + +static void +mipsfbsd_sigtramp_frame_this_id (struct frame_info *next_frame, + void **this_cache, + struct frame_id *this_id) +{ + struct mips_frame_cache *cache = + mipsfbsd_sigtramp_frame_cache (next_frame, this_cache); + + (*this_id) = frame_id_build (cache->base, + cache->saved_regs[NUM_REGS + mips_regnum (current_gdbarch)->pc].addr); +} + +static void +mipsfbsd_sigtramp_frame_prev_register (struct frame_info *next_frame, + void **this_cache, + int regnum, int *optimizedp, + enum lval_type *lvalp, + CORE_ADDR *addrp, + int *realnump, void *valuep) +{ + struct mips_frame_cache *cache = + mipsfbsd_sigtramp_frame_cache (next_frame, this_cache); + + trad_frame_prev_register (next_frame, cache->saved_regs, regnum, + optimizedp, lvalp, addrp, realnump, valuep); +} + + +static const struct frame_unwind mipsfbsd_sigtramp_frame_unwind = +{ + SIGTRAMP_FRAME, + mipsfbsd_sigtramp_frame_this_id, + mipsfbsd_sigtramp_frame_prev_register +}; + +static const struct frame_unwind * +mipsfbsd_sigtramp_frame_sniffer (struct frame_info *next_frame) +{ + CORE_ADDR pc = frame_pc_unwind (next_frame); + char *name; + + find_pc_partial_function (pc, &name, NULL, NULL); + if (mipsfbsd_pc_in_sigtramp (pc, name) ) + return &mipsfbsd_sigtramp_frame_unwind; + + return NULL; +} + +/* + * Find out if PC has landed into dynamic library stub. + * We can find it by seeing if the name of the object + * file section where the PC lies is "MIPS.stubs" + */ + +int +mipsfbsd_in_stub_section (CORE_ADDR pc, char *name) +{ + struct obj_section *s; + int retval = 0; + + s = find_pc_section (pc); + + retval = (s != NULL + && s->the_bfd_section->name != NULL + && strcmp (s->the_bfd_section->name, ".MIPS.stubs") == 0); + return (retval); +} + + +/* + * Prologue cache for dynamic library stub frame. + * This stub does not modify the SP, so we set the + * cache base to calling frame's SP + */ +static struct mips_frame_cache * +mipsfbsd_stub_frame_cache (struct frame_info *next_frame, + void **this_cache) +{ + struct mips_frame_cache *cache; + + if (*this_cache) + return *this_cache; + + cache = FRAME_OBSTACK_ZALLOC (struct mips_frame_cache); + *this_cache = cache; + + cache->saved_regs = trad_frame_alloc_saved_regs (next_frame); + + + cache->saved_regs[NUM_REGS + mips_regnum (current_gdbarch)->pc].realreg = + NUM_REGS + RA_REGNUM; + cache->base = frame_unwind_register_unsigned (next_frame, + NUM_REGS + SP_REGNUM); + + return (*this_cache); +} + + +static void +mipsfbsd_stub_frame_this_id (struct frame_info *next_frame, + void **this_cache, + struct frame_id *this_id) +{ + struct mips_frame_cache *cache = + mipsfbsd_stub_frame_cache (next_frame, this_cache); + + (*this_id) = frame_id_build (cache->base, + cache->saved_regs[NUM_REGS + mips_regnum (current_gdbarch)->pc].addr); +} + +static void +mipsfbsd_stub_frame_prev_register (struct frame_info *next_frame, + void **this_cache, + int regnum, int *optimizedp, + enum lval_type *lvalp, CORE_ADDR *addrp, + int *realnump, void *valuep) +{ + struct mips_frame_cache *cache = + mipsfbsd_stub_frame_cache (next_frame, this_cache); + + trad_frame_prev_register (next_frame, cache->saved_regs, regnum, + optimizedp, lvalp, addrp, realnump, valuep); +} + + + +static const struct frame_unwind mipsfbsd_stub_frame_unwind = { + NORMAL_FRAME, + mipsfbsd_stub_frame_this_id, + mipsfbsd_stub_frame_prev_register +}; + +static const struct frame_unwind * +mipsfbsd_stub_frame_sniffer (struct frame_info *next_frame) +{ + CORE_ADDR pc = frame_pc_unwind (next_frame); + + if (mipsfbsd_in_stub_section(pc, NULL)) + return &mipsfbsd_stub_frame_unwind; + + return NULL; +} + +/* + * typedef struct link_map { + * caddr_t l_addr; /* Base Address of library + * #ifdef __mips__ + * caddr_t l_offs; /* Load Offset of library + * #endif + * const char *l_name; /* Absolute Path to Library + * const void *l_ld; /* Pointer to .dynamic in memory + * struct link_map *l_next, *l_prev; /* linked list of of mapped libs + * } Link_map; + * + * struct r_debug { + * int r_version; /* not used + * struct link_map *r_map; /* list of loaded images + * void (*r_brk)(struct r_debug *, struct link_map *); + * /* pointer to break point + * enum { + * RT_CONSISTENT, /* things are stable + * RT_ADD, /* adding a shared library + * RT_DELETE /* removing a shared library + * } r_state; + * }; + * + */ + +static struct link_map_offsets * +mipsfbsd_ilp32_solib_svr4_fetch_link_map_offsets (void) +{ + static struct link_map_offsets lmo; + static struct link_map_offsets *lmp = NULL; + + if (lmp == NULL) + { + lmp = &lmo; + + lmo.r_debug_size = 16; + + lmo.r_map_offset = 4; + lmo.r_map_size = 4; + + lmo.link_map_size = 24; + + lmo.l_addr_offset = 0; + lmo.l_addr_size = 4; + + lmo.l_name_offset = 8; + lmo.l_name_size = 4; + + lmo.l_next_offset = 16; + lmo.l_next_size = 4; + + lmo.l_prev_offset = 20; + lmo.l_prev_size = 4; + } + + return lmp; +} + +static void +mipsfbsd_init_abi (struct gdbarch_info info, + struct gdbarch *gdbarch) +{ + set_gdbarch_pc_in_sigtramp (gdbarch, mipsfbsd_pc_in_sigtramp); + + set_gdbarch_get_longjmp_target (gdbarch, mipsfbsd_get_longjmp_target); + + set_gdbarch_cannot_fetch_register (gdbarch, mipsfbsd_cannot_fetch_register); + set_gdbarch_cannot_store_register (gdbarch, mipsfbsd_cannot_store_register); + + set_gdbarch_software_single_step (gdbarch, mips_software_single_step); + set_solib_svr4_fetch_link_map_offsets (gdbarch, + mipsfbsd_ilp32_solib_svr4_fetch_link_map_offsets); + set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); + set_gdbarch_in_solib_call_trampoline (gdbarch, mipsfbsd_in_stub_section); + + /* frame sniffers */ + frame_unwind_append_sniffer (gdbarch, mipsfbsd_sigtramp_frame_sniffer); + frame_unwind_append_sniffer (gdbarch, mipsfbsd_stub_frame_sniffer); + +} + +void +_initialize_mipsfbsd_tdep (void) +{ + gdbarch_register_osabi (bfd_arch_mips, 0, GDB_OSABI_FREEBSD_ELF, + mipsfbsd_init_abi); +} Added: head/contrib/gdb/gdb/mipsfbsd-tdep.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/gdb/gdb/mipsfbsd-tdep.h Sun Feb 21 17:25:00 2010 (r204174) @@ -0,0 +1,40 @@ +/*********************************************************************** +Copyright 2003-2006 Raza Microelectronics, Inc.(RMI). +This is a derived work from software originally provided by the external +entity identified below. The licensing terms and warranties specified in +the header of the original work apply to this derived work. +Contribution by RMI: +*****************************#RMI_1#**********************************/ +/* Common target dependent code for GDB on MIPS systems running NetBSD. + Copyright 2002 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef mipsfbsd_TDEP_H +#define mipsfbsd_TDEP_H + +void mipsfbsd_supply_reg (char *, int); +void mipsfbsd_fill_reg (char *, int); + +void mipsfbsd_supply_fpreg (char *, int); +void mipsfbsd_fill_fpreg (char *, int); + +#define SIZEOF_STRUCT_REG (38 * mips_regsize (current_gdbarch)) +#define SIZEOF_STRUCT_FPREG (33 * mips_regsize (current_gdbarch)) + +#endif /* mipsfbsd_TDEP_H */ From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 17:27:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAC68106566C; Sun, 21 Feb 2010 17:27:20 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 997C68FC16; Sun, 21 Feb 2010 17:27:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1LHRK0x089927; Sun, 21 Feb 2010 17:27:20 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1LHRK2J089925; Sun, 21 Feb 2010 17:27:20 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201002211727.o1LHRK2J089925@svn.freebsd.org> From: Randall Stewart Date: Sun, 21 Feb 2010 17:27:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204175 - head/sys/mips/rmi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 17:27:20 -0000 Author: rrs Date: Sun Feb 21 17:27:20 2010 New Revision: 204175 URL: http://svn.freebsd.org/changeset/base/204175 Log: Fix another fo-pa of mine... duplicate patches should not be applied and randy needs coffee in the morning when working to help keep things sorted out... obviously :-) Modified: head/sys/mips/rmi/bus_space_rmi_pci.c Modified: head/sys/mips/rmi/bus_space_rmi_pci.c ============================================================================== --- head/sys/mips/rmi/bus_space_rmi_pci.c Sun Feb 21 17:25:00 2010 (r204174) +++ head/sys/mips/rmi/bus_space_rmi_pci.c Sun Feb 21 17:27:20 2010 (r204175) @@ -759,763 +759,3 @@ rmi_pci_bus_space_barrier(void *tag __un { } -/*- - * Copyright (c) 2009 RMI Corporation - * 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 -#include - -#include -#include - -static int -rmi_pci_bus_space_map(void *t, bus_addr_t addr, - bus_size_t size, int flags, - bus_space_handle_t * bshp); - -static void -rmi_pci_bus_space_unmap(void *t, bus_space_handle_t bsh, - bus_size_t size); - -static int -rmi_pci_bus_space_subregion(void *t, - bus_space_handle_t bsh, - bus_size_t offset, bus_size_t size, - bus_space_handle_t * nbshp); - -static u_int8_t -rmi_pci_bus_space_read_1(void *t, - bus_space_handle_t handle, - bus_size_t offset); - -static u_int16_t -rmi_pci_bus_space_read_2(void *t, - bus_space_handle_t handle, - bus_size_t offset); - -static u_int32_t -rmi_pci_bus_space_read_4(void *t, - bus_space_handle_t handle, - bus_size_t offset); - -static void -rmi_pci_bus_space_read_multi_1(void *t, - bus_space_handle_t handle, - bus_size_t offset, u_int8_t * addr, - size_t count); - -static void -rmi_pci_bus_space_read_multi_2(void *t, - bus_space_handle_t handle, - bus_size_t offset, u_int16_t * addr, - size_t count); - -static void -rmi_pci_bus_space_read_multi_4(void *t, - bus_space_handle_t handle, - bus_size_t offset, u_int32_t * addr, - size_t count); - -static void -rmi_pci_bus_space_read_region_1(void *t, - bus_space_handle_t bsh, - bus_size_t offset, u_int8_t * addr, - size_t count); - -static void -rmi_pci_bus_space_read_region_2(void *t, - bus_space_handle_t bsh, - bus_size_t offset, u_int16_t * addr, - size_t count); - -static void -rmi_pci_bus_space_read_region_4(void *t, - bus_space_handle_t bsh, - bus_size_t offset, u_int32_t * addr, - size_t count); - -static void -rmi_pci_bus_space_write_1(void *t, - bus_space_handle_t handle, - bus_size_t offset, u_int8_t value); - -static void -rmi_pci_bus_space_write_2(void *t, - bus_space_handle_t handle, - bus_size_t offset, u_int16_t value); - -static void -rmi_pci_bus_space_write_4(void *t, - bus_space_handle_t handle, - bus_size_t offset, u_int32_t value); - -static void -rmi_pci_bus_space_write_multi_1(void *t, - bus_space_handle_t handle, - bus_size_t offset, - const u_int8_t * addr, - size_t count); - -static void -rmi_pci_bus_space_write_multi_2(void *t, - bus_space_handle_t handle, - bus_size_t offset, - const u_int16_t * addr, - size_t count); - -static void -rmi_pci_bus_space_write_multi_4(void *t, - bus_space_handle_t handle, - bus_size_t offset, - const u_int32_t * addr, - size_t count); - -static void -rmi_pci_bus_space_write_region_2(void *t, - bus_space_handle_t bsh, - bus_size_t offset, - const u_int16_t * addr, - size_t count); - -static void -rmi_pci_bus_space_write_region_4(void *t, - bus_space_handle_t bsh, - bus_size_t offset, - const u_int32_t * addr, - size_t count); - - -static void -rmi_pci_bus_space_set_region_2(void *t, - bus_space_handle_t bsh, - bus_size_t offset, u_int16_t value, - size_t count); -static void -rmi_pci_bus_space_set_region_4(void *t, - bus_space_handle_t bsh, - bus_size_t offset, u_int32_t value, - size_t count); - -static void -rmi_pci_bus_space_barrier(void *tag __unused, bus_space_handle_t bsh __unused, - bus_size_t offset __unused, bus_size_t len __unused, int flags); - -static void -rmi_pci_bus_space_copy_region_2(void *t, - bus_space_handle_t bsh1, - bus_size_t off1, - bus_space_handle_t bsh2, - bus_size_t off2, size_t count); - -u_int8_t -rmi_pci_bus_space_read_stream_1(void *t, bus_space_handle_t handle, - bus_size_t offset); - -static u_int16_t -rmi_pci_bus_space_read_stream_2(void *t, bus_space_handle_t handle, - bus_size_t offset); - -static u_int32_t -rmi_pci_bus_space_read_stream_4(void *t, bus_space_handle_t handle, - bus_size_t offset); -static void -rmi_pci_bus_space_read_multi_stream_1(void *t, - bus_space_handle_t handle, - bus_size_t offset, u_int8_t * addr, - size_t count); - -static void -rmi_pci_bus_space_read_multi_stream_2(void *t, - bus_space_handle_t handle, - bus_size_t offset, u_int16_t * addr, - size_t count); - -static void -rmi_pci_bus_space_read_multi_stream_4(void *t, - bus_space_handle_t handle, - bus_size_t offset, u_int32_t * addr, - size_t count); - -void -rmi_pci_bus_space_write_stream_1(void *t, bus_space_handle_t bsh, - bus_size_t offset, u_int8_t value); -static void -rmi_pci_bus_space_write_stream_2(void *t, bus_space_handle_t handle, - bus_size_t offset, u_int16_t value); - -static void -rmi_pci_bus_space_write_stream_4(void *t, bus_space_handle_t handle, - bus_size_t offset, u_int32_t value); - -static void -rmi_pci_bus_space_write_multi_stream_1(void *t, - bus_space_handle_t handle, - bus_size_t offset, - const u_int8_t * addr, - size_t count); -static void -rmi_pci_bus_space_write_multi_stream_2(void *t, - bus_space_handle_t handle, - bus_size_t offset, - const u_int16_t * addr, - size_t count); - -static void -rmi_pci_bus_space_write_multi_stream_4(void *t, - bus_space_handle_t handle, - bus_size_t offset, - const u_int32_t * addr, - size_t count); - -#define TODO() printf("XLR memory bus space function '%s' unimplemented\n", __func__) - -static struct bus_space local_rmi_pci_bus_space = { - /* cookie */ - (void *)0, - - /* mapping/unmapping */ - rmi_pci_bus_space_map, - rmi_pci_bus_space_unmap, - rmi_pci_bus_space_subregion, - - /* allocation/deallocation */ - NULL, - NULL, - - /* barrier */ - rmi_pci_bus_space_barrier, - - /* read (single) */ - rmi_pci_bus_space_read_1, - rmi_pci_bus_space_read_2, - rmi_pci_bus_space_read_4, - NULL, - - /* read multiple */ - rmi_pci_bus_space_read_multi_1, - rmi_pci_bus_space_read_multi_2, - rmi_pci_bus_space_read_multi_4, - NULL, - - /* read region */ - rmi_pci_bus_space_read_region_1, - rmi_pci_bus_space_read_region_2, - rmi_pci_bus_space_read_region_4, - NULL, - - /* write (single) */ - rmi_pci_bus_space_write_1, - rmi_pci_bus_space_write_2, - rmi_pci_bus_space_write_4, - NULL, - - /* write multiple */ - rmi_pci_bus_space_write_multi_1, - rmi_pci_bus_space_write_multi_2, - rmi_pci_bus_space_write_multi_4, - NULL, - - /* write region */ - NULL, - rmi_pci_bus_space_write_region_2, - rmi_pci_bus_space_write_region_4, - NULL, - - /* set multiple */ - NULL, - NULL, - NULL, - NULL, - - /* set region */ - NULL, - rmi_pci_bus_space_set_region_2, - rmi_pci_bus_space_set_region_4, - NULL, - - /* copy */ - NULL, - rmi_pci_bus_space_copy_region_2, - NULL, - NULL, - - /* read (single) stream */ - rmi_pci_bus_space_read_stream_1, - rmi_pci_bus_space_read_stream_2, - rmi_pci_bus_space_read_stream_4, - NULL, - - /* read multiple stream */ - rmi_pci_bus_space_read_multi_stream_1, - rmi_pci_bus_space_read_multi_stream_2, - rmi_pci_bus_space_read_multi_stream_4, - NULL, - - /* read region stream */ - rmi_pci_bus_space_read_region_1, - rmi_pci_bus_space_read_region_2, - rmi_pci_bus_space_read_region_4, - NULL, - - /* write (single) stream */ - rmi_pci_bus_space_write_stream_1, - rmi_pci_bus_space_write_stream_2, - rmi_pci_bus_space_write_stream_4, - NULL, - - /* write multiple stream */ - rmi_pci_bus_space_write_multi_stream_1, - rmi_pci_bus_space_write_multi_stream_2, - rmi_pci_bus_space_write_multi_stream_4, - NULL, - - /* write region stream */ - NULL, - rmi_pci_bus_space_write_region_2, - rmi_pci_bus_space_write_region_4, - NULL, -}; - -/* generic bus_space tag */ -bus_space_tag_t rmi_pci_bus_space = &local_rmi_pci_bus_space; - -/* - * Map a region of device bus space into CPU virtual address space. - */ -static int -rmi_pci_bus_space_map(void *t __unused, bus_addr_t addr, - bus_size_t size __unused, int flags __unused, - bus_space_handle_t * bshp) -{ - *bshp = addr; - return (0); -} - -/* - * Unmap a region of device bus space. - */ -static void -rmi_pci_bus_space_unmap(void *t __unused, bus_space_handle_t bsh __unused, - bus_size_t size __unused) -{ -} - -/* - * Get a new handle for a subregion of an already-mapped area of bus space. - */ - -static int -rmi_pci_bus_space_subregion(void *t __unused, bus_space_handle_t bsh, - bus_size_t offset, bus_size_t size __unused, - bus_space_handle_t * nbshp) -{ - *nbshp = bsh + offset; - return (0); -} - -/* - * Read a 1, 2, 4, or 8 byte quantity from bus space - * described by tag/handle/offset. - */ - -static u_int8_t -rmi_pci_bus_space_read_1(void *tag, bus_space_handle_t handle, - bus_size_t offset) -{ - return (u_int8_t) (*(volatile u_int8_t *)(handle + offset)); -} - -static u_int16_t -rmi_pci_bus_space_read_2(void *tag, bus_space_handle_t handle, - bus_size_t offset) -{ - return bswap16((u_int16_t) (*(volatile u_int16_t *)(handle + offset))); -} - -static u_int32_t -rmi_pci_bus_space_read_4(void *tag, bus_space_handle_t handle, - bus_size_t offset) -{ - return bswap32((*(volatile u_int32_t *)(handle + offset))); -} - - -/* - * Read `count' 1, 2, 4, or 8 byte quantities from bus space - * described by tag/handle/offset and copy into buffer provided. - */ -static void -rmi_pci_bus_space_read_multi_1(void *tag, bus_space_handle_t handle, - bus_size_t offset, u_int8_t * addr, size_t count) -{ - while (count--) { - *addr = (*(volatile u_int8_t *)(handle + offset)); - addr++; - } -} - -static void -rmi_pci_bus_space_read_multi_2(void *tag, bus_space_handle_t handle, - bus_size_t offset, u_int16_t * addr, size_t count) -{ - - while (count--) { - *addr = *(volatile u_int16_t *)(handle + offset); - *addr = bswap16(*addr); - addr++; - } -} - -static void -rmi_pci_bus_space_read_multi_4(void *tag, bus_space_handle_t handle, - bus_size_t offset, u_int32_t * addr, size_t count) -{ - - while (count--) { - *addr = *(volatile u_int32_t *)(handle + offset); - *addr = bswap32(*addr); - addr++; - } -} - -/* - * Write the 1, 2, 4, or 8 byte value `value' to bus space - * described by tag/handle/offset. - */ - -static void -rmi_pci_bus_space_write_1(void *tag, bus_space_handle_t handle, - bus_size_t offset, u_int8_t value) -{ - mips_sync(); - *(volatile u_int8_t *)(handle + offset) = value; -} - -static void -rmi_pci_bus_space_write_2(void *tag, bus_space_handle_t handle, - bus_size_t offset, u_int16_t value) -{ - mips_sync(); - *(volatile u_int16_t *)(handle + offset) = bswap16(value); -} - - -static void -rmi_pci_bus_space_write_4(void *tag, bus_space_handle_t handle, - bus_size_t offset, u_int32_t value) -{ - mips_sync(); - *(volatile u_int32_t *)(handle + offset) = bswap32(value); -} - -/* - * Write `count' 1, 2, 4, or 8 byte quantities from the buffer - * provided to bus space described by tag/handle/offset. - */ - - -static void -rmi_pci_bus_space_write_multi_1(void *tag, bus_space_handle_t handle, - bus_size_t offset, const u_int8_t * addr, size_t count) -{ - mips_sync(); - while (count--) { - (*(volatile u_int8_t *)(handle + offset)) = *addr; - addr++; - } -} - -static void -rmi_pci_bus_space_write_multi_2(void *tag, bus_space_handle_t handle, - bus_size_t offset, const u_int16_t * addr, size_t count) -{ - mips_sync(); - while (count--) { - (*(volatile u_int16_t *)(handle + offset)) = bswap16(*addr); - addr++; - } -} - -static void -rmi_pci_bus_space_write_multi_4(void *tag, bus_space_handle_t handle, - bus_size_t offset, const u_int32_t * addr, size_t count) -{ - mips_sync(); - while (count--) { - (*(volatile u_int32_t *)(handle + offset)) = bswap32(*addr); - addr++; - } -} - -/* - * Write `count' 1, 2, 4, or 8 byte value `val' to bus space described - * by tag/handle starting at `offset'. - */ - -static void -rmi_pci_bus_space_set_region_2(void *t, bus_space_handle_t bsh, - bus_size_t offset, u_int16_t value, size_t count) -{ - bus_addr_t addr = bsh + offset; - - for (; count != 0; count--, addr += 2) - (*(volatile u_int16_t *)(addr)) = value; -} - -static void -rmi_pci_bus_space_set_region_4(void *t, bus_space_handle_t bsh, - bus_size_t offset, u_int32_t value, size_t count) -{ - bus_addr_t addr = bsh + offset; - - for (; count != 0; count--, addr += 4) - (*(volatile u_int32_t *)(addr)) = value; -} - - -/* - * Copy `count' 1, 2, 4, or 8 byte values from bus space starting - * at tag/bsh1/off1 to bus space starting at tag/bsh2/off2. - */ -static void -rmi_pci_bus_space_copy_region_2(void *t, bus_space_handle_t bsh1, - bus_size_t off1, bus_space_handle_t bsh2, - bus_size_t off2, size_t count) -{ - TODO(); -} - -/* - * Read `count' 1, 2, 4, or 8 byte quantities from bus space - * described by tag/handle/offset and copy into buffer provided. - */ - -u_int8_t -rmi_pci_bus_space_read_stream_1(void *t, bus_space_handle_t handle, - bus_size_t offset) -{ - - return *((volatile u_int8_t *)(handle + offset)); -} - - -static u_int16_t -rmi_pci_bus_space_read_stream_2(void *t, bus_space_handle_t handle, - bus_size_t offset) -{ - return *(volatile u_int16_t *)(handle + offset); -} - - -static u_int32_t -rmi_pci_bus_space_read_stream_4(void *t, bus_space_handle_t handle, - bus_size_t offset) -{ - return (*(volatile u_int32_t *)(handle + offset)); -} - - -static void -rmi_pci_bus_space_read_multi_stream_1(void *tag, bus_space_handle_t handle, - bus_size_t offset, u_int8_t * addr, size_t count) -{ - while (count--) { - *addr = (*(volatile u_int8_t *)(handle + offset)); - addr++; - } -} - -static void -rmi_pci_bus_space_read_multi_stream_2(void *tag, bus_space_handle_t handle, - bus_size_t offset, u_int16_t * addr, size_t count) -{ - while (count--) { - *addr = (*(volatile u_int16_t *)(handle + offset)); - addr++; - } -} - -static void -rmi_pci_bus_space_read_multi_stream_4(void *tag, bus_space_handle_t handle, - bus_size_t offset, u_int32_t * addr, size_t count) -{ - while (count--) { - *addr = (*(volatile u_int32_t *)(handle + offset)); - addr++; - } -} - - - -/* - * Read `count' 1, 2, 4, or 8 byte quantities from bus space - * described by tag/handle and starting at `offset' and copy into - * buffer provided. - */ -void -rmi_pci_bus_space_read_region_1(void *t, bus_space_handle_t bsh, - bus_size_t offset, u_int8_t * addr, size_t count) -{ - bus_addr_t baddr = bsh + offset; - - while (count--) { - *addr++ = (*(volatile u_int8_t *)(baddr)); - baddr += 1; - } -} - -void -rmi_pci_bus_space_read_region_2(void *t, bus_space_handle_t bsh, - bus_size_t offset, u_int16_t * addr, size_t count) -{ - bus_addr_t baddr = bsh + offset; - - while (count--) { - *addr++ = (*(volatile u_int16_t *)(baddr)); - baddr += 2; - } -} - -void -rmi_pci_bus_space_read_region_4(void *t, bus_space_handle_t bsh, - bus_size_t offset, u_int32_t * addr, size_t count) -{ - bus_addr_t baddr = bsh + offset; - - while (count--) { - *addr++ = (*(volatile u_int32_t *)(baddr)); - baddr += 4; - } -} - - -void -rmi_pci_bus_space_write_stream_1(void *t, bus_space_handle_t handle, - bus_size_t offset, u_int8_t value) -{ - mips_sync(); - *(volatile u_int8_t *)(handle + offset) = value; -} - -static void -rmi_pci_bus_space_write_stream_2(void *t, bus_space_handle_t handle, - bus_size_t offset, u_int16_t value) -{ - mips_sync(); - *(volatile u_int16_t *)(handle + offset) = value; -} - - -static void -rmi_pci_bus_space_write_stream_4(void *t, bus_space_handle_t handle, - bus_size_t offset, u_int32_t value) -{ - mips_sync(); - *(volatile u_int32_t *)(handle + offset) = value; -} - - -static void -rmi_pci_bus_space_write_multi_stream_1(void *tag, bus_space_handle_t handle, - bus_size_t offset, const u_int8_t * addr, size_t count) -{ - mips_sync(); - while (count--) { - (*(volatile u_int8_t *)(handle + offset)) = *addr; - addr++; - } -} - -static void -rmi_pci_bus_space_write_multi_stream_2(void *tag, bus_space_handle_t handle, - bus_size_t offset, const u_int16_t * addr, size_t count) -{ - mips_sync(); - while (count--) { - (*(volatile u_int16_t *)(handle + offset)) = *addr; - addr++; - } -} - -static void -rmi_pci_bus_space_write_multi_stream_4(void *tag, bus_space_handle_t handle, - bus_size_t offset, const u_int32_t * addr, size_t count) -{ - mips_sync(); - while (count--) { - (*(volatile u_int32_t *)(handle + offset)) = *addr; - addr++; - } -} - -void -rmi_pci_bus_space_write_region_2(void *t, - bus_space_handle_t bsh, - bus_size_t offset, - const u_int16_t * addr, - size_t count) -{ - bus_addr_t baddr = (bus_addr_t) bsh + offset; - - while (count--) { - (*(volatile u_int16_t *)(baddr)) = *addr; - addr++; - baddr += 2; - } -} - -void -rmi_pci_bus_space_write_region_4(void *t, bus_space_handle_t bsh, - bus_size_t offset, const u_int32_t * addr, size_t count) -{ - bus_addr_t baddr = bsh + offset; - - while (count--) { - (*(volatile u_int32_t *)(baddr)) = *addr; - addr++; - baddr += 4; - } -} - -static void -rmi_pci_bus_space_barrier(void *tag __unused, bus_space_handle_t bsh __unused, - bus_size_t offset __unused, bus_size_t len __unused, int flags) -{ - -} From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 19:53:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E65F9106568D; Sun, 21 Feb 2010 19:53:33 +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 D3DCE8FC1C; Sun, 21 Feb 2010 19:53:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1LJrXhY022483; Sun, 21 Feb 2010 19:53:33 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1LJrXBA022479; Sun, 21 Feb 2010 19:53:33 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201002211953.o1LJrXBA022479@svn.freebsd.org> From: Ed Schouten Date: Sun, 21 Feb 2010 19:53: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: r204176 - in head/sys: conf kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 19:53:34 -0000 Author: ed Date: Sun Feb 21 19:53:33 2010 New Revision: 204176 URL: http://svn.freebsd.org/changeset/base/204176 Log: Decompose the most lousy named file in sys/kern; kern_subr.c. Although this file has historically been used as a dumping ground for random functions, nowadays it only contains functions related to copying bits {from,to} userspace and hash table utility functions. Behold, subr_uio.c and subr_hash.c. Added: head/sys/kern/subr_hash.c - copied, changed from r204168, head/sys/kern/kern_subr.c head/sys/kern/subr_uio.c - copied, changed from r204168, head/sys/kern/kern_subr.c Deleted: head/sys/kern/kern_subr.c Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Feb 21 17:27:20 2010 (r204175) +++ head/sys/conf/files Sun Feb 21 19:53:33 2010 (r204176) @@ -2084,7 +2084,6 @@ kern/kern_sdt.c optional kdtrace_hooks kern/kern_sema.c standard kern/kern_shutdown.c standard kern/kern_sig.c standard -kern/kern_subr.c standard kern/kern_switch.c standard kern/kern_sx.c standard kern/kern_synch.c standard @@ -2121,6 +2120,7 @@ kern/subr_disk.c standard kern/subr_eventhandler.c standard kern/subr_fattime.c standard kern/subr_firmware.c optional firmware +kern/subr_hash.c standard kern/subr_hints.c standard kern/subr_kdb.c standard kern/subr_kobj.c standard @@ -2146,6 +2146,7 @@ kern/subr_stack.c optional ddb | stack kern/subr_taskqueue.c standard kern/subr_trap.c standard kern/subr_turnstile.c standard +kern/subr_uio.c standard kern/subr_unit.c standard kern/subr_witness.c optional witness kern/sys_generic.c standard Copied and modified: head/sys/kern/subr_hash.c (from r204168, head/sys/kern/kern_subr.c) ============================================================================== --- head/sys/kern/kern_subr.c Sun Feb 21 11:22:01 2010 (r204168, copy source) +++ head/sys/kern/subr_hash.c Sun Feb 21 19:53:33 2010 (r204176) @@ -37,328 +37,9 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_zero.h" - #include #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include - -#include -#include -#include -#ifdef ZERO_COPY_SOCKETS -#include -#include -#endif - -SYSCTL_INT(_kern, KERN_IOV_MAX, iov_max, CTLFLAG_RD, NULL, UIO_MAXIOV, - "Maximum number of elements in an I/O vector; sysconf(_SC_IOV_MAX)"); - -#ifdef ZERO_COPY_SOCKETS -/* Declared in uipc_socket.c */ -extern int so_zero_copy_receive; - -/* - * Identify the physical page mapped at the given kernel virtual - * address. Insert this physical page into the given address space at - * the given virtual address, replacing the physical page, if any, - * that already exists there. - */ -static int -vm_pgmoveco(vm_map_t mapa, vm_offset_t kaddr, vm_offset_t uaddr) -{ - vm_map_t map = mapa; - vm_page_t kern_pg, user_pg; - vm_object_t uobject; - vm_map_entry_t entry; - vm_pindex_t upindex; - vm_prot_t prot; - boolean_t wired; - - KASSERT((uaddr & PAGE_MASK) == 0, - ("vm_pgmoveco: uaddr is not page aligned")); - - /* - * Herein the physical page is validated and dirtied. It is - * unwired in sf_buf_mext(). - */ - kern_pg = PHYS_TO_VM_PAGE(vtophys(kaddr)); - kern_pg->valid = VM_PAGE_BITS_ALL; - KASSERT(kern_pg->queue == PQ_NONE && kern_pg->wire_count == 1, - ("vm_pgmoveco: kern_pg is not correctly wired")); - - if ((vm_map_lookup(&map, uaddr, - VM_PROT_WRITE, &entry, &uobject, - &upindex, &prot, &wired)) != KERN_SUCCESS) { - return(EFAULT); - } - VM_OBJECT_LOCK(uobject); -retry: - if ((user_pg = vm_page_lookup(uobject, upindex)) != NULL) { - if (vm_page_sleep_if_busy(user_pg, TRUE, "vm_pgmoveco")) - goto retry; - vm_page_lock_queues(); - pmap_remove_all(user_pg); - vm_page_free(user_pg); - } else { - /* - * Even if a physical page does not exist in the - * object chain's first object, a physical page from a - * backing object may be mapped read only. - */ - if (uobject->backing_object != NULL) - pmap_remove(map->pmap, uaddr, uaddr + PAGE_SIZE); - vm_page_lock_queues(); - } - vm_page_insert(kern_pg, uobject, upindex); - vm_page_dirty(kern_pg); - vm_page_unlock_queues(); - VM_OBJECT_UNLOCK(uobject); - vm_map_lookup_done(map, entry); - return(KERN_SUCCESS); -} -#endif /* ZERO_COPY_SOCKETS */ - -int -uiomove(void *cp, int n, struct uio *uio) -{ - struct thread *td = curthread; - struct iovec *iov; - u_int cnt; - int error = 0; - int save = 0; - - KASSERT(uio->uio_rw == UIO_READ || uio->uio_rw == UIO_WRITE, - ("uiomove: mode")); - KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread, - ("uiomove proc")); - WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, - "Calling uiomove()"); - - save = td->td_pflags & TDP_DEADLKTREAT; - td->td_pflags |= TDP_DEADLKTREAT; - - while (n > 0 && uio->uio_resid) { - iov = uio->uio_iov; - cnt = iov->iov_len; - if (cnt == 0) { - uio->uio_iov++; - uio->uio_iovcnt--; - continue; - } - if (cnt > n) - cnt = n; - - switch (uio->uio_segflg) { - - case UIO_USERSPACE: - if (ticks - PCPU_GET(switchticks) >= hogticks) - uio_yield(); - if (uio->uio_rw == UIO_READ) - error = copyout(cp, iov->iov_base, cnt); - else - error = copyin(iov->iov_base, cp, cnt); - if (error) - goto out; - break; - - case UIO_SYSSPACE: - if (uio->uio_rw == UIO_READ) - bcopy(cp, iov->iov_base, cnt); - else - bcopy(iov->iov_base, cp, cnt); - break; - case UIO_NOCOPY: - break; - } - iov->iov_base = (char *)iov->iov_base + cnt; - iov->iov_len -= cnt; - uio->uio_resid -= cnt; - uio->uio_offset += cnt; - cp = (char *)cp + cnt; - n -= cnt; - } -out: - if (save == 0) - td->td_pflags &= ~TDP_DEADLKTREAT; - return (error); -} - -/* - * Wrapper for uiomove() that validates the arguments against a known-good - * kernel buffer. Currently, uiomove accepts a signed (n) argument, which - * is almost definitely a bad thing, so we catch that here as well. We - * return a runtime failure, but it might be desirable to generate a runtime - * assertion failure instead. - */ -int -uiomove_frombuf(void *buf, int buflen, struct uio *uio) -{ - unsigned int offset, n; - - if (uio->uio_offset < 0 || uio->uio_resid < 0 || - (offset = uio->uio_offset) != uio->uio_offset) - return (EINVAL); - if (buflen <= 0 || offset >= buflen) - return (0); - if ((n = buflen - offset) > INT_MAX) - return (EINVAL); - return (uiomove((char *)buf + offset, n, uio)); -} - -#ifdef ZERO_COPY_SOCKETS -/* - * Experimental support for zero-copy I/O - */ -static int -userspaceco(void *cp, u_int cnt, struct uio *uio, int disposable) -{ - struct iovec *iov; - int error; - - iov = uio->uio_iov; - if (uio->uio_rw == UIO_READ) { - if ((so_zero_copy_receive != 0) - && ((cnt & PAGE_MASK) == 0) - && ((((intptr_t) iov->iov_base) & PAGE_MASK) == 0) - && ((uio->uio_offset & PAGE_MASK) == 0) - && ((((intptr_t) cp) & PAGE_MASK) == 0) - && (disposable != 0)) { - /* SOCKET: use page-trading */ - /* - * We only want to call vm_pgmoveco() on - * disposeable pages, since it gives the - * kernel page to the userland process. - */ - error = vm_pgmoveco(&curproc->p_vmspace->vm_map, - (vm_offset_t)cp, (vm_offset_t)iov->iov_base); - - /* - * If we get an error back, attempt - * to use copyout() instead. The - * disposable page should be freed - * automatically if we weren't able to move - * it into userland. - */ - if (error != 0) - error = copyout(cp, iov->iov_base, cnt); - } else { - error = copyout(cp, iov->iov_base, cnt); - } - } else { - error = copyin(iov->iov_base, cp, cnt); - } - return (error); -} - -int -uiomoveco(void *cp, int n, struct uio *uio, int disposable) -{ - struct iovec *iov; - u_int cnt; - int error; - - KASSERT(uio->uio_rw == UIO_READ || uio->uio_rw == UIO_WRITE, - ("uiomoveco: mode")); - KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread, - ("uiomoveco proc")); - - while (n > 0 && uio->uio_resid) { - iov = uio->uio_iov; - cnt = iov->iov_len; - if (cnt == 0) { - uio->uio_iov++; - uio->uio_iovcnt--; - continue; - } - if (cnt > n) - cnt = n; - - switch (uio->uio_segflg) { - - case UIO_USERSPACE: - if (ticks - PCPU_GET(switchticks) >= hogticks) - uio_yield(); - - error = userspaceco(cp, cnt, uio, disposable); - - if (error) - return (error); - break; - - case UIO_SYSSPACE: - if (uio->uio_rw == UIO_READ) - bcopy(cp, iov->iov_base, cnt); - else - bcopy(iov->iov_base, cp, cnt); - break; - case UIO_NOCOPY: - break; - } - iov->iov_base = (char *)iov->iov_base + cnt; - iov->iov_len -= cnt; - uio->uio_resid -= cnt; - uio->uio_offset += cnt; - cp = (char *)cp + cnt; - n -= cnt; - } - return (0); -} -#endif /* ZERO_COPY_SOCKETS */ - -/* - * Give next character to user as result of read. - */ -int -ureadc(int c, struct uio *uio) -{ - struct iovec *iov; - char *iov_base; - - WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, - "Calling ureadc()"); - -again: - if (uio->uio_iovcnt == 0 || uio->uio_resid == 0) - panic("ureadc"); - iov = uio->uio_iov; - if (iov->iov_len == 0) { - uio->uio_iovcnt--; - uio->uio_iov++; - goto again; - } - switch (uio->uio_segflg) { - - case UIO_USERSPACE: - if (subyte(iov->iov_base, c) < 0) - return (EFAULT); - break; - - case UIO_SYSSPACE: - iov_base = iov->iov_base; - *iov_base = c; - iov->iov_base = iov_base; - break; - - case UIO_NOCOPY: - break; - } - iov->iov_base = (char *)iov->iov_base + 1; - iov->iov_len--; - uio->uio_resid--; - uio->uio_offset++; - return (0); -} /* * General routine to allocate a hash table with control of memory flags. @@ -449,123 +130,3 @@ phashinit(int elements, struct malloc_ty *nentries = hashsize; return (hashtbl); } - -void -uio_yield(void) -{ - struct thread *td; - - td = curthread; - DROP_GIANT(); - thread_lock(td); - sched_prio(td, td->td_user_pri); - mi_switch(SW_INVOL | SWT_RELINQUISH, NULL); - thread_unlock(td); - PICKUP_GIANT(); -} - -int -copyinfrom(const void * __restrict src, void * __restrict dst, size_t len, - int seg) -{ - int error = 0; - - switch (seg) { - case UIO_USERSPACE: - error = copyin(src, dst, len); - break; - case UIO_SYSSPACE: - bcopy(src, dst, len); - break; - default: - panic("copyinfrom: bad seg %d\n", seg); - } - return (error); -} - -int -copyinstrfrom(const void * __restrict src, void * __restrict dst, size_t len, - size_t * __restrict copied, int seg) -{ - int error = 0; - - switch (seg) { - case UIO_USERSPACE: - error = copyinstr(src, dst, len, copied); - break; - case UIO_SYSSPACE: - error = copystr(src, dst, len, copied); - break; - default: - panic("copyinstrfrom: bad seg %d\n", seg); - } - return (error); -} - -int -copyiniov(struct iovec *iovp, u_int iovcnt, struct iovec **iov, int error) -{ - u_int iovlen; - - *iov = NULL; - if (iovcnt > UIO_MAXIOV) - return (error); - iovlen = iovcnt * sizeof (struct iovec); - *iov = malloc(iovlen, M_IOV, M_WAITOK); - error = copyin(iovp, *iov, iovlen); - if (error) { - free(*iov, M_IOV); - *iov = NULL; - } - return (error); -} - -int -copyinuio(struct iovec *iovp, u_int iovcnt, struct uio **uiop) -{ - struct iovec *iov; - struct uio *uio; - u_int iovlen; - int error, i; - - *uiop = NULL; - if (iovcnt > UIO_MAXIOV) - return (EINVAL); - iovlen = iovcnt * sizeof (struct iovec); - uio = malloc(iovlen + sizeof *uio, M_IOV, M_WAITOK); - iov = (struct iovec *)(uio + 1); - error = copyin(iovp, iov, iovlen); - if (error) { - free(uio, M_IOV); - return (error); - } - uio->uio_iov = iov; - uio->uio_iovcnt = iovcnt; - uio->uio_segflg = UIO_USERSPACE; - uio->uio_offset = -1; - uio->uio_resid = 0; - for (i = 0; i < iovcnt; i++) { - if (iov->iov_len > INT_MAX - uio->uio_resid) { - free(uio, M_IOV); - return (EINVAL); - } - uio->uio_resid += iov->iov_len; - iov++; - } - *uiop = uio; - return (0); -} - -struct uio * -cloneuio(struct uio *uiop) -{ - struct uio *uio; - int iovlen; - - iovlen = uiop->uio_iovcnt * sizeof (struct iovec); - uio = malloc(iovlen + sizeof *uio, M_IOV, M_WAITOK); - *uio = *uiop; - uio->uio_iov = (struct iovec *)(uio + 1); - bcopy(uiop->uio_iov, uio->uio_iov, iovlen); - return (uio); -} Copied and modified: head/sys/kern/subr_uio.c (from r204168, head/sys/kern/kern_subr.c) ============================================================================== --- head/sys/kern/kern_subr.c Sun Feb 21 11:22:01 2010 (r204168, copy source) +++ head/sys/kern/subr_uio.c Sun Feb 21 19:53:33 2010 (r204176) @@ -42,13 +42,10 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include #include -#include -#include #include #include #include @@ -360,96 +357,6 @@ again: return (0); } -/* - * General routine to allocate a hash table with control of memory flags. - */ -void * -hashinit_flags(int elements, struct malloc_type *type, u_long *hashmask, - int flags) -{ - long hashsize; - LIST_HEAD(generic, generic) *hashtbl; - int i; - - if (elements <= 0) - panic("hashinit: bad elements"); - - /* Exactly one of HASH_WAITOK and HASH_NOWAIT must be set. */ - KASSERT((flags & HASH_WAITOK) ^ (flags & HASH_NOWAIT), - ("Bad flags (0x%x) passed to hashinit_flags", flags)); - - for (hashsize = 1; hashsize <= elements; hashsize <<= 1) - continue; - hashsize >>= 1; - - if (flags & HASH_NOWAIT) - hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl), - type, M_NOWAIT); - else - hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl), - type, M_WAITOK); - - if (hashtbl != NULL) { - for (i = 0; i < hashsize; i++) - LIST_INIT(&hashtbl[i]); - *hashmask = hashsize - 1; - } - return (hashtbl); -} - -/* - * Allocate and initialize a hash table with default flag: may sleep. - */ -void * -hashinit(int elements, struct malloc_type *type, u_long *hashmask) -{ - - return (hashinit_flags(elements, type, hashmask, HASH_WAITOK)); -} - -void -hashdestroy(void *vhashtbl, struct malloc_type *type, u_long hashmask) -{ - LIST_HEAD(generic, generic) *hashtbl, *hp; - - hashtbl = vhashtbl; - for (hp = hashtbl; hp <= &hashtbl[hashmask]; hp++) - if (!LIST_EMPTY(hp)) - panic("hashdestroy: hash not empty"); - free(hashtbl, type); -} - -static const int primes[] = { 1, 13, 31, 61, 127, 251, 509, 761, 1021, 1531, - 2039, 2557, 3067, 3583, 4093, 4603, 5119, 5623, 6143, - 6653, 7159, 7673, 8191, 12281, 16381, 24571, 32749 }; -#define NPRIMES (sizeof(primes) / sizeof(primes[0])) - -/* - * General routine to allocate a prime number sized hash table. - */ -void * -phashinit(int elements, struct malloc_type *type, u_long *nentries) -{ - long hashsize; - LIST_HEAD(generic, generic) *hashtbl; - int i; - - if (elements <= 0) - panic("phashinit: bad elements"); - for (i = 1, hashsize = primes[1]; hashsize <= elements;) { - i++; - if (i == NPRIMES) - break; - hashsize = primes[i]; - } - hashsize = primes[i - 1]; - hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl), type, M_WAITOK); - for (i = 0; i < hashsize; i++) - LIST_INIT(&hashtbl[i]); - *nentries = hashsize; - return (hashtbl); -} - void uio_yield(void) { From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 19:56:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 686A5106566C; Sun, 21 Feb 2010 19:56:47 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 572828FC14; Sun, 21 Feb 2010 19:56:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1LJulWJ023221; Sun, 21 Feb 2010 19:56:47 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1LJul9N023219; Sun, 21 Feb 2010 19:56:47 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201002211956.o1LJul9N023219@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 21 Feb 2010 19:56: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: r204177 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 19:56:47 -0000 Author: pjd Date: Sun Feb 21 19:56:47 2010 New Revision: 204177 URL: http://svn.freebsd.org/changeset/base/204177 Log: Changing proto_socketpair.c compilation and linking order revealed a problem - we should simply ignore proto_server() if address doesn't start with socketpair://, and not abort. Modified: head/sbin/hastd/proto_socketpair.c Modified: head/sbin/hastd/proto_socketpair.c ============================================================================== --- head/sbin/hastd/proto_socketpair.c Sun Feb 21 19:53:33 2010 (r204176) +++ head/sbin/hastd/proto_socketpair.c Sun Feb 21 19:56:47 2010 (r204177) @@ -91,9 +91,12 @@ sp_connect(void *ctx __unused) } static int -sp_server(const char *addr __unused, void **ctxp __unused) +sp_server(const char *addr, void **ctxp __unused) { + if (strcmp(addr, "socketpair://") != 0) + return (-1); + assert(!"proto_server() not supported on socketpairs"); abort(); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 21:03:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68C5C1065676; Sun, 21 Feb 2010 21:03:15 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 570CF8FC0C; Sun, 21 Feb 2010 21:03:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1LL3FEu037891; Sun, 21 Feb 2010 21:03:15 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1LL3FGS037889; Sun, 21 Feb 2010 21:03:15 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201002212103.o1LL3FGS037889@svn.freebsd.org> From: Ulrich Spoerlein Date: Sun, 21 Feb 2010 21:03: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: r204178 - head/games/fortune/fortune X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 21:03:15 -0000 Author: uqs Date: Sun Feb 21 21:03:15 2010 New Revision: 204178 URL: http://svn.freebsd.org/changeset/base/204178 Log: Prefer exit(0) from main over return(0). Although not explicitly mentioned in style(9), it allows for easier grepping of exit points. This reverts part of r203926. Requested by: des Approved by: philip (mentor) Modified: head/games/fortune/fortune/fortune.c Modified: head/games/fortune/fortune/fortune.c ============================================================================== --- head/games/fortune/fortune/fortune.c Sun Feb 21 19:56:47 2010 (r204177) +++ head/games/fortune/fortune/fortune.c Sun Feb 21 21:03:15 2010 (r204178) @@ -216,7 +216,7 @@ main(int argc, char *argv[]) sleep((unsigned int) max(Fort_len / CPERS, MINW)); } - return (0); + exit(0); } void From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 21:03:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 899CD1065696; Sun, 21 Feb 2010 21:03:37 +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 776358FC08; Sun, 21 Feb 2010 21:03:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1LL3bCj037996; Sun, 21 Feb 2010 21:03:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1LL3b2o037994; Sun, 21 Feb 2010 21:03:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201002212103.o1LL3b2o037994@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 21 Feb 2010 21:03: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: r204179 - head/sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 21:03:37 -0000 Author: nwhitehorn Date: Sun Feb 21 21:03:37 2010 New Revision: 204179 URL: http://svn.freebsd.org/changeset/base/204179 Log: Fix several mistakes in this file, in order to allow individual fan speeds to be read and set correctly. Modified: head/sys/powerpc/powermac/smu.c Modified: head/sys/powerpc/powermac/smu.c ============================================================================== --- head/sys/powerpc/powermac/smu.c Sun Feb 21 21:03:15 2010 (r204178) +++ head/sys/powerpc/powermac/smu.c Sun Feb 21 21:03:37 2010 (r204179) @@ -58,6 +58,7 @@ struct smu_fan { cell_t max_rpm; cell_t unmanaged_rpm; char location[32]; + int old_style; }; struct smu_sensor { @@ -115,6 +116,7 @@ static void smu_cpufreq_pre_change(devic static void smu_cpufreq_post_change(device_t, const struct cf_level *level); /* utility functions */ +static int smu_run_cmd(device_t dev, struct smu_cmd *cmd); static int smu_get_datablock(device_t dev, int8_t id, uint8_t *buf, size_t len); static void smu_attach_fans(device_t dev, phandle_t fanroot); @@ -148,11 +150,12 @@ MALLOC_DEFINE(M_SMU, "smu", "SMU Sensor #define SMU_ADC 0xd8 #define SMU_FAN 0x4a #define SMU_I2C 0x9a -#define SMU_I2C_SIMPLE 0x00 -#define SMU_I2C_NORMAL 0x01 -#define SMU_I2C_COMBINED 0x02 +#define SMU_I2C_SIMPLE 0x00 +#define SMU_I2C_NORMAL 0x01 +#define SMU_I2C_COMBINED 0x02 #define SMU_MISC 0xee -#define SMU_MISC_GET_DATA 0x02 +#define SMU_MISC_GET_DATA 0x02 +#define SMU_MISC_LED_CTRL 0x04 #define SMU_POWER 0xaa /* Data blocks */ @@ -306,6 +309,7 @@ smu_run_cmd(device_t dev, struct smu_cmd powerpc_pow_enabled = oldpow; memcpy(cmd->data, sc->sc_cmd->data, sizeof(cmd->data)); + cmd->len = sc->sc_cmd->len; mtx_unlock(&sc->sc_mtx); @@ -430,21 +434,43 @@ static int smu_fan_set_rpm(device_t smu, struct smu_fan *fan, int rpm) { struct smu_cmd cmd; + int error; cmd.cmd = SMU_FAN; - cmd.len = 14; - cmd.data[0] = 0; - cmd.data[1] = 1 << fan->reg; + error = EIO; + + /* Clamp to allowed range */ + rpm = max(fan->min_rpm, rpm); + rpm = min(fan->max_rpm, rpm); /* - * There are two locations used for the fan speed. - * Store it in both. + * Apple has two fan control mechanisms. We can't distinguish + * them except by seeing if the new one fails. If the new one + * fails, use the old one. */ + + if (!fan->old_style) { + cmd.len = 4; + cmd.data[0] = 0x30; + cmd.data[1] = fan->reg; + cmd.data[2] = (rpm >> 8) & 0xff; + cmd.data[3] = rpm & 0xff; + + error = smu_run_cmd(smu, &cmd); + if (error) + fan->old_style = 1; + } - cmd.data[2] = cmd.data[2 + 2*fan->reg] = (rpm >> 8) & 0xff; - cmd.data[3] = cmd.data[3 + 2*fan->reg] = rpm & 0xff; + if (fan->old_style) { + cmd.len = 14; + cmd.data[0] = 0; + cmd.data[1] = 1 << fan->reg; + cmd.data[2 + 2*fan->reg] = (rpm >> 8) & 0xff; + cmd.data[3 + 2*fan->reg] = rpm & 0xff; + error = smu_run_cmd(smu, &cmd); + } - return (smu_run_cmd(smu, &cmd)); + return (error); } static int @@ -453,13 +479,12 @@ smu_fan_read_rpm(device_t smu, struct sm struct smu_cmd cmd; cmd.cmd = SMU_FAN; - cmd.len = 2; + cmd.len = 1; cmd.data[0] = 1; - cmd.data[1] = 1 << fan->reg; smu_run_cmd(smu, &cmd); - return ((cmd.data[1] << 8) | cmd.data[2]); + return ((cmd.data[fan->reg*2+1] << 8) | cmd.data[fan->reg*2+2]); } static int @@ -522,11 +547,15 @@ smu_attach_fans(device_t dev, phandle_t if (strcmp(type, "fan-rpm-control") != 0) continue; + fan->old_style = 0; OF_getprop(child, "reg", &fan->reg, sizeof(cell_t)); OF_getprop(child, "min-value", &fan->min_rpm, sizeof(cell_t)); OF_getprop(child, "max-value", &fan->max_rpm, sizeof(cell_t)); - OF_getprop(child, "unmanaged-value", &fan->unmanaged_rpm, - sizeof(cell_t)); + + if (OF_getprop(child, "unmanaged-value", &fan->unmanaged_rpm, + sizeof(cell_t)) != sizeof(cell_t)) + fan->unmanaged_rpm = fan->max_rpm; + OF_getprop(child, "location", fan->location, sizeof(fan->location)); @@ -661,8 +690,8 @@ smu_attach_sensors(device_t dev, phandle return; } - sc->sc_fans = malloc(sc->sc_nsensors * sizeof(struct smu_sensor), M_SMU, - M_WAITOK | M_ZERO); + sc->sc_sensors = malloc(sc->sc_nsensors * sizeof(struct smu_sensor), + M_SMU, M_WAITOK | M_ZERO); sens = sc->sc_sensors; sc->sc_nsensors = 0; From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 22:13:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6246A106566C; Sun, 21 Feb 2010 22:13:58 +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 4FACC8FC12; Sun, 21 Feb 2010 22:13:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1LMDw0j053387; Sun, 21 Feb 2010 22:13:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1LMDwtj053385; Sun, 21 Feb 2010 22:13:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201002212213.o1LMDwtj053385@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 21 Feb 2010 22:13: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: r204180 - head/sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 22:13:58 -0000 Author: nwhitehorn Date: Sun Feb 21 22:13:57 2010 New Revision: 204180 URL: http://svn.freebsd.org/changeset/base/204180 Log: Add a simple fan management callout to the SMU driver. This is designed such that a fancier thermal management algorithm can be run from user space, but the kernel will at least ensure your machine does not either sound like a wind tunnel or catch fire. Modified: head/sys/powerpc/powermac/smu.c Modified: head/sys/powerpc/powermac/smu.c ============================================================================== --- head/sys/powerpc/powermac/smu.c Sun Feb 21 21:03:37 2010 (r204179) +++ head/sys/powerpc/powermac/smu.c Sun Feb 21 22:13:57 2010 (r204180) @@ -32,10 +32,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include +#include #include #include @@ -58,7 +60,9 @@ struct smu_fan { cell_t max_rpm; cell_t unmanaged_rpm; char location[32]; + int old_style; + int setpoint; }; struct smu_sensor { @@ -92,6 +96,9 @@ struct smu_softc { struct smu_sensor *sc_sensors; int sc_nsensors; + struct callout sc_fanmgt_callout; + time_t sc_lastuserchange; + /* Calibration data */ uint16_t sc_cpu_diode_scale; int16_t sc_cpu_diode_offset; @@ -103,6 +110,10 @@ struct smu_softc { uint16_t sc_slots_pow_scale; int16_t sc_slots_pow_offset; + + /* Thermal management parameters */ + int sc_target_temp; /* Default 55 C */ + int sc_critical_temp; /* Default 90 C */ }; /* regular bus attachment functions */ @@ -121,6 +132,7 @@ static int smu_get_datablock(device_t de size_t len); static void smu_attach_fans(device_t dev, phandle_t fanroot); static void smu_attach_sensors(device_t dev, phandle_t sensroot); +static void smu_fanmgt_callout(void *xdev); /* where to find the doorbell GPIO */ @@ -145,6 +157,7 @@ DRIVER_MODULE(smu, nexus, smu_driver, sm MALLOC_DEFINE(M_SMU, "smu", "SMU Sensor Information"); #define SMU_MAILBOX 0x8000860c +#define SMU_FANMGT_INTERVAL 500 /* ms */ /* Command types */ #define SMU_ADC 0xd8 @@ -261,6 +274,24 @@ smu_attach(device_t dev) sc->sc_slots_pow_scale = (data[4] << 8) + data[5]; sc->sc_slots_pow_offset = (data[6] << 8) + data[7]; + /* + * Set up simple-minded thermal management. + */ + sc->sc_target_temp = 55; + sc->sc_critical_temp = 90; + + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "target_temp", CTLTYPE_INT | CTLFLAG_RW, &sc->sc_target_temp, + sizeof(int), "Target temperature (C)"); + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "critical_temp", CTLTYPE_INT | CTLFLAG_RW, + &sc->sc_critical_temp, sizeof(int), "Critical temperature (C)"); + + callout_init(&sc->sc_fanmgt_callout, 1); + smu_fanmgt_callout(dev); + return (0); } @@ -470,6 +501,9 @@ smu_fan_set_rpm(device_t smu, struct smu error = smu_run_cmd(smu, &cmd); } + if (error == 0) + fan->setpoint = rpm; + return (error); } @@ -505,6 +539,7 @@ smu_fanrpm_sysctl(SYSCTL_HANDLER_ARGS) if (error || !req->newptr) return (error); + sc->sc_lastuserchange = time_uptime; return (smu_fan_set_rpm(smu, fan, rpm)); } @@ -556,12 +591,11 @@ smu_attach_fans(device_t dev, phandle_t sizeof(cell_t)) != sizeof(cell_t)) fan->unmanaged_rpm = fan->max_rpm; + fan->setpoint = smu_fan_read_rpm(dev, fan); + OF_getprop(child, "location", fan->location, sizeof(fan->location)); - - /* Make sure it is at a safe value initially */ - //smu_fan_set_rpm(dev, fan, fan->unmanaged_rpm); - + /* Add sysctls */ for (i = 0; i < strlen(fan->location); i++) { sysctl_name[i] = tolower(fan->location[i]); @@ -745,3 +779,77 @@ smu_attach_sensors(device_t dev, phandle } } +static int +ms_to_ticks(int ms) +{ + if (hz > 1000) + return ms*(hz/1000); + + return ms/(1000/hz); +} + +static void +smu_fanmgt_callout(void *xdev) { + device_t smu = xdev; + struct smu_softc *sc; + int i, maxtemp, temp, factor; + + sc = device_get_softc(smu); + + if (time_uptime - sc->sc_lastuserchange < 3) { + /* + * If we have heard from a user process in the last 3 seconds, + * go away. + */ + + callout_reset(&sc->sc_fanmgt_callout, + ms_to_ticks(SMU_FANMGT_INTERVAL), smu_fanmgt_callout, smu); + return; + } + + maxtemp = 0; + for (i = 0; i < sc->sc_nsensors; i++) { + if (sc->sc_sensors[i].type != SMU_TEMP_SENSOR) + continue; + + temp = smu_sensor_read(smu, &sc->sc_sensors[i]); + if (temp > maxtemp) + maxtemp = temp; + } + + if (maxtemp < 10) { /* Bail if no good sensors */ + for (i = 0; i < sc->sc_nfans; i++) + smu_fan_set_rpm(smu, &sc->sc_fans[i], + sc->sc_fans[i].unmanaged_rpm); + return; + } + + if (maxtemp > sc->sc_critical_temp) { + device_printf(smu, "WARNING: Current system temperature (%d C) " + "exceeds critical temperature (%d C)! Shutting down!\n", + maxtemp, sc->sc_critical_temp); + shutdown_nice(RB_POWEROFF); + } + + if (maxtemp - sc->sc_target_temp > 20) + device_printf(smu, "WARNING: Current system temperature (%d C) " + "more than 20 degrees over target temperature (%d C)!\n", + maxtemp, sc->sc_target_temp); + + if (maxtemp > sc->sc_target_temp) + factor = 110; + else if (sc->sc_target_temp - maxtemp > 4) + factor = 90; + else if (sc->sc_target_temp - maxtemp > 1) + factor = 95; + else + factor = 100; + + for (i = 0; i < sc->sc_nfans; i++) + smu_fan_set_rpm(smu, &sc->sc_fans[i], + (sc->sc_fans[i].setpoint * factor) / 100); + + callout_reset(&sc->sc_fanmgt_callout, + ms_to_ticks(SMU_FANMGT_INTERVAL), smu_fanmgt_callout, smu); +} + From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 22:23:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8434106566C; Sun, 21 Feb 2010 22:23:13 +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 C73C78FC0A; Sun, 21 Feb 2010 22:23:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1LMNDVH055474; Sun, 21 Feb 2010 22:23:13 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1LMNDkJ055472; Sun, 21 Feb 2010 22:23:13 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201002212223.o1LMNDkJ055472@svn.freebsd.org> From: Alan Cox Date: Sun, 21 Feb 2010 22:23: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: r204181 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 22:23:13 -0000 Author: alc Date: Sun Feb 21 22:23:13 2010 New Revision: 204181 URL: http://svn.freebsd.org/changeset/base/204181 Log: Align the start of the clean submap to a superpage boundary. Although no superpage mappings are created within the clean submap, aligning the start of the clean submap helps to prevent interference with kmem_alloc()'s use of superpages. Modified: head/sys/vm/vm_init.c Modified: head/sys/vm/vm_init.c ============================================================================== --- head/sys/vm/vm_init.c Sun Feb 21 22:13:57 2010 (r204180) +++ head/sys/vm/vm_init.c Sun Feb 21 22:23:13 2010 (r204181) @@ -186,7 +186,7 @@ again: panic("startup: table size inconsistency"); clean_map = kmem_suballoc(kernel_map, &kmi->clean_sva, &kmi->clean_eva, - (long)nbuf * BKVASIZE + (long)nswbuf * MAXPHYS, FALSE); + (long)nbuf * BKVASIZE + (long)nswbuf * MAXPHYS, TRUE); buffer_map = kmem_suballoc(clean_map, &kmi->buffer_sva, &kmi->buffer_eva, (long)nbuf * BKVASIZE, FALSE); buffer_map->system_map = 1; From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 22:39:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 032C91065784; Sun, 21 Feb 2010 22:39:51 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id 7B3A48FC18; Sun, 21 Feb 2010 22:39:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.4/8.14.4) with ESMTP id o1LMdm1I092772; Mon, 22 Feb 2010 01:39:48 +0300 (MSK) (envelope-from marck@rinet.ru) Date: Mon, 22 Feb 2010 01:39:48 +0300 (MSK) From: Dmitry Morozovsky To: Pawel Jakub Dawidek In-Reply-To: <201002182316.o1INGKqf007786@svn.freebsd.org> Message-ID: References: <201002182316.o1INGKqf007786@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (woozle.rinet.ru [0.0.0.0]); Mon, 22 Feb 2010 01:39:48 +0300 (MSK) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r204076 - in head: etc/defaults etc/rc.d sbin sbin/ggate/ggatec sbin/ggate/ggatel sbin/hastctl sbin/hastd share/examples share/examples/hast share/man/man5 sys/geom/gate X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 22:39:51 -0000 On Thu, 18 Feb 2010, Pawel Jakub Dawidek wrote: PJD> as well as http://wiki.FreeBSD.org/HAST. Does not exist yet? Anyway, thanks a lot! -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 22:57:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FC2C106566C; Sun, 21 Feb 2010 22:57:34 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id D87FA8FC08; Sun, 21 Feb 2010 22:57:33 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.4/8.14.4) with ESMTP id o1LMvK4R093000; Mon, 22 Feb 2010 01:57:20 +0300 (MSK) (envelope-from marck@rinet.ru) Date: Mon, 22 Feb 2010 01:57:20 +0300 (MSK) From: Dmitry Morozovsky To: Pawel Jakub Dawidek In-Reply-To: Message-ID: References: <201002182316.o1INGKqf007786@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (woozle.rinet.ru [0.0.0.0]); Mon, 22 Feb 2010 01:57:20 +0300 (MSK) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r204076 - in head: etc/defaults etc/rc.d sbin sbin/ggate/ggatec sbin/ggate/ggatel sbin/hastctl sbin/hastd share/examples share/examples/hast share/man/man5 sys/geom/gate X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 22:57:34 -0000 On Mon, 22 Feb 2010, Dmitry Morozovsky wrote: DM> PJD> as well as http://wiki.FreeBSD.org/HAST. DM> DM> Does not exist yet? oops, seems wrong page was cached. sorry for the noise. -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 23:10:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC1D71065670; Sun, 21 Feb 2010 23:10:13 +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 B1E568FC0C; Sun, 21 Feb 2010 23:10:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1LNADkc065824; Sun, 21 Feb 2010 23:10:13 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1LNADoU065821; Sun, 21 Feb 2010 23:10:13 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201002212310.o1LNADoU065821@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 21 Feb 2010 23:10: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: r204182 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 23:10:14 -0000 Author: marcel Date: Sun Feb 21 23:10:13 2010 New Revision: 204182 URL: http://svn.freebsd.org/changeset/base/204182 Log: Remove pm_active from struct pmap as it serves no purpose. MFC after: 1 week Modified: head/sys/ia64/ia64/pmap.c head/sys/ia64/include/pmap.h Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Sun Feb 21 22:23:13 2010 (r204181) +++ head/sys/ia64/ia64/pmap.c Sun Feb 21 23:10:13 2010 (r204182) @@ -453,7 +453,6 @@ pmap_bootstrap() PMAP_LOCK_INIT(kernel_pmap); for (i = 0; i < 5; i++) kernel_pmap->pm_rid[i] = 0; - kernel_pmap->pm_active = 1; TAILQ_INIT(&kernel_pmap->pm_pvlist); PCPU_SET(md.current_pmap, kernel_pmap); @@ -662,7 +661,6 @@ pmap_pinit(struct pmap *pmap) PMAP_LOCK_INIT(pmap); for (i = 0; i < 5; i++) pmap->pm_rid[i] = pmap_allocate_rid(); - pmap->pm_active = 0; TAILQ_INIT(&pmap->pm_pvlist); bzero(&pmap->pm_stats, sizeof pmap->pm_stats); return (1); @@ -2246,8 +2244,6 @@ pmap_switch(pmap_t pm) prevpm = PCPU_GET(md.current_pmap); if (prevpm == pm) goto out; - if (prevpm != NULL) - atomic_clear_32(&prevpm->pm_active, PCPU_GET(cpumask)); if (pm == NULL) { for (i = 0; i < 5; i++) { ia64_set_rr(IA64_RR_BASE(i), @@ -2258,7 +2254,6 @@ pmap_switch(pmap_t pm) ia64_set_rr(IA64_RR_BASE(i), (pm->pm_rid[i] << 8)|(PAGE_SHIFT << 2)|1); } - atomic_set_32(&pm->pm_active, PCPU_GET(cpumask)); } PCPU_SET(md.current_pmap, pm); ia64_srlz_d(); Modified: head/sys/ia64/include/pmap.h ============================================================================== --- head/sys/ia64/include/pmap.h Sun Feb 21 22:23:13 2010 (r204181) +++ head/sys/ia64/include/pmap.h Sun Feb 21 23:10:13 2010 (r204182) @@ -76,7 +76,6 @@ struct pmap { struct mtx pm_mtx; TAILQ_HEAD(,pv_entry) pm_pvlist; /* list of mappings in pmap */ u_int32_t pm_rid[5]; /* base RID for pmap */ - int pm_active; /* active flag */ struct pmap_statistics pm_stats; /* pmap statistics */ }; From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 23:41:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD61C106566B; Sun, 21 Feb 2010 23:41:59 +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 9D1348FC19; Sun, 21 Feb 2010 23:41:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1LNfxEH072820; Sun, 21 Feb 2010 23:41:59 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1LNfx83072818; Sun, 21 Feb 2010 23:41:59 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201002212341.o1LNfx83072818@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 21 Feb 2010 23:41: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: r204183 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 23:41:59 -0000 Author: marcel Date: Sun Feb 21 23:41:59 2010 New Revision: 204183 URL: http://svn.freebsd.org/changeset/base/204183 Log: Normalize nop instructions: Only use 0 for the immediate operand. Modified: head/sys/ia64/ia64/context.S Modified: head/sys/ia64/ia64/context.S ============================================================================== --- head/sys/ia64/ia64/context.S Sun Feb 21 23:10:13 2010 (r204182) +++ head/sys/ia64/ia64/context.S Sun Feb 21 23:41:59 2010 (r204183) @@ -86,18 +86,18 @@ ENTRY(restorectx, 1) { .mmi ld8.fill r6=[r14],16 // r6 ld8.fill r7=[r15],16 // r7 - nop 1 + nop 0 ;; } { .mmi mov ar.unat=r16 mov ar.rsc=3 - nop 2 + nop 0 } { .mmi ld8 r17=[r14],16 // b1 ld8 r18=[r15],16 // b2 - nop 3 + nop 0 ;; } { .mmi From owner-svn-src-head@FreeBSD.ORG Sun Feb 21 23:55:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02FB41065670; Sun, 21 Feb 2010 23:55:50 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-qy0-f172.google.com (mail-qy0-f172.google.com [209.85.221.172]) by mx1.freebsd.org (Postfix) with ESMTP id 7F5478FC08; Sun, 21 Feb 2010 23:55:49 +0000 (UTC) Received: by qyk2 with SMTP id 2so986007qyk.20 for ; Sun, 21 Feb 2010 15:55:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=s3i9KLKrgPBWGUP8umybwRlcP+lxSvuuclAFfe6+fRQ=; b=OEXw+2fnE/LIScdljJvCmMNbcTvcP/mnxEwLlG6dfvUSHRAhSK4X2wYU0QoVpfnyc6 2A2OA/3VXvNGI3UOBbE0d4gwimi9agFib2OFyP+hamlMtCRhGYNyyPabXa6El8jwu3Po FzGFZ6zXSXb/tXWbgfpUf6dGObfpThYjqCDoI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=StjkLMp22dDlelp7sp+TDMgF+w+ur2znmexsHWwK5J8HcrELcGiDYxP1mdNLBDc0B9 URGpXR3rjL5e6KD+EA+lt2uazhDW22hPS54inXwffiesj5y47ELqzQjrfeiyZzpLz5ap U0Z/1OzvOeChNW9tlt2VnWtvQkLY2UGcS6qVE= Received: by 10.229.218.204 with SMTP id hr12mr3156943qcb.101.1266796542923; Sun, 21 Feb 2010 15:55:42 -0800 (PST) Received: from ?192.168.0.226? (deviant.freebsdgirl.com [173.8.183.73]) by mx.google.com with ESMTPS id 22sm2108579qyk.2.2010.02.21.15.55.40 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 21 Feb 2010 15:55:41 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Garrett Cooper In-Reply-To: <20100220115838.GB94735@FreeBSD.org> Date: Sun, 21 Feb 2010 15:55:08 -0800 Content-Transfer-Encoding: 7bit Message-Id: References: <201002192354.o1JNsCZJ035886@svn.freebsd.org> <20100220115838.GB94735@FreeBSD.org> To: Alexey Dokuchaev X-Mailer: Apple Mail (2.1077) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI Subject: Re: svn commit: r204103 - in head/usr.bin: . seq X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2010 23:55:50 -0000 On Feb 20, 2010, at 3:58 AM, Alexey Dokuchaev wrote: > On Fri, Feb 19, 2010 at 11:54:12PM +0000, Xin LI wrote: >> Author: delphij >> Date: Fri Feb 19 23:54:12 2010 >> New Revision: 204103 >> URL: http://svn.freebsd.org/changeset/base/204103 >> >> Log: >> Add seq(1), a small utility to generate sequence number. > > Why do we need this when we have jot(1)? > > ./danfe Agreed. FreeBSD isn't Linux (seq is a non-standard GNU tool). -Garrett From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 01:23:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 279B3106566B; Mon, 22 Feb 2010 01:23:42 +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 0E87F8FC12; Mon, 22 Feb 2010 01:23:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1M1Nf7k095148; Mon, 22 Feb 2010 01:23:41 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1M1NfJQ095142; Mon, 22 Feb 2010 01:23:41 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201002220123.o1M1NfJQ095142@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 22 Feb 2010 01:23: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: r204184 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 01:23:42 -0000 Author: marcel Date: Mon Feb 22 01:23:41 2010 New Revision: 204184 URL: http://svn.freebsd.org/changeset/base/204184 Log: Prefer I-units and M-units for nop instructions. This works around McKinley flaws. It also avoids using the F-unit in the kernel for no reason. Modified: head/sys/ia64/ia64/context.S head/sys/ia64/ia64/exception.S head/sys/ia64/ia64/locore.S head/sys/ia64/ia64/support.S head/sys/ia64/ia64/syscall.S Modified: head/sys/ia64/ia64/context.S ============================================================================== --- head/sys/ia64/ia64/context.S Sun Feb 21 23:41:59 2010 (r204183) +++ head/sys/ia64/ia64/context.S Mon Feb 22 01:23:41 2010 (r204184) @@ -286,7 +286,7 @@ ENTRY(swapctx, 2) (p15) br.ret.sptk rp ;; } -{ .mfb +{ .mib mov r32=r33 nop 0 br.sptk restorectx @@ -338,10 +338,10 @@ ENTRY(save_callee_saved, 1) mov r17=b5 ;; } -{ .mfi +{ .mii st8 [r14]=r17,16 // b5 - nop 0 mov r16=ar.lc + nop 0 ;; } { .mmb @@ -363,13 +363,13 @@ ENTRY(restore_callee_saved, 1) add r31=-8,r32 ;; } -{ .mmb +{ .mmi ld8.fill r4=[r31],16 // r4 ld8.fill r5=[r32],16 // r5 nop 0 ;; } -{ .mmb +{ .mmi ld8.fill r6=[r31],16 // r6 ld8.fill r7=[r32],16 // r7 nop 0 Modified: head/sys/ia64/ia64/exception.S ============================================================================== --- head/sys/ia64/ia64/exception.S Sun Feb 21 23:41:59 2010 (r204183) +++ head/sys/ia64/ia64/exception.S Mon Feb 22 01:23:41 2010 (r204184) @@ -89,10 +89,10 @@ xhead: data8 xtrace addl r29=1024*5*8,r0 ;; \ (p15) sub r27=r28,r29 ;; \ } ; \ -{ .mib ; \ +{ .mmi ; \ st8 [r28]=r27 ; \ - mov pr=r25,0x1ffff ; \ - nop 0 ;; \ + nop 0 ; \ + mov pr=r25,0x1ffff ;; \ } #else @@ -148,10 +148,10 @@ ENTRY_NOPROFILE(exception_save, 0) add r31=8,r30 ;; } -{ .mib +{ .mmi mov r22=cr.iip - addl r29=NTLBRT_SAVE,r0 // 22-bit restart token. nop 0 + addl r29=NTLBRT_SAVE,r0 // 22-bit restart token. ;; } @@ -235,7 +235,7 @@ exception_save_restart: nop 0 ;; } -{ .mmb +{ .mmi (p13) mov ar.rnat=r19 mov r18=ar.bsp nop 0 @@ -248,7 +248,7 @@ exception_save_restart: ;; } // r19=ifs, r22=iip -{ .mmb +{ .mmi st8 [r31]=r18,16 // ndirty st8 [r30]=r19,16 // cfm nop 0 @@ -260,7 +260,7 @@ exception_save_restart: add r29=16,r30 ;; } -{ .mmb +{ .mmi st8 [r30]=r17,24 // ifa st8 [r31]=r18,24 // isr nop 0 @@ -407,7 +407,7 @@ exception_save_restart: movl gp=__gp ;; } -{ .mfb +{ .mib srlz.d nop 0 br.sptk b7 @@ -567,7 +567,7 @@ ENTRY_NOPROFILE(exception_restore, 0) cmp.le p14,p15=5,r28 ;; } -{ .mmb +{ .mmi ld8 r25=[r30] // cfm ld8 r19=[r31] // ip nop 0 @@ -606,13 +606,13 @@ exception_restore_restart: dep r31=0,r31,0,13 // 8KB aligned ;; } -{ .mmb +{ .mmi mov ar.k6=r31 mov ar.rnat=r21 nop 0 ;; } -{ .mmb +{ .mmi mov ar.unat=r17 mov cr.iip=r19 nop 0 @@ -656,7 +656,7 @@ END(exception_restore) add out1=16,sp ; \ br.call.sptk rp=_func_ ;; \ } ; \ -{ .mfb ; \ +{ .mib ; \ nop 0 ; \ nop 0 ; \ br.sptk exception_restore ;; \ @@ -1021,10 +1021,10 @@ IVT_ENTRY(Data_Nested_TLB, 0x1400) movl r27=kstack ;; } -{ .mib +{ .mmi mov r28=sp - addl r27=KSTACK_PAGES*PAGE_SIZE-16,r0 nop 0 + addl r27=KSTACK_PAGES*PAGE_SIZE-16,r0 ;; } { .mmi @@ -1287,13 +1287,13 @@ IVT_ENTRY(Break_Instruction, 0x2c00) (p11) srlz.d add out1=16,sp } -{ .mfb +{ .mib nop 0 nop 0 br.call.sptk rp=trap ;; } -{ .mfb +{ .mib nop 0 nop 0 br.sptk exception_restore @@ -1308,19 +1308,19 @@ IVT_ENTRY(External_Interrupt, 0x3000) br.sptk exception_save ;; } -{ .mfb +{ .mmi alloc r15=ar.pfs,0,0,1,0 nop 0 nop 0 ;; } -{ .mfb +{ .mib add out0=16,sp nop 0 br.call.sptk rp=interrupt ;; } -{ .mfb +{ .mib nop 0 nop 0 br.sptk exception_restore Modified: head/sys/ia64/ia64/locore.S ============================================================================== --- head/sys/ia64/ia64/locore.S Sun Feb 21 23:41:59 2010 (r204183) +++ head/sys/ia64/ia64/locore.S Mon Feb 22 01:23:41 2010 (r204184) @@ -98,13 +98,13 @@ ENTRY_NOPROFILE(__start, 1) mov out0=r0 // we are linked at the right address ;; // we just need to process fptrs } -{ .bbb +{ .mib nop 0 nop 0 br.call.sptk.many rp=_reloc ;; } -{ .bbb +{ .mib nop 0 nop 0 br.call.sptk.many rp=ia64_init @@ -112,21 +112,21 @@ ENTRY_NOPROFILE(__start, 1) } // We have the new bspstore in r8 and the new sp in r9. // Switch onto the new stack and call mi_startup(). -{ +{ .mmi mov ar.rsc = 0 ;; mov ar.bspstore = r8 mov sp = r9 ;; } -{ +{ .mmi loadrs ;; mov ar.rsc = 3 nop 0 ;; } -{ +{ .mib nop 0 nop 0 br.call.sptk.many rp=mi_startup @@ -163,7 +163,7 @@ ENTRY(fork_trampoline, 0) ld8 out1=[r16] nop 0 } -{ .mfb +{ .mib add out2=16,sp nop 0 br.call.sptk rp=fork_exit @@ -174,7 +174,7 @@ ENTRY(fork_trampoline, 0) .global enter_userland .type enter_userland, @function enter_userland: -{ .mfb +{ .mib nop 0 nop 0 br.sptk epc_syscall_return @@ -282,7 +282,7 @@ ENTRY_NOPROFILE(os_boot_rendez,0) add sp = r18, r16 ;; } -{ .mfb +{ .mib mov ar.rsc = 3 nop 0 br.call.sptk.few rp = ia64_ap_startup @@ -290,7 +290,7 @@ ENTRY_NOPROFILE(os_boot_rendez,0) } /* NOT REACHED */ 9: -{ .mfb +{ .mib nop 0 nop 0 br.sptk 9b Modified: head/sys/ia64/ia64/support.S ============================================================================== --- head/sys/ia64/ia64/support.S Sun Feb 21 23:41:59 2010 (r204183) +++ head/sys/ia64/ia64/support.S Mon Feb 22 01:23:41 2010 (r204184) @@ -227,14 +227,14 @@ ENTRY(casuword, 3) nop 0 ;; } -{ .mfb +{ .mib st8.rel [r15]=r0 // Clear onfault nop 0 br.ret.sptk rp ;; } 1: -{ .mfb +{ .mib add ret0=-1,r0 nop 0 br.ret.sptk rp @@ -277,14 +277,14 @@ ENTRY(casuword32, 3) nop 0 ;; } -{ .mfb +{ .mib st8.rel [r15]=r0 // Clear onfault nop 0 br.ret.sptk rp ;; } 1: -{ .mfb +{ .mib add ret0=-1,r0 nop 0 br.ret.sptk rp @@ -338,7 +338,7 @@ ENTRY(subyte, 2) ;; } 1: -{ .mfb +{ .mib add ret0=-1,r0 nop 0 br.ret.sptk rp @@ -384,7 +384,7 @@ ENTRY(suword16, 2) ;; } 1: -{ .mfb +{ .mib add ret0=-1,r0 nop 0 br.ret.sptk rp @@ -430,7 +430,7 @@ ENTRY(suword32, 2) ;; } 1: -{ .mfb +{ .mib add ret0=-1,r0 nop 0 br.ret.sptk rp @@ -477,7 +477,7 @@ XENTRY(suword) ;; } 1: -{ .mfb +{ .mib add ret0=-1,r0 nop 0 br.ret.sptk rp @@ -531,7 +531,7 @@ ENTRY(fubyte, 1) ;; } 1: -{ .mfb +{ .mib add ret0=-1,r0 nop 0 br.ret.sptk rp @@ -577,7 +577,7 @@ ENTRY(fuword16, 2) ;; } 1: -{ .mfb +{ .mib add ret0=-1,r0 nop 0 br.ret.sptk rp @@ -623,7 +623,7 @@ ENTRY(fuword32, 2) ;; } 1: -{ .mfb +{ .mib add ret0=-1,r0 nop 0 br.ret.sptk rp @@ -670,7 +670,7 @@ XENTRY(fuword) ;; } 1: -{ .mfb +{ .mib add ret0=-1,r0 nop 0 br.ret.sptk rp @@ -684,7 +684,7 @@ END(fuword64) */ ENTRY(fuswintr, 1) -{ .mfb +{ .mib add ret0=-1,r0 nop 0 br.ret.sptk rp @@ -693,7 +693,7 @@ ENTRY(fuswintr, 1) END(fuswintr) ENTRY(suswintr, 0) -{ .mfb +{ .mib add ret0=-1,r0 nop 0 br.ret.sptk rp Modified: head/sys/ia64/ia64/syscall.S ============================================================================== --- head/sys/ia64/ia64/syscall.S Sun Feb 21 23:41:59 2010 (r204183) +++ head/sys/ia64/ia64/syscall.S Mon Feb 22 01:23:41 2010 (r204184) @@ -102,13 +102,13 @@ gw_ret: ;; } gw_ret_ia32: -{ .mfb +{ .mmi flushrs nop 0 nop 0 ;; } -{ .mfb +{ .mib nop 0 nop 0 br.ia.sptk b6 @@ -193,7 +193,7 @@ ENTRY_NOPROFILE(epc_sigtramp, 0) mov b7=r16 ;; } -{ .mmb +{ .mmi alloc r14=ar.pfs, 0, 0, 3, 0 mov ar.rsc=15 nop 0 @@ -204,7 +204,7 @@ ENTRY_NOPROFILE(epc_sigtramp, 0) mov out0=r8 mov out1=r9 } -{ .mfb +{ .mib add out2=16,sp nop 0 br.call.sptk rp=b7 @@ -257,7 +257,7 @@ ENTRY_NOPROFILE(epc_syscall, 8) add r31=8,r30 ;; } -{ .mib +{ .mii mov r22=ar.fpsr sub r29=r14,r30 nop 0 @@ -380,7 +380,7 @@ ENTRY_NOPROFILE(epc_syscall, 8) } .global epc_syscall_return epc_syscall_return: -{ .mfb +{ .mib add out0=16,sp nop 0 br.call.sptk rp=do_ast @@ -392,7 +392,7 @@ epc_syscall_return: (p15) br.spnt 1b // restart syscall ;; } -{ .mfb +{ .mmi ld8 r14=[r14] // tf_flags nop 0 nop 0 @@ -422,7 +422,7 @@ epc_syscall_return: add r31=r31,sp ;; } -{ .mmb +{ .mmi ld8 r19=[r15],16 // pr ld8 r20=[r14],16 // pfs (syscall caller) nop 0 @@ -434,7 +434,7 @@ epc_syscall_return: mov pr=r19,0x1fffe ;; } -{ .mmb +{ .mmi ld8 r23=[r15],16 // tp ld8 r24=[r14],16 // rsc nop 0 @@ -488,7 +488,7 @@ epc_syscall_return: dep r30=0,r30,0,13 // 8KB aligned. ;; } -{ .mib +{ .mii mov ar.k6=r30 mov r13=r23 nop 0 From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 01:24:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74BC5106568B; Mon, 22 Feb 2010 01:24:34 +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 65A408FC1A; Mon, 22 Feb 2010 01:24:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1M1OYPp095379; Mon, 22 Feb 2010 01:24:34 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1M1OYFb095377; Mon, 22 Feb 2010 01:24:34 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201002220124.o1M1OYFb095377@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 22 Feb 2010 01: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: r204185 - head/sys/cddl/contrib/opensolaris/common/atomic/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 01:24:34 -0000 Author: marcel Date: Mon Feb 22 01:24:34 2010 New Revision: 204185 URL: http://svn.freebsd.org/changeset/base/204185 Log: Use mf and not mf.a. The latter doesn't force memory ordering and applies to sequential memory. Modified: head/sys/cddl/contrib/opensolaris/common/atomic/ia64/opensolaris_atomic.S Modified: head/sys/cddl/contrib/opensolaris/common/atomic/ia64/opensolaris_atomic.S ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/atomic/ia64/opensolaris_atomic.S Mon Feb 22 01:23:41 2010 (r204184) +++ head/sys/cddl/contrib/opensolaris/common/atomic/ia64/opensolaris_atomic.S Mon Feb 22 01:24:34 2010 (r204185) @@ -76,7 +76,7 @@ ENTRY(atomic_or_8_nv, 2) END(atomic_or_8_nv) ENTRY(membar_producer, 0) - mf.a + mf ;; br.ret.sptk rp END(membar_producer) From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 01:48:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30659106566B; Mon, 22 Feb 2010 01:48:39 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2205B8FC13; Mon, 22 Feb 2010 01:48:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1M1mdqs000755; Mon, 22 Feb 2010 01:48:39 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1M1mdA3000753; Mon, 22 Feb 2010 01:48:39 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201002220148.o1M1mdA3000753@svn.freebsd.org> From: Neel Natu Date: Mon, 22 Feb 2010 01:48: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: r204186 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 01:48:39 -0000 Author: neel Date: Mon Feb 22 01:48:38 2010 New Revision: 204186 URL: http://svn.freebsd.org/changeset/base/204186 Log: Use KERNLOADADDR instead of hardcoded address. This is required to be able to build the trampoline kernel that has symbol/string tables embedded within it. Modified: head/sys/conf/ldscript.mips.cfe Modified: head/sys/conf/ldscript.mips.cfe ============================================================================== --- head/sys/conf/ldscript.mips.cfe Mon Feb 22 01:24:34 2010 (r204185) +++ head/sys/conf/ldscript.mips.cfe Mon Feb 22 01:48:38 2010 (r204186) @@ -61,7 +61,7 @@ PHDRS SECTIONS { /* Read-only sections, merged into text segment: */ - . = 0x80100000 ; + . = KERNLOADADDR ; .interp : { *(.interp) } :interp .hash : { *(.hash) } :text .dynsym : { *(.dynsym) } From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 10:45:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D26C1065670; Mon, 22 Feb 2010 10:45:41 +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 5BF808FC1C; Mon, 22 Feb 2010 10:45:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1MAjfrM020479; Mon, 22 Feb 2010 10:45:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1MAjfTf020472; Mon, 22 Feb 2010 10:45:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002221045.o1MAjfTf020472@svn.freebsd.org> From: Alexander Motin Date: Mon, 22 Feb 2010 10:45: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: r204195 - in head: sbin/atacontrol sbin/camcontrol sys/cam sys/dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 10:45:41 -0000 Author: mav Date: Mon Feb 22 10:45:40 2010 New Revision: 204195 URL: http://svn.freebsd.org/changeset/base/204195 Log: Improve output for controllers that doesn't report SATA speed. Modified: head/sbin/atacontrol/atacontrol.c head/sbin/camcontrol/camcontrol.c head/sys/cam/cam_xpt.c head/sys/dev/ata/ata-all.c head/sys/dev/ata/ata-pci.c head/sys/dev/ata/ata-sata.c Modified: head/sbin/atacontrol/atacontrol.c ============================================================================== --- head/sbin/atacontrol/atacontrol.c Mon Feb 22 07:50:17 2010 (r204194) +++ head/sbin/atacontrol/atacontrol.c Mon Feb 22 10:45:40 2010 (r204195) @@ -72,6 +72,7 @@ satarev2str(int mode) case 1: return "SATA 1.5Gb/s"; case 2: return "SATA 3Gb/s"; case 3: return "SATA 6Gb/s"; + case 0xff: return "SATA"; default: return "???"; } } Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Mon Feb 22 07:50:17 2010 (r204194) +++ head/sbin/camcontrol/camcontrol.c Mon Feb 22 10:45:40 2010 (r204195) @@ -1022,6 +1022,8 @@ camxferrate(struct cam_device *device) printf(" ("); if (sata->valid & CTS_SATA_VALID_REVISION) printf("SATA %d.x, ", sata->revision); + else + printf("SATA, "); if (sata->valid & CTS_SATA_VALID_MODE) printf("%s, ", ata_mode2string(sata->mode)); if ((sata->valid & CTS_SATA_VALID_ATAPI) && sata->atapi != 0) Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Mon Feb 22 07:50:17 2010 (r204194) +++ head/sys/cam/cam_xpt.c Mon Feb 22 10:45:40 2010 (r204195) @@ -1219,6 +1219,8 @@ xpt_announce_periph(struct cam_periph *p printf(" ("); if (sata->valid & CTS_SATA_VALID_REVISION) printf("SATA %d.x, ", sata->revision); + else + printf("SATA, "); if (sata->valid & CTS_SATA_VALID_MODE) printf("%s, ", ata_mode2string(sata->mode)); if ((sata->valid & CTS_ATA_VALID_ATAPI) && sata->atapi != 0) Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Mon Feb 22 07:50:17 2010 (r204194) +++ head/sys/dev/ata/ata-all.c Mon Feb 22 10:45:40 2010 (r204195) @@ -1160,6 +1160,7 @@ ata_satarev2str(int rev) case 1: return "SATA 1.5Gb/s"; case 2: return "SATA 3Gb/s"; case 3: return "SATA 6Gb/s"; + case 0xff: return "SATA"; default: return "???"; } } @@ -1536,6 +1537,7 @@ ataaction(struct cam_sim *sim, union ccb if (ch->flags & ATA_SATA) { cts->transport = XPORT_SATA; cts->transport_version = XPORT_VERSION_UNSPECIFIED; + cts->xport_specific.sata.valid = 0; cts->xport_specific.sata.mode = d->mode; cts->xport_specific.sata.valid |= CTS_SATA_VALID_MODE; cts->xport_specific.sata.bytecount = d->bytecount; @@ -1543,14 +1545,20 @@ ataaction(struct cam_sim *sim, union ccb if (cts->type == CTS_TYPE_CURRENT_SETTINGS) { cts->xport_specific.sata.revision = ATA_GETREV(dev, ccb->ccb_h.target_id); - } else + if (cts->xport_specific.sata.revision != 0xff) { + cts->xport_specific.sata.valid |= + CTS_SATA_VALID_REVISION; + } + } else { cts->xport_specific.sata.revision = d->revision; - cts->xport_specific.sata.valid |= CTS_SATA_VALID_REVISION; + cts->xport_specific.sata.valid |= CTS_SATA_VALID_REVISION; + } cts->xport_specific.sata.atapi = d->atapi; cts->xport_specific.sata.valid |= CTS_SATA_VALID_ATAPI; } else { cts->transport = XPORT_ATA; cts->transport_version = XPORT_VERSION_UNSPECIFIED; + cts->xport_specific.ata.valid = 0; cts->xport_specific.ata.mode = d->mode; cts->xport_specific.ata.valid |= CTS_ATA_VALID_MODE; cts->xport_specific.ata.bytecount = d->bytecount; Modified: head/sys/dev/ata/ata-pci.c ============================================================================== --- head/sys/dev/ata/ata-pci.c Mon Feb 22 07:50:17 2010 (r204194) +++ head/sys/dev/ata/ata-pci.c Mon Feb 22 10:45:40 2010 (r204195) @@ -714,10 +714,14 @@ static int ata_pcichannel_getrev(device_t dev, int target) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); + struct ata_channel *ch = device_get_softc(dev); - if (ctlr->getrev) - return (ctlr->getrev(dev, target)); - else + if (ch->flags & ATA_SATA) { + if (ctlr->getrev) + return (ctlr->getrev(dev, target)); + else + return (0xff); + } else return (0); } Modified: head/sys/dev/ata/ata-sata.c ============================================================================== --- head/sys/dev/ata/ata-sata.c Mon Feb 22 07:50:17 2010 (r204194) +++ head/sys/dev/ata/ata-sata.c Mon Feb 22 10:45:40 2010 (r204195) @@ -223,7 +223,7 @@ ata_sata_getrev(device_t dev, int target if (ch->r_io[ATA_SSTATUS].res) return ((ATA_IDX_INL(ch, ATA_SSTATUS) & 0x0f0) >> 4); - return (0); + return (0xff); } int From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 11:27:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49372106568B; Mon, 22 Feb 2010 11:27: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 245DC8FC0A; Mon, 22 Feb 2010 11:27:48 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id B01A046B17; Mon, 22 Feb 2010 06:27:47 -0500 (EST) Date: Mon, 22 Feb 2010 11:27:47 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Ulrich Spoerlein In-Reply-To: <201002212103.o1LL3FGS037889@svn.freebsd.org> Message-ID: References: <201002212103.o1LL3FGS037889@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-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r204178 - head/games/fortune/fortune X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 11:27:48 -0000 On Sun, 21 Feb 2010, Ulrich Spoerlein wrote: > Prefer exit(0) from main over return(0). > > Although not explicitly mentioned in style(9), it allows for easier > grepping of exit points. This reverts part of r203926. A few people (including me) have tripped up over exit handling and style in the past. It might be nice to formulate some specific sentences about program exit paths, functions, and also return values, to put in the style guide. For example, we have sysexits(3), but my understanding is we prefer not to use it. Likewise, we do like to use err()/warn() in preference to perror() and exit(), etc. Robert From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 13:53:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 502B8106568D; Mon, 22 Feb 2010 13:53:04 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id D80748FC1A; Mon, 22 Feb 2010 13:53:03 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id A425941C70C; Mon, 22 Feb 2010 14:53:02 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id vecoXm1CH68v; Mon, 22 Feb 2010 14:53:02 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 1687341C6B4; Mon, 22 Feb 2010 14:53:02 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 60F584448EC; Mon, 22 Feb 2010 13:52:33 +0000 (UTC) Date: Mon, 22 Feb 2010 13:52:33 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Robert Watson In-Reply-To: Message-ID: <20100222133112.D27327@maildrop.int.zabbadoz.net> References: <201002212103.o1LL3FGS037889@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r204178 - head/games/fortune/fortune X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 13:53:04 -0000 On Mon, 22 Feb 2010, Robert Watson wrote: Hi, > > On Sun, 21 Feb 2010, Ulrich Spoerlein wrote: > >> Prefer exit(0) from main over return(0). >> >> Although not explicitly mentioned in style(9), it allows for easier >> grepping of exit points. This reverts part of r203926. > > A few people (including me) have tripped up over exit handling and style in > the past. It might be nice to formulate some specific sentences about > program exit paths, functions, and also return values, to put in the style > guide. > > For example, we have sysexits(3), but my understanding is we prefer not to > use it. Likewise, we do like to use err()/warn() in preference to perror() > and exit(), etc. I know better but still join this thread; the color shall be red and light blue on white or a light blue on white depending on whether you believe in the new or the old testament. While the old testament seems to talk about exit() in 7.7 Error Handling - Stderr and Exit but treated main() voidish apart from that mostly, the new testament is a bit more precise in 7.6. with the same name: >>Withing main, return expr is equivalent to exit(expr). exit has the advantage that it can be called from other functions, and that calls to it can be found with a pattern-searching program like those in Chapter 5.<< It still seems to be quite common to use return rather than exit in main(), and while style.9 may, in the future, possibly suggest that exit() is the prefered token, we should not start changing all and everything to exit() and still accept return() without major bikesheds. The thing I tripped over in the past were negative s,return,exit, (or err(3)) values which are not really good(tm). I agree with Robert that we should try to decide what, of all the (unused or prefered by some people) possibilities we support, we would prefer but may not forget portability. /bz -- Bjoern A. Zeeb It will not break if you know what you are doing. PS: Whenever you commit to fortune, you will likely start a bikeshed. From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 14:17:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84FC8106566B; Mon, 22 Feb 2010 14:17:23 +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 73C768FC13; Mon, 22 Feb 2010 14:17:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1MEHN5x067261; Mon, 22 Feb 2010 14:17:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1MEHNju067259; Mon, 22 Feb 2010 14:17:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201002221417.o1MEHNju067259@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 22 Feb 2010 14:17: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: r204197 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 14:17:23 -0000 Author: nwhitehorn Date: Mon Feb 22 14:17:23 2010 New Revision: 204197 URL: http://svn.freebsd.org/changeset/base/204197 Log: Allow user programs to execute mfpvr instructions. Linux allows this, and some math-related software like GMP expects to be able to use it to pick a target appropriately. MFC after: 1 week Modified: head/sys/powerpc/aim/trap.c Modified: head/sys/powerpc/aim/trap.c ============================================================================== --- head/sys/powerpc/aim/trap.c Mon Feb 22 14:12:23 2010 (r204196) +++ head/sys/powerpc/aim/trap.c Mon Feb 22 14:17:23 2010 (r204197) @@ -82,6 +82,7 @@ static void printtrap(u_int vector, stru int user); static int trap_pfault(struct trapframe *frame, int user); static int fix_unaligned(struct thread *td, struct trapframe *frame); +static int ppc_instr_emulate(struct trapframe *frame); static int handle_onfault(struct trapframe *frame); static void syscall(struct trapframe *frame); @@ -209,7 +210,9 @@ trap(struct trapframe *frame) /* Identify the trap reason */ if (frame->srr1 & EXC_PGM_TRAP) sig = SIGTRAP; - else + else if (ppc_instr_emulate(frame) == 0) + frame->srr0 += 4; + else sig = SIGILL; break; @@ -615,3 +618,21 @@ fix_unaligned(struct thread *td, struct return -1; } + +static int +ppc_instr_emulate(struct trapframe *frame) +{ + uint32_t instr; + int reg; + + instr = fuword32((void *)frame->srr0); + + if ((instr & 0xfc1fffff) == 0x7c1f42a6) { /* mfpvr */ + reg = (instr & ~0xfc1fffff) >> 21; + frame->fixreg[reg] = mfpvr(); + return (0); + } + + return (-1); +} + From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 14:49:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F046C106566B; Mon, 22 Feb 2010 14:49:52 +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 DF0E78FC16; Mon, 22 Feb 2010 14:49:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1MEnqeL074491; Mon, 22 Feb 2010 14:49:52 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1MEnqos074489; Mon, 22 Feb 2010 14:49:52 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201002221449.o1MEnqos074489@svn.freebsd.org> From: Rui Paulo Date: Mon, 22 Feb 2010 14:49: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: r204198 - head/sys/arm/xscale/ixp425 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 14:49:53 -0000 Author: rpaulo Date: Mon Feb 22 14:49:52 2010 New Revision: 204198 URL: http://svn.freebsd.org/changeset/base/204198 Log: Fix previous commit: led_func() doesn't exist, it should be fled_cb(). Pointed out by: bz Modified: head/sys/arm/xscale/ixp425/cambria_fled.c Modified: head/sys/arm/xscale/ixp425/cambria_fled.c ============================================================================== --- head/sys/arm/xscale/ixp425/cambria_fled.c Mon Feb 22 14:17:23 2010 (r204197) +++ head/sys/arm/xscale/ixp425/cambria_fled.c Mon Feb 22 14:49:52 2010 (r204198) @@ -74,7 +74,7 @@ fled_attach(device_t dev) sc->sc_led = led_create(fled_cb, dev, "front"); - led_func(sc, 1); /* Turn on LED */ + fled_cb(sc, 1); /* Turn on LED */ return 0; } From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 14:53:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49268106566B; Mon, 22 Feb 2010 14:53:39 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 038F38FC0A; Mon, 22 Feb 2010 14:53:38 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 176D71FFC22; Mon, 22 Feb 2010 14:53:38 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id C4E04844C4; Mon, 22 Feb 2010 15:53:37 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: "Bjoern A. Zeeb" References: <201002212103.o1LL3FGS037889@svn.freebsd.org> <20100222133112.D27327@maildrop.int.zabbadoz.net> Date: Mon, 22 Feb 2010 15:53:37 +0100 In-Reply-To: <20100222133112.D27327@maildrop.int.zabbadoz.net> (Bjoern A. Zeeb's message of "Mon, 22 Feb 2010 13:52:33 +0000 (UTC)") Message-ID: <86r5ode2z2.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Robert Watson Subject: Re: svn commit: r204178 - head/games/fortune/fortune X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 14:53:39 -0000 "Bjoern A. Zeeb" writes: > It still seems to be quite common to use return rather than exit in > main(), and while style.9 may, in the future, possibly suggest that > exit() is the prefered token, we should not start changing all and > everything to exit() and still accept return() without major > bikesheds. Nobody's talking about changing return to exit() across the board - just about documenting existing practice and encouraging it in new code. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 15:03:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3010F106566C; Mon, 22 Feb 2010 15:03:17 +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 1D6748FC12; Mon, 22 Feb 2010 15:03:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1MF3HT8077542; Mon, 22 Feb 2010 15:03:17 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1MF3GiU077539; Mon, 22 Feb 2010 15:03:16 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201002221503.o1MF3GiU077539@svn.freebsd.org> From: Robert Watson Date: Mon, 22 Feb 2010 15:03: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: r204199 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 15:03:17 -0000 Author: rwatson Date: Mon Feb 22 15:03:16 2010 New Revision: 204199 URL: http://svn.freebsd.org/changeset/base/204199 Log: Export netisr configuration and statistics to userspace via sysctl(9). MFC after: 1 week Sponsored by: Juniper Networks Modified: head/sys/net/netisr.c head/sys/net/netisr.h Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Mon Feb 22 14:49:52 2010 (r204198) +++ head/sys/net/netisr.c Mon Feb 22 15:03:16 2010 (r204199) @@ -1,7 +1,11 @@ /*- * Copyright (c) 2007-2009 Robert N. M. Watson + * Copyright (c) 2010 Juniper Networks, Inc. * All rights reserved. * + * This software was developed by Robert N. M. Watson under contract + * to Juniper Networks, Inc. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -1126,6 +1130,170 @@ netisr_start(void *arg) } SYSINIT(netisr_start, SI_SUB_SMP, SI_ORDER_MIDDLE, netisr_start, NULL); +/* + * Sysctl monitoring for netisr: query a list of registered protocols. + */ +static int +sysctl_netisr_proto(SYSCTL_HANDLER_ARGS) +{ + struct rm_priotracker tracker; + struct sysctl_netisr_proto *snpp, *snp_array; + struct netisr_proto *npp; + u_int counter, proto; + int error; + + if (req->newptr != NULL) + return (EINVAL); + snp_array = malloc(sizeof(*snp_array) * NETISR_MAXPROT, M_TEMP, + M_ZERO | M_WAITOK); + counter = 0; + NETISR_RLOCK(&tracker); + for (proto = 0; proto < NETISR_MAXPROT; proto++) { + npp = &np[proto]; + if (npp->np_name == NULL) + continue; + snpp = &snp_array[counter]; + snpp->snp_version = sizeof(*snpp); + strlcpy(snpp->snp_name, npp->np_name, NETISR_NAMEMAXLEN); + snpp->snp_proto = proto; + snpp->snp_qlimit = npp->np_qlimit; + snpp->snp_policy = npp->np_policy; + if (npp->np_m2flow != NULL) + snpp->snp_flags |= NETISR_SNP_FLAGS_M2FLOW; + if (npp->np_m2cpuid != NULL) + snpp->snp_flags |= NETISR_SNP_FLAGS_M2CPUID; + if (npp->np_drainedcpu != NULL) + snpp->snp_flags |= NETISR_SNP_FLAGS_DRAINEDCPU; + counter++; + } + NETISR_RUNLOCK(&tracker); + KASSERT(counter < NETISR_MAXPROT, + ("sysctl_netisr_proto: counter too big (%d)", counter)); + error = SYSCTL_OUT(req, snp_array, sizeof(*snp_array) * counter); + free(snp_array, M_TEMP); + return (error); +} + +SYSCTL_PROC(_net_isr, OID_AUTO, proto, + CTLFLAG_RD|CTLTYPE_STRUCT|CTLFLAG_MPSAFE, 0, 0, sysctl_netisr_proto, + "S,sysctl_netisr_proto", + "Return list of protocols registered with netisr"); + +/* + * Sysctl monitoring for netisr: query a list of workstreams. + */ +static int +sysctl_netisr_workstream(SYSCTL_HANDLER_ARGS) +{ + struct rm_priotracker tracker; + struct sysctl_netisr_workstream *snwsp, *snws_array; + struct netisr_workstream *nwsp; + u_int counter, cpuid; + int error; + + if (req->newptr != NULL) + return (EINVAL); + snws_array = malloc(sizeof(*snws_array) * MAXCPU, M_TEMP, + M_ZERO | M_WAITOK); + counter = 0; + NETISR_RLOCK(&tracker); + for (cpuid = 0; cpuid < MAXCPU; cpuid++) { + if (CPU_ABSENT(cpuid)) + continue; + nwsp = DPCPU_ID_PTR(cpuid, nws); + if (nwsp->nws_intr_event == NULL) + continue; + NWS_LOCK(nwsp); + snwsp = &snws_array[counter]; + snwsp->snws_version = sizeof(*snwsp); + + /* + * For now, we equate workstream IDs and CPU IDs in the + * kernel, but expose them independently to userspace in case + * that assumption changes in the future. + */ + snwsp->snws_wsid = cpuid; + snwsp->snws_cpu = cpuid; + if (nwsp->nws_intr_event != NULL) + snwsp->snws_flags |= NETISR_SNWS_FLAGS_INTR; + NWS_UNLOCK(nwsp); + counter++; + } + NETISR_RUNLOCK(&tracker); + KASSERT(counter < MAXCPU, + ("sysctl_netisr_workstream: counter too big (%d)", counter)); + error = SYSCTL_OUT(req, snws_array, sizeof(*snws_array) * counter); + free(snws_array, M_TEMP); + return (error); +} + +SYSCTL_PROC(_net_isr, OID_AUTO, workstream, + CTLFLAG_RD|CTLTYPE_STRUCT|CTLFLAG_MPSAFE, 0, 0, sysctl_netisr_workstream, + "S,sysctl_netisr_workstream", + "Return list of workstreams implemented by netisr"); + +/* + * Sysctl monitoring for netisr: query per-protocol data across all + * workstreams. + */ +static int +sysctl_netisr_work(SYSCTL_HANDLER_ARGS) +{ + struct rm_priotracker tracker; + struct sysctl_netisr_work *snwp, *snw_array; + struct netisr_workstream *nwsp; + struct netisr_proto *npp; + struct netisr_work *nwp; + u_int counter, cpuid, proto; + int error; + + if (req->newptr != NULL) + return (EINVAL); + snw_array = malloc(sizeof(*snw_array) * MAXCPU * NETISR_MAXPROT, + M_TEMP, M_ZERO | M_WAITOK); + counter = 0; + NETISR_RLOCK(&tracker); + for (cpuid = 0; cpuid < MAXCPU; cpuid++) { + if (CPU_ABSENT(cpuid)) + continue; + nwsp = DPCPU_ID_PTR(cpuid, nws); + if (nwsp->nws_intr_event == NULL) + continue; + NWS_LOCK(nwsp); + for (proto = 0; proto < NETISR_MAXPROT; proto++) { + npp = &np[proto]; + if (npp->np_name == NULL) + continue; + nwp = &nwsp->nws_work[proto]; + snwp = &snw_array[counter]; + snwp->snw_version = sizeof(*snwp); + snwp->snw_wsid = cpuid; /* See comment above. */ + snwp->snw_proto = proto; + snwp->snw_len = nwp->nw_len; + snwp->snw_watermark = nwp->nw_watermark; + snwp->snw_dispatched = nwp->nw_dispatched; + snwp->snw_hybrid_dispatched = + nwp->nw_hybrid_dispatched; + snwp->snw_qdrops = nwp->nw_qdrops; + snwp->snw_queued = nwp->nw_queued; + snwp->snw_handled = nwp->nw_handled; + counter++; + } + NWS_UNLOCK(nwsp); + } + KASSERT(counter < MAXCPU * NETISR_MAXPROT, + ("sysctl_netisr_work: counter too big (%d)", counter)); + NETISR_RUNLOCK(&tracker); + error = SYSCTL_OUT(req, snw_array, sizeof(*snw_array) * counter); + free(snw_array, M_TEMP); + return (error); +} + +SYSCTL_PROC(_net_isr, OID_AUTO, work, + CTLFLAG_RD|CTLTYPE_STRUCT|CTLFLAG_MPSAFE, 0, 0, sysctl_netisr_work, + "S,sysctl_netisr_work", + "Return list of per-workstream, per-protocol work in netisr"); + #ifdef DDB DB_SHOW_COMMAND(netisr, db_show_netisr) { Modified: head/sys/net/netisr.h ============================================================================== --- head/sys/net/netisr.h Mon Feb 22 14:49:52 2010 (r204198) +++ head/sys/net/netisr.h Mon Feb 22 15:03:16 2010 (r204199) @@ -1,7 +1,11 @@ /*- * Copyright (c) 2007-2009 Robert N. M. Watson + * Copyright (c) 2010 Juniper Networks, Inc. * All rights reserved. * + * This software was developed by Robert N. M. Watson under contract + * to Juniper Networks, Inc. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -28,7 +32,6 @@ #ifndef _NET_NETISR_H_ #define _NET_NETISR_H_ -#ifdef _KERNEL /* * The netisr (network interrupt service routine) provides a deferred @@ -39,6 +42,13 @@ * Historically, this was implemented by the BSD software ISR facility; it is * now implemented via a software ithread (SWI). */ + +/* + * Protocol numbers, which are encoded in monitoring applications and kernel + * modules. Internally, these are used in bit shift operations so must have + * a value 0 < proto < 32; we currently further limit at compile-time to 16 + * for array-sizing purposes. + */ #define NETISR_IP 1 #define NETISR_IGMP 2 /* IGMPv3 output queue */ #define NETISR_ROUTE 3 /* routing socket */ @@ -52,6 +62,78 @@ #define NETISR_NATM 11 #define NETISR_EPAIR 12 /* if_epair(4) */ +/* + * Protocol ordering and affinity policy constants. See the detailed + * discussion of policies later in the file. + */ +#define NETISR_POLICY_SOURCE 1 /* Maintain source ordering. */ +#define NETISR_POLICY_FLOW 2 /* Maintain flow ordering. */ +#define NETISR_POLICY_CPU 3 /* Protocol determines CPU placement. */ + +/* + * Monitoring data structures, exported by sysctl(2). + * + * Three sysctls are defined. First, a per-protocol structure exported by + * net.isr.proto. + */ +#define NETISR_NAMEMAXLEN 32 +struct sysctl_netisr_proto { + u_int snp_version; /* Length of struct. */ + char snp_name[NETISR_NAMEMAXLEN]; /* nh_name */ + u_int snp_proto; /* nh_proto */ + u_int snp_qlimit; /* nh_qlimit */ + u_int snp_policy; /* nh_policy */ + u_int snp_flags; /* Various flags. */ + u_int _snp_ispare[7]; +}; + +/* + * Flags for sysctl_netisr_proto.snp_flags. + */ +#define NETISR_SNP_FLAGS_M2FLOW 0x00000001 /* nh_m2flow */ +#define NETISR_SNP_FLAGS_M2CPUID 0x00000002 /* nh_m2cpuid */ +#define NETISR_SNP_FLAGS_DRAINEDCPU 0x00000003 /* nh_drainedcpu */ + +/* + * Next, a structure per-workstream, with per-protocol data, exported as + * net.isr.workstream. + */ +struct sysctl_netisr_workstream { + u_int snws_version; /* Length of struct. */ + u_int snws_flags; /* Various flags. */ + u_int snws_wsid; /* Workstream ID. */ + u_int snws_cpu; /* nws_cpu */ + u_int _snws_ispare[12]; +}; + +/* + * Flags for sysctl_netisr_workstream.snws_flags + */ +#define NETISR_SNWS_FLAGS_INTR 0x00000001 /* nws_intr_event */ + +/* + * Finally, a per-workstream-per-protocol structure, exported as + * net.isr.work. + */ +struct sysctl_netisr_work { + u_int snw_version; /* Length of struct. */ + u_int snw_wsid; /* Workstream ID. */ + u_int snw_proto; /* Protocol number. */ + u_int snw_len; /* nw_len */ + u_int snw_watermark; /* nw_watermark */ + u_int _snw_ispare[3]; + + uint64_t snw_dispatched; /* nw_dispatched */ + uint64_t snw_hybrid_dispatched; /* nw_hybrid_dispatched */ + uint64_t snw_qdrops; /* nw_qdrops */ + uint64_t snw_queued; /* nw_queued */ + uint64_t snw_handled; /* nw_handled */ + + uint64_t _snw_llspare[7]; +}; + +#ifdef _KERNEL + /*- * Protocols express ordering constraints and affinity preferences by * implementing one or neither of nh_m2flow and nh_m2cpuid, which are used by @@ -91,10 +173,6 @@ typedef struct mbuf *netisr_m2cpuid_t(st typedef struct mbuf *netisr_m2flow_t(struct mbuf *m, uintptr_t source); typedef void netisr_drainedcpu_t(u_int cpuid); -#define NETISR_POLICY_SOURCE 1 /* Maintain source ordering. */ -#define NETISR_POLICY_FLOW 2 /* Maintain flow ordering. */ -#define NETISR_POLICY_CPU 3 /* Protocol determines CPU placement. */ - /* * Data structure describing a protocol handler. */ From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 15:57:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0506B106566B; Mon, 22 Feb 2010 15:57:37 +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 E55E88FC08; Mon, 22 Feb 2010 15:57:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1MFva6h089654; Mon, 22 Feb 2010 15:57:36 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1MFvatD089648; Mon, 22 Feb 2010 15:57:36 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201002221557.o1MFvatD089648@svn.freebsd.org> From: Robert Watson Date: Mon, 22 Feb 2010 15:57: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: r204202 - head/usr.bin/netstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 15:57:37 -0000 Author: rwatson Date: Mon Feb 22 15:57:36 2010 New Revision: 204202 URL: http://svn.freebsd.org/changeset/base/204202 Log: Teach netstat(1) to print out netisr statistics when given the -Q argument. Currently supports only reporting on live systems via sysctl, kmem support needs to be edded. MFC after: 1 week Sponsored by: Juniper Networks Added: head/usr.bin/netstat/netisr.c (contents, props changed) Modified: head/usr.bin/netstat/Makefile head/usr.bin/netstat/main.c head/usr.bin/netstat/netstat.1 head/usr.bin/netstat/netstat.h Modified: head/usr.bin/netstat/Makefile ============================================================================== --- head/usr.bin/netstat/Makefile Mon Feb 22 15:49:16 2010 (r204201) +++ head/usr.bin/netstat/Makefile Mon Feb 22 15:57:36 2010 (r204202) @@ -4,7 +4,7 @@ .include PROG= netstat -SRCS= if.c inet.c main.c mbuf.c mroute.c route.c \ +SRCS= if.c inet.c main.c mbuf.c mroute.c netisr.c route.c \ unix.c atalk.c mroute6.c ipsec.c bpf.c pfkey.c sctp.c WARNS?= 3 Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Mon Feb 22 15:49:16 2010 (r204201) +++ head/usr.bin/netstat/main.c Mon Feb 22 15:57:36 2010 (r204202) @@ -338,6 +338,7 @@ int noutputs = 0; /* how much outputs be int numeric_addr; /* show addresses numerically */ int numeric_port; /* show ports numerically */ static int pflag; /* show given protocol */ +int Qflag; /* show netisr information */ int rflag; /* show routing tables (or routing stats) */ int sflag; /* show protocol statistics */ int Wflag; /* wide display */ @@ -360,7 +361,8 @@ main(int argc, char *argv[]) af = AF_UNSPEC; - while ((ch = getopt(argc, argv, "AaBbdf:ghI:iLlM:mN:np:q:rSsuWw:xz")) != -1) + while ((ch = getopt(argc, argv, "AaBbdf:ghI:iLlM:mN:np:Qq:rSsuWw:xz")) + != -1) switch(ch) { case 'A': Aflag = 1; @@ -446,6 +448,9 @@ main(int argc, char *argv[]) } pflag = 1; break; + case 'Q': + Qflag = 1; + break; case 'q': noutputs = atoi(optarg); if (noutputs != 0) @@ -524,6 +529,12 @@ main(int argc, char *argv[]) mbpr(NULL, 0); exit(0); } + if (Qflag) { + if (!live) + usage(); + netisr_stats(); + exit(0); + } #if 0 /* * Keep file descriptors open to avoid overhead @@ -780,7 +791,7 @@ name2protox(const char *name) static void usage(void) { - (void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", + (void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", "usage: netstat [-AaLnSWx] [-f protocol_family | -p protocol]\n" " [-M core] [-N system]", " netstat -i | -I interface [-abdhnW] [-f address_family]\n" @@ -795,6 +806,7 @@ usage(void) " netstat -r [-AanW] [-f address_family] [-M core] [-N system]", " netstat -rs [-s] [-M core] [-N system]", " netstat -g [-W] [-f address_family] [-M core] [-N system]", -" netstat -gs [-s] [-f address_family] [-M core] [-N system]"); +" netstat -gs [-s] [-f address_family] [-M core] [-N system]", +" netstat -Q"); exit(1); } Added: head/usr.bin/netstat/netisr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/netstat/netisr.c Mon Feb 22 15:57:36 2010 (r204202) @@ -0,0 +1,268 @@ +/*- + * Copyright (c) 2010 Juniper Networks, Inc. + * All rights reserved. + * + * This software was developed by Robert N. M. Watson under contract + * to Juniper Networks, 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 "netstat.h" + +/* + * Print statistics for the kernel netisr subsystem. + */ +static u_int bindthreads; +static u_int maxthreads; +static u_int numthreads; + +static u_int defaultqlimit; +static u_int maxqlimit; + +static u_int direct; +static u_int direct_force; + +static struct sysctl_netisr_proto *proto_array; +static u_int proto_array_len; + +static struct sysctl_netisr_workstream *workstream_array; +static u_int workstream_array_len; + +static struct sysctl_netisr_work *work_array; +static u_int work_array_len; + +static void +netisr_load_sysctl_uint(const char *name, u_int *p) +{ + size_t retlen; + + retlen = sizeof(u_int); + if (sysctlbyname(name, p, &retlen, NULL, 0) < 0) + err(-1, "%s", name); + if (retlen != sizeof(u_int)) + errx(-1, "%s: invalid len %ju", name, (uintmax_t)retlen); +} + +static void +netisr_load_config(void) +{ + + netisr_load_sysctl_uint("net.isr.bindthreads", &bindthreads); + netisr_load_sysctl_uint("net.isr.maxthreads", &maxthreads); + netisr_load_sysctl_uint("net.isr.numthreads", &numthreads); + + netisr_load_sysctl_uint("net.isr.defaultqlimit", &defaultqlimit); + netisr_load_sysctl_uint("net.isr.maxqlimit", &maxqlimit); + + netisr_load_sysctl_uint("net.isr.direct", &direct); + netisr_load_sysctl_uint("net.isr.direct_force", &direct_force); +} + +static void +netisr_load_proto(void) +{ + size_t len; + + if (sysctlbyname("net.isr.proto", NULL, &len, NULL, 0) < 0) + err(-1, "net.isr.proto: query len"); + if (len % sizeof(*proto_array) != 0) + errx(-1, "net.isr.proto: invalid len"); + proto_array = malloc(len); + if (proto_array == NULL) + err(-1, "malloc"); + if (sysctlbyname("net.isr.proto", proto_array, &len, NULL, 0) < 0) + err(-1, "net.isr.proto: query data"); + if (len % sizeof(*proto_array) != 0) + errx(-1, "net.isr.proto: invalid len"); + proto_array_len = len / sizeof(*proto_array); + if (proto_array_len < 1) + errx(-1, "net.isr.proto: no data"); + if (proto_array[0].snp_version != sizeof(proto_array[0])) + errx(-1, "net.isr.proto: invalid version"); +} + +static void +netisr_load_workstream(void) +{ + size_t len; + + if (sysctlbyname("net.isr.workstream", NULL, &len, NULL, 0) < 0) + err(-1, "net.isr.workstream: query len"); + if (len % sizeof(*workstream_array) != 0) + errx(-1, "net.isr.workstream: invalid len"); + workstream_array = malloc(len); + if (workstream_array == NULL) + err(-1, "malloc"); + if (sysctlbyname("net.isr.workstream", workstream_array, &len, NULL, + 0) < 0) + err(-1, "net.isr.workstream: query data"); + if (len % sizeof(*workstream_array) != 0) + errx(-1, "net.isr.workstream: invalid len"); + workstream_array_len = len / sizeof(*workstream_array); + if (workstream_array_len < 1) + errx(-1, "net.isr.workstream: no data"); + if (workstream_array[0].snws_version != sizeof(workstream_array[0])) + errx(-1, "net.isr.workstream: invalid version"); +} + +static void +netisr_load_work(void) +{ + size_t len; + + if (sysctlbyname("net.isr.work", NULL, &len, NULL, 0) < 0) + err(-1, "net.isr.work: query len"); + if (len % sizeof(*work_array) != 0) + errx(-1, "net.isr.work: invalid len"); + work_array = malloc(len); + if (work_array == NULL) + err(-1, "malloc"); + if (sysctlbyname("net.isr.work", work_array, &len, NULL, 0) < 0) + err(-1, "net.isr.work: query data"); + if (len % sizeof(*work_array) != 0) + errx(-1, "net.isr.work: invalid len"); + work_array_len = len / sizeof(*work_array); + if (work_array_len < 1) + errx(-1, "net.isr.work: no data"); + if (work_array[0].snw_version != sizeof(work_array[0])) + errx(-1, "net.isr.work: invalid version"); +} + +static void +netisr_print_proto(struct sysctl_netisr_proto *snpp) +{ + + printf("%-6s", snpp->snp_name); + printf(" %5u", snpp->snp_proto); + printf(" %6u", snpp->snp_qlimit); + printf(" %6s", + (snpp->snp_policy == NETISR_POLICY_SOURCE) ? "source" : + (snpp->snp_policy == NETISR_POLICY_FLOW) ? "flow" : + (snpp->snp_policy == NETISR_POLICY_CPU) ? "cpu" : "-"); + printf(" %s%s%s\n", + (snpp->snp_flags & NETISR_SNP_FLAGS_M2CPUID) ? "C" : "-", + (snpp->snp_flags & NETISR_SNP_FLAGS_DRAINEDCPU) ? "D" : "-", + (snpp->snp_flags & NETISR_SNP_FLAGS_M2FLOW) ? "F" : "-"); +} + +static const char * +netisr_proto2name(u_int proto) +{ + u_int i; + + for (i = 0; i < proto_array_len; i++) { + if (proto_array[i].snp_proto == proto) + return (proto_array[i].snp_name); + } + return ("unknown"); +} + +static void +netisr_print_workstream(struct sysctl_netisr_workstream *snwsp) +{ + struct sysctl_netisr_work *snwp; + int first; + u_int i; + + first = 1; + for (i = 0; i < work_array_len; i++) { + snwp = &work_array[i]; + if (snwp->snw_wsid != snwsp->snws_wsid) + continue; + if (first) { + printf("%4u", snwsp->snws_wsid); + printf(" %3u", snwsp->snws_cpu); + first = 0; + } else + printf("%4s %3s", "", ""); + printf("%2s", ""); + printf("%-6s", netisr_proto2name(snwp->snw_proto)); + printf(" %5u", snwp->snw_len); + printf(" %5u", snwp->snw_watermark); + printf(" %8ju", snwp->snw_dispatched); + printf(" %8ju", snwp->snw_hybrid_dispatched); + printf(" %8ju", snwp->snw_qdrops); + printf(" %8ju", snwp->snw_queued); + printf(" %8ju", snwp->snw_handled); + printf("\n"); + } +} + +void +netisr_stats(void) +{ + struct sysctl_netisr_workstream *snwsp; + struct sysctl_netisr_proto *snpp; + u_int i; + + netisr_load_config(); + netisr_load_proto(); + netisr_load_workstream(); + netisr_load_work(); + + printf("Configuration:\n"); + printf("%-25s %12s %12s\n", "Setting", "Value", "Maximum"); + printf("%-25s %12u %12u\n", "Thread count", numthreads, maxthreads); + printf("%-25s %12u %12u\n", "Default queue limit", defaultqlimit, + maxqlimit); + printf("%-25s %12s %12s\n", "Direct dispatch", + direct ? "enabled" : "disabled", "n/a"); + printf("%-25s %12s %12s\n", "Forced direct dispatch", + direct_force ? "enabled" : "disabled", "n/a"); + printf("%-25s %12s %12s\n", "Threads bound to CPUs", + bindthreads ? "enabled" : "disabled", "n/a"); + printf("\n"); + + printf("Protocols:\n"); + printf("%-6s %5s %6s %-6s %-5s\n", "Name", "Proto", "QLimit", + "Policy", "Flags"); + for (i = 0; i < proto_array_len; i++) { + snpp = &proto_array[i]; + netisr_print_proto(snpp); + } + printf("\n"); + + printf("Workstreams:\n"); + printf("%4s %3s ", "WSID", "CPU"); + printf("%2s", ""); + printf("%-6s %5s %5s %8s %8s %8s %8s %8s\n", "Name", "Len", "WMark", + "Disp'd", "HDisp'd", "QDrops", "Queued", "Handled"); + for (i = 0; i < workstream_array_len; i++) { + snwsp = &workstream_array[i]; + netisr_print_workstream(snwsp); + } +} Modified: head/usr.bin/netstat/netstat.1 ============================================================================== --- head/usr.bin/netstat/netstat.1 Mon Feb 22 15:49:16 2010 (r204201) +++ head/usr.bin/netstat/netstat.1 Mon Feb 22 15:57:36 2010 (r204202) @@ -292,6 +292,15 @@ Show multicast routing statistics. If .Fl s is repeated, counters with a value of zero are suppressed. +.It Xo +.Bk -words +.Nm +.Fl Q +.Ek +.Xc +Show +.Xr netisr 9 +statistics. .El .Pp Some options have the general meaning: Modified: head/usr.bin/netstat/netstat.h ============================================================================== --- head/usr.bin/netstat/netstat.h Mon Feb 22 15:49:16 2010 (r204201) +++ head/usr.bin/netstat/netstat.h Mon Feb 22 15:57:36 2010 (r204202) @@ -67,6 +67,9 @@ const char *plural(uintmax_t); const char *plurales(uintmax_t); const char *pluralies(uintmax_t); +struct sockaddr; +struct socket; +struct xsocket; int sotoxsocket(struct socket *, struct xsocket *); void protopr(u_long, const char *, int, int); void tcp_stats(u_long, const char *, int, int); @@ -112,6 +115,8 @@ void pfkey_stats(u_long, const char *, i void mbpr(void *, u_long); +void netisr_stats(void); + void hostpr(u_long, u_long); void impstats(u_long, u_long); From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 16:00:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F3D4106568B; Mon, 22 Feb 2010 16:00:57 +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 3D6CA8FC14; Mon, 22 Feb 2010 16:00:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1MG0vd2090524; Mon, 22 Feb 2010 16:00:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1MG0vLf090522; Mon, 22 Feb 2010 16:00:57 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002221600.o1MG0vLf090522@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 22 Feb 2010 16:00: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: r204205 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 16:00:57 -0000 Author: kib Date: Mon Feb 22 16:00:56 2010 New Revision: 204205 URL: http://svn.freebsd.org/changeset/base/204205 Log: Remove write-only variable. MFC after: 3 days Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Mon Feb 22 16:00:55 2010 (r204204) +++ head/sys/vm/vnode_pager.c Mon Feb 22 16:00:56 2010 (r204205) @@ -1016,7 +1016,6 @@ vnode_pager_putpages(object, m, count, s { int rtval; struct vnode *vp; - struct mount *mp; int bytes = count * PAGE_SIZE; /* @@ -1039,8 +1038,6 @@ vnode_pager_putpages(object, m, count, s */ vp = object->handle; VM_OBJECT_UNLOCK(object); - if (vp->v_type != VREG) - mp = NULL; rtval = VOP_PUTPAGES(vp, m, bytes, sync, rtvals, 0); KASSERT(rtval != EOPNOTSUPP, ("vnode_pager: stale FS putpages\n")); From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 16:02:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D55B106568D; Mon, 22 Feb 2010 16:02:17 +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 7B2FA8FC20; Mon, 22 Feb 2010 16:02:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1MG2HR1090863; Mon, 22 Feb 2010 16:02:17 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1MG2HIc090861; Mon, 22 Feb 2010 16:02:17 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201002221602.o1MG2HIc090861@svn.freebsd.org> From: Robert Watson Date: Mon, 22 Feb 2010 16:02: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: r204206 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 16:02:17 -0000 Author: rwatson Date: Mon Feb 22 16:02:17 2010 New Revision: 204206 URL: http://svn.freebsd.org/changeset/base/204206 Log: Cross-reference netstat(1) from netisr(9) since you can now use it to monitor netisr status. MFC after: 1 week Sponsored by: Juniper Networks Modified: head/share/man/man9/netisr.9 Modified: head/share/man/man9/netisr.9 ============================================================================== --- head/share/man/man9/netisr.9 Mon Feb 22 16:00:56 2010 (r204205) +++ head/share/man/man9/netisr.9 Mon Feb 22 16:02:17 2010 (r204206) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 26, 2009 +.Dd February 22, 2010 .Dt NETISR 9 .Os .Sh NAME @@ -66,6 +66,8 @@ The .Nm kernel interface suite allows device drivers (and other packet sources) to direct packets to protocols for directly dispatched or deferred processing. +Protocol registration and work stream statistics may be monitored using +.Xr netstat 1 . .Ss Protocol registration Protocols register and unregister handlers using .Fn netisr_register @@ -209,6 +211,7 @@ IPv6 .It Dv NETISR_NATM ATM .It Dv NETISR_EPAIR +.Xr netstat 1 , .Xr epair 4 .El .Sh AUTHORS From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 16:05:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CBC41065670; Mon, 22 Feb 2010 16:05:45 +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 4ABB58FC08; Mon, 22 Feb 2010 16:05:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1MG5jlF091655; Mon, 22 Feb 2010 16:05:45 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1MG5jnM091653; Mon, 22 Feb 2010 16:05:45 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201002221605.o1MG5jnM091653@svn.freebsd.org> From: Robert Watson Date: Mon, 22 Feb 2010 16:05: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: r204207 - head/usr.bin/netstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 16:05:45 -0000 Author: rwatson Date: Mon Feb 22 16:05:45 2010 New Revision: 204207 URL: http://svn.freebsd.org/changeset/base/204207 Log: Update date on netstat(1) for -Q. Suggested by: bz MFC after: 1 week Modified: head/usr.bin/netstat/netstat.1 Modified: head/usr.bin/netstat/netstat.1 ============================================================================== --- head/usr.bin/netstat/netstat.1 Mon Feb 22 16:02:17 2010 (r204206) +++ head/usr.bin/netstat/netstat.1 Mon Feb 22 16:05:45 2010 (r204207) @@ -32,7 +32,7 @@ .\" @(#)netstat.1 8.8 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd January 10, 2010 +.Dd February 22, 2010 .Dt NETSTAT 1 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 16:16:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17892106566C; Mon, 22 Feb 2010 16:16:17 +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 053ED8FC16; Mon, 22 Feb 2010 16:16:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1MGGGPd093992; Mon, 22 Feb 2010 16:16:16 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1MGGG1g093990; Mon, 22 Feb 2010 16:16:16 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201002221616.o1MGGG1g093990@svn.freebsd.org> From: Robert Watson Date: Mon, 22 Feb 2010 16:16: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: r204208 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 16:16:17 -0000 Author: rwatson Date: Mon Feb 22 16:16:16 2010 New Revision: 204208 URL: http://svn.freebsd.org/changeset/base/204208 Log: Fix constant assignment for netisr protocol information sysctl. MFC after: 1 week Spotted by: bz Modified: head/sys/net/netisr.h Modified: head/sys/net/netisr.h ============================================================================== --- head/sys/net/netisr.h Mon Feb 22 16:05:45 2010 (r204207) +++ head/sys/net/netisr.h Mon Feb 22 16:16:16 2010 (r204208) @@ -92,7 +92,7 @@ struct sysctl_netisr_proto { */ #define NETISR_SNP_FLAGS_M2FLOW 0x00000001 /* nh_m2flow */ #define NETISR_SNP_FLAGS_M2CPUID 0x00000002 /* nh_m2cpuid */ -#define NETISR_SNP_FLAGS_DRAINEDCPU 0x00000003 /* nh_drainedcpu */ +#define NETISR_SNP_FLAGS_DRAINEDCPU 0x00000004 /* nh_drainedcpu */ /* * Next, a structure per-workstream, with per-protocol data, exported as From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 16:27:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24E011065670; Mon, 22 Feb 2010 16:27:48 +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 125328FC0C; Mon, 22 Feb 2010 16:27:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1MGRlXr096651; Mon, 22 Feb 2010 16:27:47 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1MGRlcx096649; Mon, 22 Feb 2010 16:27:47 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002221627.o1MGRlcx096649@svn.freebsd.org> From: Alexander Motin Date: Mon, 22 Feb 2010 16: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: r204210 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 16:27:48 -0000 Author: mav Date: Mon Feb 22 16:27:47 2010 New Revision: 204210 URL: http://svn.freebsd.org/changeset/base/204210 Log: Add Intel PCH SATA controller IDs. Modified: head/sys/dev/ata/chipsets/ata-intel.c Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Mon Feb 22 16:17:37 2010 (r204209) +++ head/sys/dev/ata/chipsets/ata-intel.c Mon Feb 22 16:27:47 2010 (r204210) @@ -140,6 +140,22 @@ ata_intel_probe(device_t dev) { ATA_I82801JI_AH, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, { ATA_I82801JI_R1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, { ATA_I82801JI_S2, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, + { 0x80863a20, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x80863a21, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x80863a22, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x80863a23, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x80863a24, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x80863a25, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x80863a26, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x80863a27, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x80863a28, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x80863a29, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x80863a2a, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x80863a2b, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x80863a2c, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x80863a2d, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x80863a2e, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x80863a2f, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, { ATA_I31244, 0, 0, 2, ATA_SA150, "31244" }, { ATA_ISCH, 0, 0, 1, ATA_UDMA5, "SCH" }, { 0, 0, 0, 0, 0, 0}}; From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 16:49:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2C541065672; Mon, 22 Feb 2010 16:49:45 +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 BF9E08FC18; Mon, 22 Feb 2010 16:49:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1MGnjPm001621; Mon, 22 Feb 2010 16:49:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1MGnjcY001617; Mon, 22 Feb 2010 16:49:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201002221649.o1MGnjcY001617@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 22 Feb 2010 16:49: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: r204211 - head/libexec/rtld-elf/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 16:49:45 -0000 Author: nwhitehorn Date: Mon Feb 22 16:49:45 2010 New Revision: 204211 URL: http://svn.freebsd.org/changeset/base/204211 Log: Support the extended PLT format used when objects have more than 8192 PLT relocations on PPC32. Modified: head/libexec/rtld-elf/powerpc/reloc.c head/libexec/rtld-elf/powerpc/rtld_machdep.h head/libexec/rtld-elf/powerpc/rtld_start.S Modified: head/libexec/rtld-elf/powerpc/reloc.c ============================================================================== --- head/libexec/rtld-elf/powerpc/reloc.c Mon Feb 22 16:27:47 2010 (r204210) +++ head/libexec/rtld-elf/powerpc/reloc.c Mon Feb 22 16:49:45 2010 (r204211) @@ -47,6 +47,13 @@ ((u_int32_t)(x) + 0x10000) : (u_int32_t)(x)) >> 16) #define _ppc_la(x) ((u_int32_t)(x) & 0xffff) +#define min(a,b) (((a) < (b)) ? (a) : (b)) +#define max(a,b) (((a) > (b)) ? (a) : (b)) + +#define PLT_EXTENDED_BEGIN (1 << 13) +#define JMPTAB_BASE(N) (18 + N*2 + ((N > PLT_EXTENDED_BEGIN) ? \ + (N - PLT_EXTENDED_BEGIN)*2 : 0)) + /* * Process the R_PPC_COPY relocations */ @@ -313,7 +320,6 @@ done: return (r); } - /* * Initialise a PLT slot to the resolving trampoline */ @@ -321,27 +327,43 @@ static int reloc_plt_object(Obj_Entry *obj, const Elf_Rela *rela) { Elf_Word *where = (Elf_Word *)(obj->relocbase + rela->r_offset); - Elf_Addr *pltresolve; + Elf_Addr *pltresolve, *pltlongresolve, *jmptab; Elf_Addr distance; + int N = obj->pltrelasize / sizeof(Elf_Rela); int reloff; reloff = rela - obj->pltrela; - if ((reloff < 0) || (reloff >= 0x8000)) { + if (reloff < 0) return (-1); - } - pltresolve = obj->pltgot + 8; + pltlongresolve = obj->pltgot + 5; + pltresolve = pltlongresolve + 5; distance = (Elf_Addr)pltresolve - (Elf_Addr)(where + 1); dbg(" reloc_plt_object: where=%p,pltres=%p,reloff=%x,distance=%x", (void *)where, (void *)pltresolve, reloff, distance); - /* li r11,reloff */ - /* b pltresolve */ - where[0] = 0x39600000 | reloff; - where[1] = 0x48000000 | (distance & 0x03fffffc); + if (reloff < PLT_EXTENDED_BEGIN) { + /* li r11,reloff */ + /* b pltresolve */ + where[0] = 0x39600000 | reloff; + where[1] = 0x48000000 | (distance & 0x03fffffc); + } else { + jmptab = obj->pltgot + JMPTAB_BASE(N); + jmptab[reloff] = (u_int)pltlongresolve; + + /* lis r11,jmptab[reloff]@ha */ + /* lwzu r12,jmptab[reloff]@l(r11) */ + /* mtctr r12 */ + /* bctr */ + where[0] = 0x3d600000 | _ppc_ha(&jmptab[reloff]); + where[1] = 0x858b0000 | _ppc_la(&jmptab[reloff]); + where[2] = 0x7d8903a6; + where[3] = 0x4e800420; + } + /* * The icache will be sync'd in init_pltgot, which is called @@ -453,25 +475,28 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr int N = obj->pltrelasize / sizeof(Elf_Rela); int reloff = rela - obj->pltrela; - if ((reloff < 0) || (reloff >= 0x8000)) { + if (reloff < 0) return (-1); - } pltcall = obj->pltgot; - dbg(" reloc_jmpslot: indir, reloff=%d, N=%d\n", + dbg(" reloc_jmpslot: indir, reloff=%x, N=%x\n", reloff, N); - jmptab = obj->pltgot + 18 + N * 2; + jmptab = obj->pltgot + JMPTAB_BASE(N); jmptab[reloff] = target; - distance = (Elf_Addr)pltcall - (Elf_Addr)(wherep + 1); + if (reloff < PLT_EXTENDED_BEGIN) { + /* for extended PLT entries, we keep the old code */ + + distance = (Elf_Addr)pltcall - (Elf_Addr)(wherep + 1); - /* li r11,reloff */ - /* b pltcall # use indirect pltcall routine */ - wherep[0] = 0x39600000 | reloff; - wherep[1] = 0x48000000 | (distance & 0x03fffffc); - __syncicache(wherep, 8); + /* li r11,reloff */ + /* b pltcall # use indirect pltcall routine */ + wherep[0] = 0x39600000 | reloff; + wherep[1] = 0x48000000 | (distance & 0x03fffffc); + __syncicache(wherep, 8); + } } return (target); @@ -481,13 +506,14 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr /* * Setup the plt glue routines. */ -#define PLTCALL_SIZE 20 -#define PLTRESOLVE_SIZE 24 +#define PLTCALL_SIZE 20 +#define PLTLONGRESOLVE_SIZE 20 +#define PLTRESOLVE_SIZE 24 void init_pltgot(Obj_Entry *obj) { - Elf_Word *pltcall, *pltresolve; + Elf_Word *pltcall, *pltresolve, *pltlongresolve; Elf_Word *jmptab; int N = obj->pltrelasize / sizeof(Elf_Rela); @@ -524,18 +550,27 @@ init_pltgot(Obj_Entry *obj) * of the jumptable into the absolute-call assembler code so it * can determine this address. */ - jmptab = pltcall + 18 + N * 2; + jmptab = obj->pltgot + JMPTAB_BASE(N); pltcall[1] |= _ppc_ha(jmptab); /* addis 11,11,jmptab@ha */ pltcall[2] |= _ppc_la(jmptab); /* lwz 11,jmptab@l(11) */ /* - * Skip down 32 bytes into the initial reserved area and copy + * Skip down 20 bytes into the initial reserved area and copy * in the standard resolving assembler call. Into this assembler, * insert the absolute address of the _rtld_bind_start routine * and the address of the relocation object. + * + * We place pltlongresolve first, so it can fix up its arguments + * and then fall through to the regular PLT resolver. */ - pltresolve = obj->pltgot + 8; + pltlongresolve = obj->pltgot + 5; + + memcpy(pltlongresolve, _rtld_powerpc_pltlongresolve, + PLTLONGRESOLVE_SIZE); + pltlongresolve[0] |= _ppc_ha(jmptab); /* lis 12,jmptab@ha */ + pltlongresolve[1] |= _ppc_la(jmptab); /* addi 12,12,jmptab@l */ + pltresolve = pltlongresolve + PLTLONGRESOLVE_SIZE/sizeof(uint32_t); memcpy(pltresolve, _rtld_powerpc_pltresolve, PLTRESOLVE_SIZE); pltresolve[0] |= _ppc_ha(_rtld_bind_start); pltresolve[1] |= _ppc_la(_rtld_bind_start); Modified: head/libexec/rtld-elf/powerpc/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/powerpc/rtld_machdep.h Mon Feb 22 16:27:47 2010 (r204210) +++ head/libexec/rtld-elf/powerpc/rtld_machdep.h Mon Feb 22 16:49:45 2010 (r204211) @@ -57,6 +57,7 @@ void _rtld_bind_start(void); * PLT functions. Not really correct prototypes, but the * symbol values are needed. */ +void _rtld_powerpc_pltlongresolve(void); void _rtld_powerpc_pltresolve(void); void _rtld_powerpc_pltcall(void); Modified: head/libexec/rtld-elf/powerpc/rtld_start.S ============================================================================== --- head/libexec/rtld-elf/powerpc/rtld_start.S Mon Feb 22 16:27:47 2010 (r204210) +++ head/libexec/rtld-elf/powerpc/rtld_start.S Mon Feb 22 16:49:45 2010 (r204211) @@ -163,6 +163,12 @@ _ENTRY(_rtld_bind_start) * The ELF object is shifted into %r11, and _rtld_bind_start is called * to complete the binding. */ +_ENTRY(_rtld_powerpc_pltlongresolve) + lis %r12,0 # lis 12,jmptab@ha + addi %r12,%r12,0 # addi 12,12,jmptab@l + subf %r11,%r12,%r11 # reloff + li %r12,2 + srw %r11,%r11,%r12 # index = reloff/sizeof(Elf_Addr) _ENTRY(_rtld_powerpc_pltresolve) lis %r12,0 # lis 12,_rtld_bind_start@ha addi %r12,%r12,0 # addi 12,12,_rtld_bind_start@l From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 16:57:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65151106568B; Mon, 22 Feb 2010 16:57:03 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52E288FC14; Mon, 22 Feb 2010 16:57:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1MGv364003312; Mon, 22 Feb 2010 16:57:03 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1MGv3sk003310; Mon, 22 Feb 2010 16:57:03 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201002221657.o1MGv3sk003310@svn.freebsd.org> From: Andrew Gallatin Date: Mon, 22 Feb 2010 16:57: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: r204212 - head/sys/dev/mxge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 16:57:03 -0000 Author: gallatin Date: Mon Feb 22 16:57:03 2010 New Revision: 204212 URL: http://svn.freebsd.org/changeset/base/204212 Log: Update mxge to support IFCAP_VLAN_HWTSO. Note: If/when FreeBSD supports TSO over IPv6, the minimal mxge fw rev to enable IFCAP_VLAN_HWTSO will need to be increased to 1.4.37 Modified: head/sys/dev/mxge/if_mxge.c Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Mon Feb 22 16:49:45 2010 (r204211) +++ head/sys/dev/mxge/if_mxge.c Mon Feb 22 16:57:03 2010 (r204212) @@ -4122,6 +4122,13 @@ mxge_ioctl(struct ifnet *ifp, u_long com } if (mask & IFCAP_VLAN_HWTAGGING) ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + if (mask & IFCAP_VLAN_HWTSO) + ifp->if_capenable ^= IFCAP_VLAN_HWTSO; + + if (!(ifp->if_capabilities & IFCAP_VLAN_HWTSO) || + !(ifp->if_capenable & IFCAP_VLAN_HWTAGGING)) + ifp->if_capenable &= ~IFCAP_VLAN_HWTSO; + mtx_unlock(&sc->driver_mtx); VLAN_CAPABILITIES(ifp); @@ -4734,6 +4741,11 @@ mxge_attach(device_t dev) #ifdef MXGE_NEW_VLAN_API ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM; + + /* Only FW 1.4.32 and newer can do TSO over vlans */ + if (sc->fw_ver_major == 1 && sc->fw_ver_minor == 4 && + sc->fw_ver_tiny >= 32) + ifp->if_capabilities |= IFCAP_VLAN_HWTSO; #endif sc->max_mtu = mxge_max_mtu(sc); From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 17:01:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95E20106566B; Mon, 22 Feb 2010 17:01:32 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id 61B418FC1B; Mon, 22 Feb 2010 17:01:32 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0KY900H0A5YAK500@smtpauth3.wiscmail.wisc.edu>; Mon, 22 Feb 2010 11:01:22 -0600 (CST) Received: from comporellon.tachypleus.net (adsl-76-233-146-74.dsl.mdsnwi.sbcglobal.net [76.233.146.74]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0KY900GY35Y5K210@smtpauth3.wiscmail.wisc.edu>; Mon, 22 Feb 2010 11:01:19 -0600 (CST) Date: Mon, 22 Feb 2010 11:01:17 -0600 From: Nathan Whitehorn In-reply-to: <201002221417.o1MEHNju067259@svn.freebsd.org> To: Nathan Whitehorn Message-id: <4B82B85D.4070806@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.233.146.74 X-Spam-PmxInfo: Server=avs-14, Version=5.5.5.374460, Antispam-Engine: 2.7.1.369594, Antispam-Data: 2010.2.22.164535, SenderIP=76.233.146.74 References: <201002221417.o1MEHNju067259@svn.freebsd.org> User-Agent: Thunderbird 2.0.0.23 (X11/20100206) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r204197 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 17:01:32 -0000 Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Mon Feb 22 14:17:23 2010 > New Revision: 204197 > URL: http://svn.freebsd.org/changeset/base/204197 > > Log: > Allow user programs to execute mfpvr instructions. Linux allows this, and > some math-related software like GMP expects to be able to use it to pick > a target appropriately. > > MFC after: 1 week > Reported by: Jakob van Santen -Nathan From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 17:03:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1D6B1065670; Mon, 22 Feb 2010 17:03:26 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF7C98FC15; Mon, 22 Feb 2010 17:03:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1MH3Qja004762; Mon, 22 Feb 2010 17:03:26 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1MH3Q5d004760; Mon, 22 Feb 2010 17:03:26 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201002221703.o1MH3Q5d004760@svn.freebsd.org> From: Bernhard Schmidt Date: Mon, 22 Feb 2010 17:03: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: r204213 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 17:03:27 -0000 Author: bschmidt Date: Mon Feb 22 17:03:26 2010 New Revision: 204213 URL: http://svn.freebsd.org/changeset/base/204213 Log: Fix some typos. Approved by: rpaulo (mentor) MFC after: 1 week Modified: head/share/man/man9/ieee80211_scan.9 Modified: head/share/man/man9/ieee80211_scan.9 ============================================================================== --- head/share/man/man9/ieee80211_scan.9 Mon Feb 22 16:57:03 2010 (r204212) +++ head/share/man/man9/ieee80211_scan.9 Mon Feb 22 17:03:26 2010 (r204213) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 4, 2009 +.Dd February 20, 2010 .Dt IEEE80211_SCAN 9 .Os .Sh NAME @@ -177,8 +177,8 @@ Scanning is not tied to the state machine that governs vaps except for linkage to the .Dv IEEE80211_S_SCAN state. -One one vap at a time may be scanning; this scheduling policy -is handle in +Only one vap at a time may be scanning; this scheduling policy +is handled in .Fn ieee80211_new_state and is transparent to scanning code. .Pp From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 17:03:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A8D110656C9; Mon, 22 Feb 2010 17:03:46 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 180518FC1F; Mon, 22 Feb 2010 17:03:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1MH3jIh004864; Mon, 22 Feb 2010 17:03:45 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1MH3jdH004862; Mon, 22 Feb 2010 17:03:45 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201002221703.o1MH3jdH004862@svn.freebsd.org> From: "Justin T. Gibbs" Date: Mon, 22 Feb 2010 17:03: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: r204214 - head/sys/amd64/amd64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 17:03:46 -0000 Author: gibbs Date: Mon Feb 22 17:03:45 2010 New Revision: 204214 URL: http://svn.freebsd.org/changeset/base/204214 Log: Enforce stronger semantics for bus-dma alignment (currently only on amd64). Now all contiguous regions returned from bus-dma will be aligned to the alignment constraint and all but the last region are guaranteed to be a multiple of the alignment in length. This also means that the relative alignment of two adjacent bytes in the I/O stream have a difference of 1 even if they are not physically contiguous. The old code, when needing to perform a copy in order to align data, only copied the amount of data needed to reach the next page boundary. This often left an unaligned end to the segment. Drivers such as Xen's blkfront can't deal with such segments. The downside to this approach is that, once an unaligned region is encountered, the remainder of the I/O will be bounced. However, bouncing should be rare. It is typically caused by non-performance critical userland programs that don't bother to align their I/O buffers (e.g. bsdlabel). In-kernel I/O buffers are always aligned to at least a page boundary. Reviewed by: scottl MFC after: 2 weeks Modified: head/sys/amd64/amd64/busdma_machdep.c Modified: head/sys/amd64/amd64/busdma_machdep.c ============================================================================== --- head/sys/amd64/amd64/busdma_machdep.c Mon Feb 22 17:03:26 2010 (r204213) +++ head/sys/amd64/amd64/busdma_machdep.c Mon Feb 22 17:03:45 2010 (r204214) @@ -239,8 +239,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, newtag->alignment = alignment; newtag->boundary = boundary; newtag->lowaddr = trunc_page((vm_paddr_t)lowaddr) + (PAGE_SIZE - 1); - newtag->highaddr = trunc_page((vm_paddr_t)highaddr) + - (PAGE_SIZE - 1); + newtag->highaddr = trunc_page((vm_paddr_t)highaddr) + (PAGE_SIZE - 1); newtag->filter = filter; newtag->filterarg = filterarg; newtag->maxsize = maxsize; @@ -605,13 +604,18 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm vendaddr = (vm_offset_t)buf + buflen; while (vaddr < vendaddr) { + bus_size_t sg_len; + + sg_len = PAGE_SIZE - ((vm_offset_t)vaddr & PAGE_MASK); if (pmap) paddr = pmap_extract(pmap, vaddr); else paddr = pmap_kextract(vaddr); - if (run_filter(dmat, paddr) != 0) + if (run_filter(dmat, paddr) != 0) { + sg_len = roundup2(sg_len, dmat->alignment); map->pagesneeded++; - vaddr += (PAGE_SIZE - ((vm_offset_t)vaddr & PAGE_MASK)); + } + vaddr += sg_len; } CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded); } @@ -644,6 +648,8 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm bmask = ~(dmat->boundary - 1); for (seg = *segp; buflen > 0 ; ) { + bus_size_t max_sgsize; + /* * Get the physical address for this segment. */ @@ -655,11 +661,15 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm /* * Compute the segment size, and adjust counts. */ - sgsize = PAGE_SIZE - ((u_long)curaddr & PAGE_MASK); - if (sgsize > dmat->maxsegsz) - sgsize = dmat->maxsegsz; - if (buflen < sgsize) - sgsize = buflen; + max_sgsize = MIN(buflen, dmat->maxsegsz); + sgsize = PAGE_SIZE - ((vm_offset_t)curaddr & PAGE_MASK); + if (map->pagesneeded != 0 && run_filter(dmat, curaddr)) { + sgsize = roundup2(sgsize, dmat->alignment); + sgsize = MIN(sgsize, max_sgsize); + curaddr = add_bounce_page(dmat, map, vaddr, sgsize); + } else { + sgsize = MIN(sgsize, max_sgsize); + } /* * Make sure we don't cross any boundaries. @@ -670,9 +680,6 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm sgsize = (baddr - curaddr); } - if (map->pagesneeded != 0 && run_filter(dmat, curaddr)) - curaddr = add_bounce_page(dmat, map, vaddr, sgsize); - /* * Insert chunk into a segment, coalescing with * previous segment if possible. From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 17:34:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 997FB106566B; Mon, 22 Feb 2010 17:34:35 +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 86B668FC08; Mon, 22 Feb 2010 17:34:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1MHYZAO011749; Mon, 22 Feb 2010 17:34:35 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1MHYZEg011747; Mon, 22 Feb 2010 17:34:35 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002221734.o1MHYZEg011747@svn.freebsd.org> From: Alexander Motin Date: Mon, 22 Feb 2010 17:34: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: r204216 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 17:34:35 -0000 Author: mav Date: Mon Feb 22 17:34:35 2010 New Revision: 204216 URL: http://svn.freebsd.org/changeset/base/204216 Log: Oops! Wrong word order. :( Modified: head/sys/dev/ata/chipsets/ata-intel.c Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Mon Feb 22 17:10:47 2010 (r204215) +++ head/sys/dev/ata/chipsets/ata-intel.c Mon Feb 22 17:34:35 2010 (r204216) @@ -140,22 +140,22 @@ ata_intel_probe(device_t dev) { ATA_I82801JI_AH, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, { ATA_I82801JI_R1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, { ATA_I82801JI_S2, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, - { 0x80863a20, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x80863a21, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x80863a22, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x80863a23, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x80863a24, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x80863a25, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x80863a26, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x80863a27, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x80863a28, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x80863a29, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x80863a2a, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x80863a2b, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x80863a2c, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x80863a2d, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x80863a2e, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x80863a2f, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3a208086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3a218086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3a228086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3a238086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3a248086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3a258086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3a268086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3a278086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3a288086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3a298086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3a2a8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3a2b8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3a2c8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3a2d8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3a2e8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3a2f8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, { ATA_I31244, 0, 0, 2, ATA_SA150, "31244" }, { ATA_ISCH, 0, 0, 1, ATA_UDMA5, "SCH" }, { 0, 0, 0, 0, 0, 0}}; From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 18:49:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 657D11065672; Mon, 22 Feb 2010 18:49:43 +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 542548FC13; Mon, 22 Feb 2010 18:49:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1MInhui028276; Mon, 22 Feb 2010 18:49:43 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1MInhmj028274; Mon, 22 Feb 2010 18:49:43 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201002221849.o1MInhmj028274@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 22 Feb 2010 18:49: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: r204218 - head/sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 18:49:43 -0000 Author: nwhitehorn Date: Mon Feb 22 18:49:43 2010 New Revision: 204218 URL: http://svn.freebsd.org/changeset/base/204218 Log: Provide a new useless feature: an led(4) interface for the system's sleep LED. Modified: head/sys/powerpc/powermac/smu.c Modified: head/sys/powerpc/powermac/smu.c ============================================================================== --- head/sys/powerpc/powermac/smu.c Mon Feb 22 18:07:41 2010 (r204217) +++ head/sys/powerpc/powermac/smu.c Mon Feb 22 18:49:43 2010 (r204218) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -114,6 +115,8 @@ struct smu_softc { /* Thermal management parameters */ int sc_target_temp; /* Default 55 C */ int sc_critical_temp; /* Default 90 C */ + + struct cdev *sc_leddev; }; /* regular bus attachment functions */ @@ -133,6 +136,7 @@ static int smu_get_datablock(device_t de static void smu_attach_fans(device_t dev, phandle_t fanroot); static void smu_attach_sensors(device_t dev, phandle_t sensroot); static void smu_fanmgt_callout(void *xdev); +static void smu_set_sleepled(void *xdev, int onoff); /* where to find the doorbell GPIO */ @@ -292,6 +296,11 @@ smu_attach(device_t dev) callout_init(&sc->sc_fanmgt_callout, 1); smu_fanmgt_callout(dev); + /* + * Set up LED interface + */ + sc->sc_leddev = led_create(smu_set_sleepled, dev, "sleepled"); + return (0); } @@ -853,3 +862,18 @@ smu_fanmgt_callout(void *xdev) { ms_to_ticks(SMU_FANMGT_INTERVAL), smu_fanmgt_callout, smu); } +static void +smu_set_sleepled(void *xdev, int onoff) +{ + struct smu_cmd cmd; + device_t smu = xdev; + + cmd.cmd = SMU_MISC; + cmd.len = 3; + cmd.data[0] = SMU_MISC_LED_CTRL; + cmd.data[1] = 0; + cmd.data[2] = onoff; + + smu_run_cmd(smu, &cmd); +} + From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 18:51:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15CC51065670; Mon, 22 Feb 2010 18:51:15 +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 DFBB28FC17; Mon, 22 Feb 2010 18:51:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1MIpEin028645; Mon, 22 Feb 2010 18:51:14 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1MIpEbb028643; Mon, 22 Feb 2010 18:51:14 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002221851.o1MIpEbb028643@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 22 Feb 2010 18:51: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: r204219 - head/sys/dev/re X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 18:51:15 -0000 Author: yongari Date: Mon Feb 22 18:51:14 2010 New Revision: 204219 URL: http://svn.freebsd.org/changeset/base/204219 Log: Add TSO on VLANs. Because re(4) has a TSO limitation for jumbo frame, make sure to update VLAN capabilities whenever jumbo frame is configured. While I'm here rearrange interface capabilities configuration. The controller requires VLAN hardware tagging to make TSO work on VLANs so explicitly check this requirement. Modified: head/sys/dev/re/if_re.c Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Mon Feb 22 18:49:43 2010 (r204218) +++ head/sys/dev/re/if_re.c Mon Feb 22 18:51:14 2010 (r204219) @@ -1429,7 +1429,7 @@ re_attach(device_t dev) */ if ((sc->rl_flags & RL_FLAG_DESCV2) == 0) { ifp->if_hwassist |= CSUM_TSO; - ifp->if_capabilities |= IFCAP_TSO4; + ifp->if_capabilities |= IFCAP_TSO4 | IFCAP_VLAN_HWTSO; } /* @@ -1451,7 +1451,7 @@ re_attach(device_t dev) * packets in TSO size. */ ifp->if_hwassist &= ~CSUM_TSO; - ifp->if_capenable &= ~IFCAP_TSO4; + ifp->if_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO); #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; #endif @@ -2789,6 +2789,7 @@ re_ioctl(struct ifnet *ifp, u_long comma (ifp->if_capenable & IFCAP_TSO4) != 0) { ifp->if_capenable &= ~IFCAP_TSO4; ifp->if_hwassist &= ~CSUM_TSO; + VLAN_CAPABILITIES(ifp); } RL_UNLOCK(sc); break; @@ -2855,14 +2856,10 @@ re_ioctl(struct ifnet *ifp, u_long comma ifp->if_hwassist &= ~RE_CSUM_FEATURES; reinit = 1; } - if (mask & IFCAP_VLAN_HWTAGGING) { - ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; - reinit = 1; - } - if (mask & IFCAP_TSO4) { + if ((mask & IFCAP_TSO4) != 0 && + (ifp->if_capabilities & IFCAP_TSO) != 0) { ifp->if_capenable ^= IFCAP_TSO4; - if ((IFCAP_TSO4 & ifp->if_capenable) && - (IFCAP_TSO4 & ifp->if_capabilities)) + if ((IFCAP_TSO4 & ifp->if_capenable) != 0) ifp->if_hwassist |= CSUM_TSO; else ifp->if_hwassist &= ~CSUM_TSO; @@ -2872,6 +2869,17 @@ re_ioctl(struct ifnet *ifp, u_long comma ifp->if_hwassist &= ~CSUM_TSO; } } + if ((mask & IFCAP_VLAN_HWTSO) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0) + ifp->if_capenable ^= IFCAP_VLAN_HWTSO; + if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) { + ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + /* TSO over VLAN requires VLAN hardware tagging. */ + if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0) + ifp->if_capenable &= ~IFCAP_VLAN_HWTSO; + reinit = 1; + } if ((mask & IFCAP_WOL) != 0 && (ifp->if_capabilities & IFCAP_WOL) != 0) { if ((mask & IFCAP_WOL_UCAST) != 0) From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 18:53:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19AC0106566C; Mon, 22 Feb 2010 18:53:37 +0000 (UTC) (envelope-from remko@elvandar.org) Received: from mailgate.jr-hosting.nl (mailgate.jr-hosting.nl [78.46.126.30]) by mx1.freebsd.org (Postfix) with ESMTP id 944C28FC1C; Mon, 22 Feb 2010 18:53:36 +0000 (UTC) Received: from websrv01.jr-hosting.nl (websrv01 [78.47.69.233]) by mailgate.jr-hosting.nl (Postfix) with ESMTP id 138EA1CC60; Mon, 22 Feb 2010 19:53:35 +0100 (CET) Received: from a83-163-38-147.adsl.xs4all.nl ([83.163.38.147] helo=axantucar.elvandar.int) by websrv01.jr-hosting.nl with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71 (FreeBSD)) (envelope-from ) id 1NjdPS-000L8P-RJ; Mon, 22 Feb 2010 19:53:35 +0100 Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Remko Lodder In-Reply-To: <201002182316.o1INGKqf007786@svn.freebsd.org> Date: Mon, 22 Feb 2010 19:53:33 +0100 Content-Transfer-Encoding: 7bit Message-Id: References: <201002182316.o1INGKqf007786@svn.freebsd.org> To: Pawel Jakub Dawidek X-Mailer: Apple Mail (2.1077) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r204076 - in head: etc/defaults etc/rc.d sbin sbin/ggate/ggatec sbin/ggate/ggatel sbin/hastctl sbin/hastd share/examples share/examples/hast share/man/man5 sys/geom/gate X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 18:53:37 -0000 On Feb 19, 2010, at 12:16 AM, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Thu Feb 18 23:16:19 2010 > New Revision: 204076 > URL: http://svn.freebsd.org/changeset/base/204076 > > Log: > Please welcome HAST - Highly Avalable Storage. > > \o/ !! -- /"\ Best regards, | remko@FreeBSD.org \ / Remko Lodder | remko@EFnet X http://www.evilcoder.org/ | / \ ASCII Ribbon Campaign | Against HTML Mail and News From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 19:17:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F1FA106566C; Mon, 22 Feb 2010 19:17:18 +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 1D5FF8FC0C; Mon, 22 Feb 2010 19:17:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1MJHIVG034405; Mon, 22 Feb 2010 19:17:18 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1MJHIuT034400; Mon, 22 Feb 2010 19:17:18 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002221917.o1MJHIuT034400@svn.freebsd.org> From: Alexander Motin Date: Mon, 22 Feb 2010 19: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: r204220 - in head/sys/cam: . ata scsi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 19:17:18 -0000 Author: mav Date: Mon Feb 22 19:17:17 2010 New Revision: 204220 URL: http://svn.freebsd.org/changeset/base/204220 Log: Virtualize transport part of periph announcement. Modified: head/sys/cam/ata/ata_xpt.c head/sys/cam/cam_xpt.c head/sys/cam/cam_xpt_internal.h head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Mon Feb 22 18:51:14 2010 (r204219) +++ head/sys/cam/ata/ata_xpt.c Mon Feb 22 19:17:17 2010 (r204220) @@ -178,11 +178,13 @@ static void ata_dev_async(u_int32_t asy struct cam_ed *device, void *async_arg); static void ata_action(union ccb *start_ccb); +static void ata_announce_periph(struct cam_periph *periph); static struct xpt_xport ata_xport = { .alloc_device = ata_alloc_device, .action = ata_action, .async = ata_dev_async, + .announce = ata_announce_periph, }; struct xpt_xport * @@ -1641,3 +1643,82 @@ ata_dev_async(u_int32_t async_code, stru } } +static void +ata_announce_periph(struct cam_periph *periph) +{ + struct ccb_pathinq cpi; + struct ccb_trans_settings cts; + struct cam_path *path = periph->path; + u_int speed; + u_int mb; + + mtx_assert(periph->sim->mtx, MA_OWNED); + + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; + cts.type = CTS_TYPE_CURRENT_SETTINGS; + xpt_action((union ccb*)&cts); + if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) + return; + /* Ask the SIM for its base transfer speed */ + xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL); + cpi.ccb_h.func_code = XPT_PATH_INQ; + xpt_action((union ccb *)&cpi); + /* Report connection speed */ + speed = cpi.base_transfer_speed; + if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_ATA) { + struct ccb_trans_settings_ata *ata = + &cts.xport_specific.ata; + + if (ata->valid & CTS_ATA_VALID_MODE) + speed = ata_mode2speed(ata->mode); + } + if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SATA) { + struct ccb_trans_settings_sata *sata = + &cts.xport_specific.sata; + + if (sata->valid & CTS_SATA_VALID_REVISION) + speed = ata_revision2speed(sata->revision); + } + mb = speed / 1000; + if (mb > 0) + printf("%s%d: %d.%03dMB/s transfers", + periph->periph_name, periph->unit_number, + mb, speed % 1000); + else + printf("%s%d: %dKB/s transfers", periph->periph_name, + periph->unit_number, speed); + /* Report additional information about connection */ + if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_ATA) { + struct ccb_trans_settings_ata *ata = + &cts.xport_specific.ata; + + printf(" ("); + if (ata->valid & CTS_ATA_VALID_MODE) + printf("%s, ", ata_mode2string(ata->mode)); + if ((ata->valid & CTS_ATA_VALID_ATAPI) && ata->atapi != 0) + printf("ATAPI %dbytes, ", ata->atapi); + if (ata->valid & CTS_ATA_VALID_BYTECOUNT) + printf("PIO %dbytes", ata->bytecount); + printf(")"); + } + if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SATA) { + struct ccb_trans_settings_sata *sata = + &cts.xport_specific.sata; + + printf(" ("); + if (sata->valid & CTS_SATA_VALID_REVISION) + printf("SATA %d.x, ", sata->revision); + else + printf("SATA, "); + if (sata->valid & CTS_SATA_VALID_MODE) + printf("%s, ", ata_mode2string(sata->mode)); + if ((sata->valid & CTS_ATA_VALID_ATAPI) && sata->atapi != 0) + printf("ATAPI %dbytes, ", sata->atapi); + if (sata->valid & CTS_SATA_VALID_BYTECOUNT) + printf("PIO %dbytes", sata->bytecount); + printf(")"); + } + printf("\n"); +} + Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Mon Feb 22 18:51:14 2010 (r204219) +++ head/sys/cam/cam_xpt.c Mon Feb 22 19:17:17 2010 (r204220) @@ -1065,20 +1065,10 @@ xpt_remove_periph(struct cam_periph *per void xpt_announce_periph(struct cam_periph *periph, char *announce_string) { - struct ccb_pathinq cpi; - struct ccb_trans_settings cts; - struct cam_path *path; - u_int speed; - u_int freq; - u_int mb; + struct cam_path *path = periph->path; mtx_assert(periph->sim->mtx, MA_OWNED); - path = periph->path; - /* - * To ensure that this is printed in one piece, - * mask out CAM interrupts. - */ printf("%s%d at %s%d bus %d scbus%d target %d lun %d\n", periph->periph_name, periph->unit_number, path->bus->sim->sim_name, @@ -1089,157 +1079,26 @@ xpt_announce_periph(struct cam_periph *p path->device->lun_id); printf("%s%d: ", periph->periph_name, periph->unit_number); if (path->device->protocol == PROTO_SCSI) - scsi_print_inquiry(&path->device->inq_data); + scsi_print_inquiry(&path->device->inq_data); else if (path->device->protocol == PROTO_ATA || path->device->protocol == PROTO_SATAPM) ata_print_ident(&path->device->ident_data); else - printf("Unknown protocol device\n"); + printf("Unknown protocol device\n"); if (bootverbose && path->device->serial_num_len > 0) { /* Don't wrap the screen - print only the first 60 chars */ printf("%s%d: Serial Number %.60s\n", periph->periph_name, periph->unit_number, path->device->serial_num); } - xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); - cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; - cts.type = CTS_TYPE_CURRENT_SETTINGS; - xpt_action((union ccb*)&cts); - if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - return; - } - - /* Ask the SIM for its base transfer speed */ - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); - - speed = cpi.base_transfer_speed; - freq = 0; - if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SPI) { - struct ccb_trans_settings_spi *spi = - &cts.xport_specific.spi; - - if ((spi->valid & CTS_SPI_VALID_SYNC_OFFSET) != 0 - && spi->sync_offset != 0) { - freq = scsi_calc_syncsrate(spi->sync_period); - speed = freq; - } - if ((spi->valid & CTS_SPI_VALID_BUS_WIDTH) != 0) - speed *= (0x01 << spi->bus_width); - } - if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_FC) { - struct ccb_trans_settings_fc *fc = - &cts.xport_specific.fc; - - if (fc->valid & CTS_FC_VALID_SPEED) - speed = fc->bitrate; - } - if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SAS) { - struct ccb_trans_settings_sas *sas = - &cts.xport_specific.sas; - - if (sas->valid & CTS_SAS_VALID_SPEED) - speed = sas->bitrate; - } - if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_ATA) { - struct ccb_trans_settings_ata *ata = - &cts.xport_specific.ata; - - if (ata->valid & CTS_ATA_VALID_MODE) - speed = ata_mode2speed(ata->mode); - } - if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SATA) { - struct ccb_trans_settings_sata *sata = - &cts.xport_specific.sata; - - if (sata->valid & CTS_SATA_VALID_REVISION) - speed = ata_revision2speed(sata->revision); - } - - mb = speed / 1000; - if (mb > 0) - printf("%s%d: %d.%03dMB/s transfers", - periph->periph_name, periph->unit_number, - mb, speed % 1000); - else - printf("%s%d: %dKB/s transfers", periph->periph_name, - periph->unit_number, speed); - /* Report additional information about SPI connections */ - if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SPI) { - struct ccb_trans_settings_spi *spi; - - spi = &cts.xport_specific.spi; - if (freq != 0) { - printf(" (%d.%03dMHz%s, offset %d", freq / 1000, - freq % 1000, - (spi->ppr_options & MSG_EXT_PPR_DT_REQ) != 0 - ? " DT" : "", - spi->sync_offset); - } - if ((spi->valid & CTS_SPI_VALID_BUS_WIDTH) != 0 - && spi->bus_width > 0) { - if (freq != 0) { - printf(", "); - } else { - printf(" ("); - } - printf("%dbit)", 8 * (0x01 << spi->bus_width)); - } else if (freq != 0) { - printf(")"); - } - } - if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_FC) { - struct ccb_trans_settings_fc *fc; - - fc = &cts.xport_specific.fc; - if (fc->valid & CTS_FC_VALID_WWNN) - printf(" WWNN 0x%llx", (long long) fc->wwnn); - if (fc->valid & CTS_FC_VALID_WWPN) - printf(" WWPN 0x%llx", (long long) fc->wwpn); - if (fc->valid & CTS_FC_VALID_PORT) - printf(" PortID 0x%x", fc->port); - } - if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_ATA) { - struct ccb_trans_settings_ata *ata = - &cts.xport_specific.ata; - - printf(" ("); - if (ata->valid & CTS_ATA_VALID_MODE) - printf("%s, ", ata_mode2string(ata->mode)); - if ((ata->valid & CTS_ATA_VALID_ATAPI) && ata->atapi != 0) - printf("ATAPI %dbytes, ", ata->atapi); - if (ata->valid & CTS_ATA_VALID_BYTECOUNT) - printf("PIO %dbytes", ata->bytecount); - printf(")"); - } - if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SATA) { - struct ccb_trans_settings_sata *sata = - &cts.xport_specific.sata; - - printf(" ("); - if (sata->valid & CTS_SATA_VALID_REVISION) - printf("SATA %d.x, ", sata->revision); - else - printf("SATA, "); - if (sata->valid & CTS_SATA_VALID_MODE) - printf("%s, ", ata_mode2string(sata->mode)); - if ((sata->valid & CTS_ATA_VALID_ATAPI) && sata->atapi != 0) - printf("ATAPI %dbytes, ", sata->atapi); - if (sata->valid & CTS_SATA_VALID_BYTECOUNT) - printf("PIO %dbytes", sata->bytecount); - printf(")"); - } + /* Announce transport details. */ + (*(path->bus->xport->announce))(periph); + /* Announce command queueing. */ if (path->device->inq_flags & SID_CmdQue || path->device->flags & CAM_DEV_TAG_AFTER_COUNT) { printf("\n%s%d: Command Queueing enabled", periph->periph_name, periph->unit_number); } - printf("\n"); - - /* - * We only want to print the caller's announce string if they've - * passed one in.. - */ + /* Announce caller's details if they've passed in. */ if (announce_string != NULL) printf("%s%d: %s\n", periph->periph_name, periph->unit_number, announce_string); Modified: head/sys/cam/cam_xpt_internal.h ============================================================================== --- head/sys/cam/cam_xpt_internal.h Mon Feb 22 18:51:14 2010 (r204219) +++ head/sys/cam/cam_xpt_internal.h Mon Feb 22 19:17:17 2010 (r204220) @@ -44,8 +44,7 @@ typedef void (*xpt_dev_async_func)(u_int struct cam_et *target, struct cam_ed *device, void *async_arg); -typedef void (*xpt_announce_periph_func)(struct cam_periph *periph, - char *announce_string); +typedef void (*xpt_announce_periph_func)(struct cam_periph *periph); struct xpt_xport { xpt_alloc_device_func alloc_device; Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Mon Feb 22 18:51:14 2010 (r204219) +++ head/sys/cam/scsi/scsi_xpt.c Mon Feb 22 19:17:17 2010 (r204220) @@ -552,11 +552,13 @@ static void scsi_dev_async(u_int32_t as struct cam_ed *device, void *async_arg); static void scsi_action(union ccb *start_ccb); +static void scsi_announce_periph(struct cam_periph *periph); static struct xpt_xport scsi_xport = { .alloc_device = scsi_alloc_device, .action = scsi_action, .async = scsi_dev_async, + .announce = scsi_announce_periph, }; struct xpt_xport * @@ -2414,3 +2416,100 @@ scsi_dev_async(u_int32_t async_code, str } } +static void +scsi_announce_periph(struct cam_periph *periph) +{ + struct ccb_pathinq cpi; + struct ccb_trans_settings cts; + struct cam_path *path = periph->path; + u_int speed; + u_int freq; + u_int mb; + + mtx_assert(periph->sim->mtx, MA_OWNED); + + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; + cts.type = CTS_TYPE_CURRENT_SETTINGS; + xpt_action((union ccb*)&cts); + if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) + return; + /* Ask the SIM for its base transfer speed */ + xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL); + cpi.ccb_h.func_code = XPT_PATH_INQ; + xpt_action((union ccb *)&cpi); + /* Report connection speed */ + speed = cpi.base_transfer_speed; + freq = 0; + if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SPI) { + struct ccb_trans_settings_spi *spi = + &cts.xport_specific.spi; + + if ((spi->valid & CTS_SPI_VALID_SYNC_OFFSET) != 0 + && spi->sync_offset != 0) { + freq = scsi_calc_syncsrate(spi->sync_period); + speed = freq; + } + if ((spi->valid & CTS_SPI_VALID_BUS_WIDTH) != 0) + speed *= (0x01 << spi->bus_width); + } + if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_FC) { + struct ccb_trans_settings_fc *fc = + &cts.xport_specific.fc; + + if (fc->valid & CTS_FC_VALID_SPEED) + speed = fc->bitrate; + } + if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SAS) { + struct ccb_trans_settings_sas *sas = + &cts.xport_specific.sas; + + if (sas->valid & CTS_SAS_VALID_SPEED) + speed = sas->bitrate; + } + mb = speed / 1000; + if (mb > 0) + printf("%s%d: %d.%03dMB/s transfers", + periph->periph_name, periph->unit_number, + mb, speed % 1000); + else + printf("%s%d: %dKB/s transfers", periph->periph_name, + periph->unit_number, speed); + /* Report additional information about SPI connections */ + if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SPI) { + struct ccb_trans_settings_spi *spi; + + spi = &cts.xport_specific.spi; + if (freq != 0) { + printf(" (%d.%03dMHz%s, offset %d", freq / 1000, + freq % 1000, + (spi->ppr_options & MSG_EXT_PPR_DT_REQ) != 0 + ? " DT" : "", + spi->sync_offset); + } + if ((spi->valid & CTS_SPI_VALID_BUS_WIDTH) != 0 + && spi->bus_width > 0) { + if (freq != 0) { + printf(", "); + } else { + printf(" ("); + } + printf("%dbit)", 8 * (0x01 << spi->bus_width)); + } else if (freq != 0) { + printf(")"); + } + } + if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_FC) { + struct ccb_trans_settings_fc *fc; + + fc = &cts.xport_specific.fc; + if (fc->valid & CTS_FC_VALID_WWNN) + printf(" WWNN 0x%llx", (long long) fc->wwnn); + if (fc->valid & CTS_FC_VALID_WWPN) + printf(" WWPN 0x%llx", (long long) fc->wwpn); + if (fc->valid & CTS_FC_VALID_PORT) + printf(" PortID 0x%x", fc->port); + } + printf("\n"); +} + From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 21:01:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C34DB106566B; Mon, 22 Feb 2010 21:01: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 B34BE8FC17; Mon, 22 Feb 2010 21:01:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1ML18Gv057419; Mon, 22 Feb 2010 21:01:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1ML1844057417; Mon, 22 Feb 2010 21:01:08 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201002222101.o1ML1844057417@svn.freebsd.org> From: Marius Strobl Date: Mon, 22 Feb 2010 21:01: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: r204222 - head/sys/dev/gem X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 21:01:08 -0000 Author: marius Date: Mon Feb 22 21:01:08 2010 New Revision: 204222 URL: http://svn.freebsd.org/changeset/base/204222 Log: According to the Linux sungem driver, in case of Apple (K2) GMACs GEM_MIF_CONFIG_MDI0 cannot be trusted when the firmware has powered down the chip so the internal transceiver has to be hardcoded. This is also in line with the AppleGMACEthernet driver, which just doesn't distinguish between internal/external transceiver and MDIO/MDI1 respectively in the first place. Tested by: Andreas Tobler MFC after: 1 week Modified: head/sys/dev/gem/if_gem.c Modified: head/sys/dev/gem/if_gem.c ============================================================================== --- head/sys/dev/gem/if_gem.c Mon Feb 22 20:42:30 2010 (r204221) +++ head/sys/dev/gem/if_gem.c Mon Feb 22 21:01:08 2010 (r204222) @@ -297,8 +297,11 @@ gem_attach(struct gem_softc *sc) /* * Fall back on an internal PHY if no external PHY was found. + * Note that with Apple (K2) GMACs GEM_MIF_CONFIG_MDI0 can't be + * trusted when the firmware has powered down the chip. */ - if (error != 0 && (v & GEM_MIF_CONFIG_MDI0) != 0) { + if (error != 0 && + ((v & GEM_MIF_CONFIG_MDI0) != 0 || GEM_IS_APPLE(sc))) { v &= ~GEM_MIF_CONFIG_PHY_SEL; GEM_BANK1_WRITE_4(sc, GEM_MIF_CONFIG, v); switch (sc->sc_variant) { From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 21:03:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10952106568D; Mon, 22 Feb 2010 21:03: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 00A1C8FC14; Mon, 22 Feb 2010 21:03:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1ML3FBI057944; Mon, 22 Feb 2010 21:03:15 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1ML3FCu057942; Mon, 22 Feb 2010 21:03:15 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002222103.o1ML3FCu057942@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 22 Feb 2010 21:03: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: r204223 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 21:03:16 -0000 Author: yongari Date: Mon Feb 22 21:03:15 2010 New Revision: 204223 URL: http://svn.freebsd.org/changeset/base/204223 Log: Remove Tx mbuf parsing code for VLAN in TSO path. Controller does not support TSO over VLAN if VLAN hardware tagging is disabled so there is no need to check VLAN here. While I'm here make sure to pullup IP/TCP headers in the first buffer. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Mon Feb 22 21:01:08 2010 (r204222) +++ head/sys/dev/bge/if_bge.c Mon Feb 22 21:03:15 2010 (r204223) @@ -3835,12 +3835,11 @@ bge_cksum_pad(struct mbuf *m) static struct mbuf * bge_setup_tso(struct bge_softc *sc, struct mbuf *m, uint16_t *mss) { - struct ether_header *eh; struct ip *ip; struct tcphdr *tcp; struct mbuf *n; uint16_t hlen; - uint32_t ip_off, poff; + uint32_t poff; if (M_WRITABLE(m) == 0) { /* Get a writable copy. */ @@ -3850,28 +3849,16 @@ bge_setup_tso(struct bge_softc *sc, stru return (NULL); m = n; } - ip_off = sizeof(struct ether_header); - m = m_pullup(m, ip_off); + m = m_pullup(m, sizeof(struct ether_header) + sizeof(struct ip)); if (m == NULL) return (NULL); - eh = mtod(m, struct ether_header *); - /* Check the existence of VLAN tag. */ - if (eh->ether_type == htons(ETHERTYPE_VLAN)) { - ip_off = sizeof(struct ether_vlan_header); - m = m_pullup(m, ip_off); - if (m == NULL) - return (NULL); - } - m = m_pullup(m, ip_off + sizeof(struct ip)); - if (m == NULL) - return (NULL); - ip = (struct ip *)(mtod(m, char *) + ip_off); - poff = ip_off + (ip->ip_hl << 2); + ip = (struct ip *)(mtod(m, char *) + sizeof(struct ether_header)); + poff = sizeof(struct ether_header) + (ip->ip_hl << 2); m = m_pullup(m, poff + sizeof(struct tcphdr)); if (m == NULL) return (NULL); tcp = (struct tcphdr *)(mtod(m, char *) + poff); - m = m_pullup(m, poff + sizeof(struct tcphdr) + tcp->th_off); + m = m_pullup(m, poff + (tcp->th_off << 2)); if (m == NULL) return (NULL); /* From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 22:05:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E96A91065670; Mon, 22 Feb 2010 22:05:49 +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 D9A458FC0C; Mon, 22 Feb 2010 22:05:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1MM5nHZ071852; Mon, 22 Feb 2010 22:05:49 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1MM5nax071850; Mon, 22 Feb 2010 22:05:49 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002222205.o1MM5nax071850@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 22 Feb 2010 22:05: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: r204225 - head/sys/dev/jme X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 22:05:50 -0000 Author: yongari Date: Mon Feb 22 22:05:49 2010 New Revision: 204225 URL: http://svn.freebsd.org/changeset/base/204225 Log: Add TSO support on VLANs. jme(4) controllers do not require VLAN hardware tagging to make TSO work over VLANs. Modified: head/sys/dev/jme/if_jme.c Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Mon Feb 22 21:45:20 2010 (r204224) +++ head/sys/dev/jme/if_jme.c Mon Feb 22 22:05:49 2010 (r204225) @@ -775,7 +775,7 @@ jme_attach(device_t dev) /* VLAN capability setup */ ifp->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | - IFCAP_VLAN_HWCSUM; + IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTSO; ifp->if_capenable = ifp->if_capabilities; /* Tell the upper layer(s) we support long frames. */ @@ -1992,6 +1992,9 @@ jme_ioctl(struct ifnet *ifp, u_long cmd, if ((mask & IFCAP_VLAN_HWCSUM) != 0 && (ifp->if_capabilities & IFCAP_VLAN_HWCSUM) != 0) ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; + if ((mask & IFCAP_VLAN_HWTSO) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0) + ifp->if_capenable ^= IFCAP_VLAN_HWTSO; if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && (IFCAP_VLAN_HWTAGGING & ifp->if_capabilities) != 0) { ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 22:32:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2738106566C; Mon, 22 Feb 2010 22:32:24 +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 78DF68FC12; Mon, 22 Feb 2010 22:32:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1MMWOI5077750; Mon, 22 Feb 2010 22:32:24 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1MMWOPA077745; Mon, 22 Feb 2010 22:32:24 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201002222232.o1MMWOPA077745@svn.freebsd.org> From: Xin LI Date: Mon, 22 Feb 2010 22:32: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: r204227 - in head/gnu/usr.bin: diff diff3 sdiff X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 22:32:24 -0000 Author: delphij Date: Mon Feb 22 22:32:24 2010 New Revision: 204227 URL: http://svn.freebsd.org/changeset/base/204227 Log: POSIX patch(1) would treat -b as different meaning (the functionality is to be provided by --suffix). Looking at the usage here in diffutils, it seems that we can just get rid of the -b .orig stuff. This resolves a problem that can triggered if we move toward to a more permissively licensed patch(1) program. Modified: head/gnu/usr.bin/diff/Makefile head/gnu/usr.bin/diff3/Makefile head/gnu/usr.bin/sdiff/Makefile Modified: head/gnu/usr.bin/diff/Makefile ============================================================================== --- head/gnu/usr.bin/diff/Makefile Mon Feb 22 22:27:26 2010 (r204226) +++ head/gnu/usr.bin/diff/Makefile Mon Feb 22 22:32:24 2010 (r204227) @@ -29,7 +29,7 @@ LDADD= -lgnuregex .for f in diff.c context.c ${f}: ${DIFFSRC}/${f} ${.CURDIR}/${f}.diff - patch -s -b .orig -o ${.TARGET} < ${.CURDIR}/${f}.diff ${DIFFSRC}/${f} + patch -s -o ${.TARGET} < ${.CURDIR}/${f}.diff ${DIFFSRC}/${f} CLEANFILES+= ${f} .endfor Modified: head/gnu/usr.bin/diff3/Makefile ============================================================================== --- head/gnu/usr.bin/diff3/Makefile Mon Feb 22 22:27:26 2010 (r204226) +++ head/gnu/usr.bin/diff3/Makefile Mon Feb 22 22:32:24 2010 (r204227) @@ -20,7 +20,7 @@ CFLAGS+=-DDEFAULT_DIFF_PROGRAM=\"/usr/bi .for f in diff3.c ${f}: ${DIFFSRC}/${f} ${.CURDIR}/${f}.diff - patch -s -b .orig -o ${.TARGET} < ${.CURDIR}/${f}.diff ${DIFFSRC}/${f} + patch -s -o ${.TARGET} < ${.CURDIR}/${f}.diff ${DIFFSRC}/${f} CLEANFILES+= ${f} .endfor Modified: head/gnu/usr.bin/sdiff/Makefile ============================================================================== --- head/gnu/usr.bin/sdiff/Makefile Mon Feb 22 22:27:26 2010 (r204226) +++ head/gnu/usr.bin/sdiff/Makefile Mon Feb 22 22:32:24 2010 (r204227) @@ -21,7 +21,7 @@ CFLAGS+=-DDEFAULT_DIFF_PROGRAM=\"/usr/bi .for f in sdiff.c ${f}: ${DIFFSRC}/${f} ${.CURDIR}/${f}.diff - patch -s -b .orig -o ${.TARGET} < ${.CURDIR}/${f}.diff ${DIFFSRC}/${f} + patch -s -o ${.TARGET} < ${.CURDIR}/${f}.diff ${DIFFSRC}/${f} CLEANFILES+= ${f} .endfor From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 22:41:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E0771065670; Mon, 22 Feb 2010 22:41:28 +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 F227A8FC0C; Mon, 22 Feb 2010 22:41:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1MMfRNZ079768; Mon, 22 Feb 2010 22:41:27 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1MMfRiA079766; Mon, 22 Feb 2010 22:41:27 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002222241.o1MMfRiA079766@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 22 Feb 2010 22:41: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: r204228 - head/sys/dev/alc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 22:41:28 -0000 Author: yongari Date: Mon Feb 22 22:41:27 2010 New Revision: 204228 URL: http://svn.freebsd.org/changeset/base/204228 Log: Add TSO support on VLANs. Also make sure to update TSO capability whenever jumbo frame is configured. While I'm here remove unnecessary check of VLAN hardware checksum offloading. vlan(4) already takes care of this. Modified: head/sys/dev/alc/if_alc.c Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Mon Feb 22 22:32:24 2010 (r204227) +++ head/sys/dev/alc/if_alc.c Mon Feb 22 22:41:27 2010 (r204228) @@ -84,9 +84,6 @@ __FBSDID("$FreeBSD$"); #else #define ALC_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) #endif -#ifndef IFCAP_VLAN_HWTSO -#define IFCAP_VLAN_HWTSO 0 -#endif MODULE_DEPEND(alc, pci, 1, 1, 1); MODULE_DEPEND(alc, ether, 1, 1, 1); @@ -756,8 +753,8 @@ alc_attach(device_t dev) ether_ifattach(ifp, sc->alc_eaddr); /* VLAN capability setup. */ - ifp->if_capabilities |= IFCAP_VLAN_MTU; - ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM; + ifp->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | + IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTSO; ifp->if_capenable = ifp->if_capabilities; /* * XXX @@ -2133,6 +2130,7 @@ alc_ioctl(struct ifnet *ifp, u_long cmd, (ifp->if_capenable & IFCAP_TSO4) != 0) { ifp->if_capenable &= ~IFCAP_TSO4; ifp->if_hwassist &= ~CSUM_TSO; + VLAN_CAPABILITIES(ifp); } ALC_UNLOCK(sc); } @@ -2204,14 +2202,6 @@ alc_ioctl(struct ifnet *ifp, u_long cmd, if ((mask & IFCAP_VLAN_HWTSO) != 0 && (ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0) ifp->if_capenable ^= IFCAP_VLAN_HWTSO; - /* - * VLAN hardware tagging is required to do checksum - * offload or TSO on VLAN interface. Checksum offload - * on VLAN interface also requires hardware checksum - * offload of parent interface. - */ - if ((ifp->if_capenable & IFCAP_TXCSUM) == 0) - ifp->if_capenable &= ~IFCAP_VLAN_HWCSUM; if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0) ifp->if_capenable &= ~(IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM); From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 23:35:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CC27106566B; Mon, 22 Feb 2010 23:35: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 032A08FC0A; Mon, 22 Feb 2010 23:35:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1MNZZlE091749; Mon, 22 Feb 2010 23:35:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1MNZZ4Y091747; Mon, 22 Feb 2010 23:35:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002222335.o1MNZZ4Y091747@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 22 Feb 2010 23:35: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: r204230 - head/sys/dev/alc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 23:35:36 -0000 Author: yongari Date: Mon Feb 22 23:35:35 2010 New Revision: 204230 URL: http://svn.freebsd.org/changeset/base/204230 Log: Remove Tx mbuf parsing code for VLAN in TSO path. Controller does not support TSO over VLAN if VLAN hardware tagging is disabled so there is no need to check VLAN here. Modified: head/sys/dev/alc/if_alc.c Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Mon Feb 22 22:41:36 2010 (r204229) +++ head/sys/dev/alc/if_alc.c Mon Feb 22 23:35:35 2010 (r204230) @@ -1788,7 +1788,7 @@ alc_encap(struct alc_softc *sc, struct m struct tcphdr *tcp; bus_dma_segment_t txsegs[ALC_MAXTXSEGS]; bus_dmamap_t map; - uint32_t cflags, hdrlen, ip_off, poff, vtag; + uint32_t cflags, hdrlen, poff, vtag; int error, idx, nsegs, prod; ALC_LOCK_ASSERT(sc); @@ -1798,7 +1798,7 @@ alc_encap(struct alc_softc *sc, struct m m = *m_head; ip = NULL; tcp = NULL; - ip_off = poff = 0; + poff = 0; if ((m->m_pkthdr.csum_flags & (ALC_CSUM_FEATURES | CSUM_TSO)) != 0) { /* * AR8131/AR8132 requires offset of TCP/UDP header in its @@ -1808,7 +1808,6 @@ alc_encap(struct alc_softc *sc, struct m * cycles on FreeBSD so fast host CPU is required to get * smooth TSO performance. */ - struct ether_header *eh; if (M_WRITABLE(m) == 0) { /* Get a writable copy. */ @@ -1822,32 +1821,13 @@ alc_encap(struct alc_softc *sc, struct m *m_head = m; } - ip_off = sizeof(struct ether_header); - m = m_pullup(m, ip_off); + m = m_pullup(m, sizeof(struct ether_header) + sizeof(struct ip)); if (m == NULL) { *m_head = NULL; return (ENOBUFS); } - eh = mtod(m, struct ether_header *); - /* - * Check if hardware VLAN insertion is off. - * Additional check for LLC/SNAP frame? - */ - if (eh->ether_type == htons(ETHERTYPE_VLAN)) { - ip_off = sizeof(struct ether_vlan_header); - m = m_pullup(m, ip_off); - if (m == NULL) { - *m_head = NULL; - return (ENOBUFS); - } - } - m = m_pullup(m, ip_off + sizeof(struct ip)); - if (m == NULL) { - *m_head = NULL; - return (ENOBUFS); - } - ip = (struct ip *)(mtod(m, char *) + ip_off); - poff = ip_off + (ip->ip_hl << 2); + ip = (struct ip *)(mtod(m, char *) + sizeof(struct ether_header)); + poff = sizeof(struct ether_header) + (ip->ip_hl << 2); if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { m = m_pullup(m, poff + sizeof(struct tcphdr)); if (m == NULL) { From owner-svn-src-head@FreeBSD.ORG Tue Feb 23 00:34:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FC951065679; Tue, 23 Feb 2010 00:34:21 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F7F08FC16; Tue, 23 Feb 2010 00:34:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1N0YKmn004813; Tue, 23 Feb 2010 00:34:20 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1N0YKKL004811; Tue, 23 Feb 2010 00:34:20 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201002230034.o1N0YKKL004811@svn.freebsd.org> From: Matt Jacob Date: Tue, 23 Feb 2010 00:34:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204231 - head/sys/dev/isp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2010 00:34:21 -0000 Author: mjacob Date: Tue Feb 23 00:34:20 2010 New Revision: 204231 URL: http://svn.freebsd.org/changeset/base/204231 Log: When we rescan, just scan from logical unit 0. In other words, don't specify a wildcard lun here. This unbreaks disk re-arrival. MFC after: 2 days Modified: head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Mon Feb 22 23:35:35 2010 (r204230) +++ head/sys/dev/isp/isp_freebsd.c Tue Feb 23 00:34:20 2010 (r204231) @@ -3892,7 +3892,7 @@ isp_make_here(ispsoftc_t *isp, int chan, isp_prt(isp, ISP_LOGWARN, "Chan %d unable to alloc CCB for rescan", chan); return; } - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(fc->sim), tgt, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { + if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(fc->sim), tgt, 0) != CAM_REQ_CMP) { isp_prt(isp, ISP_LOGWARN, "unable to create path for rescan"); xpt_free_ccb(ccb); return; From owner-svn-src-head@FreeBSD.ORG Tue Feb 23 01:00:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 003FE1065672; Tue, 23 Feb 2010 01:00:19 +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 E47038FC14; Tue, 23 Feb 2010 01:00:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1N10JOY010744; Tue, 23 Feb 2010 01:00:19 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1N10JIn010742; Tue, 23 Feb 2010 01:00:19 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201002230100.o1N10JIn010742@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 23 Feb 2010 01:00: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: r204235 - head/sys/dev/fb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2010 01:00:20 -0000 Author: jkim Date: Tue Feb 23 01:00:19 2010 New Revision: 204235 URL: http://svn.freebsd.org/changeset/base/204235 Log: Fix FBIO_ADPINFO ioctl on amd64. Modified: head/sys/dev/fb/fb.c Modified: head/sys/dev/fb/fb.c ============================================================================== --- head/sys/dev/fb/fb.c Tue Feb 23 01:00:15 2010 (r204234) +++ head/sys/dev/fb/fb.c Tue Feb 23 01:00:19 2010 (r204235) @@ -653,7 +653,7 @@ fb_commonioctl(video_adapter_t *adp, u_l ((video_adapter_info_t *)arg)->va_mem_base = adp->va_mem_base; ((video_adapter_info_t *)arg)->va_mem_size = adp->va_mem_size; ((video_adapter_info_t *)arg)->va_window -#ifdef __i386__ +#if defined(__amd64__) || defined(__i386__) = vtophys(adp->va_window); #else = adp->va_window; @@ -665,8 +665,8 @@ fb_commonioctl(video_adapter_t *adp, u_l ((video_adapter_info_t *)arg)->va_window_orig = adp->va_window_orig; ((video_adapter_info_t *)arg)->va_unused0 -#ifdef __i386__ - = (adp->va_buffer) ? vtophys(adp->va_buffer) : 0; +#if defined(__amd64__) || defined(__i386__) + = adp->va_buffer != 0 ? vtophys(adp->va_buffer) : 0; #else = adp->va_buffer; #endif From owner-svn-src-head@FreeBSD.ORG Tue Feb 23 01:02:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B5D31065672; Tue, 23 Feb 2010 01:02:11 +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 61CC38FC19; Tue, 23 Feb 2010 01:02:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1N12BIp011233; Tue, 23 Feb 2010 01:02:11 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1N12Bue011231; Tue, 23 Feb 2010 01:02:11 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201002230102.o1N12Bue011231@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 23 Feb 2010 01:02: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: r204236 - head/sys/dev/fb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2010 01:02:11 -0000 Author: jkim Date: Tue Feb 23 01:02:11 2010 New Revision: 204236 URL: http://svn.freebsd.org/changeset/base/204236 Log: Re-add accidentally removed pixel format for direct memory model. Modified: head/sys/dev/fb/vesa.c Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Tue Feb 23 01:00:19 2010 (r204235) +++ head/sys/dev/fb/vesa.c Tue Feb 23 01:02:11 2010 (r204236) @@ -919,9 +919,49 @@ vesa_bios_init(void) vesa_vmode[modes].vi_buffer_size = bsize; vesa_vmode[modes].vi_mem_model = vesa_translate_mmodel(vmode.v_memmodel); - if (vesa_vmode[modes].vi_mem_model == V_INFO_MM_PACKED || - vesa_vmode[modes].vi_mem_model == V_INFO_MM_DIRECT) + switch (vesa_vmode[modes].vi_mem_model) { + case V_INFO_MM_DIRECT: + if ((vmode.v_modeattr & V_MODELFB) != 0 && + vers >= 0x0300) { + vesa_vmode[modes].vi_pixel_fields[0] = + vmode.v_linredfieldpos; + vesa_vmode[modes].vi_pixel_fields[1] = + vmode.v_lingreenfieldpos; + vesa_vmode[modes].vi_pixel_fields[2] = + vmode.v_linbluefieldpos; + vesa_vmode[modes].vi_pixel_fields[3] = + vmode.v_linresfieldpos; + vesa_vmode[modes].vi_pixel_fsizes[0] = + vmode.v_linredmasksize; + vesa_vmode[modes].vi_pixel_fsizes[1] = + vmode.v_lingreenmasksize; + vesa_vmode[modes].vi_pixel_fsizes[2] = + vmode.v_linbluemasksize; + vesa_vmode[modes].vi_pixel_fsizes[3] = + vmode.v_linresmasksize; + } else { + vesa_vmode[modes].vi_pixel_fields[0] = + vmode.v_redfieldpos; + vesa_vmode[modes].vi_pixel_fields[1] = + vmode.v_greenfieldpos; + vesa_vmode[modes].vi_pixel_fields[2] = + vmode.v_bluefieldpos; + vesa_vmode[modes].vi_pixel_fields[3] = + vmode.v_resfieldpos; + vesa_vmode[modes].vi_pixel_fsizes[0] = + vmode.v_redmasksize; + vesa_vmode[modes].vi_pixel_fsizes[1] = + vmode.v_greenmasksize; + vesa_vmode[modes].vi_pixel_fsizes[2] = + vmode.v_bluemasksize; + vesa_vmode[modes].vi_pixel_fsizes[3] = + vmode.v_resmasksize; + } + /* FALLTHROUGH */ + case V_INFO_MM_PACKED: vesa_vmode[modes].vi_pixel_size = (vmode.v_bpp + 7) / 8; + break; + } vesa_vmode[modes].vi_flags = vesa_translate_flags(vmode.v_modeattr) | V_INFO_VESA; From owner-svn-src-head@FreeBSD.ORG Tue Feb 23 01:08:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9E25106566B; Tue, 23 Feb 2010 01:08: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 C0CE98FC15; Tue, 23 Feb 2010 01:08:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1N183iU012683; Tue, 23 Feb 2010 01:08:03 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1N1830M012682; Tue, 23 Feb 2010 01:08:03 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201002230108.o1N1830M012682@svn.freebsd.org> From: Xin LI Date: Tue, 23 Feb 2010 01:08: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: r204239 - head/lib/libz X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2010 01:08:04 -0000 Author: delphij Date: Tue Feb 23 01:08:03 2010 New Revision: 204239 URL: http://svn.freebsd.org/changeset/base/204239 Log: Bootstrap the merge history for zlib. Modified: Directory Properties: head/lib/libz/ (props changed) From owner-svn-src-head@FreeBSD.ORG Tue Feb 23 04:56:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E459106566B; Tue, 23 Feb 2010 04:56:07 +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 2C0558FC16; Tue, 23 Feb 2010 04:56:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1N4u743062930; Tue, 23 Feb 2010 04:56:07 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1N4u7C2062927; Tue, 23 Feb 2010 04:56:07 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201002230456.o1N4u7C2062927@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 23 Feb 2010 04:56: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: r204241 - head/share/man/man4/man4.powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2010 04:56:07 -0000 Author: nwhitehorn Date: Tue Feb 23 04:56:06 2010 New Revision: 204241 URL: http://svn.freebsd.org/changeset/base/204241 Log: Add a manpage for smu(4) now that it does something useful. Added: head/share/man/man4/man4.powerpc/smu.4 (contents, props changed) Modified: head/share/man/man4/man4.powerpc/Makefile Modified: head/share/man/man4/man4.powerpc/Makefile ============================================================================== --- head/share/man/man4/man4.powerpc/Makefile Tue Feb 23 01:24:01 2010 (r204240) +++ head/share/man/man4/man4.powerpc/Makefile Tue Feb 23 04:56:06 2010 (r204241) @@ -7,6 +7,7 @@ MAN= adb.4 \ cuda.4 \ pmu.4 \ powermac_nvram.4 \ + smu.4 \ snd_ai2s.4 \ snd_davbus.4 \ tsec.4 Added: head/share/man/man4/man4.powerpc/smu.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.powerpc/smu.4 Tue Feb 23 04:56:06 2010 (r204241) @@ -0,0 +1,122 @@ +.\"- +.\" Copyright (c) 2010 Nathan Whitehorn +.\" 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 ``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$ +.\" +.Dd February 22, 2010 +.Dt SMU 4 +.Os +.Sh NAME +.Nm smu +.Nd Apple System Management Unit Driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device smu" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the System Management Unit (PMU) found in many +Apple G5 systems. +This includes most Power Macintosh G5 and all iMac G5 systems. +.Pp +The Apple SMU controller provides software power management and thermal +control functionality, and is responsible for managing system cooling +devices. +.Sh HARDWARE +Chips supported by the +.Nm +driver include: +.Pp +.Bl -bullet -compact +.It +Apple System Management Unit +.El +.Sh THERMAL MANAGEMENT +The +.Nm +driver provides basic automatic thermal management. Without a userspace +daemon providing more advanced control, the driver will attempt to maintain +system temperatures in a conservative range through coarse-grained control of +system cooling devices (see below). Automatic kernel-level thermal control +will take over if more than 3 seconds elapses between userspace cooling +setting adjustments. +.Sh SYSCTL VARIABLES +The +.Nm +driver provides power management services and thermal readout through a +sysctl interface. +The following sysctls can be used to control the +power management behavior and to examine current system power and +thermal conditions. +.Bl -tag -width indent +.It Va dev.smu.%d.target_temp +Target system temperature, in degrees Celsius. The +.Nm +driver will attempt to adjust fans to maintain the temperature of the +warmest component in the system at or below this level. +.It Va dev.smu.%d.critical_temp +System critical temperature, in degrees Celsius. If any component in +the system exceeds this temperature, the machine will be shut down within +500 ms. +.It Va dev.smu.%d.fans.%s.minrpm +Minimum allowed speed for this fan. +.It Va dev.smu.%d.fans.%s.maxrpm +Maximum allowed speed for this fan. +.It Va dev.smu.%d.fans.%s.rpm +Current speed for this fan. The fan speed can be adjusted by changing this +sysctl. If more than 3 seconds elapses between fan speed adjustments, the +kernel will resume automatic control of the fan. +.It Va dev.smu.%d.sensors.%s +Current reading from this sensor. Four sensor types are supported. Temperature +sensors are in units of degrees Celsius, current sensors in milliamps, voltage +sensors in millivolts, and power sensors in milliwatts. +.El +.Sh LED INTERFACE +The +.Nm +driver provides an +.Xr led 4 +annunciator interface at +.Pa /dev/led/sleepled . +.Sh SEE ALSO +.Xr acpi 4 , +.Xr pmu 4 , +.Xr led 4 +.Sh HISTORY +The +.Nm +device driver appeared in +.Fx 9.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Nathan Whitehorn +.Aq nwhitehorn@FreeBSD.org . From owner-svn-src-head@FreeBSD.ORG Tue Feb 23 05:02:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAE2A1065670; Tue, 23 Feb 2010 05:02:10 +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 D9B548FC15; Tue, 23 Feb 2010 05:02:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1N52A33064306; Tue, 23 Feb 2010 05:02:10 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1N52Af0064304; Tue, 23 Feb 2010 05:02:10 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002230502.o1N52Af0064304@svn.freebsd.org> From: Warner Losh Date: Tue, 23 Feb 2010 05:02: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: r204242 - head/sys/dev/bwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2010 05:02:11 -0000 Author: imp Date: Tue Feb 23 05:02:10 2010 New Revision: 204242 URL: http://svn.freebsd.org/changeset/base/204242 Log: Fix compilation problems with INVARIANTS. # also limit RX decryption attempted messages to 50 Reviewed by: weongyo Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Tue Feb 23 04:56:06 2010 (r204241) +++ head/sys/dev/bwn/if_bwn.c Tue Feb 23 05:02:10 2010 (r204242) @@ -1496,6 +1496,7 @@ bwn_pio_select(struct bwn_mac *mac, uint return (&mac->mac_method.pio.wme[WME_AC_VO]); } KASSERT(0 == 1, ("%s:%d: fail", __func__, __LINE__)); + return (NULL); } static int @@ -1905,10 +1906,9 @@ bwn_setup_channels(struct bwn_mac *mac, static uint32_t bwn_shm_read_4(struct bwn_mac *mac, uint16_t way, uint16_t offset) { - struct bwn_softc *sc = mac->mac_sc; uint32_t ret; - BWN_ASSERT_LOCKED(sc); + BWN_ASSERT_LOCKED(mac->mac_sc); if (way == BWN_SHARED) { KASSERT((offset & 0x0001) == 0, @@ -1932,10 +1932,9 @@ out: static uint16_t bwn_shm_read_2(struct bwn_mac *mac, uint16_t way, uint16_t offset) { - struct bwn_softc *sc = mac->mac_sc; uint16_t ret; - BWN_ASSERT_LOCKED(sc); + BWN_ASSERT_LOCKED(mac->mac_sc); if (way == BWN_SHARED) { KASSERT((offset & 0x0001) == 0, @@ -1970,9 +1969,7 @@ static void bwn_shm_write_4(struct bwn_mac *mac, uint16_t way, uint16_t offset, uint32_t value) { - struct bwn_softc *sc = mac->mac_sc; - - BWN_ASSERT_LOCKED(sc); + BWN_ASSERT_LOCKED(mac->mac_sc); if (way == BWN_SHARED) { KASSERT((offset & 0x0001) == 0, @@ -1995,9 +1992,7 @@ static void bwn_shm_write_2(struct bwn_mac *mac, uint16_t way, uint16_t offset, uint16_t value) { - struct bwn_softc *sc = mac->mac_sc; - - BWN_ASSERT_LOCKED(sc); + BWN_ASSERT_LOCKED(mac->mac_sc); if (way == BWN_SHARED) { KASSERT((offset & 0x0001) == 0, @@ -3335,10 +3330,9 @@ bwn_core_start(struct bwn_mac *mac) static void bwn_core_exit(struct bwn_mac *mac) { - struct bwn_softc *sc = mac->mac_sc; uint32_t macctl; - BWN_ASSERT_LOCKED(sc); + BWN_ASSERT_LOCKED(mac->mac_sc); KASSERT(mac->mac_status <= BWN_MAC_STATUS_INITED, ("%s:%d: fail", __func__, __LINE__)); @@ -5198,6 +5192,8 @@ bwn_rf_init_bcm2050(struct bwn_mac *mac) 0x0e, 0x0f, 0x0d, 0x0f, }; + loctl = lomask = reg0 = classctl = crs0 = analogoverval = analogover = + rfoverval = rfover = cck3 = 0; radio0 = BWN_RF_READ(mac, 0x43); radio1 = BWN_RF_READ(mac, 0x51); radio2 = BWN_RF_READ(mac, 0x52); @@ -5891,7 +5887,6 @@ static void bwn_dummy_transmission(struct bwn_mac *mac, int ofdm, int paon) { struct bwn_phy *phy = &mac->mac_phy; - struct bwn_softc *sc = mac->mac_sc; unsigned int i, max_loop; uint16_t value; uint32_t buffer[5] = { @@ -5906,7 +5901,7 @@ bwn_dummy_transmission(struct bwn_mac *m buffer[0] = 0x000b846e; } - BWN_ASSERT_LOCKED(sc); + BWN_ASSERT_LOCKED(mac->mac_sc); for (i = 0; i < 5; i++) bwn_ram_write(mac, i * 4, buffer[i]); @@ -5972,10 +5967,9 @@ bwn_ram_write(struct bwn_mac *mac, uint1 static void bwn_lo_write(struct bwn_mac *mac, struct bwn_loctl *ctl) { - struct bwn_phy *phy = &mac->mac_phy; uint16_t value; - KASSERT(phy->type == BWN_PHYTYPE_G, + KASSERT(mac->mac_phy->type == BWN_PHYTYPE_G, ("%s:%d: fail", __func__, __LINE__)); value = (uint8_t) (ctl->q); @@ -6570,7 +6564,7 @@ bwn_lo_calibset(struct bwn_mac *mac, struct bwn_phy_g *pg = &phy->phy_g; struct bwn_loctl loctl = { 0, 0 }; struct bwn_lo_calib *cal; - struct bwn_lo_g_value sval; + struct bwn_lo_g_value sval = { 0 }; int rxgain; uint16_t pad, reg, value; @@ -8984,9 +8978,7 @@ bwn_noise_gensample(struct bwn_mac *mac) static int bwn_dma_freeslot(struct bwn_dma_ring *dr) { - struct bwn_mac *mac = dr->dr_mac; - - BWN_ASSERT_LOCKED(mac->mac_sc); + BWN_ASSERT_LOCKED(dr->dr_mac->mac_sc); return (dr->dr_numslots - dr->dr_usedslot); } @@ -8994,9 +8986,7 @@ bwn_dma_freeslot(struct bwn_dma_ring *dr static int bwn_dma_nextslot(struct bwn_dma_ring *dr, int slot) { - struct bwn_mac *mac = dr->dr_mac; - - BWN_ASSERT_LOCKED(mac->mac_sc); + BWN_ASSERT_LOCKED(dr->dr_mac->mac_sc); KASSERT(slot >= -1 && slot <= dr->dr_numslots - 1, ("%s:%d: fail", __func__, __LINE__)); @@ -9393,9 +9383,10 @@ bwn_rxeof(struct bwn_mac *mac, struct mb struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; uint32_t macstat; - int padding, rate, rssi, noise, type; + int padding, rate, rssi = 0, noise = 0, type; uint16_t phytype, phystat0, phystat3, chanstat; unsigned char *mp = mtod(m, unsigned char *); + static int rx_mac_dec_rpt = 0; BWN_ASSERT_LOCKED(sc); @@ -9429,7 +9420,7 @@ bwn_rxeof(struct bwn_mac *mac, struct mb } wh = mtod(m, struct ieee80211_frame_min *); - if (macstat & BWN_RX_MAC_DEC) + if (macstat & BWN_RX_MAC_DEC && rx_mac_dec_rpt++ < 50) device_printf(sc->sc_dev, "RX decryption attempted (old %d keyidx %#x)\n", BWN_ISOLDFMT(mac), @@ -10086,15 +10077,15 @@ bwn_dma_select(struct bwn_mac *mac, uint return (mac->mac_method.dma.wme[WME_AC_BK]); } KASSERT(0 == 1, ("%s:%d: fail", __func__, __LINE__)); + return (NULL); } static int bwn_dma_getslot(struct bwn_dma_ring *dr) { - struct bwn_mac *mac = dr->dr_mac; int slot; - BWN_ASSERT_LOCKED(mac->mac_sc); + BWN_ASSERT_LOCKED(dr->dr_mac->mac_sc); KASSERT(dr->dr_tx, ("%s:%d: fail", __func__, __LINE__)); KASSERT(!(dr->dr_stop), ("%s:%d: fail", __func__, __LINE__)); @@ -10579,6 +10570,7 @@ bwn_dma_parse_cookie(struct bwn_mac *mac dr = dma->mcast; break; default: + dr = NULL; KASSERT(0 == 1, ("invalid cookie value %d", cookie & 0xf000)); } @@ -11677,6 +11669,7 @@ bwn_phy_lp_set_txpctlmode(struct bwn_mac ctl = BWN_PHY_TX_PWR_CTL_CMD_MODE_SW; break; default: + ctl = 0; KASSERT(0 == 1, ("%s:%d: fail", __func__, __LINE__)); } BWN_PHY_SETMASK(mac, BWN_PHY_TX_PWR_CTL_CMD, From owner-svn-src-head@FreeBSD.ORG Tue Feb 23 14:35:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61CDD1065670; Tue, 23 Feb 2010 14:35:45 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 223DE8FC17; Tue, 23 Feb 2010 14:35:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1NEZjhW093002; Tue, 23 Feb 2010 14:35:45 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1NEZjrd093000; Tue, 23 Feb 2010 14:35:45 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201002231435.o1NEZjrd093000@svn.freebsd.org> From: Matt Jacob Date: Tue, 23 Feb 2010 14:35: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: r204246 - head/sys/dev/isp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2010 14:35:45 -0000 Author: mjacob Date: Tue Feb 23 14:35:44 2010 New Revision: 204246 URL: http://svn.freebsd.org/changeset/base/204246 Log: xpt_rescan only honors a wildcard in the target field. Revert the previous change and have isp_make_here scan the whole bus which will then scan all luns. I think xpt_rescan needs to be fixed, but that's a separable issue. Suggested by: Alexander Modified: head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Tue Feb 23 09:58:12 2010 (r204245) +++ head/sys/dev/isp/isp_freebsd.c Tue Feb 23 14:35:44 2010 (r204246) @@ -3892,7 +3892,12 @@ isp_make_here(ispsoftc_t *isp, int chan, isp_prt(isp, ISP_LOGWARN, "Chan %d unable to alloc CCB for rescan", chan); return; } - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(fc->sim), tgt, 0) != CAM_REQ_CMP) { + /* + * xpt_rescan only honors wildcard in the target field. + * Scan the whole bus instead of target, which will then + * force a scan of all luns. + */ + if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(fc->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { isp_prt(isp, ISP_LOGWARN, "unable to create path for rescan"); xpt_free_ccb(ccb); return; From owner-svn-src-head@FreeBSD.ORG Tue Feb 23 14:40:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B2511065676; Tue, 23 Feb 2010 14:40:06 +0000 (UTC) (envelope-from netch@segfault.kiev.ua) Received: from segfault.kiev.ua (segfault.kiev.ua [193.193.193.4]) by mx1.freebsd.org (Postfix) with ESMTP id 80AB88FC1E; Tue, 23 Feb 2010 14:40:04 +0000 (UTC) Received: from segfault.kiev.ua (localhost.segfault.kiev.ua [127.0.0.1]) by segfault.kiev.ua (8.14.3/8.14.3/8.Who.Cares) with ESMTP id o1NEe4I6047320; Tue, 23 Feb 2010 16:40:04 +0200 (EET) (envelope-from netch@segfault.kiev.ua) Received: (from netch@localhost) by segfault.kiev.ua (8.14.3/8.14.3/Submit) id o1NEdxsU047317; Tue, 23 Feb 2010 16:39:59 +0200 (EET) (envelope-from netch) Date: Tue, 23 Feb 2010 16:39:59 +0200 From: Valentin Nechayev To: Garrett Cooper Message-ID: <20100223143959.GA47073@netch.kiev.ua> References: <201002192354.o1JNsCZJ035886@svn.freebsd.org> <20100220115838.GB94735@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-42: On Cc: svn-src-head@freebsd.org, Alexey Dokuchaev , src-committers@freebsd.org, Xin LI , svn-src-all@freebsd.org Subject: Re: svn commit: r204103 - in head/usr.bin: . seq X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: netch@netch.kiev.ua List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2010 14:40:06 -0000 Sun, Feb 21, 2010 at 15:55:08, yanefbsd wrote about "Re: svn commit: r204103 - in head/usr.bin: . seq": > >> Add seq(1), a small utility to generate sequence number. > > Why do we need this when we have jot(1)? > Agreed. FreeBSD isn't Linux (seq is a non-standard GNU tool). > -Garrett jot is non-standard in the same way. OTOH defining intervals in seq is much easier to understand. -netch- From owner-svn-src-head@FreeBSD.ORG Tue Feb 23 14:56:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D89F1065670; Tue, 23 Feb 2010 14:56:50 +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 3C5C98FC12; Tue, 23 Feb 2010 14:56:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1NEuoU1097734; Tue, 23 Feb 2010 14:56:50 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1NEuoO2097732; Tue, 23 Feb 2010 14:56:50 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201002231456.o1NEuoO2097732@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 23 Feb 2010 14:56: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: r204247 - head/share/man/man4/man4.powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2010 14:56:50 -0000 Author: nwhitehorn Date: Tue Feb 23 14:56:49 2010 New Revision: 204247 URL: http://svn.freebsd.org/changeset/base/204247 Log: Fix two bugs in this manpage: 'System' is not abbreviated with 'P', and a non-useful version of smu(4) was in 8.0, so modify the history to reflect that. Submitted by: gavin Modified: head/share/man/man4/man4.powerpc/smu.4 Modified: head/share/man/man4/man4.powerpc/smu.4 ============================================================================== --- head/share/man/man4/man4.powerpc/smu.4 Tue Feb 23 14:35:44 2010 (r204246) +++ head/share/man/man4/man4.powerpc/smu.4 Tue Feb 23 14:56:49 2010 (r204247) @@ -41,7 +41,7 @@ kernel configuration file: .Sh DESCRIPTION The .Nm -driver provides support for the System Management Unit (PMU) found in many +driver provides support for the System Management Unit (SMU) found in many Apple G5 systems. This includes most Power Macintosh G5 and all iMac G5 systems. .Pp @@ -112,7 +112,7 @@ annunciator interface at The .Nm device driver appeared in -.Fx 9.0 . +.Fx 8.0 . .Sh AUTHORS .An -nosplit The From owner-svn-src-head@FreeBSD.ORG Tue Feb 23 15:12:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0BD71065679; Tue, 23 Feb 2010 15:12:41 +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 BFB7C8FC16; Tue, 23 Feb 2010 15:12:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1NFCfUn001449; Tue, 23 Feb 2010 15:12:41 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1NFCfgQ001447; Tue, 23 Feb 2010 15:12:41 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201002231512.o1NFCfgQ001447@svn.freebsd.org> From: Ivan Voras Date: Tue, 23 Feb 2010 15:12: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: r204248 - head/sys/dev/syscons/snake X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2010 15:12:42 -0000 Author: ivoras Date: Tue Feb 23 15:12:41 2010 New Revision: 204248 URL: http://svn.freebsd.org/changeset/base/204248 Log: Upgrade the "snake" syscons screensaver to the new, multimedia version! Now, with color! And system load averages! Amused by it: gnn Modified: head/sys/dev/syscons/snake/snake_saver.c Modified: head/sys/dev/syscons/snake/snake_saver.c ============================================================================== --- head/sys/dev/syscons/snake/snake_saver.c Tue Feb 23 14:56:49 2010 (r204247) +++ head/sys/dev/syscons/snake/snake_saver.c Tue Feb 23 15:12:41 2010 (r204248) @@ -36,6 +36,8 @@ #include #include #include +#include +#include #include @@ -48,11 +50,22 @@ static int *messagep; static int messagelen; static int blanked; +#define MSGBUF_LEN 70 + +static int nofancy = 0; +TUNABLE_INT("hw.syscons.saver_snake_nofancy", &nofancy); + +#define FANCY_SNAKE (!nofancy) +#define LOAD_HIGH(ld) (((ld * 100 + FSCALE / 2) >> FSHIFT) / 100) +#define LOAD_LOW(ld) (((ld * 100 + FSCALE / 2) >> FSHIFT) % 100) + +static inline void update_msg(void); + static int snake_saver(video_adapter_t *adp, int blank) { static int dirx, diry; - int f; + int f, color, load; sc_softc_t *sc; scr_stat *scp; @@ -99,22 +112,52 @@ snake_saver(video_adapter_t *adp, int bl (random() % 20) == 0) diry = -diry; savs[0] += dirx + diry; + if (FANCY_SNAKE) { + update_msg(); + load = LOAD_HIGH(averunnable.ldavg[0]) * 100; + if (load == 0) + color = FG_LIGHTGREY | BG_BLACK; + else if (load / mp_ncpus <= 50) + color = FG_LIGHTGREEN | BG_BLACK; + else if (load / mp_ncpus <= 75) + color = FG_YELLOW | BG_BLACK; + else if (load / mp_ncpus <= 99) + color = FG_LIGHTRED | BG_BLACK; + else + color = FG_RED | FG_BLINK | BG_BLACK; + } else + color = FG_LIGHTGREY | BG_BLACK; + for (f=messagelen-1; f>=0; f--) sc_vtb_putc(&scp->scr, savs[f], sc->scr_map[save[f]], - (FG_LIGHTGREY | BG_BLACK) << 8); + color << 8); } else blanked = 0; return 0; } +static inline void +update_msg(void) +{ + if (!FANCY_SNAKE) { + messagelen = sprintf(message, "%s %s", ostype, osrelease); + return; + } + messagelen = snprintf(message, MSGBUF_LEN, + "%s %s (%d.%02d %d.%02d, %d.%02d)", + ostype, osrelease, + LOAD_HIGH(averunnable.ldavg[0]), LOAD_LOW(averunnable.ldavg[0]), + LOAD_HIGH(averunnable.ldavg[1]), LOAD_LOW(averunnable.ldavg[1]), + LOAD_HIGH(averunnable.ldavg[2]), LOAD_LOW(averunnable.ldavg[2])); +} + static int snake_init(video_adapter_t *adp) { - messagelen = strlen(ostype) + 1 + strlen(osrelease); - message = malloc(messagelen + 1, M_DEVBUF, M_WAITOK); - sprintf(message, "%s %s", ostype, osrelease); - messagep = malloc(messagelen * sizeof *messagep, M_DEVBUF, M_WAITOK); + message = malloc(MSGBUF_LEN, M_DEVBUF, M_WAITOK); + messagep = malloc(MSGBUF_LEN * sizeof *messagep, M_DEVBUF, M_WAITOK); + update_msg(); return 0; } From owner-svn-src-head@FreeBSD.ORG Tue Feb 23 15:27:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64797106568D; Tue, 23 Feb 2010 15:27:07 +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 5406E8FC19; Tue, 23 Feb 2010 15:27:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1NFR7os004654; Tue, 23 Feb 2010 15:27:07 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1NFR7TT004652; Tue, 23 Feb 2010 15:27:07 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201002231527.o1NFR7TT004652@svn.freebsd.org> From: Ivan Voras Date: Tue, 23 Feb 2010 15:27: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: r204249 - head/sys/dev/syscons/snake X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2010 15:27:07 -0000 Author: ivoras Date: Tue Feb 23 15:27:07 2010 New Revision: 204249 URL: http://svn.freebsd.org/changeset/base/204249 Log: The New and Improved snake_server - Service Pack 1: now even more sensitive to load average variations! Modified: head/sys/dev/syscons/snake/snake_saver.c Modified: head/sys/dev/syscons/snake/snake_saver.c ============================================================================== --- head/sys/dev/syscons/snake/snake_saver.c Tue Feb 23 15:12:41 2010 (r204248) +++ head/sys/dev/syscons/snake/snake_saver.c Tue Feb 23 15:27:07 2010 (r204249) @@ -114,7 +114,7 @@ snake_saver(video_adapter_t *adp, int bl savs[0] += dirx + diry; if (FANCY_SNAKE) { update_msg(); - load = LOAD_HIGH(averunnable.ldavg[0]) * 100; + load = ((averunnable.ldavg[0] * 100 + FSCALE / 2) >> FSHIFT); if (load == 0) color = FG_LIGHTGREY | BG_BLACK; else if (load / mp_ncpus <= 50) From owner-svn-src-head@FreeBSD.ORG Tue Feb 23 16:39:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12F071065672; Tue, 23 Feb 2010 16:39:54 +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 02F6F8FC12; Tue, 23 Feb 2010 16:39:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1NGdrWo020753; Tue, 23 Feb 2010 16:39:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1NGdrJ8020751; Tue, 23 Feb 2010 16:39:53 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002231639.o1NGdrJ8020751@svn.freebsd.org> From: Alexander Motin Date: Tue, 23 Feb 2010 16:39: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: r204250 - head/sys/dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2010 16:39:54 -0000 Author: mav Date: Tue Feb 23 16:39:53 2010 New Revision: 204250 URL: http://svn.freebsd.org/changeset/base/204250 Log: Fix recursive lock attempt on hot-plug event in non-ATA_CAM mode. Modified: head/sys/dev/ata/ata-all.c Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Tue Feb 23 15:27:07 2010 (r204249) +++ head/sys/dev/ata/ata-all.c Tue Feb 23 16:39:53 2010 (r204250) @@ -289,15 +289,13 @@ static void ata_conn_event(void *context, int dummy) { device_t dev = (device_t)context; - struct ata_channel *ch = device_get_softc(dev); #ifdef ATA_CAM + struct ata_channel *ch = device_get_softc(dev); union ccb *ccb; -#endif mtx_lock(&ch->state_mtx); ata_reinit(dev); mtx_unlock(&ch->state_mtx); -#ifdef ATA_CAM if ((ccb = xpt_alloc_ccb()) == NULL) return; if (xpt_create_path(&ccb->ccb_h.path, NULL, @@ -307,6 +305,8 @@ ata_conn_event(void *context, int dummy) return; } xpt_rescan(ccb); +#else + ata_reinit(dev); #endif } From owner-svn-src-head@FreeBSD.ORG Tue Feb 23 18:42:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BD52106566B; Tue, 23 Feb 2010 18:42:07 +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 7BDE48FC0C; Tue, 23 Feb 2010 18:42:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1NIg7oQ047726; Tue, 23 Feb 2010 18:42:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1NIg7uD047724; Tue, 23 Feb 2010 18:42:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002231842.o1NIg7uD047724@svn.freebsd.org> From: Alexander Motin Date: Tue, 23 Feb 2010 18:42: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: r204253 - head/sys/cam X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2010 18:42:07 -0000 Author: mav Date: Tue Feb 23 18:42:07 2010 New Revision: 204253 URL: http://svn.freebsd.org/changeset/base/204253 Log: Make xpt_rescan() more correct, as it was before r197208: do not use XPT_SCAN_LUN for wildcard LUN, fall back to XPT_SCAN_BUS. Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Tue Feb 23 18:37:21 2010 (r204252) +++ head/sys/cam/cam_xpt.c Tue Feb 23 18:42:07 2010 (r204253) @@ -866,7 +866,8 @@ xpt_rescan(union ccb *ccb) struct ccb_hdr *hdr; /* Prepare request */ - if(ccb->ccb_h.path->target->target_id == CAM_TARGET_WILDCARD) + if (ccb->ccb_h.path->target->target_id == CAM_TARGET_WILDCARD || + ccb->ccb_h.path->device->lun_id == CAM_LUN_WILDCARD) ccb->ccb_h.func_code = XPT_SCAN_BUS; else ccb->ccb_h.func_code = XPT_SCAN_LUN; From owner-svn-src-head@FreeBSD.ORG Tue Feb 23 19:44:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5950E1065698; Tue, 23 Feb 2010 19:44:52 +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 48F7B8FC0C; Tue, 23 Feb 2010 19:44:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1NJiqxr061636; Tue, 23 Feb 2010 19:44:52 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1NJiqOg061634; Tue, 23 Feb 2010 19:44:52 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201002231944.o1NJiqOg061634@svn.freebsd.org> From: Weongyo Jeong Date: Tue, 23 Feb 2010 19:44: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: r204256 - head/sys/dev/bwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2010 19:44:52 -0000 Author: weongyo Date: Tue Feb 23 19:44:51 2010 New Revision: 204256 URL: http://svn.freebsd.org/changeset/base/204256 Log: fixes a compile error; invalid type argument of '->'. Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Tue Feb 23 19:37:00 2010 (r204255) +++ head/sys/dev/bwn/if_bwn.c Tue Feb 23 19:44:51 2010 (r204256) @@ -5969,7 +5969,7 @@ bwn_lo_write(struct bwn_mac *mac, struct { uint16_t value; - KASSERT(mac->mac_phy->type == BWN_PHYTYPE_G, + KASSERT(mac->mac_phy.type == BWN_PHYTYPE_G, ("%s:%d: fail", __func__, __LINE__)); value = (uint8_t) (ctl->q); From owner-svn-src-head@FreeBSD.ORG Tue Feb 23 19:55:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E7181065676; Tue, 23 Feb 2010 19:55:55 +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 5D9FE8FC2B; Tue, 23 Feb 2010 19:55:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1NJttHf064089; Tue, 23 Feb 2010 19:55:55 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1NJtshq064086; Tue, 23 Feb 2010 19:55:55 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201002231955.o1NJtshq064086@svn.freebsd.org> From: Weongyo Jeong Date: Tue, 23 Feb 2010 19:55: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: r204257 - head/sys/dev/bwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2010 19:55:55 -0000 Author: weongyo Date: Tue Feb 23 19:55:54 2010 New Revision: 204257 URL: http://svn.freebsd.org/changeset/base/204257 Log: o adds sysctl variables to show device statistics. o records RTS success/fail statistics. Pointed by: imp Modified: head/sys/dev/bwn/if_bwn.c head/sys/dev/bwn/if_bwnvar.h Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Tue Feb 23 19:44:51 2010 (r204256) +++ head/sys/dev/bwn/if_bwn.c Tue Feb 23 19:55:54 2010 (r204257) @@ -536,6 +536,7 @@ static void bwn_phy_lp_gaintbl_write_r2( struct bwn_txgain_entry); static void bwn_phy_lp_gaintbl_write_r01(struct bwn_mac *, int, struct bwn_txgain_entry); +static void bwn_sysctl_node(struct bwn_softc *); static struct resource_spec bwn_res_spec_legacy[] = { { SYS_RES_IRQ, 0, RF_ACTIVE | RF_SHAREABLE }, @@ -1066,9 +1067,6 @@ bwn_attach_post(struct bwn_softc *sc) struct ifnet *ifp = sc->sc_ifp; struct siba_dev_softc *sd = sc->sc_sd; struct siba_sprom *sprom = &sd->sd_bus->siba_sprom; -#ifdef BWN_DEBUG - device_t dev = sc->sc_dev; -#endif ic = ifp->if_l2com; ic->ic_ifp = ifp; @@ -1117,11 +1115,7 @@ bwn_attach_post(struct bwn_softc *sc) &sc->sc_rx_th.wr_ihdr, sizeof(sc->sc_rx_th), BWN_RX_RADIOTAP_PRESENT); -#ifdef BWN_DEBUG - SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "debug", CTLFLAG_RW, &sc->sc_debug, 0, "Debug flags"); -#endif + bwn_sysctl_node(sc); if (bootverbose) ieee80211_announce(ic); @@ -9077,6 +9071,7 @@ bwn_handle_txeof(struct bwn_mac *mac, co struct bwn_pio_txqueue *tq; struct bwn_pio_txpkt *tp = NULL; struct bwn_softc *sc = mac->mac_sc; + struct bwn_stats *stats = &mac->mac_stats; struct ieee80211_node *ni; int slot; @@ -9088,9 +9083,9 @@ bwn_handle_txeof(struct bwn_mac *mac, co device_printf(sc->sc_dev, "TODO: STATUS AMPDU\n"); if (status->rtscnt) { if (status->rtscnt == 0xf) - device_printf(sc->sc_dev, "TODO: RTS fail\n"); + stats->rtsfail++; else - device_printf(sc->sc_dev, "TODO: RTS ok\n"); + stats->rts++; } if (mac->mac_flags & BWN_MAC_FLAG_DMA) { @@ -14286,6 +14281,36 @@ bwn_phy_lp_gaintbl_write_r01(struct bwn_ } static void +bwn_sysctl_node(struct bwn_softc *sc) +{ + device_t dev = sc->sc_dev; + struct bwn_mac *mac; + struct bwn_stats *stats; + + /* XXX assume that count of MAC is only 1. */ + + if ((mac = sc->sc_curmac) == NULL) + return; + stats = &mac->mac_stats; + + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "linknoise", CTLFLAG_RW, &stats->rts, 0, "Noise level"); + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "rts", CTLFLAG_RW, &stats->rts, 0, "RTS"); + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "rtsfail", CTLFLAG_RW, &stats->rtsfail, 0, "RTS failed to send"); + +#ifdef BWN_DEBUG + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "debug", CTLFLAG_RW, &sc->sc_debug, 0, "Debug flags"); +#endif +} + +static void bwn_identify(driver_t *driver, device_t parent) { Modified: head/sys/dev/bwn/if_bwnvar.h ============================================================================== --- head/sys/dev/bwn/if_bwnvar.h Tue Feb 23 19:44:51 2010 (r204256) +++ head/sys/dev/bwn/if_bwnvar.h Tue Feb 23 19:55:54 2010 (r204257) @@ -515,6 +515,8 @@ struct bwn_tx_radiotap_header { }; struct bwn_stats { + int32_t rtsfail; + int32_t rts; int32_t link_noise; }; From owner-svn-src-head@FreeBSD.ORG Tue Feb 23 21:41:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 014451065670; Tue, 23 Feb 2010 21:41:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E44748FC18; Tue, 23 Feb 2010 21:41:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1NLfDmS087514; Tue, 23 Feb 2010 21:41:13 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1NLfDah087511; Tue, 23 Feb 2010 21:41:13 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201002232141.o1NLfDah087511@svn.freebsd.org> From: Ed Maste Date: Tue, 23 Feb 2010 21:41: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: r204264 - head/sys/dev/aac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2010 21:41:14 -0000 Author: emaste Date: Tue Feb 23 21:41:13 2010 New Revision: 204264 URL: http://svn.freebsd.org/changeset/base/204264 Log: Minor diff reduction with Adaptec's driver: in aac_release_command() set cm_queue to AAC_ADAP_NORM_CMD_QUEUE by default. In every place it was set, it was set to AAC_ADAP_NORM_CMD_QUEUE anyhow. Modified: head/sys/dev/aac/aac.c head/sys/dev/aac/aac_cam.c Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Tue Feb 23 21:39:11 2010 (r204263) +++ head/sys/dev/aac/aac.c Tue Feb 23 21:41:13 2010 (r204264) @@ -1195,7 +1195,6 @@ aac_bio_command(struct aac_softc *sc, st cm->cm_complete = aac_bio_complete; cm->cm_private = bp; cm->cm_timestamp = time_uptime; - cm->cm_queue = AAC_ADAP_NORM_CMD_QUEUE; /* build the FIB */ fib = cm->cm_fib; @@ -1350,7 +1349,6 @@ aac_wait_command(struct aac_command *cm) fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); /* Put the command on the ready queue and get things going */ - cm->cm_queue = AAC_ADAP_NORM_CMD_QUEUE; aac_enqueue_ready(cm); aac_startio(sc); error = msleep(cm, &sc->aac_io_lock, PRIBIO, "aacwait", 0); @@ -1400,6 +1398,7 @@ aac_release_command(struct aac_command * cm->cm_flags = 0; cm->cm_complete = NULL; cm->cm_private = NULL; + cm->cm_queue = AAC_ADAP_NORM_CMD_QUEUE; cm->cm_fib->Header.XferState = AAC_FIBSTATE_EMPTY; cm->cm_fib->Header.StructType = AAC_FIBTYPE_TFIB; cm->cm_fib->Header.Flags = 0; Modified: head/sys/dev/aac/aac_cam.c ============================================================================== --- head/sys/dev/aac/aac_cam.c Tue Feb 23 21:39:11 2010 (r204263) +++ head/sys/dev/aac/aac_cam.c Tue Feb 23 21:41:13 2010 (r204264) @@ -453,7 +453,6 @@ aac_cam_action(struct cam_sim *sim, unio cm->cm_complete = aac_cam_complete; cm->cm_private = ccb; cm->cm_timestamp = time_uptime; - cm->cm_queue = AAC_ADAP_NORM_CMD_QUEUE; fib->Header.XferState = AAC_FIBSTATE_HOSTOWNED | From owner-svn-src-head@FreeBSD.ORG Tue Feb 23 21:51:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 892471065670; Tue, 23 Feb 2010 21:51:14 +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 76CB58FC15; Tue, 23 Feb 2010 21:51:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1NLpEnG089768; Tue, 23 Feb 2010 21:51:14 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1NLpERv089762; Tue, 23 Feb 2010 21:51:14 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201002232151.o1NLpERv089762@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 23 Feb 2010 21:51: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: r204265 - in head/sys: dev/fb dev/syscons sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2010 21:51:14 -0000 Author: jkim Date: Tue Feb 23 21:51:14 2010 New Revision: 204265 URL: http://svn.freebsd.org/changeset/base/204265 Log: Yet another attempt to make palette loading more safer: - Add a separate palette data for 8-bit DAC mode when SC_PIXEL_MODE is set and fill it up with default gray-scale palette data for text. Now we don't have to set `hint.sc.0.vesa_mode' to get the default palette data. - Add a new adapter flag, V_ADP_DAC8 to track whether the controller is using 8-bit palette format and load correct palette when switching modes. - Set 8-bit DAC mode only for non-VGA compatible graphics mode. Modified: head/sys/dev/fb/vesa.c head/sys/dev/syscons/scvidctl.c head/sys/dev/syscons/syscons.c head/sys/dev/syscons/syscons.h head/sys/sys/fbio.h Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Tue Feb 23 21:41:13 2010 (r204264) +++ head/sys/dev/fb/vesa.c Tue Feb 23 21:51:14 2010 (r204265) @@ -165,7 +165,9 @@ static int int10_set_mode(int mode); static int vesa_bios_post(void); static int vesa_bios_get_mode(int mode, struct vesa_mode *vmode); static int vesa_bios_set_mode(int mode); +#if 0 static int vesa_bios_get_dac(void); +#endif static int vesa_bios_set_dac(int bits); static int vesa_bios_save_palette(int start, int colors, u_char *palette, int bits); @@ -318,6 +320,7 @@ vesa_bios_set_mode(int mode) return (regs.R_AX != 0x004f); } +#if 0 static int vesa_bios_get_dac(void) { @@ -334,6 +337,7 @@ vesa_bios_get_dac(void) return (regs.R_BH); } +#endif static int vesa_bios_set_dac(int bits) @@ -1198,6 +1202,10 @@ vesa_set_mode(video_adapter_t *adp, int if (VESA_MODE(adp->va_mode)) { if (!VESA_MODE(mode) && (*prevvidsw->get_info)(adp, mode, &info) == 0) { + if ((adp->va_flags & V_ADP_DAC8) != 0) { + vesa_bios_set_dac(6); + adp->va_flags &= ~V_ADP_DAC8; + } int10_set_mode(adp->va_initial_bios_mode); if (adp->va_info.vi_flags & V_INFO_LINEAR) pmap_unmapdev(adp->va_buffer, @@ -1228,8 +1236,14 @@ vesa_set_mode(video_adapter_t *adp, int if (vesa_bios_set_mode(mode | ((info.vi_flags & V_INFO_LINEAR) ? 0x4000 : 0))) return (1); - if ((vesa_adp_info->v_flags & V_DAC8) != 0) - vesa_bios_set_dac(8); + /* Palette format is reset by the above VBE function call. */ + adp->va_flags &= ~V_ADP_DAC8; + + if ((vesa_adp_info->v_flags & V_DAC8) != 0 && + (info.vi_flags & V_INFO_GRAPHICS) != 0 && + (info.vi_flags & V_INFO_NONVGA) != 0 && + vesa_bios_set_dac(8) > 6) + adp->va_flags |= V_ADP_DAC8; if (adp->va_info.vi_flags & V_INFO_LINEAR) pmap_unmapdev(adp->va_buffer, adp->va_buffer_size); @@ -1308,10 +1322,10 @@ vesa_save_palette(video_adapter_t *adp, { int bits; - if (adp == vesa_adp && VESA_MODE(adp->va_mode)) { - bits = vesa_bios_get_dac(); - if ((adp->va_info.vi_flags & V_INFO_NONVGA) != 0 || bits > 6) - return (vesa_bios_save_palette(0, 256, palette, bits)); + if (adp == vesa_adp && VESA_MODE(adp->va_mode) && + (adp->va_info.vi_flags & V_INFO_NONVGA) != 0) { + bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6; + return (vesa_bios_save_palette(0, 256, palette, bits)); } return ((*prevvidsw->save_palette)(adp, palette)); @@ -1322,10 +1336,10 @@ vesa_load_palette(video_adapter_t *adp, { int bits; - if (adp == vesa_adp && VESA_MODE(adp->va_mode)) { - bits = vesa_bios_get_dac(); - if ((adp->va_info.vi_flags & V_INFO_NONVGA) != 0 || bits > 6) - return (vesa_bios_load_palette(0, 256, palette, bits)); + if (adp == vesa_adp && VESA_MODE(adp->va_mode) && + (adp->va_info.vi_flags & V_INFO_NONVGA) != 0) { + bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6; + return (vesa_bios_load_palette(0, 256, palette, bits)); } return ((*prevvidsw->load_palette)(adp, palette)); @@ -1530,10 +1544,10 @@ get_palette(video_adapter_t *adp, int ba return (1); if (!VESA_MODE(adp->va_mode)) return (1); - bits = vesa_bios_get_dac(); - if ((adp->va_info.vi_flags & V_INFO_NONVGA) == 0 && bits <= 6) + if ((adp->va_info.vi_flags & V_INFO_NONVGA) == 0) return (1); + bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6; r = malloc(count * 3, M_DEVBUF, M_WAITOK); g = r + count; b = g + count; @@ -1568,10 +1582,10 @@ set_palette(video_adapter_t *adp, int ba return (1); if (!VESA_MODE(adp->va_mode)) return (1); - bits = vesa_bios_get_dac(); - if ((adp->va_info.vi_flags & V_INFO_NONVGA) == 0 && bits <= 6) + if ((adp->va_info.vi_flags & V_INFO_NONVGA) == 0) return (1); + bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6; r = malloc(count * 3, M_DEVBUF, M_WAITOK); g = r + count; b = g + count; @@ -1789,7 +1803,6 @@ vesa_unload(void) { u_char palette[256*3]; int error; - int bits; int s; /* if the adapter is currently in a VESA mode, don't unload */ @@ -1803,15 +1816,11 @@ vesa_unload(void) s = spltty(); if ((error = vesa_unload_ioctl()) == 0) { if (vesa_adp != NULL) { - if (vesa_adp_info->v_flags & V_DAC8) { - bits = vesa_bios_get_dac(); - if (bits > 6) { - vesa_bios_save_palette(0, 256, - palette, bits); - vesa_bios_set_dac(6); - vesa_bios_load_palette(0, 256, - palette, 6); - } + if ((vesa_adp->va_flags & V_ADP_DAC8) != 0) { + vesa_bios_save_palette(0, 256, palette, 8); + vesa_bios_set_dac(6); + vesa_adp->va_flags &= ~V_ADP_DAC8; + vesa_bios_load_palette(0, 256, palette, 6); } vesa_adp->va_flags &= ~V_ADP_VESA; vidsw[vesa_adp->va_index] = prevvidsw; Modified: head/sys/dev/syscons/scvidctl.c ============================================================================== --- head/sys/dev/syscons/scvidctl.c Tue Feb 23 21:41:13 2010 (r204264) +++ head/sys/dev/syscons/scvidctl.c Tue Feb 23 21:51:14 2010 (r204265) @@ -725,6 +725,11 @@ sc_vid_ioctl(struct tty *tp, u_long cmd, #endif #ifndef SC_NO_PALETTE_LOADING +#ifdef SC_PIXEL_MODE + if ((adp->va_flags & V_ADP_DAC8) != 0) + vidd_load_palette(adp, scp->sc->palette2); + else +#endif vidd_load_palette(adp, scp->sc->palette); #endif @@ -782,7 +787,10 @@ sc_vid_ioctl(struct tty *tp, u_long cmd, if (scp == scp->sc->cur_scp) { set_mode(scp); #ifndef SC_NO_PALETTE_LOADING - vidd_load_palette(adp, scp->sc->palette); + if ((adp->va_flags & V_ADP_DAC8) != 0) + vidd_load_palette(adp, scp->sc->palette2); + else + vidd_load_palette(adp, scp->sc->palette); #endif } sc_clear_screen(scp); Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Tue Feb 23 21:41:13 2010 (r204264) +++ head/sys/dev/syscons/syscons.c Tue Feb 23 21:51:14 2010 (r204265) @@ -414,9 +414,6 @@ sc_attach_unit(int unit, int flags) #endif sc_set_graphics_mode(scp, NULL, vmode); sc_set_pixel_mode(scp, NULL, 0, 0, 16, 8); -#ifndef SC_NO_PALETTE_LOADING - vidd_save_palette(sc->adp, sc->palette); -#endif sc->initial_mode = vmode; #ifdef DEV_SPLASH /* put up the splash again! */ @@ -2090,6 +2087,11 @@ restore_scrn_saver_mode(scr_stat *scp, i } if (set_mode(scp) == 0) { #ifndef SC_NO_PALETTE_LOADING +#ifdef SC_PIXEL_MODE + if ((scp->sc->adp->va_flags & V_ADP_DAC8) != 0) + vidd_load_palette(scp->sc->adp, scp->sc->palette2); + else +#endif vidd_load_palette(scp->sc->adp, scp->sc->palette); #endif --scrn_blanked; @@ -2493,8 +2495,14 @@ exchange_scr(sc_softc_t *sc) if (!ISGRAPHSC(scp)) sc_set_cursor_image(scp); #ifndef SC_NO_PALETTE_LOADING - if (ISGRAPHSC(sc->old_scp)) + if (ISGRAPHSC(sc->old_scp)) { +#ifdef SC_PIXEL_MODE + if ((sc->adp->va_flags & V_ADP_DAC8) != 0) + vidd_load_palette(sc->adp, sc->palette2); + else +#endif vidd_load_palette(sc->adp, sc->palette); + } #endif sc_set_border(scp, scp->border); @@ -2843,6 +2851,10 @@ scinit(int unit, int flags) #ifndef SC_NO_PALETTE_LOADING vidd_save_palette(sc->adp, sc->palette); +#ifdef SC_PIXEL_MODE + for (i = 0; i < sizeof(sc->palette2); i++) + sc->palette2[i] = i / 3; +#endif #endif #ifdef DEV_SPLASH Modified: head/sys/dev/syscons/syscons.h ============================================================================== --- head/sys/dev/syscons/syscons.h Tue Feb 23 21:41:13 2010 (r204264) +++ head/sys/dev/syscons/syscons.h Tue Feb 23 21:51:14 2010 (r204265) @@ -245,7 +245,10 @@ typedef struct sc_softc { #endif #ifndef SC_NO_PALETTE_LOADING - u_char palette[256*3]; + u_char palette[256 * 3]; +#ifdef SC_PIXEL_MODE + u_char palette2[256 * 3]; +#endif #endif #ifndef SC_NO_FONT_LOADING Modified: head/sys/sys/fbio.h ============================================================================== --- head/sys/sys/fbio.h Tue Feb 23 21:41:13 2010 (r204264) +++ head/sys/sys/fbio.h Tue Feb 23 21:51:14 2010 (r204265) @@ -332,6 +332,7 @@ struct video_adapter { #define V_ADP_INITIALIZED (1 << 17) #define V_ADP_REGISTERED (1 << 18) #define V_ADP_ATTACHED (1 << 19) +#define V_ADP_DAC8 (1 << 20) vm_offset_t va_io_base; int va_io_size; vm_offset_t va_crtc_addr; From owner-svn-src-head@FreeBSD.ORG Wed Feb 24 00:50:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08960106567D; Wed, 24 Feb 2010 00:50:08 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E86938FC15; Wed, 24 Feb 2010 00:50:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1NN1gIo005605; Tue, 23 Feb 2010 23:01:42 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1NN1g63005599; Tue, 23 Feb 2010 23:01:42 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201002232301.o1NN1g63005599@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 23 Feb 2010 23:01: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: r204267 - head/usr.sbin/cxgbtool X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2010 00:50:08 -0000 Author: np Date: Tue Feb 23 23:01:41 2010 New Revision: 204267 URL: http://svn.freebsd.org/changeset/base/204267 Log: Allow cxgbtool to build with WARNS=6 MFC after: 1 week Modified: head/usr.sbin/cxgbtool/cxgbtool.c head/usr.sbin/cxgbtool/reg_defs.c head/usr.sbin/cxgbtool/reg_defs_t3.c head/usr.sbin/cxgbtool/reg_defs_t3b.c head/usr.sbin/cxgbtool/reg_defs_t3c.c Modified: head/usr.sbin/cxgbtool/cxgbtool.c ============================================================================== --- head/usr.sbin/cxgbtool/cxgbtool.c Tue Feb 23 22:09:42 2010 (r204266) +++ head/usr.sbin/cxgbtool/cxgbtool.c Tue Feb 23 23:01:41 2010 (r204267) @@ -85,7 +85,8 @@ struct reg_info { static const char *progname; -static void __attribute__((noreturn)) usage(FILE *fp) +static void +usage(FILE *fp) { fprintf(fp, "Usage: %s [operation]\n", progname); fprintf(fp, @@ -136,7 +137,8 @@ doit(const char *iff_name, unsigned long return ioctl(fd, cmd, data) < 0 ? -1 : 0; } -static int get_int_arg(const char *s, uint32_t *valp) +static int +get_int_arg(const char *s, uint32_t *valp) { char *p; @@ -172,11 +174,12 @@ write_reg(const char *iff_name, uint32_t err(1, "register write"); } -static int register_io(int argc, char *argv[], int start_arg, +static int +register_io(int argc, char *argv[], int start_arg, const char *iff_name) { char *p; - uint32_t addr, val = 0, write = 0; + uint32_t addr, val = 0, w = 0; if (argc != start_arg + 1) return -1; @@ -184,14 +187,14 @@ static int register_io(int argc, char *a if (p == argv[start_arg]) return -1; if (*p == '=' && p[1]) { val = strtoul(p + 1, &p, 0); - write = 1; + w = 1; } if (*p) { warnx("bad parameter \"%s\"", argv[start_arg]); return -1; } - if (write) + if (w) write_reg(iff_name, addr, val); else { val = read_reg(iff_name, addr); @@ -200,9 +203,9 @@ static int register_io(int argc, char *a return 0; } -static int mdio_io(int argc, char *argv[], int start_arg, const char *iff_name) +static int +mdio_io(int argc, char *argv[], int start_arg, const char *iff_name) { - struct ifreq ifr; struct ch_mii_data p; unsigned int cmd, phy_addr, reg, mmd, val; @@ -230,12 +233,14 @@ static int mdio_io(int argc, char *argv[ return 0; } -static inline uint32_t xtract(uint32_t val, int shift, int len) +static inline +uint32_t xtract(uint32_t val, int shift, int len) { return (val >> shift) & ((1 << len) - 1); } -static int dump_block_regs(const struct reg_info *reg_array, uint32_t *regs) +static int +dump_block_regs(const struct reg_info *reg_array, uint32_t *regs) { uint32_t reg_val = 0; // silence compiler warning @@ -254,7 +259,8 @@ static int dump_block_regs(const struct return 1; } -static int dump_regs_t2(int argc, char *argv[], int start_arg, uint32_t *regs) +static int +dump_regs_t2(int argc, char *argv[], int start_arg, uint32_t *regs) { int match = 0; char *block_name = NULL; @@ -292,8 +298,8 @@ static int dump_regs_t2(int argc, char * } #if defined(CONFIG_T3_REGS) -static int dump_regs_t3(int argc, char *argv[], int start_arg, uint32_t *regs, - int is_pcie) +static int +dump_regs_t3(int argc, char *argv[], int start_arg, uint32_t *regs, int is_pcie) { int match = 0; char *block_name = NULL; @@ -353,8 +359,9 @@ static int dump_regs_t3(int argc, char * return 0; } -static int dump_regs_t3b(int argc, char *argv[], int start_arg, uint32_t *regs, - int is_pcie) +static int +dump_regs_t3b(int argc, char *argv[], int start_arg, uint32_t *regs, + int is_pcie) { int match = 0; char *block_name = NULL; @@ -414,8 +421,9 @@ static int dump_regs_t3b(int argc, char return 0; } -static int dump_regs_t3c(int argc, char *argv[], int start_arg, uint32_t *regs, - int is_pcie) +static int +dump_regs_t3c(int argc, char *argv[], int start_arg, uint32_t *regs, + int is_pcie) { int match = 0; char *block_name = NULL; @@ -479,7 +487,7 @@ static int dump_regs_t3c(int argc, char static int dump_regs(int argc, char *argv[], int start_arg, const char *iff_name) { - int i, vers, revision, is_pcie; + int vers, revision, is_pcie; struct ch_ifconf_regs regs; regs.len = REGDUMP_SIZE; @@ -514,7 +522,8 @@ dump_regs(int argc, char *argv[], int st return 0; } -static int t3_meminfo(const uint32_t *regs) +static int +t3_meminfo(const uint32_t *regs) { enum { SG_EGR_CNTX_BADDR = 0x58, @@ -592,11 +601,16 @@ static int t3_meminfo(const uint32_t *re return 0; } -static int meminfo(int argc, char *argv[], int start_arg, const char *iff_name) +static int +meminfo(int argc, char *argv[], int start_arg, const char *iff_name) { int vers; struct ch_ifconf_regs regs; + (void) argc; + (void) argv; + (void) start_arg; + regs.len = REGDUMP_SIZE; if ((regs.data = malloc(regs.len)) == NULL) err(1, "can't malloc"); @@ -612,11 +626,11 @@ static int meminfo(int argc, char *argv[ return 0; } -static int mtu_tab_op(int argc, char *argv[], int start_arg, - const char *iff_name) +static int +mtu_tab_op(int argc, char *argv[], int start_arg, const char *iff_name) { struct ch_mtus m; - int i; + unsigned int i; if (argc == start_arg) { if (doit(iff_name, CHELSIO_GETMTUTAB, &m) < 0) @@ -649,13 +663,14 @@ static int mtu_tab_op(int argc, char *ar } #ifdef CHELSIO_INTERNAL -static void show_egress_cntxt(uint32_t data[]) +static void +show_egress_cntxt(uint32_t data[]) { printf("credits: %u\n", data[0] & 0x7fff); printf("GTS: %u\n", (data[0] >> 15) & 1); printf("index: %u\n", data[0] >> 16); printf("queue size: %u\n", data[1] & 0xffff); - printf("base address: 0x%llx\n", + printf("base address: 0x%" PRIx64 "\n", ((data[1] >> 16) | ((uint64_t)data[2] << 16) | (((uint64_t)data[3] & 0xf) << 48)) << 12); printf("rsp queue #: %u\n", (data[3] >> 4) & 7); @@ -667,9 +682,10 @@ static void show_egress_cntxt(uint32_t d printf("valid: %u\n", (data[3] >> 31) & 1); } -static void show_fl_cntxt(uint32_t data[]) +static void +show_fl_cntxt(uint32_t data[]) { - printf("base address: 0x%llx\n", + printf("base address: 0x%" PRIx64 "\n", ((uint64_t)data[0] | ((uint64_t)data[1] & 0xfffff) << 32) << 12); printf("index: %u\n", (data[1] >> 20) | ((data[2] & 0xf) << 12)); printf("queue size: %u\n", (data[2] >> 4) & 0xffff); @@ -680,11 +696,12 @@ static void show_fl_cntxt(uint32_t data[ printf("GTS: %u\n", (data[3] >> 31) & 1); } -static void show_response_cntxt(uint32_t data[]) +static void +show_response_cntxt(uint32_t data[]) { printf("index: %u\n", data[0] & 0xffff); printf("size: %u\n", data[0] >> 16); - printf("base address: 0x%llx\n", + printf("base address: 0x%" PRIx64 "\n", ((uint64_t)data[1] | ((uint64_t)data[2] & 0xfffff) << 32) << 12); printf("MSI-X/RspQ: %u\n", (data[2] >> 20) & 0x3f); printf("intr enable: %u\n", (data[2] >> 26) & 1); @@ -694,11 +711,12 @@ static void show_response_cntxt(uint32_t printf("FL threshold: %u\n", data[3]); } -static void show_cq_cntxt(uint32_t data[]) +static void +show_cq_cntxt(uint32_t data[]) { printf("index: %u\n", data[0] & 0xffff); printf("size: %u\n", data[0] >> 16); - printf("base address: 0x%llx\n", + printf("base address: 0x%" PRIx64 "\n", ((uint64_t)data[1] | ((uint64_t)data[2] & 0xfffff) << 32) << 12); printf("rsp queue #: %u\n", (data[2] >> 20) & 0x3f); printf("AN: %u\n", (data[2] >> 26) & 1); @@ -710,8 +728,8 @@ static void show_cq_cntxt(uint32_t data[ printf("credit threshold: %u\n", data[3] >> 16); } -static int get_sge_context(int argc, char *argv[], int start_arg, - const char *iff_name) +static int +get_sge_context(int argc, char *argv[], int start_arg, const char *iff_name) { struct ch_cntxt ctx; @@ -750,8 +768,8 @@ static int get_sge_context(int argc, cha #define ntohll(x) be64toh((x)) -static int get_sge_desc(int argc, char *argv[], int start_arg, - const char *iff_name) +static int +get_sge_desc(int argc, char *argv[], int start_arg, const char *iff_name) { uint64_t *p, wr_hdr; unsigned int n = 1, qset, qnum; @@ -796,7 +814,8 @@ static int get_sge_desc(int argc, char * } #endif -static int get_tcb2(int argc, char *argv[], int start_arg, const char *iff_name) +static int +get_tcb2(int argc, char *argv[], int start_arg, const char *iff_name) { uint64_t *d; unsigned int i; @@ -835,8 +854,9 @@ static int get_tcb2(int argc, char *argv return 0; } -static int get_pm_page_spec(const char *s, unsigned int *page_size, - unsigned int *num_pages) +static int +get_pm_page_spec(const char *s, unsigned int *page_size, + unsigned int *num_pages) { char *p; unsigned long val; @@ -854,7 +874,8 @@ static int get_pm_page_spec(const char * return *p; } -static int conf_pm(int argc, char *argv[], int start_arg, const char *iff_name) +static int +conf_pm(int argc, char *argv[], int start_arg, const char *iff_name) { struct ch_pm pm; @@ -884,8 +905,8 @@ static int conf_pm(int argc, char *argv[ } #ifdef CHELSIO_INTERNAL -static int dump_tcam(int argc, char *argv[], int start_arg, - const char *iff_name) +static int +dump_tcam(int argc, char *argv[], int start_arg, const char *iff_name) { unsigned int nwords; struct ch_tcam_word op; @@ -907,7 +928,8 @@ static int dump_tcam(int argc, char *arg return 0; } -static void hexdump_8b(unsigned int start, uint64_t *data, unsigned int len) +static void +hexdump_8b(unsigned int start, uint64_t *data, unsigned int len) { int i; @@ -920,8 +942,8 @@ static void hexdump_8b(unsigned int star } } -static int dump_mc7(int argc, char *argv[], int start_arg, - const char *iff_name) +static int +dump_mc7(int argc, char *argv[], int start_arg, const char *iff_name) { struct ch_mem_range mem; unsigned int mem_id, addr, len; @@ -959,10 +981,11 @@ static int dump_mc7(int argc, char *argv } #endif -/* Max FW size is 32K including version, +4 bytes for the checksum. */ +/* Max FW size is 64K including version, +4 bytes for the checksum. */ #define MAX_FW_IMAGE_SIZE (64 * 1024) -static int load_fw(int argc, char *argv[], int start_arg, const char *iff_name) +static int +load_fw(int argc, char *argv[], int start_arg, const char *iff_name) { int fd, len; struct ch_mem_range op; @@ -979,12 +1002,13 @@ static int load_fw(int argc, char *argv[ if (!op.buf) err(1, "load firmware"); - op.len = read(fd, op.buf, MAX_FW_IMAGE_SIZE + 1); - if (op.len < 0) + len = read(fd, op.buf, MAX_FW_IMAGE_SIZE + 1); + if (len < 0) err(1, "load firmware"); - if (op.len > MAX_FW_IMAGE_SIZE) + if (len > MAX_FW_IMAGE_SIZE) errx(1, "FW image too large"); + op.len = len; if (doit(iff_name, CHELSIO_LOAD_FW, &op) < 0) err(1, "load firmware"); return 0; @@ -993,8 +1017,8 @@ static int load_fw(int argc, char *argv[ /* Max BOOT size is 255*512 bytes including the BIOS boot ROM basic header */ #define MAX_BOOT_IMAGE_SIZE (0xff * 512) -static int load_boot(int argc, char *argv[], - int start_arg, const char *iff_name) +static int +load_boot(int argc, char *argv[], int start_arg, const char *iff_name) { int fd, len; struct ch_mem_range op; @@ -1024,7 +1048,8 @@ static int load_boot(int argc, char *arg return 0; } -static int dump_proto_sram(const char *iff_name) +static int +dump_proto_sram(const char *iff_name) { int i, j; uint8_t buf[PROTO_SRAM_SIZE]; @@ -1054,15 +1079,20 @@ static int dump_proto_sram(const char *i return 0; } -static int proto_sram_op(int argc, char *argv[], int start_arg, +static int +proto_sram_op(int argc, char *argv[], int start_arg, const char *iff_name) { + (void) argv; + (void) start_arg; + if (argc == start_arg) return dump_proto_sram(iff_name); return -1; } -static int dump_qset_params(const char *iff_name) +static int +dump_qset_params(const char *iff_name) { struct ch_qset_params qp; @@ -1084,10 +1114,10 @@ static int dump_qset_params(const char * return 0; } -static int qset_config(int argc, char *argv[], int start_arg, - const char *iff_name) +static int +qset_config(int argc, char *argv[], int start_arg, const char *iff_name) { - struct ch_qset_params qp; + (void) argv; if (argc == start_arg) return dump_qset_params(iff_name); @@ -1095,11 +1125,13 @@ static int qset_config(int argc, char *a return -1; } -static int qset_num_config(int argc, char *argv[], int start_arg, - const char *iff_name) +static int +qset_num_config(int argc, char *argv[], int start_arg, const char *iff_name) { struct ch_reg reg; + (void) argv; + if (argc == start_arg) { if (doit(iff_name, CHELSIO_GET_QSET_NUM, ®) < 0) err(1, "get qsets"); @@ -1113,7 +1145,8 @@ static int qset_num_config(int argc, cha /* * Parse a string containing an IP address with an optional network prefix. */ -static int parse_ipaddr(const char *s, uint32_t *addr, uint32_t *mask) +static int +parse_ipaddr(const char *s, uint32_t *addr, uint32_t *mask) { char *p, *slash; struct in_addr ia; @@ -1143,7 +1176,8 @@ static int parse_ipaddr(const char *s, u /* * Parse a string containing a value and an optional colon separated mask. */ -static int parse_val_mask_param(const char *s, uint32_t *val, uint32_t *mask) +static int +parse_val_mask_param(const char *s, uint32_t *val, uint32_t *mask) { char *p; @@ -1156,14 +1190,15 @@ static int parse_val_mask_param(const ch return *p ? -1 : 0; } -static int parse_trace_param(const char *s, uint32_t *val, uint32_t *mask) +static int +parse_trace_param(const char *s, uint32_t *val, uint32_t *mask) { return strchr(s, '.') ? parse_ipaddr(s, val, mask) : parse_val_mask_param(s, val, mask); } -static int trace_config(int argc, char *argv[], int start_arg, - const char *iff_name) +static int +trace_config(int argc, char *argv[], int start_arg, const char *iff_name) { uint32_t val, mask; struct ch_trace trace; @@ -1238,7 +1273,8 @@ static int trace_config(int argc, char * return 0; } -static int get_sched_param(int argc, char *argv[], int pos, unsigned int *valp) +static int +get_sched_param(int argc, char *argv[], int pos, unsigned int *valp) { if (pos + 1 >= argc) errx(1, "missing value for %s", argv[pos]); @@ -1247,7 +1283,8 @@ static int get_sched_param(int argc, cha return 0; } -static int tx_sched(int argc, char *argv[], int start_arg, const char *iff_name) +static int +tx_sched(int argc, char *argv[], int start_arg, const char *iff_name) { struct ch_hw_sched op; unsigned int idx, val; @@ -1293,7 +1330,8 @@ static int tx_sched(int argc, char *argv return 0; } -static int pktsched(int argc, char *argv[], int start_arg, const char *iff_name) +static int +pktsched(int argc, char *argv[], int start_arg, const char *iff_name) { struct ch_pktsched_params op; unsigned int idx, min = -1, max, binding = -1; @@ -1333,20 +1371,29 @@ static int pktsched(int argc, char *argv return 0; } -static int clear_stats(int argc, char *argv[], int start_arg, - const char *iff_name) +static int +clear_stats(int argc, char *argv[], int start_arg, const char *iff_name) { + (void) argc; + (void) argv; + (void) start_arg; + if (doit(iff_name, CHELSIO_CLEAR_STATS, NULL) < 0) err(1, "clearstats"); return 0; } -static int get_up_la(int argc, char *argv[], int start_arg, const char *iff_name) +static int +get_up_la(int argc, char *argv[], int start_arg, const char *iff_name) { struct ch_up_la la; int i, idx, max_idx, entries; + (void) argc; + (void) argv; + (void) start_arg; + la.stopped = 0; la.idx = -1; la.bufsize = LA_BUFSIZE; @@ -1372,11 +1419,16 @@ static int get_up_la(int argc, char *arg return 0; } -static int get_up_ioqs(int argc, char *argv[], int start_arg, const char *iff_name) +static int +get_up_ioqs(int argc, char *argv[], int start_arg, const char *iff_name) { struct ch_up_ioqs ioqs; int i, entries; + (void) argc; + (void) argv; + (void) start_arg; + bzero(&ioqs, sizeof(ioqs)); ioqs.bufsize = IOQS_BUFSIZE; ioqs.data = malloc(IOQS_BUFSIZE); @@ -1465,10 +1517,12 @@ run_cmd(int argc, char *argv[], const ch static int run_cmd_loop(int argc, char *argv[], const char *iff_name) { - int n, i; + int n; + unsigned int i; char buf[64]; char *args[8], *s; + (void) argc; args[0] = argv[0]; args[1] = argv[1]; @@ -1481,11 +1535,8 @@ run_cmd_loop(int argc, char *argv[], con for (;;) { fprintf(stdout, "> "); fflush(stdout); - n = read(STDIN_FILENO, buf, sizeof(buf)); - if (n > sizeof(buf) - 1) { - fprintf(stdout, "too much input.\n"); - return (0); - } else if (n <= 0) + n = read(STDIN_FILENO, buf, sizeof(buf) - 1); + if (n <= 0) return (0); if (buf[--n] != '\n') Modified: head/usr.sbin/cxgbtool/reg_defs.c ============================================================================== --- head/usr.sbin/cxgbtool/reg_defs.c Tue Feb 23 22:09:42 2010 (r204266) +++ head/usr.sbin/cxgbtool/reg_defs.c Tue Feb 23 23:01:41 2010 (r204267) @@ -106,7 +106,7 @@ struct reg_info sge_regs[] = { { "Packet_Too_Big", 3, 1 }, { "Packet_Mismatch", 4, 1 }, { "SG_RESPACCUTIMER", 0xc0, 0 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info mc3_regs[] = { @@ -196,7 +196,7 @@ struct reg_info mc3_regs[] = { { "MC3_Uncorr_Err", 1, 1 }, { "MC3_Parity_Err", 2, 8 }, { "MC3_Addr_Err", 10, 1 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info mc4_regs[] = { @@ -276,7 +276,7 @@ struct reg_info mc4_regs[] = { { "MC4_Corr_Err", 0, 1 }, { "MC4_Uncorr_Err", 1, 1 }, { "MC4_Addr_Err", 2, 1 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info tpi_regs[] = { @@ -290,7 +290,7 @@ struct reg_info tpi_regs[] = { { "INT_DIR", 31, 1 }, { "TPI_PAR", 0x29c, 0 }, { "TPIPAR", 0, 7 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info tp_regs[] = { @@ -509,7 +509,7 @@ struct reg_info tp_regs[] = { { "DROP_TICKS_CNT", 4, 26 }, { "NUM_PKTS_DROPPED", 0, 4 }, { "TP_TX_DROP_COUNT", 0x4bc, 0 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info rat_regs[] = { @@ -532,7 +532,7 @@ struct reg_info rat_regs[] = { { "CspiFramingError", 1, 1 }, { "SgeFramingError", 2, 1 }, { "TpFramingError", 3, 1 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info cspi_regs[] = { @@ -560,7 +560,7 @@ struct reg_info cspi_regs[] = { { "TXDrop", 2, 1 }, { "RXOverflow", 3, 1 }, { "RAMParityErr", 4, 1 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info espi_regs[] = { @@ -660,7 +660,7 @@ struct reg_info espi_regs[] = { { "Error_Ack", 9, 1 }, { "Unmapped_Err", 10, 1 }, { "Transaction_Timer", 16, 8 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info ulp_regs[] = { @@ -682,7 +682,7 @@ struct reg_info ulp_regs[] = { { "Pm_E2C_Wrt_Full", 24, 1 }, { "Pm_C2E_Wrt_Full", 25, 1 }, { "ULP_PIO_CTRL", 0x998, 0 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info pl_regs[] = { @@ -712,7 +712,7 @@ struct reg_info pl_regs[] = { { "PL_Intr_CSPI", 9, 1 }, { "PL_Intr_PCIX", 10, 1 }, { "PL_Intr_EXT", 11, 1 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info mc5_regs[] = { @@ -833,5 +833,5 @@ struct reg_info mc5_regs[] = { { "MC5_DATA_WRITE_CMD", 0xcf4, 0 }, { "MC5_DATA_READ_CMD", 0xcf8, 0 }, { "MC5_MASK_WRITE_CMD", 0xcfc, 0 }, - { NULL } + { NULL, 0, 0 } }; Modified: head/usr.sbin/cxgbtool/reg_defs_t3.c ============================================================================== --- head/usr.sbin/cxgbtool/reg_defs_t3.c Tue Feb 23 22:09:42 2010 (r204266) +++ head/usr.sbin/cxgbtool/reg_defs_t3.c Tue Feb 23 23:01:41 2010 (r204267) @@ -140,7 +140,7 @@ struct reg_info sge3_regs[] = { { "DrbPriThrsh", 0, 16 }, { "SG_DEBUG_INDEX", 0x78, 0 }, { "SG_DEBUG_DATA", 0x7c, 0 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info pcix1_regs[] = { @@ -212,7 +212,7 @@ struct reg_info pcix1_regs[] = { { "WakeUp0", 2, 1 }, { "SleepMode1", 1, 1 }, { "SleepMode0", 0, 1 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info pcie0_regs[] = { @@ -411,7 +411,7 @@ struct reg_info pcie0_regs[] = { { "BISTDone", 24, 8 }, { "BISTCycleThresh", 3, 16 }, { "BISTMode", 0, 3 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info t3dbg_regs[] = { @@ -557,7 +557,7 @@ struct reg_info t3dbg_regs[] = { { "PMON_CDEL_MANUAL", 4, 1 }, { "PMON_MANUAL", 1, 1 }, { "PMON_AUTO", 0, 1 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info mc7_pmrx_regs[] = { @@ -674,7 +674,7 @@ struct reg_info mc7_pmrx_regs[] = { { "PE", 2, 15 }, { "UE", 1, 1 }, { "CE", 0, 1 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info mc7_pmtx_regs[] = { @@ -791,7 +791,7 @@ struct reg_info mc7_pmtx_regs[] = { { "PE", 2, 15 }, { "UE", 1, 1 }, { "CE", 0, 1 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info mc7_cm_regs[] = { @@ -908,7 +908,7 @@ struct reg_info mc7_cm_regs[] = { { "PE", 2, 15 }, { "UE", 1, 1 }, { "CE", 0, 1 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info cim_regs[] = { @@ -1024,7 +1024,7 @@ struct reg_info cim_regs[] = { { "CIM_CDEBUGDATA", 0x2d0, 0 }, { "CDebugDataH", 16, 16 }, { "CDebugDataL", 0, 16 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info tp1_regs[] = { @@ -1384,7 +1384,7 @@ struct reg_info tp1_regs[] = { { "TP_EMBED_OP_FIELD3", 0x4f4, 0 }, { "TP_EMBED_OP_FIELD4", 0x4f8, 0 }, { "TP_EMBED_OP_FIELD5", 0x4fc, 0 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info ulp2_rx_regs[] = { @@ -1428,7 +1428,7 @@ struct reg_info ulp2_rx_regs[] = { { "ULPRX_RQ_ULIMIT", 0x538, 0 }, { "ULPRX_PBL_LLIMIT", 0x53c, 0 }, { "ULPRX_PBL_ULIMIT", 0x540, 0 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info ulp2_tx_regs[] = { @@ -1456,7 +1456,7 @@ struct reg_info ulp2_tx_regs[] = { { "ULPTX_DMA_WEIGHT", 0x5ac, 0 }, { "D1_WEIGHT", 16, 16 }, { "D0_WEIGHT", 0, 16 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info pm1_rx_regs[] = { @@ -1500,7 +1500,7 @@ struct reg_info pm1_rx_regs[] = { { "ocspi1_ofifo2x_Tx_framing_error", 6, 1 }, { "iespi_par_error", 3, 3 }, { "ocspi_par_error", 0, 3 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info pm1_tx_regs[] = { @@ -1544,7 +1544,7 @@ struct reg_info pm1_tx_regs[] = { { "oespi1_ofifo2x_Tx_framing_error", 6, 1 }, { "icspi_par_error", 3, 3 }, { "oespi_par_error", 0, 3 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info mps0_regs[] = { @@ -1585,7 +1585,7 @@ struct reg_info mps0_regs[] = { { "RXTpParErr", 4, 2 }, { "TX1TpParErr", 2, 2 }, { "TX0TpParErr", 0, 2 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info cpl_switch_regs[] = { @@ -1616,7 +1616,7 @@ struct reg_info cpl_switch_regs[] = { { "cpl_map_tbl_idx", 0, 8 }, { "CPL_MAP_TBL_DATA", 0x65c, 0 }, { "cpl_map_tbl_data", 0, 8 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info smb0_regs[] = { @@ -1682,7 +1682,7 @@ struct reg_info smb0_regs[] = { { "DebugDataL", 0, 16 }, { "SMB_DEBUG_LA", 0x69c, 0 }, { "DebugLAReqAddr", 0, 10 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info i2cm0_regs[] = { @@ -1695,7 +1695,7 @@ struct reg_info i2cm0_regs[] = { { "Ack", 30, 1 }, { "Cont", 1, 1 }, { "Op", 0, 1 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info mi1_regs[] = { @@ -1714,7 +1714,7 @@ struct reg_info mi1_regs[] = { { "Busy", 31, 1 }, { "Inc", 2, 1 }, { "Op", 0, 2 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info jm1_regs[] = { @@ -1727,7 +1727,7 @@ struct reg_info jm1_regs[] = { { "JM_OP", 0x6cc, 0 }, { "Busy", 31, 1 }, { "Cnt", 0, 5 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info sf1_regs[] = { @@ -1737,7 +1737,7 @@ struct reg_info sf1_regs[] = { { "Cont", 3, 1 }, { "ByteCnt", 1, 2 }, { "Op", 0, 1 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info pl3_regs[] = { @@ -1839,7 +1839,7 @@ struct reg_info pl3_regs[] = { { "PL_REV", 0x6f4, 0 }, { "Rev", 0, 4 }, { "PL_CLI", 0x6f8, 0 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info mc5a_regs[] = { @@ -2010,7 +2010,7 @@ struct reg_info mc5a_regs[] = { { "ReadCmd", 0, 20 }, { "MC5_DB_MASK_WRITE_CMD", 0x7fc, 0 }, { "MaskWr", 0, 16 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info xgmac0_0_regs[] = { @@ -2341,7 +2341,7 @@ struct reg_info xgmac0_0_regs[] = { { "XGM_RX_SPI4_SOP_EOP_CNT", 0x9ac, 0 }, { "RxSPI4SopCnt", 16, 16 }, { "RxSPI4EopCnt", 0, 16 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info xgmac0_1_regs[] = { @@ -2672,5 +2672,5 @@ struct reg_info xgmac0_1_regs[] = { { "XGM_RX_SPI4_SOP_EOP_CNT", 0xbac, 0 }, { "RxSPI4SopCnt", 16, 16 }, { "RxSPI4EopCnt", 0, 16 }, - { NULL } + { NULL, 0, 0 } }; Modified: head/usr.sbin/cxgbtool/reg_defs_t3b.c ============================================================================== --- head/usr.sbin/cxgbtool/reg_defs_t3b.c Tue Feb 23 22:09:42 2010 (r204266) +++ head/usr.sbin/cxgbtool/reg_defs_t3b.c Tue Feb 23 23:01:41 2010 (r204267) @@ -150,7 +150,7 @@ struct reg_info t3b_sge3_regs[] = { { "DrbPriThrsh", 0, 16 }, { "SG_DEBUG_INDEX", 0x78, 0 }, { "SG_DEBUG_DATA", 0x7c, 0 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info t3b_pcix1_regs[] = { @@ -222,7 +222,7 @@ struct reg_info t3b_pcix1_regs[] = { { "WakeUp0", 2, 1 }, { "SleepMode1", 1, 1 }, { "SleepMode0", 0, 1 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info t3b_pcie0_regs[] = { @@ -376,7 +376,7 @@ struct reg_info t3b_pcie0_regs[] = { { "BeaconDetect", 2, 1 }, { "RxDetect", 1, 1 }, { "TxIdleDetect", 0, 1 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info t3b_t3dbg_regs[] = { @@ -557,7 +557,7 @@ struct reg_info t3b_t3dbg_regs[] = { { "BSEnLane1", 4, 1 }, { "BSInSelLane0", 1, 2 }, { "BSEnLane0", 0, 1 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info t3b_mc7_pmrx_regs[] = { @@ -678,7 +678,7 @@ struct reg_info t3b_mc7_pmrx_regs[] = { { "PE", 2, 15 }, { "UE", 1, 1 }, { "CE", 0, 1 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info t3b_mc7_pmtx_regs[] = { @@ -799,7 +799,7 @@ struct reg_info t3b_mc7_pmtx_regs[] = { { "PE", 2, 15 }, { "UE", 1, 1 }, { "CE", 0, 1 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info t3b_mc7_cm_regs[] = { @@ -920,7 +920,7 @@ struct reg_info t3b_mc7_cm_regs[] = { { "PE", 2, 15 }, { "UE", 1, 1 }, { "CE", 0, 1 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info t3b_cim_regs[] = { @@ -1047,7 +1047,7 @@ struct reg_info t3b_cim_regs[] = { { "PILADbgWrPtr", 0, 9 }, { "CIM_PO_LA_DEBUGDATA", 0x2e8, 0 }, { "CIM_PI_LA_DEBUGDATA", 0x2ec, 0 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info t3b_tp1_regs[] = { @@ -1453,7 +1453,7 @@ struct reg_info t3b_tp1_regs[] = { { "TP_EMBED_OP_FIELD3", 0x4f4, 0 }, { "TP_EMBED_OP_FIELD4", 0x4f8, 0 }, { "TP_EMBED_OP_FIELD5", 0x4fc, 0 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info t3b_ulp2_rx_regs[] = { @@ -1497,7 +1497,7 @@ struct reg_info t3b_ulp2_rx_regs[] = { { "ULPRX_RQ_ULIMIT", 0x538, 0 }, { "ULPRX_PBL_LLIMIT", 0x53c, 0 }, { "ULPRX_PBL_ULIMIT", 0x540, 0 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info t3b_ulp2_tx_regs[] = { @@ -1525,7 +1525,7 @@ struct reg_info t3b_ulp2_tx_regs[] = { { "ULPTX_DMA_WEIGHT", 0x5ac, 0 }, { "D1_WEIGHT", 16, 16 }, { "D0_WEIGHT", 0, 16 }, - { NULL } + { NULL, 0, 0 } }; struct reg_info t3b_pm1_rx_regs[] = { @@ -1569,7 +1569,7 @@ struct reg_info t3b_pm1_rx_regs[] = { { "ocspi1_ofifo2x_Tx_framing_error", 6, 1 }, { "iespi_par_error", 3, 3 }, { "ocspi_par_error", 0, 3 }, - { NULL } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Feb 24 00:54:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2CA91065672; Wed, 24 Feb 2010 00:54:37 +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 D16058FC17; Wed, 24 Feb 2010 00:54:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1O0sblF030428; Wed, 24 Feb 2010 00:54:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1O0sbq9030426; Wed, 24 Feb 2010 00:54:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201002240054.o1O0sbq9030426@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 24 Feb 2010 00:54: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: r204268 - in head/sys/powerpc: aim include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2010 00:54:38 -0000 Author: nwhitehorn Date: Wed Feb 24 00:54:37 2010 New Revision: 204268 URL: http://svn.freebsd.org/changeset/base/204268 Log: Close a race involving the OEA64 scratchpage. When the scratch page's physical address is changed, there is a brief window during which its PTE is invalid. Since moea64_set_scratchpage_pa() does not and cannot hold the page table lock, it was possible for another CPU to insert a new PTE into the scratch page's PTEG slot during this interval, corrupting both mappings. Solve this by creating a new flag, LPTE_LOCKED, such that moea64_pte_insert will avoid claiming locked PTEG slots even if they are invalid. This change also incorporates some additional paranoia added to solve things I thought might be this bug. Reported by: linimon Modified: head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/include/pte.h Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Tue Feb 23 23:01:41 2010 (r204267) +++ head/sys/powerpc/aim/mmu_oea64.c Wed Feb 24 00:54:37 2010 (r204268) @@ -227,6 +227,7 @@ TLBIE(pmap_t pmap, vm_offset_t va) { #define VSID_MAKE(sr, hash) ((sr) | (((hash) & 0xfffff) << 4)) #define VSID_TO_SR(vsid) ((vsid) & 0xf) #define VSID_TO_HASH(vsid) (((vsid) >> 4) & 0xfffff) +#define VSID_HASH_MASK 0x0000007fffffffffULL #define PVO_PTEGIDX_MASK 0x007UL /* which PTEG slot */ #define PVO_PTEGIDX_VALID 0x008UL /* slot is valid */ @@ -458,9 +459,9 @@ MMU_DEF(oea64_bridge_mmu); static __inline u_int va_to_pteg(uint64_t vsid, vm_offset_t addr) { - u_int hash; + uint64_t hash; - hash = vsid ^ (((uint64_t)addr & ADDR_PIDX) >> + hash = (vsid & VSID_HASH_MASK) ^ (((uint64_t)addr & ADDR_PIDX) >> ADDR_PIDX_SHFT); return (hash & moea64_pteg_mask); } @@ -979,6 +980,7 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o moea64_scratchpage_va[i],&j); moea64_scratchpage_pte[i] = moea64_pvo_to_pte( moea64_scratchpage_pvo[i],j); + moea64_scratchpage_pte[i]->pte_hi |= LPTE_LOCKED; UNLOCK_TABLE(); } @@ -1090,8 +1092,10 @@ moea64_zero_page(mmu_t mmu, vm_page_t m) static __inline void moea64_set_scratchpage_pa(int which, vm_offset_t pa) { + mtx_assert(&moea64_scratchpage_mtx, MA_OWNED); + moea64_scratchpage_pvo[which]->pvo_pte.lpte.pte_lo &= - (~LPTE_WIMG & ~LPTE_RPGN); + ~(LPTE_WIMG | LPTE_RPGN); moea64_scratchpage_pvo[which]->pvo_pte.lpte.pte_lo |= moea64_calc_wimg(pa) | (uint64_t)pa; @@ -2151,18 +2155,16 @@ moea64_pvo_remove(struct pvo_entry *pvo, static __inline int moea64_pvo_pte_index(const struct pvo_entry *pvo, int ptegidx) { - int pteidx; /* * We can find the actual pte entry without searching by grabbing - * the PTEG index from 3 unused bits in pte_lo[11:9] and by + * the PTEG index from 3 unused bits in pvo_vaddr and by * noticing the HID bit. */ - pteidx = ptegidx * 8 + PVO_PTEGIDX_GET(pvo); if (pvo->pvo_pte.lpte.pte_hi & LPTE_HID) - pteidx ^= moea64_pteg_mask * 8; + ptegidx ^= moea64_pteg_mask; - return (pteidx); + return ((ptegidx << 3) | PVO_PTEGIDX_GET(pvo)); } static struct pvo_entry * @@ -2259,7 +2261,8 @@ moea64_pte_insert(u_int ptegidx, struct * First try primary hash. */ for (pt = moea64_pteg_table[ptegidx].pt, i = 0; i < 8; i++, pt++) { - if ((pt->pte_hi & LPTE_VALID) == 0) { + if ((pt->pte_hi & LPTE_VALID) == 0 && + (pt->pte_hi & LPTE_LOCKED) == 0) { pvo_pt->pte_hi &= ~LPTE_HID; moea64_pte_set(pt, pvo_pt); return (i); @@ -2272,7 +2275,8 @@ moea64_pte_insert(u_int ptegidx, struct ptegidx ^= moea64_pteg_mask; for (pt = moea64_pteg_table[ptegidx].pt, i = 0; i < 8; i++, pt++) { - if ((pt->pte_hi & LPTE_VALID) == 0) { + if ((pt->pte_hi & LPTE_VALID) == 0 && + (pt->pte_hi & LPTE_LOCKED) == 0) { pvo_pt->pte_hi |= LPTE_HID; moea64_pte_set(pt, pvo_pt); return (i); Modified: head/sys/powerpc/include/pte.h ============================================================================== --- head/sys/powerpc/include/pte.h Tue Feb 23 23:01:41 2010 (r204267) +++ head/sys/powerpc/include/pte.h Wed Feb 24 00:54:37 2010 (r204268) @@ -95,6 +95,7 @@ struct lpteg { /* High quadword: */ #define LPTE_VSID_SHIFT 12 #define LPTE_API 0x0000000000000F80ULL +#define LPTE_LOCKED 0x0000000000000008ULL #define LPTE_BIG 0x0000000000000004ULL /* 4kb/16Mb page */ #define LPTE_HID 0x0000000000000002ULL #define LPTE_VALID 0x0000000000000001ULL From owner-svn-src-head@FreeBSD.ORG Wed Feb 24 00:55:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3DD51065670; Wed, 24 Feb 2010 00:55:55 +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 A33318FC1E; Wed, 24 Feb 2010 00:55:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1O0ttJD030770; Wed, 24 Feb 2010 00:55:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1O0ttmZ030768; Wed, 24 Feb 2010 00:55:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201002240055.o1O0ttmZ030768@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 24 Feb 2010 00:55:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204269 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2010 00:55:55 -0000 Author: nwhitehorn Date: Wed Feb 24 00:55:55 2010 New Revision: 204269 URL: http://svn.freebsd.org/changeset/base/204269 Log: Use dcbz instead of word stores for page zeroing, providing a factor of 3-4 speedup. Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Wed Feb 24 00:54:37 2010 (r204268) +++ head/sys/powerpc/aim/mmu_oea64.c Wed Feb 24 00:55:55 2010 (r204269) @@ -1075,15 +1075,6 @@ moea64_change_wiring(mmu_t mmu, pmap_t p } /* - * Zero a page of physical memory by temporarily mapping it into the tlb. - */ -void -moea64_zero_page(mmu_t mmu, vm_page_t m) -{ - moea64_zero_page_area(mmu,m,0,PAGE_SIZE); -} - -/* * This goes through and sets the physical address of our * special scratch PTE to the PA we want to zero or copy. Because * of locking issues (this can get called in pvo_enter() by @@ -1147,6 +1138,27 @@ moea64_zero_page_area(mmu_t mmu, vm_page mtx_unlock(&moea64_scratchpage_mtx); } +/* + * Zero a page of physical memory by temporarily mapping it + */ +void +moea64_zero_page(mmu_t mmu, vm_page_t m) +{ + vm_offset_t pa = VM_PAGE_TO_PHYS(m); + vm_offset_t off; + + if (!moea64_initialized) + panic("moea64_zero_page: can't zero pa %#x", pa); + + mtx_lock(&moea64_scratchpage_mtx); + + moea64_set_scratchpage_pa(0,pa); + for (off = 0; off < PAGE_SIZE; off += cacheline_size) + __asm __volatile("dcbz 0,%0" :: + "r"(moea64_scratchpage_va[0] + off)); + mtx_unlock(&moea64_scratchpage_mtx); +} + void moea64_zero_page_idle(mmu_t mmu, vm_page_t m) { From owner-svn-src-head@FreeBSD.ORG Wed Feb 24 01:27:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDE111065670; Wed, 24 Feb 2010 01:27:36 +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 9D0D88FC12; Wed, 24 Feb 2010 01:27:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1O1RaF0037726; Wed, 24 Feb 2010 01:27:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1O1RaH9037723; Wed, 24 Feb 2010 01:27:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201002240127.o1O1RaH9037723@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 24 Feb 2010 01:27: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: r204270 - in head: share/man/man4/man4.powerpc sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2010 01:27:37 -0000 Author: nwhitehorn Date: Wed Feb 24 01:27:36 2010 New Revision: 204270 URL: http://svn.freebsd.org/changeset/base/204270 Log: Add the ability to set SMU-based machines to restart automatically after power loss. Modified: head/share/man/man4/man4.powerpc/smu.4 head/sys/powerpc/powermac/smu.c Modified: head/share/man/man4/man4.powerpc/smu.4 ============================================================================== --- head/share/man/man4/man4.powerpc/smu.4 Wed Feb 24 00:55:55 2010 (r204269) +++ head/share/man/man4/man4.powerpc/smu.4 Wed Feb 24 01:27:36 2010 (r204270) @@ -75,6 +75,9 @@ The following sysctls can be used to con power management behavior and to examine current system power and thermal conditions. .Bl -tag -width indent +.It Va dev.smu.%d.server_mode +Restart after power failure behavior (1 causes system to reboot after power +cut, 0 causes system to remain off). .It Va dev.smu.%d.target_temp Target system temperature, in degrees Celsius. The .Nm Modified: head/sys/powerpc/powermac/smu.c ============================================================================== --- head/sys/powerpc/powermac/smu.c Wed Feb 24 00:55:55 2010 (r204269) +++ head/sys/powerpc/powermac/smu.c Wed Feb 24 01:27:36 2010 (r204270) @@ -137,6 +137,7 @@ static void smu_attach_fans(device_t dev static void smu_attach_sensors(device_t dev, phandle_t sensroot); static void smu_fanmgt_callout(void *xdev); static void smu_set_sleepled(void *xdev, int onoff); +static int smu_server_mode(SYSCTL_HANDLER_ARGS); /* where to find the doorbell GPIO */ @@ -174,6 +175,16 @@ MALLOC_DEFINE(M_SMU, "smu", "SMU Sensor #define SMU_MISC_GET_DATA 0x02 #define SMU_MISC_LED_CTRL 0x04 #define SMU_POWER 0xaa +#define SMU_POWER_EVENTS 0x8f +#define SMU_PWR_GET_POWERUP 0x00 +#define SMU_PWR_SET_POWERUP 0x01 +#define SMU_PWR_CLR_POWERUP 0x02 + +/* Power event types */ +#define SMU_WAKEUP_KEYPRESS 0x01 +#define SMU_WAKEUP_AC_INSERT 0x02 +#define SMU_WAKEUP_AC_CHANGE 0x04 +#define SMU_WAKEUP_RING 0x10 /* Data blocks */ #define SMU_CPUTEMP_CAL 0x18 @@ -301,6 +312,15 @@ smu_attach(device_t dev) */ sc->sc_leddev = led_create(smu_set_sleepled, dev, "sleepled"); + /* + * Reset on power loss behavior + */ + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "server_mode", CTLTYPE_INT | CTLFLAG_RW, dev, 0, + smu_server_mode, "I", "Enable reboot after power failure"); + return (0); } @@ -877,3 +897,41 @@ smu_set_sleepled(void *xdev, int onoff) smu_run_cmd(smu, &cmd); } +static int +smu_server_mode(SYSCTL_HANDLER_ARGS) +{ + struct smu_cmd cmd; + u_int server_mode; + device_t smu = arg1; + int error; + + cmd.cmd = SMU_POWER_EVENTS; + cmd.len = 1; + cmd.data[0] = SMU_PWR_GET_POWERUP; + + error = smu_run_cmd(smu, &cmd); + + if (error) + return (error); + + server_mode = (cmd.data[1] & SMU_WAKEUP_AC_INSERT) ? 1 : 0; + + error = sysctl_handle_int(oidp, &server_mode, 0, req); + + if (error || !req->newptr) + return (error); + + if (server_mode == 1) + cmd.data[0] = SMU_PWR_SET_POWERUP; + else if (server_mode == 0) + cmd.data[0] = SMU_PWR_CLR_POWERUP; + else + return (EINVAL); + + cmd.len = 3; + cmd.data[1] = 0; + cmd.data[2] = SMU_WAKEUP_AC_INSERT; + + return (smu_run_cmd(smu, &cmd)); +} + From owner-svn-src-head@FreeBSD.ORG Wed Feb 24 01:44:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08E9E1065729; Wed, 24 Feb 2010 01:44:40 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DC568FC0A; Wed, 24 Feb 2010 01:44:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1O1iepI041477; Wed, 24 Feb 2010 01:44:40 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1O1ieXn041475; Wed, 24 Feb 2010 01:44:40 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201002240144.o1O1ieXn041475@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 24 Feb 2010 01:44: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: r204271 - head/sys/dev/cxgb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2010 01:44:41 -0000 Author: np Date: Wed Feb 24 01:44:39 2010 New Revision: 204271 URL: http://svn.freebsd.org/changeset/base/204271 Log: Accessing an mbuf after it has been handed off to the hardware is a bad race as it could already have been tx'd and freed by that time. Place the bpf tap just _before_ writing the gen bit. This fixes a panic when running tcpdump on a cxgb interface. Modified: head/sys/dev/cxgb/cxgb_sge.c Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Wed Feb 24 01:27:36 2010 (r204270) +++ head/sys/dev/cxgb/cxgb_sge.c Wed Feb 24 01:44:39 2010 (r204271) @@ -1477,6 +1477,7 @@ t3_encap(struct sge_qset *qs, struct mbu V_WR_GEN(txqs.gen)) | htonl(V_WR_TID(txq->token)); set_wr_hdr(wrp, wr_hi, wr_lo); wmb(); + ETHER_BPF_MTAP(pi->ifp, m0); wr_gen2(txd, txqs.gen); check_ring_tx_db(sc, txq); return (0); @@ -1549,8 +1550,10 @@ t3_encap(struct sge_qset *qs, struct mbu V_WR_GEN(txqs.gen) | V_WR_TID(txq->token)); set_wr_hdr(&hdr->wr, wr_hi, wr_lo); wmb(); + ETHER_BPF_MTAP(pi->ifp, m0); wr_gen2(txd, txqs.gen); check_ring_tx_db(sc, txq); + m_freem(m0); return (0); } flits = 3; @@ -1578,8 +1581,10 @@ t3_encap(struct sge_qset *qs, struct mbu V_WR_GEN(txqs.gen) | V_WR_TID(txq->token)); set_wr_hdr(&cpl->wr, wr_hi, wr_lo); wmb(); + ETHER_BPF_MTAP(pi->ifp, m0); wr_gen2(txd, txqs.gen); check_ring_tx_db(sc, txq); + m_freem(m0); return (0); } flits = 2; @@ -1590,12 +1595,14 @@ t3_encap(struct sge_qset *qs, struct mbu sgl_flits = sgl_len(nsegs); + ETHER_BPF_MTAP(pi->ifp, m0); + KASSERT(ndesc <= 4, ("ndesc too large %d", ndesc)); wr_hi = htonl(V_WR_OP(FW_WROPCODE_TUNNEL_TX_PKT) | txqs.compl); wr_lo = htonl(V_WR_TID(txq->token)); write_wr_hdr_sgl(ndesc, txd, &txqs, txq, sgl, flits, sgl_flits, wr_hi, wr_lo); - check_ring_tx_db(pi->adapter, txq); + check_ring_tx_db(sc, txq); return (0); } @@ -1674,16 +1681,6 @@ cxgb_start_locked(struct sge_qset *qs) */ if (t3_encap(qs, &m_head) || m_head == NULL) break; - - /* Send a copy of the frame to the BPF listener */ - ETHER_BPF_MTAP(ifp, m_head); - - /* - * We sent via PIO, no longer need a copy - */ - if (m_head->m_nextpkt == NULL && - m_head->m_pkthdr.len <= PIO_LEN) - m_freem(m_head); m_head = NULL; } @@ -1726,17 +1723,6 @@ cxgb_transmit_locked(struct ifnet *ifp, */ txq->txq_direct_packets++; txq->txq_direct_bytes += m->m_pkthdr.len; - /* - ** Send a copy of the frame to the BPF - ** listener and set the watchdog on. - */ - ETHER_BPF_MTAP(ifp, m); - /* - * We sent via PIO, no longer need a copy - */ - if (m->m_pkthdr.len <= PIO_LEN) - m_freem(m); - } } else if ((error = drbr_enqueue(ifp, br, m)) != 0) return (error); From owner-svn-src-head@FreeBSD.ORG Wed Feb 24 01:53:32 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1665106564A; Wed, 24 Feb 2010 01:53:32 +0000 (UTC) (envelope-from cyrille.lefevre-lists@laposte.net) Received: from out4.laposte.net (out3.laposte.net [193.251.214.120]) by mx1.freebsd.org (Postfix) with ESMTP id 877498FC0C; Wed, 24 Feb 2010 01:53:32 +0000 (UTC) Received: from out3.laposte.net (lbao93aubmepnpf001-183-pip.meplus.info [10.98.50.10]) by mwinf8305.laposte.net (SMTP Server) with ESMTP id 139CA1C00113; Wed, 24 Feb 2010 02:22:02 +0100 (CET) Received: from meplus.info (localhost [127.0.0.1]) by mwinf8313.laposte.net (SMTP Server) with ESMTP id C55BD7000084; Wed, 24 Feb 2010 02:22:00 +0100 (CET) Received: from [192.168.1.133] (84.228.100-84.rev.gaoland.net [84.100.228.84]) by mwinf8313.laposte.net (SMTP Server) with ESMTP id 3D46C7000083; Wed, 24 Feb 2010 02:22:00 +0100 (CET) X-ME-UUID: 20100224012200251.3D46C7000083@mwinf8313.laposte.net Message-ID: <4B847F4D.8010307@laposte.net> Date: Wed, 24 Feb 2010 02:22:21 +0100 From: Cyrille Lefevre Organization: ACME User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.3) Gecko/20070326 Thunderbird/2.0.0.0 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Doug Barton References: <200912200134.nBK1YCAA048942@svn.freebsd.org> <4B2DBB51.9060002@FreeBSD.org> <4B2DD2A1.8060907@FreeBSD.org> <4B2E84CF.2060902@FreeBSD.org> <4B847E98.5040209@laposte.net> In-Reply-To: <4B847E98.5040209@laposte.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-me-spamlevel: not-spam X-me-spamrating: 36.000000 X-me-spamcause: OK, (-100)(0000)gggruggvucftvghtrhhoucdtuddrvdeltddrgeehucetggdotefuucfrrhhofhhilhgvmecuoehnohhnvgeqnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, freebsd-rc@FreeBSD.org, Hajimu UMEMOTO Subject: Re: svn commit: r200743 - in head/usr.sbin: . service X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2010 01:53:32 -0000 Cyrille Lefevre a =E9crit : > Doug Barton a =E9crit : >> I agree to making the change you suggested, but I would like to >> quibble over the format. Isn't the attached patch equivalent, and >> simpler? What is the value of setting HOME and PATH in the environment= >> if we're just going to use 'env -i HOME PATH' anyway? >=20 > how about to replace $* by "$@" in service.sh and to quote $dir/$script= =20 > as well ? >=20 > before : > exec env -i HOME=3D/ PATH=3D/sbin:/bin:/usr/sbin:/usr/bin $dir/$script = $* >=20 > after : > exec env -i HOME=3D/ PATH=3D/sbin:/bin:/usr/sbin:/usr/bin "$dir/$script= " "$@" forgive me for the noise, don't see the message from "Jilles Tjoelker"...= Regards, Cyrille Lefevre --=20 mailto:Cyrille.Lefevre-lists@laposte.net From owner-svn-src-head@FreeBSD.ORG Wed Feb 24 01:53:42 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFCEE106564A; Wed, 24 Feb 2010 01:53:42 +0000 (UTC) (envelope-from cyrille.lefevre-lists@laposte.net) Received: from out4.laposte.net (out3.laposte.net [193.251.214.120]) by mx1.freebsd.org (Postfix) with ESMTP id 93B0E8FC29; Wed, 24 Feb 2010 01:53:42 +0000 (UTC) Received: from out3.laposte.net (lbao93aubmepnpf001-183-pip.meplus.info [10.98.50.10]) by mwinf8310.laposte.net (SMTP Server) with ESMTP id 6209E1C0017F; Wed, 24 Feb 2010 02:19:02 +0100 (CET) Received: from meplus.info (localhost [127.0.0.1]) by mwinf8302.laposte.net (SMTP Server) with ESMTP id 41109E000086; Wed, 24 Feb 2010 02:19:00 +0100 (CET) Received: from [192.168.1.133] (84.228.100-84.rev.gaoland.net [84.100.228.84]) by mwinf8302.laposte.net (SMTP Server) with ESMTP id C6B26E000083; Wed, 24 Feb 2010 02:18:59 +0100 (CET) X-ME-UUID: 20100224011859813.C6B26E000083@mwinf8302.laposte.net Message-ID: <4B847E98.5040209@laposte.net> Date: Wed, 24 Feb 2010 02:19:20 +0100 From: Cyrille Lefevre Organization: ACME User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.3) Gecko/20070326 Thunderbird/2.0.0.0 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Doug Barton References: <200912200134.nBK1YCAA048942@svn.freebsd.org> <4B2DBB51.9060002@FreeBSD.org> <4B2DD2A1.8060907@FreeBSD.org> <4B2E84CF.2060902@FreeBSD.org> In-Reply-To: <4B2E84CF.2060902@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-me-spamlevel: not-spam X-me-spamrating: 36.000000 X-me-spamcause: OK, (-100)(0000)gggruggvucftvghtrhhoucdtuddrvdeltddrgeehucetggdotefuucfrrhhofhhilhgvmecuoehnohhnvgeqnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, freebsd-rc@FreeBSD.org, Hajimu UMEMOTO Subject: Re: svn commit: r200743 - in head/usr.sbin: . service X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2010 01:53:43 -0000 Doug Barton a =E9crit : > I agree to making the change you suggested, but I would like to > quibble over the format. Isn't the attached patch equivalent, and > simpler? What is the value of setting HOME and PATH in the environment > if we're just going to use 'env -i HOME PATH' anyway? how about to replace $* by "$@" in service.sh and to quote $dir/$script=20 as well ? before : exec env -i HOME=3D/ PATH=3D/sbin:/bin:/usr/sbin:/usr/bin $dir/$script $*= after : exec env -i HOME=3D/ PATH=3D/sbin:/bin:/usr/sbin:/usr/bin "$dir/$script" = "$@" Regards, Cyrille Lefevre --=20 mailto:Cyrille.Lefevre-lists@laposte.net From owner-svn-src-head@FreeBSD.ORG Wed Feb 24 10:16:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45FF9106564A; Wed, 24 Feb 2010 10:16:19 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 331408FC16; Wed, 24 Feb 2010 10:16:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1OAGJ1B054171; Wed, 24 Feb 2010 10:16:19 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1OAGJso054160; Wed, 24 Feb 2010 10:16:19 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201002241016.o1OAGJso054160@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 24 Feb 2010 10:16: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: r204274 - in head/sys: dev/cxgb dev/cxgb/common dev/cxgb/ulp/iw_cxgb dev/cxgb/ulp/tom modules/cxgb/cxgb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2010 10:16:19 -0000 Author: np Date: Wed Feb 24 10:16:18 2010 New Revision: 204274 URL: http://svn.freebsd.org/changeset/base/204274 Log: There is no need to test __FreeBSD_version for features that have been around for a long time now (7.1-ish or even earlier); assume they are present. These includes MSI, TSO, LRO, VLAN, INTR_FILTERS, FIRMWARE, etc. Also, eliminate some dead code and clean up in other places as part of this quick once-over. MFC after: 1 week Deleted: head/sys/dev/cxgb/common/cxgb_version.h head/sys/dev/cxgb/cxgb_config.h Modified: head/sys/dev/cxgb/common/cxgb_common.h head/sys/dev/cxgb/common/cxgb_t3_hw.c head/sys/dev/cxgb/cxgb_adapter.h head/sys/dev/cxgb/cxgb_main.c head/sys/dev/cxgb/cxgb_offload.h head/sys/dev/cxgb/cxgb_osdep.h head/sys/dev/cxgb/cxgb_sge.c head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c head/sys/dev/cxgb/ulp/tom/cxgb_cpl_socket.c head/sys/modules/cxgb/cxgb/Makefile Modified: head/sys/dev/cxgb/common/cxgb_common.h ============================================================================== --- head/sys/dev/cxgb/common/cxgb_common.h Wed Feb 24 07:53:29 2010 (r204273) +++ head/sys/dev/cxgb/common/cxgb_common.h Wed Feb 24 10:16:18 2010 (r204274) @@ -392,11 +392,9 @@ struct adapter_params { const struct adapter_info *info; -#ifdef CONFIG_CHELSIO_T3_CORE unsigned short mtus[NMTUS]; unsigned short a_wnd[NCCTRL_WIN]; unsigned short b_wnd[NCCTRL_WIN]; -#endif unsigned int nports; /* # of ethernet ports */ unsigned int chan_map; /* bitmap of in-use Tx channels */ unsigned int stats_update_period; /* MAC stats accumulation period */ @@ -650,11 +648,7 @@ static inline int is_10G(const adapter_t static inline int is_offload(const adapter_t *adap) { -#if defined(CONFIG_CHELSIO_T3_CORE) return adap->params.offload; -#else - return 0; -#endif } static inline unsigned int core_ticks_per_usec(const adapter_t *adap) @@ -772,7 +766,6 @@ void t3_mc5_intr_handler(struct mc5 *mc5 int t3_read_mc5_range(const struct mc5 *mc5, unsigned int start, unsigned int n, u32 *buf); -#ifdef CONFIG_CHELSIO_T3_CORE int t3_tp_set_coalescing_size(adapter_t *adap, unsigned int size, int psh); void t3_tp_set_max_rxsize(adapter_t *adap, unsigned int size); void t3_tp_get_mib_stats(adapter_t *adap, struct tp_mib_stats *tps); @@ -793,7 +786,6 @@ void t3_get_tx_sched(adapter_t *adap, un void t3_read_pace_tbl(adapter_t *adap, unsigned int pace_vals[NTX_SCHED]); void t3_set_pace_tbl(adapter_t *adap, unsigned int *pace_vals, unsigned int start, unsigned int n); -#endif int t3_get_up_la(adapter_t *adapter, u32 *stopped, u32 *index, u32 *size, void *data); Modified: head/sys/dev/cxgb/common/cxgb_t3_hw.c ============================================================================== --- head/sys/dev/cxgb/common/cxgb_t3_hw.c Wed Feb 24 07:53:29 2010 (r204273) +++ head/sys/dev/cxgb/common/cxgb_t3_hw.c Wed Feb 24 10:16:18 2010 (r204274) @@ -3263,7 +3263,6 @@ static void tp_set_timers(adapter_t *ada #undef SECONDS } -#ifdef CONFIG_CHELSIO_T3_CORE /** * t3_tp_set_coalescing_size - set receive coalescing size * @adap: the adapter @@ -3566,7 +3565,6 @@ int t3_set_proto_sram(adapter_t *adap, c } return 0; } -#endif /** * t3_config_trace_filter - configure one of the tracing filters @@ -4150,14 +4148,12 @@ int t3_init_hw(adapter_t *adapter, u32 f if (tp_init(adapter, &adapter->params.tp)) goto out_err; -#ifdef CONFIG_CHELSIO_T3_CORE t3_tp_set_coalescing_size(adapter, min(adapter->params.sge.max_pkt_size, MAX_RX_COALESCING_LEN), 1); t3_tp_set_max_rxsize(adapter, min(adapter->params.sge.max_pkt_size, 16384U)); ulp_config(adapter, &adapter->params.tp); -#endif if (is_pcie(adapter)) config_pcie(adapter); else @@ -4508,10 +4504,8 @@ int __devinit t3_prep_adapter(adapter_t adapter->params.mc5.nroutes = 0; t3_mc5_prep(adapter, &adapter->mc5, MC5_MODE_144_BIT); -#ifdef CONFIG_CHELSIO_T3_CORE init_mtus(adapter->params.mtus); init_cong_ctrl(adapter->params.a_wnd, adapter->params.b_wnd); -#endif } early_hw_init(adapter, ai); Modified: head/sys/dev/cxgb/cxgb_adapter.h ============================================================================== --- head/sys/dev/cxgb/cxgb_adapter.h Wed Feb 24 07:53:29 2010 (r204273) +++ head/sys/dev/cxgb/cxgb_adapter.h Wed Feb 24 10:16:18 2010 (r204274) @@ -46,6 +46,7 @@ $FreeBSD$ #include #include #include +#include #include #include @@ -58,10 +59,6 @@ $FreeBSD$ #include #include -#ifdef LRO_SUPPORTED -#include -#endif - struct adapter; struct sge_qset; extern int cxgb_debug; @@ -156,12 +153,10 @@ enum { TXQ_ETH = 0, #define WR_LEN (WR_FLITS * 8) #define PIO_LEN (WR_LEN - sizeof(struct cpl_tx_pkt_lso)) -#ifdef LRO_SUPPORTED struct lro_state { unsigned short enabled; struct lro_ctrl ctrl; }; -#endif #define RX_BUNDLE_SIZE 8 @@ -284,9 +279,7 @@ enum { struct sge_qset { struct sge_rspq rspq; struct sge_fl fl[SGE_RXQ_PER_SET]; -#ifdef LRO_SUPPORTED struct lro_state lro; -#endif struct sge_txq txq[SGE_TXQ_PER_SET]; uint32_t txq_stopped; /* which Tx queues are stopped */ uint64_t port_stats[SGE_PSTAT_MAX]; Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Wed Feb 24 07:53:29 2010 (r204273) +++ head/sys/dev/cxgb/cxgb_main.c Wed Feb 24 10:16:18 2010 (r204274) @@ -376,11 +376,7 @@ cxgb_controller_probe(device_t dev) static int upgrade_fw(adapter_t *sc) { -#ifdef FIRMWARE_LATEST const struct firmware *fw; -#else - struct firmware *fw; -#endif int status; if ((fw = firmware_get(FW_FNAME)) == NULL) { @@ -390,7 +386,8 @@ upgrade_fw(adapter_t *sc) device_printf(sc->dev, "updating firmware on card\n"); status = t3_load_fw(sc, (const uint8_t *)fw->data, fw->datasize); - device_printf(sc->dev, "firmware update returned %s %d\n", (status == 0) ? "success" : "fail", status); + device_printf(sc->dev, "firmware update returned %s %d\n", + status == 0 ? "success" : "fail", status); firmware_put(fw, FIRMWARE_UNLOAD); @@ -432,9 +429,7 @@ cxgb_controller_attach(device_t dev) int i, error = 0; uint32_t vers; int port_qsets = 1; -#ifdef MSI_SUPPORTED int msi_needed, reg; -#endif char buf[80]; sc = device_get_softc(dev); @@ -442,10 +437,6 @@ cxgb_controller_attach(device_t dev) sc->msi_count = 0; ai = cxgb_get_adapter_info(dev); - /* - * XXX not really related but a recent addition - */ -#ifdef MSI_SUPPORTED /* find the PCIe link width and set max read request to 4KB*/ if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) { uint16_t lnk, pectl; @@ -463,7 +454,7 @@ cxgb_controller_attach(device_t dev) "PCIe x%d Link, expect reduced performance\n", sc->link_width); } -#endif + touch_bars(dev); pci_enable_busmaster(dev); /* @@ -518,8 +509,6 @@ cxgb_controller_attach(device_t dev) * back to MSI. If that fails, then try falling back to the legacy * interrupt pin model. */ -#ifdef MSI_SUPPORTED - sc->msix_regs_rid = 0x20; if ((msi_allowed >= 2) && (sc->msix_regs_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, @@ -565,20 +554,14 @@ cxgb_controller_attach(device_t dev) device_printf(dev, "using MSI interrupts\n"); } } -#endif if (sc->msi_count == 0) { device_printf(dev, "using line interrupts\n"); sc->cxgb_intr = t3b_intr; } /* Create a private taskqueue thread for handling driver events */ -#ifdef TASKQUEUE_CURRENT sc->tq = taskqueue_create("cxgb_taskq", M_NOWAIT, taskqueue_thread_enqueue, &sc->tq); -#else - sc->tq = taskqueue_create_fast("cxgb_taskq", M_NOWAIT, - taskqueue_thread_enqueue, &sc->tq); -#endif if (sc->tq == NULL) { device_printf(dev, "failed to allocate controller task queue\n"); goto out; @@ -764,7 +747,6 @@ cxgb_free(struct adapter *sc) * Release all interrupt resources. */ cxgb_teardown_interrupts(sc); -#ifdef MSI_SUPPORTED if (sc->flags & (USING_MSI | USING_MSIX)) { device_printf(sc->dev, "releasing msi message(s)\n"); pci_release_msi(sc->dev); @@ -776,7 +758,6 @@ cxgb_free(struct adapter *sc) bus_release_resource(sc->dev, SYS_RES_MEMORY, sc->msix_regs_rid, sc->msix_regs_res); } -#endif /* * Free the adapter's taskqueue. @@ -910,11 +891,8 @@ cxgb_setup_interrupts(adapter_t *sc) sc->irq_rid = 0; } else { err = bus_setup_intr(sc->dev, sc->irq_res, - INTR_MPSAFE | INTR_TYPE_NET, -#ifdef INTR_FILTERS - NULL, -#endif - sc->cxgb_intr, sc, &sc->intr_tag); + INTR_MPSAFE | INTR_TYPE_NET, NULL, + sc->cxgb_intr, sc, &sc->intr_tag); if (err) { device_printf(sc->dev, @@ -943,10 +921,7 @@ cxgb_setup_interrupts(adapter_t *sc) } err = bus_setup_intr(sc->dev, res, INTR_MPSAFE | INTR_TYPE_NET, -#ifdef INTR_FILTERS - NULL, -#endif - t3_intr_msix, &sc->sge.qs[i], &tag); + NULL, t3_intr_msix, &sc->sge.qs[i], &tag); if (err) { device_printf(sc->dev, "Cannot set up interrupt " "for message %d (%d)\n", rid, err); @@ -996,26 +971,9 @@ cxgb_makedev(struct port_info *pi) return (0); } -#ifndef LRO_SUPPORTED -#ifdef IFCAP_LRO -#undef IFCAP_LRO -#endif -#define IFCAP_LRO 0x0 -#endif - -#ifdef TSO_SUPPORTED -#define CXGB_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO) -/* Don't enable TSO6 yet */ -#define CXGB_CAP_ENABLE (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | IFCAP_TSO4 | IFCAP_JUMBO_MTU | IFCAP_LRO) -#else -#define CXGB_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_JUMBO_MTU) -/* Don't enable TSO6 yet */ -#define CXGB_CAP_ENABLE (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_JUMBO_MTU) -#define IFCAP_TSO4 0x0 -#define IFCAP_TSO6 0x0 -#define CSUM_TSO 0x0 -#endif - +#define CXGB_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | \ + IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO) +#define CXGB_CAP_ENABLE (CXGB_CAP & ~IFCAP_TSO6) static int cxgb_port_attach(device_t dev) @@ -1024,8 +982,7 @@ cxgb_port_attach(device_t dev) struct ifnet *ifp; int err; struct adapter *sc; - - + p = device_get_softc(dev); sc = p->adapter; snprintf(p->lockbuf, PORT_NAME_LEN, "cxgb port lock %d:%d", @@ -1039,9 +996,6 @@ cxgb_port_attach(device_t dev) return (ENOMEM); } - /* - * Note that there is currently no watchdog timer. - */ if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_init = cxgb_init; ifp->if_softc = p; @@ -1053,16 +1007,16 @@ cxgb_port_attach(device_t dev) IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); IFQ_SET_READY(&ifp->if_snd); - ifp->if_hwassist = ifp->if_capabilities = ifp->if_capenable = 0; - ifp->if_capabilities |= CXGB_CAP; - ifp->if_capenable |= CXGB_CAP_ENABLE; - ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO); + ifp->if_capabilities = CXGB_CAP; + ifp->if_capenable = CXGB_CAP_ENABLE; + ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO; + /* - * disable TSO on 4-port - it isn't supported by the firmware yet + * Disable TSO on 4-port - it isn't supported by the firmware. */ - if (p->adapter->params.nports > 2) { - ifp->if_capabilities &= ~(IFCAP_TSO4 | IFCAP_TSO6); - ifp->if_capenable &= ~(IFCAP_TSO4 | IFCAP_TSO6); + if (sc->params.nports > 2) { + ifp->if_capabilities &= ~IFCAP_TSO; + ifp->if_capenable &= ~IFCAP_TSO; ifp->if_hwassist &= ~CSUM_TSO; } @@ -1070,11 +1024,10 @@ cxgb_port_attach(device_t dev) ifp->if_transmit = cxgb_transmit; ifp->if_qflush = cxgb_qflush; - /* - * Only default to jumbo frames on 10GigE - */ - if (p->adapter->params.nports <= 2) +#ifdef DEFAULT_JUMBO + if (sc->params.nports <= 2) ifp->if_mtu = ETHERMTU_JUMBO; +#endif if ((err = cxgb_makedev(p)) != 0) { printf("makedev failed %d\n", err); return (err); @@ -1583,11 +1536,7 @@ bind_qsets(adapter_t *sc) static void update_tpeeprom(struct adapter *adap) { -#ifdef FIRMWARE_LATEST const struct firmware *tpeeprom; -#else - struct firmware *tpeeprom; -#endif uint32_t version; unsigned int major, minor; @@ -1645,11 +1594,7 @@ release_tpeeprom: static int update_tpsram(struct adapter *adap) { -#ifdef FIRMWARE_LATEST const struct firmware *tpsram; -#else - struct firmware *tpsram; -#endif int ret; char rev, name[32]; @@ -1999,7 +1944,6 @@ cxgb_uninit_synchronized(struct port_inf return (0); } -#ifdef LRO_SUPPORTED /* * Mark lro enabled or disabled in all qsets for this port */ @@ -2017,7 +1961,6 @@ cxgb_set_lro(struct port_info *p, int en } return (0); } -#endif static int cxgb_ioctl(struct ifnet *ifp, unsigned long command, caddr_t data) @@ -2125,14 +2068,12 @@ fail: } else error = EINVAL; } -#ifdef LRO_SUPPORTED if (mask & IFCAP_LRO) { ifp->if_capenable ^= IFCAP_LRO; /* Safe to do this even if cxgb_up not called yet */ cxgb_set_lro(p, ifp->if_capenable & IFCAP_LRO); } -#endif if (mask & IFCAP_VLAN_HWTAGGING) { ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { Modified: head/sys/dev/cxgb/cxgb_offload.h ============================================================================== --- head/sys/dev/cxgb/cxgb_offload.h Wed Feb 24 07:53:29 2010 (r204273) +++ head/sys/dev/cxgb/cxgb_offload.h Wed Feb 24 10:16:18 2010 (r204274) @@ -33,8 +33,6 @@ $FreeBSD$ #ifndef _CXGB_OFFLOAD_H #define _CXGB_OFFLOAD_H -#include -#include #include #include Modified: head/sys/dev/cxgb/cxgb_osdep.h ============================================================================== --- head/sys/dev/cxgb/cxgb_osdep.h Wed Feb 24 07:53:29 2010 (r204273) +++ head/sys/dev/cxgb/cxgb_osdep.h Wed Feb 24 10:16:18 2010 (r204274) @@ -41,9 +41,6 @@ $FreeBSD$ #include -#define CONFIG_CHELSIO_T3_CORE -#include - #ifndef _CXGB_OSDEP_H_ #define _CXGB_OSDEP_H_ @@ -91,33 +88,6 @@ struct t3_mbuf_hdr { #define MT_DONTFREE 128 -#if __FreeBSD_version > 700030 -#define INTR_FILTERS -#define FIRMWARE_LATEST -#endif - -#if ((__FreeBSD_version > 602103) && (__FreeBSD_version < 700000)) -#define FIRMWARE_LATEST -#endif - -#if __FreeBSD_version > 700000 -#define MSI_SUPPORTED -#define TSO_SUPPORTED -#define VLAN_SUPPORTED -#define TASKQUEUE_CURRENT -#else -#define if_name(ifp) (ifp)->if_xname -#define M_SANITY(m, n) -#endif - -#if __FreeBSD_version >= 701000 -#include "opt_inet.h" -#ifdef INET -#define LRO_SUPPORTED -#define TOE_SUPPORTED -#endif -#endif - #if __FreeBSD_version < 800054 #if defined (__GNUC__) #if #cpu(i386) || defined __i386 || defined i386 || defined __i386__ || #cpu(x86_64) || defined __x86_64__ Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Wed Feb 24 07:53:29 2010 (r204273) +++ head/sys/dev/cxgb/cxgb_sge.c Wed Feb 24 10:16:18 2010 (r204274) @@ -1145,10 +1145,9 @@ calc_tx_descs(const struct mbuf *m, int return 1; flits = sgl_len(nsegs) + 2; -#ifdef TSO_SUPPORTED if (m->m_pkthdr.csum_flags & CSUM_TSO) flits++; -#endif + return flits_to_desc(flits); } @@ -1366,17 +1365,12 @@ write_wr_hdr_sgl(unsigned int ndesc, str /* sizeof(*eh) + sizeof(*vhdr) + sizeof(*ip) + sizeof(*tcp) */ #define TCPPKTHDRSIZE (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN + 20 + 20) -#ifdef VLAN_SUPPORTED #define GET_VTAG(cntrl, m) \ do { \ if ((m)->m_flags & M_VLANTAG) \ cntrl |= F_TXPKT_VLAN_VLD | V_TXPKT_VLAN((m)->m_pkthdr.ether_vtag); \ } while (0) -#else -#define GET_VTAG(cntrl, m) -#endif - static int t3_encap(struct sge_qset *qs, struct mbuf **m) { @@ -1413,11 +1407,10 @@ t3_encap(struct sge_qset *qs, struct mbu cntrl = V_TXPKT_INTF(pi->txpkt_intf); KASSERT(m0->m_flags & M_PKTHDR, ("not packet header\n")); -#ifdef VLAN_SUPPORTED if (m0->m_nextpkt == NULL && m0->m_next != NULL && m0->m_pkthdr.csum_flags & (CSUM_TSO)) tso_info = V_LSO_MSS(m0->m_pkthdr.tso_segsz); -#endif + if (m0->m_nextpkt != NULL) { busdma_map_sg_vec(txq->entry_tag, txsd->map, m0, segs, &nsegs); ndesc = 1; @@ -2076,9 +2069,7 @@ t3_free_qset(adapter_t *sc, struct sge_q MTX_DESTROY(&q->rspq.lock); } -#ifdef LRO_SUPPORTED tcp_lro_free(&q->lro.ctrl); -#endif bzero(q, sizeof(*q)); } @@ -2663,7 +2654,6 @@ t3_sge_alloc_qset(adapter_t *sc, u_int i q->fl[1].type = EXT_JUMBOP; #endif -#ifdef LRO_SUPPORTED /* Allocate and setup the lro_ctrl structure */ q->lro.enabled = !!(pi->ifp->if_capenable & IFCAP_LRO); ret = tcp_lro_init(&q->lro.ctrl); @@ -2672,7 +2662,6 @@ t3_sge_alloc_qset(adapter_t *sc, u_int i goto err; } q->lro.ctrl.ifp = pi->ifp; -#endif mtx_lock_spin(&sc->sge.reg_lock); ret = -t3_sge_init_rspcntxt(sc, q->rspq.cntxt_id, irq_vec_idx, @@ -2773,16 +2762,12 @@ t3_rx_eth(struct adapter *adap, struct s m->m_pkthdr.csum_flags = (CSUM_IP_CHECKED|CSUM_IP_VALID|CSUM_DATA_VALID|CSUM_PSEUDO_HDR); m->m_pkthdr.csum_data = 0xffff; } - /* - * XXX need to add VLAN support for 6.x - */ -#ifdef VLAN_SUPPORTED - if (__predict_false(cpl->vlan_valid)) { + + if (cpl->vlan_valid) { m->m_pkthdr.ether_vtag = ntohs(cpl->vlan); m->m_flags |= M_VLANTAG; } -#endif - + m->m_pkthdr.rcvif = ifp; m->m_pkthdr.header = mtod(m, uint8_t *) + sizeof(*cpl) + ethpad; /* @@ -2962,11 +2947,9 @@ process_responses(adapter_t *adap, struc struct rsp_desc *r = &rspq->desc[rspq->cidx]; int budget_left = budget; unsigned int sleeping = 0; -#ifdef LRO_SUPPORTED int lro_enabled = qs->lro.enabled; int skip_lro; struct lro_ctrl *lro_ctrl = &qs->lro.ctrl; -#endif struct mbuf *offload_mbufs[RX_BUNDLE_SIZE]; int ngathered = 0; #ifdef DEBUG @@ -3075,7 +3058,6 @@ process_responses(adapter_t *adap, struc t3_rx_eth(adap, rspq, m, ethpad); -#ifdef LRO_SUPPORTED /* * The T304 sends incoming packets on any qset. If LRO * is also enabled, we could end up sending packet up @@ -3089,9 +3071,7 @@ process_responses(adapter_t *adap, struc if (lro_enabled && lro_ctrl->lro_cnt && !skip_lro && (tcp_lro_rx(lro_ctrl, m, 0) == 0)) { /* successfully queue'd for LRO */ - } else -#endif - { + } else { /* * LRO not enabled, packet unsuitable for LRO, * or unable to queue. Pass it up right now in @@ -3110,14 +3090,12 @@ process_responses(adapter_t *adap, struc deliver_partial_bundle(&adap->tdev, rspq, offload_mbufs, ngathered); -#ifdef LRO_SUPPORTED /* Flush LRO */ while (!SLIST_EMPTY(&lro_ctrl->lro_active)) { struct lro_entry *queued = SLIST_FIRST(&lro_ctrl->lro_active); SLIST_REMOVE_HEAD(&lro_ctrl->lro_active, next); tcp_lro_flush(lro_ctrl, queued); } -#endif if (sleeping) check_ring_db(adap, qs, sleeping); @@ -3690,7 +3668,6 @@ t3_add_configured_sysctls(adapter_t *sc) CTLTYPE_STRING | CTLFLAG_RD, &qs->txq[TXQ_CTRL], 0, t3_dump_txq_ctrl, "A", "dump of the transmit queue"); -#ifdef LRO_SUPPORTED SYSCTL_ADD_INT(ctx, lropoidlist, OID_AUTO, "lro_queued", CTLFLAG_RD, &qs->lro.ctrl.lro_queued, 0, NULL); SYSCTL_ADD_INT(ctx, lropoidlist, OID_AUTO, "lro_flushed", @@ -3699,7 +3676,6 @@ t3_add_configured_sysctls(adapter_t *sc) CTLFLAG_RD, &qs->lro.ctrl.lro_bad_csum, 0, NULL); SYSCTL_ADD_INT(ctx, lropoidlist, OID_AUTO, "lro_cnt", CTLFLAG_RD, &qs->lro.ctrl.lro_cnt, 0, NULL); -#endif } /* Now add a node for mac stats. */ Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c ============================================================================== --- head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c Wed Feb 24 07:53:29 2010 (r204273) +++ head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c Wed Feb 24 10:16:18 2010 (r204274) @@ -138,8 +138,7 @@ open_rnic_dev(struct t3cdev *tdev) CTR2(KTR_IW_CXGB, "%s t3cdev %p", __FUNCTION__, tdev); if (!vers_printed++) - printf("Chelsio T3 RDMA Driver - version %s\n", - DRV_VERSION); + printf("Chelsio T3 RDMA Driver - version x.xx\n"); rnicp = (struct iwch_dev *)ib_alloc_device(sizeof(*rnicp)); if (!rnicp) { printf("Cannot allocate ib device\n"); Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_socket.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_cpl_socket.c Wed Feb 24 07:53:29 2010 (r204273) +++ head/sys/dev/cxgb/ulp/tom/cxgb_cpl_socket.c Wed Feb 24 10:16:18 2010 (r204274) @@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/modules/cxgb/cxgb/Makefile ============================================================================== --- head/sys/modules/cxgb/cxgb/Makefile Wed Feb 24 07:53:29 2010 (r204273) +++ head/sys/modules/cxgb/cxgb/Makefile Wed Feb 24 10:16:18 2010 (r204274) @@ -12,13 +12,5 @@ SRCS+= opt_inet.h opt_zero.h opt_sched.h SRCS+= uipc_mvec.c CFLAGS+= -g -DDEFAULT_JUMBO -I${CXGB} -CFLAGS+= -DDISABLE_MBUF_IOVEC -#CFLAGS+= -DIFNET_MULTIQUEUE -#CFLAGS+= -DDISABLE_MBUF_IOVEC -#CFLAGS+= -DDEBUG -DDEBUG_PRINT -#CFLAGS+= -DINVARIANT_SUPPORT -DINVARIANTS -#CFLAGS+= -DWITNESS -#CFLAGS += -DLOCK_PROFILING -#CFLAGS+= -DWITNESS .include From owner-svn-src-head@FreeBSD.ORG Wed Feb 24 13:13:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE5FE1065672; Wed, 24 Feb 2010 13:13:29 +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 ADB988FC1B; Wed, 24 Feb 2010 13:13:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1ODDTNL096195; Wed, 24 Feb 2010 13:13:29 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1ODDTk0096193; Wed, 24 Feb 2010 13:13:29 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201002241313.o1ODDTk0096193@svn.freebsd.org> From: John Baldwin Date: Wed, 24 Feb 2010 13:13: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: r204275 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2010 13:13:29 -0000 Author: jhb Date: Wed Feb 24 13:13:29 2010 New Revision: 204275 URL: http://svn.freebsd.org/changeset/base/204275 Log: Fix spelling of EACCES. PR: docs/144112 Submitted by: Alexander Best MFC after: 3 days Modified: head/share/man/man9/namei.9 Modified: head/share/man/man9/namei.9 ============================================================================== --- head/share/man/man9/namei.9 Wed Feb 24 10:16:18 2010 (r204274) +++ head/share/man/man9/namei.9 Wed Feb 24 13:13:29 2010 (r204275) @@ -333,7 +333,7 @@ or an entire pathname exceeded 1023 char .It Bq Er ENOENT A component of the specified pathname does not exist, or the pathname is an empty string. -.It Bq Er ACCES +.It Bq Er EACCES An attempt is made to access a file in a way forbidden by its file access permissions. .It Bq Er ELOOP From owner-svn-src-head@FreeBSD.ORG Wed Feb 24 14:19:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C9C31065674; Wed, 24 Feb 2010 14:19:56 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C1978FC17; Wed, 24 Feb 2010 14:19:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1OEJuW0010877; Wed, 24 Feb 2010 14:19:56 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1OEJug1010875; Wed, 24 Feb 2010 14:19:56 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201002241419.o1OEJug1010875@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 24 Feb 2010 14:19: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: r204276 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2010 14:19:56 -0000 Author: jh Date: Wed Feb 24 14:19:56 2010 New Revision: 204276 URL: http://svn.freebsd.org/changeset/base/204276 Log: Fix expansion of \W in prompt strings when the working directory is "/". The prompt string was truncated after \W when the working directory was "/". PR: bin/89410 Submitted by: Dr Balwinder Singh Dheeman MFC after: 1 week Modified: head/bin/sh/parser.c Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Wed Feb 24 13:13:29 2010 (r204275) +++ head/bin/sh/parser.c Wed Feb 24 14:19:56 2010 (r204276) @@ -1641,7 +1641,7 @@ getprompt(void *unused __unused) case 'w': ps[i] = '\0'; getcwd(&ps[i], PROMPTLEN - i); - if (*fmt == 'W') { + if (*fmt == 'W' && ps[i + 1] != '\0') { /* Final path component only. */ trim = 1; for (j = i; ps[j] != '\0'; j++) From owner-svn-src-head@FreeBSD.ORG Wed Feb 24 15:52:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A0BB106564A; Wed, 24 Feb 2010 15:52:18 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59B528FC19; Wed, 24 Feb 2010 15:52:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1OFqIg4031294; Wed, 24 Feb 2010 15:52:18 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1OFqI0l031292; Wed, 24 Feb 2010 15:52:18 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201002241552.o1OFqI0l031292@svn.freebsd.org> From: Brooks Davis Date: Wed, 24 Feb 2010 15:52: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: r204278 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2010 15:52:18 -0000 Author: brooks Date: Wed Feb 24 15:52:18 2010 New Revision: 204278 URL: http://svn.freebsd.org/changeset/base/204278 Log: Don't inforce an upper bound on kern.ngroups. The INT_MAX-1 limit was too high due to several overflows. The actual limit is somewhere in the neighborhood of INT_MAX/4 on 64-bit machines, but most systems could not support such a limit due to a lack of memory and the cost of duplicate credentials. Reported by: bde Modified: head/sys/kern/subr_param.c Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Wed Feb 24 15:27:31 2010 (r204277) +++ head/sys/kern/subr_param.c Wed Feb 24 15:52:18 2010 (r204278) @@ -240,8 +240,6 @@ init_param1(void) TUNABLE_INT_FETCH("kern.ngroups", &ngroups_max); if (ngroups_max < NGROUPS_MAX) ngroups_max = NGROUPS_MAX; - if (ngroups_max > INT_MAX - 1) - ngroups_max = INT_MAX - 1; } /* From owner-svn-src-head@FreeBSD.ORG Wed Feb 24 15:54:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FEAC106566C; Wed, 24 Feb 2010 15:54:25 +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 2FE0B8FC1B; Wed, 24 Feb 2010 15:54:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1OFsP00031829; Wed, 24 Feb 2010 15:54:25 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1OFsPDd031827; Wed, 24 Feb 2010 15:54:25 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201002241554.o1OFsPDd031827@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 24 Feb 2010 15:54: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: r204279 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2010 15:54:25 -0000 Author: bz Date: Wed Feb 24 15:54:24 2010 New Revision: 204279 URL: http://svn.freebsd.org/changeset/base/204279 Log: Use the DB_SHOW_ALL_COMMAND() macro to register the formerly 'show ifnets' in the db_show_all_table as 'show all ifnets' and with that follow the convention for showing complete lists. Submitted by: thompsa MFC after: 3 days Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Wed Feb 24 15:52:18 2010 (r204278) +++ head/sys/net/if.c Wed Feb 24 15:54:24 2010 (r204279) @@ -3389,7 +3389,7 @@ DB_SHOW_COMMAND(ifnet, db_show_ifnet) if_show_ifnet((struct ifnet *)addr); } -DB_SHOW_COMMAND(ifnets, db_show_ifnets) +DB_SHOW_ALL_COMMAND(ifnets, db_show_all_ifnets) { VNET_ITERATOR_DECL(vnet_iter); struct ifnet *ifp; From owner-svn-src-head@FreeBSD.ORG Wed Feb 24 19:28:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4707106566B; Wed, 24 Feb 2010 19:28:15 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 982B08FC0C; Wed, 24 Feb 2010 19:28:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1OJSFPH082812; Wed, 24 Feb 2010 19:28:15 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1OJSF4v082811; Wed, 24 Feb 2010 19:28:15 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201002241928.o1OJSF4v082811@svn.freebsd.org> From: Bruce Cran Date: Wed, 24 Feb 2010 19:28: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: r204280 - head/sys/arm/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2010 19:28:15 -0000 Author: brucec Date: Wed Feb 24 19:28:15 2010 New Revision: 204280 URL: http://svn.freebsd.org/changeset/base/204280 Log: Update the commented out option for omitting the sysctl descriptions; it was committed as NO_SYSCTL_DESCR. Approved by: rrs (mentor) Modified: head/sys/arm/conf/BWCT head/sys/arm/conf/HL200 head/sys/arm/conf/KB920X Modified: head/sys/arm/conf/BWCT ============================================================================== --- head/sys/arm/conf/BWCT Wed Feb 24 15:54:24 2010 (r204279) +++ head/sys/arm/conf/BWCT Wed Feb 24 19:28:15 2010 (r204280) @@ -63,7 +63,7 @@ options SYSVSHM #SYSV-style shared me options SYSVMSG #SYSV-style message queues options SYSVSEM #SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -#options SYSCTL_OMIT_DESCR +#options NO_SYSCTL_DESCR options MUTEX_NOINLINE options RWLOCK_NOINLINE options NO_FFS_SNAPSHOT Modified: head/sys/arm/conf/HL200 ============================================================================== --- head/sys/arm/conf/HL200 Wed Feb 24 15:54:24 2010 (r204279) +++ head/sys/arm/conf/HL200 Wed Feb 24 19:28:15 2010 (r204280) @@ -59,7 +59,7 @@ options SYSVSHM #SYSV-style shared me options SYSVMSG #SYSV-style message queues options SYSVSEM #SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -#options SYSCTL_OMIT_DESCR +#options NO_SYSCTL_DESCR options MUTEX_NOINLINE options RWLOCK_NOINLINE options NO_FFS_SNAPSHOT Modified: head/sys/arm/conf/KB920X ============================================================================== --- head/sys/arm/conf/KB920X Wed Feb 24 15:54:24 2010 (r204279) +++ head/sys/arm/conf/KB920X Wed Feb 24 19:28:15 2010 (r204280) @@ -57,7 +57,7 @@ options SYSVSHM #SYSV-style shared me options SYSVMSG #SYSV-style message queues options SYSVSEM #SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -#options SYSCTL_OMIT_DESCR +#options NO_SYSCTL_DESCR # Disable the inlining of mutex, rwlock and sx locks. These eat up a lot # of space. options MUTEX_NOINLINE From owner-svn-src-head@FreeBSD.ORG Wed Feb 24 20:13:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1C7B1065670; Wed, 24 Feb 2010 20:13: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 8FACA8FC0A; Wed, 24 Feb 2010 20:13:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1OKDYWU092816; Wed, 24 Feb 2010 20:13:34 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1OKDYa7092812; Wed, 24 Feb 2010 20:13:34 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201002242013.o1OKDYa7092812@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 24 Feb 2010 20: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: r204281 - head/sys/dev/syscons X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2010 20:13:34 -0000 Author: jkim Date: Wed Feb 24 20:13:34 2010 New Revision: 204281 URL: http://svn.freebsd.org/changeset/base/204281 Log: Improve VESA mode switching via loader tunable `hint.sc.0.vesa_mode'. The most notable change is history buffer is fully saved/restored now. Modified: head/sys/dev/syscons/scvidctl.c head/sys/dev/syscons/syscons.c head/sys/dev/syscons/syscons.h Modified: head/sys/dev/syscons/scvidctl.c ============================================================================== --- head/sys/dev/syscons/scvidctl.c Wed Feb 24 19:28:15 2010 (r204280) +++ head/sys/dev/syscons/scvidctl.c Wed Feb 24 20:13:34 2010 (r204281) @@ -369,34 +369,7 @@ sc_set_pixel_mode(scr_stat *scp, struct if ((info.vi_width < xsize*8) || (info.vi_height < ysize*fontsize)) return EINVAL; - /* - * We currently support the following graphic modes: - * - * - 4 bpp planar modes whose memory size does not exceed 64K - * - 15, 16, 24 and 32 bpp linear modes - */ - - if (info.vi_mem_model == V_INFO_MM_PLANAR) { - if (info.vi_planes != 4) - return ENODEV; - - /* - * A memory size >64K requires bank switching to access the entire - * screen. XXX - */ - - if (info.vi_width * info.vi_height / 8 > info.vi_window_size) - return ENODEV; - } else if (info.vi_mem_model == V_INFO_MM_DIRECT) { - if (!(info.vi_flags & V_INFO_LINEAR) && - (info.vi_depth != 15) && (info.vi_depth != 16) && - (info.vi_depth != 24) && (info.vi_depth != 32)) - return ENODEV; - } else if (info.vi_mem_model == V_INFO_MM_PACKED) { - if (!(info.vi_flags & V_INFO_LINEAR) && - (info.vi_depth != 8)) - return ENODEV; - } else + if (!sc_support_pixel_mode(&info)) return ENODEV; /* stop screen saver, etc */ @@ -472,6 +445,48 @@ sc_set_pixel_mode(scr_stat *scp, struct #endif /* SC_PIXEL_MODE */ } +int +sc_support_pixel_mode(void *arg) +{ +#ifdef SC_PIXEL_MODE + video_info_t *info = arg; + + if ((info->vi_flags & V_INFO_GRAPHICS) == 0) + return (0); + + /* + * We currently support the following graphic modes: + * + * - 4 bpp planar modes whose memory size does not exceed 64K + * - 15, 16, 24 and 32 bpp linear modes + */ + switch (info->vi_mem_model) { + case V_INFO_MM_PLANAR: + if (info->vi_planes != 4) + break; + /* + * A memory size >64K requires bank switching to access + * the entire screen. XXX + */ + if (info->vi_width * info->vi_height / 8 > info->vi_window_size) + break; + return (1); + case V_INFO_MM_DIRECT: + if ((info->vi_flags & V_INFO_LINEAR) == 0 && + info->vi_depth != 15 && info->vi_depth != 16 && + info->vi_depth != 24 && info->vi_depth != 32) + break; + return (1); + case V_INFO_MM_PACKED: + if ((info->vi_flags & V_INFO_LINEAR) == 0 && + info->vi_depth != 8) + break; + return (1); + } +#endif + return (0); +} + #define fb_ioctl(a, c, d) \ (((a) == NULL) ? ENODEV : \ vidd_ioctl((a), (c), (caddr_t)(d))) Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Wed Feb 24 19:28:15 2010 (r204280) +++ head/sys/dev/syscons/syscons.c Wed Feb 24 20:13:34 2010 (r204281) @@ -344,35 +344,94 @@ sc_alloc_tty(int index, int devnum) } #ifdef SC_PIXEL_MODE -static int -sc_initial_mode(video_adapter_t *adp, int unit) +static void +sc_set_vesa_mode(scr_stat *scp, sc_softc_t *sc, int unit) { video_info_t info; - int depth, vmode; + int depth; int i; + int vmode; vmode = 0; (void)resource_int_value("sc", unit, "vesa_mode", &vmode); - if (vmode < M_VESA_BASE || vmode > M_VESA_MODE_MAX) - vmode = 0; + if (vmode < M_VESA_BASE || vmode > M_VESA_MODE_MAX || + vidd_get_info(sc->adp, vmode, &info) != 0 || + !sc_support_pixel_mode(&info)) + vmode = 0; /* - * If the default mode is not supported, search for an available + * If the mode is unset or unsupported, search for an available * 800x600 graphics mode with the highest color depth. */ - if (vmode == 0 || vidd_get_info(adp, vmode, &info) != 0) { - depth = vmode = 0; - for (i = M_VESA_BASE; i <= M_VESA_MODE_MAX; i++) - if (vidd_get_info(adp, i, &info) == 0 && - (info.vi_flags & V_INFO_GRAPHICS) != 0 && - info.vi_width == 800 && info.vi_height == 600 && - info.vi_depth > depth) { - vmode = i; - depth = info.vi_depth; - } + if (vmode == 0) { + for (depth = 0, i = M_VESA_BASE; i <= M_VESA_MODE_MAX; i++) + if (vidd_get_info(sc->adp, i, &info) == 0 && + info.vi_width == 800 && info.vi_height == 600 && + sc_support_pixel_mode(&info) && + info.vi_depth > depth) { + vmode = i; + depth = info.vi_depth; + } + if (vmode == 0) + return; + vidd_get_info(sc->adp, vmode, &info); } - return (vmode); +#ifndef SC_NO_FONT_LOADING + if ((sc->fonts_loaded & FONT_16) == 0) + return; +#endif +#ifdef DEV_SPLASH + if ((sc->flags & SC_SPLASH_SCRN) != 0) + splash_term(sc->adp); +#endif +#ifndef SC_NO_HISTORY + if (scp->history != NULL) { + sc_vtb_append(&scp->vtb, 0, scp->history, + scp->ypos * scp->xsize + scp->xpos); + scp->history_pos = sc_vtb_tail(scp->history); + } +#endif + vidd_set_mode(sc->adp, vmode); + scp->status |= (UNKNOWN_MODE | PIXEL_MODE | MOUSE_HIDDEN); + scp->status &= ~(GRAPHICS_MODE | MOUSE_VISIBLE); + scp->xpixel = info.vi_width; + scp->ypixel = info.vi_height; + scp->xsize = scp->xpixel / 8; + scp->ysize = scp->ypixel / 16; + scp->xpos = 0; + scp->ypos = scp->ysize - 1; + scp->xoff = scp->yoff = 0; +#ifndef SC_NO_FONT_LOADING + scp->font = sc->font_16; +#else + scp->font = NULL; +#endif + scp->font_size = 16; + scp->font_width = 8; + scp->start = scp->xsize * scp->ysize - 1; + scp->end = 0; + scp->cursor_pos = scp->cursor_oldpos = scp->xsize * scp->xsize; + scp->mode = sc->initial_mode = vmode; +#ifndef __sparc64__ + sc_vtb_init(&scp->scr, VTB_FRAMEBUFFER, scp->xsize, scp->ysize, + (void *)sc->adp->va_window, FALSE); +#endif + sc_alloc_scr_buffer(scp, FALSE, FALSE); + sc_init_emulator(scp, NULL); +#ifndef SC_NO_CUTPASTE + sc_alloc_cut_buffer(scp, FALSE); +#endif +#ifndef SC_NO_HISTORY + sc_alloc_history_buffer(scp, 0, 0, FALSE); +#endif + sc_set_border(scp, scp->border); + sc_set_cursor_image(scp); + scp->status &= ~UNKNOWN_MODE; +#ifdef DEV_SPLASH + if ((sc->flags & SC_SPLASH_SCRN) != 0) + splash_init(sc->adp, scsplash_callback, sc); +#endif } #endif @@ -381,8 +440,8 @@ sc_attach_unit(int unit, int flags) { sc_softc_t *sc; scr_stat *scp; - int vc; struct cdev *dev; + int vc; flags &= ~SC_KERNEL_CONSOLE; @@ -404,24 +463,8 @@ sc_attach_unit(int unit, int flags) sc_console = scp; #ifdef SC_PIXEL_MODE - if ((sc->config & SC_VESAMODE) != 0) { - int vmode; - vmode = sc_initial_mode(sc->adp, unit); - if (vmode >= M_VESA_BASE) { -#ifdef DEV_SPLASH - if (sc->flags & SC_SPLASH_SCRN) - splash_term(sc->adp); -#endif - sc_set_graphics_mode(scp, NULL, vmode); - sc_set_pixel_mode(scp, NULL, 0, 0, 16, 8); - sc->initial_mode = vmode; -#ifdef DEV_SPLASH - /* put up the splash again! */ - if (sc->flags & SC_SPLASH_SCRN) - splash_init(sc->adp, scsplash_callback, sc); -#endif - } - } + if ((sc->config & SC_VESAMODE) != 0) + sc_set_vesa_mode(scp, sc, unit); #endif /* SC_PIXEL_MODE */ /* initialize cursor */ Modified: head/sys/dev/syscons/syscons.h ============================================================================== --- head/sys/dev/syscons/syscons.h Wed Feb 24 19:28:15 2010 (r204280) +++ head/sys/dev/syscons/syscons.h Wed Feb 24 20:13:34 2010 (r204281) @@ -623,6 +623,7 @@ int sc_set_text_mode(scr_stat *scp, str int sc_set_graphics_mode(scr_stat *scp, struct tty *tp, int mode); int sc_set_pixel_mode(scr_stat *scp, struct tty *tp, int xsize, int ysize, int fontsize, int font_width); +int sc_support_pixel_mode(void *arg); int sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td); From owner-svn-src-head@FreeBSD.ORG Wed Feb 24 20:31:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C797106564A; Wed, 24 Feb 2010 20:31:01 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B6258FC18; Wed, 24 Feb 2010 20:31:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1OKV1fx096735; Wed, 24 Feb 2010 20:31:01 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1OKV1fX096732; Wed, 24 Feb 2010 20:31:01 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201002242031.o1OKV1fX096732@svn.freebsd.org> From: Rafal Jaworowski Date: Wed, 24 Feb 2010 20:31: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: r204283 - head/sys/arm/mv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2010 20:31:01 -0000 Author: raj Date: Wed Feb 24 20:31:00 2010 New Revision: 204283 URL: http://svn.freebsd.org/changeset/base/204283 Log: Do not force verbose and single mode in non-metadata boot case. We want to go multi-user by default also in case of booting without loader(8). Modified: head/sys/arm/mv/mv_machdep.c Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Wed Feb 24 20:20:02 2010 (r204282) +++ head/sys/arm/mv/mv_machdep.c Wed Feb 24 20:31:00 2010 (r204283) @@ -406,8 +406,7 @@ initarm(void *mdp, void *unused __unused } availmem_regions_sz = i; } else { - /* Fall back to hardcoded boothowto flags and metadata. */ - boothowto = RB_VERBOSE | RB_SINGLE; + /* Fall back to hardcoded metadata. */ lastaddr = fake_preload_metadata(); /* From owner-svn-src-head@FreeBSD.ORG Wed Feb 24 23:00:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD17D106564A; Wed, 24 Feb 2010 23:00:16 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBA198FC12; Wed, 24 Feb 2010 23:00:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1ON0G7P030437; Wed, 24 Feb 2010 23:00:16 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1ON0GVW030434; Wed, 24 Feb 2010 23:00:16 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201002242300.o1ON0GVW030434@svn.freebsd.org> From: Bruce Cran Date: Wed, 24 Feb 2010 23:00: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: r204294 - head/tools/regression/sockets/sendfile X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2010 23:00:17 -0000 Author: brucec Date: Wed Feb 24 23:00:16 2010 New Revision: 204294 URL: http://svn.freebsd.org/changeset/base/204294 Log: Update the sendfile regression test so that it outputs results in the TAP format. Add a checksum to verify that the data hasn't been corrupted between being read from disk and being received. Approved by: rrs (mentor) Modified: head/tools/regression/sockets/sendfile/Makefile head/tools/regression/sockets/sendfile/sendfile.c Modified: head/tools/regression/sockets/sendfile/Makefile ============================================================================== --- head/tools/regression/sockets/sendfile/Makefile Wed Feb 24 22:16:16 2010 (r204293) +++ head/tools/regression/sockets/sendfile/Makefile Wed Feb 24 23:00:16 2010 (r204294) @@ -5,5 +5,6 @@ PROG= sendfile NO_MAN= WARNS?= 6 +LDADD = -lmd .include Modified: head/tools/regression/sockets/sendfile/sendfile.c ============================================================================== --- head/tools/regression/sockets/sendfile/sendfile.c Wed Feb 24 22:16:16 2010 (r204293) +++ head/tools/regression/sockets/sendfile/sendfile.c Wed Feb 24 23:00:16 2010 (r204294) @@ -29,11 +29,14 @@ #include #include #include +#include #include #include +#include #include +#include #include #include #include @@ -47,113 +50,192 @@ * of cases and performing limited validation. */ +#define FAIL(msg) {printf("# %s\n", msg); \ + return (-1);} + +#define FAIL_ERR(msg) {printf("# %s: %s\n", msg, strerror(errno)); \ + return (-1);} + #define TEST_PORT 5678 #define TEST_MAGIC 0x4440f7bb #define TEST_PAGES 4 #define TEST_SECONDS 30 struct test_header { - u_int32_t th_magic; - u_int32_t th_header_length; - u_int32_t th_offset; - u_int32_t th_length; + uint32_t th_magic; + uint32_t th_header_length; + uint32_t th_offset; + uint32_t th_length; + char th_md5[33]; +}; + +struct sendfile_test { + uint32_t hdr_length; + uint32_t offset; + uint32_t length; }; -pid_t child_pid, parent_pid; -int listen_socket; int file_fd; +char path[PATH_MAX]; +int listen_socket; +int accept_socket; + +static int test_th(struct test_header *th, uint32_t *header_length, + uint32_t *offset, uint32_t *length); +static void signal_alarm(int signum); +static void setup_alarm(int seconds); +static void cancel_alarm(void); +static int receive_test(void); +static void run_child(void); +static int new_test_socket(int *connect_socket); +static void init_th(struct test_header *th, uint32_t header_length, + uint32_t offset, uint32_t length); +static int send_test(int connect_socket, struct sendfile_test); +static void run_parent(void); +static void cleanup(void); + static int -test_th(struct test_header *th, u_int32_t *header_length, u_int32_t *offset, - u_int32_t *length) +test_th(struct test_header *th, uint32_t *header_length, uint32_t *offset, + uint32_t *length) { if (th->th_magic != htonl(TEST_MAGIC)) - return (0); + FAIL("magic number not found in header") *header_length = ntohl(th->th_header_length); *offset = ntohl(th->th_offset); *length = ntohl(th->th_length); - return (1); + return (0); } static void signal_alarm(int signum) { - (void)signum; + + printf("# test timeout\n"); + + if (accept_socket > 0) + close(accept_socket); + if (listen_socket > 0) + close(listen_socket); + + _exit(-1); } static void setup_alarm(int seconds) { + struct itimerval itv; + bzero(&itv, sizeof(itv)); + (void)seconds; + itv.it_value.tv_sec = seconds; signal(SIGALRM, signal_alarm); - alarm(seconds); + setitimer(ITIMER_REAL, &itv, NULL); } static void cancel_alarm(void) { - - alarm(0); - signal(SIGALRM, SIG_DFL); + struct itimerval itv; + bzero(&itv, sizeof(itv)); + setitimer(ITIMER_REAL, &itv, NULL); } -static void -receive_test(int accept_socket) +static int +receive_test(void) { - u_int32_t header_length, offset, length, counter; + uint32_t header_length, offset, length, counter; struct test_header th; ssize_t len; - char ch; + char buf[10240]; + MD5_CTX md5ctx; + char *rxmd5; len = read(accept_socket, &th, sizeof(th)); - if (len < 0) - err(1, "read"); - if ((size_t)len < sizeof(th)) - errx(1, "read: %zd", len); + if (len < 0 || (size_t)len < sizeof(th)) + FAIL_ERR("read") - if (test_th(&th, &header_length, &offset, &length) == 0) - errx(1, "test_th: bad"); + if (test_th(&th, &header_length, &offset, &length) != 0) + return (-1); + + MD5Init(&md5ctx); counter = 0; while (1) { - len = read(accept_socket, &ch, sizeof(ch)); - if (len < 0) - err(1, "read"); - if (len == 0) + len = read(accept_socket, buf, sizeof(buf)); + if (len < 0 || len == 0) break; - counter++; - /* XXXRW: Validate byte here. */ + counter += len; + MD5Update(&md5ctx, buf, len); } - if (counter != header_length + length) - errx(1, "receive_test: expected (%d, %d) received %d", - header_length, length, counter); + + rxmd5 = MD5End(&md5ctx, NULL); + + if ((counter != header_length+length) || + memcmp(th.th_md5, rxmd5, 33) != 0) + FAIL("receive length mismatch") + + free(rxmd5); + return (0); } static void run_child(void) { - int accept_socket; + struct sockaddr_in sin; + int rc = 0; - while (1) { + listen_socket = socket(PF_INET, SOCK_STREAM, 0); + if (listen_socket < 0) { + printf("# socket: %s\n", strerror(errno)); + rc = -1; + } + + if (!rc) { + bzero(&sin, sizeof(sin)); + sin.sin_len = sizeof(sin); + sin.sin_family = AF_INET; + sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + sin.sin_port = htons(TEST_PORT); + + if (bind(listen_socket, (struct sockaddr *)&sin, sizeof(sin)) < 0) { + printf("# bind: %s\n", strerror(errno)); + rc = -1; + } + } + + if (!rc && listen(listen_socket, -1) < 0) { + printf("# listen: %s\n", strerror(errno)); + rc = -1; + } + + if (!rc) { accept_socket = accept(listen_socket, NULL, NULL); setup_alarm(TEST_SECONDS); - receive_test(accept_socket); - cancel_alarm(); - close(accept_socket); + if (receive_test() != 0) + rc = -1; } + + cancel_alarm(); + if (accept_socket > 0) + close(accept_socket); + if (listen_socket > 0) + close(listen_socket); + + _exit(rc); } static int -new_test_socket(void) +new_test_socket(int *connect_socket) { struct sockaddr_in sin; - int connect_socket; + int rc = 0; - connect_socket = socket(PF_INET, SOCK_STREAM, 0); - if (connect_socket < 0) - err(1, "socket"); + *connect_socket = socket(PF_INET, SOCK_STREAM, 0); + if (*connect_socket < 0) + FAIL_ERR("socket") bzero(&sin, sizeof(sin)); sin.sin_len = sizeof(sin); @@ -161,57 +243,65 @@ new_test_socket(void) sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); sin.sin_port = htons(TEST_PORT); - if (connect(connect_socket, (struct sockaddr *)&sin, sizeof(sin)) < 0) - err(1, "connect"); + if (connect(*connect_socket, (struct sockaddr *)&sin, sizeof(sin)) < 0) + FAIL_ERR("connect") - return (connect_socket); + return (rc); } static void -init_th(struct test_header *th, u_int32_t header_length, u_int32_t offset, - u_int32_t length) +init_th(struct test_header *th, uint32_t header_length, uint32_t offset, + uint32_t length) { - bzero(th, sizeof(*th)); th->th_magic = htonl(TEST_MAGIC); th->th_header_length = htonl(header_length); th->th_offset = htonl(offset); th->th_length = htonl(length); + + MD5FileChunk(path, th->th_md5, offset, length); } -static void -send_test(int connect_socket, u_int32_t header_length, u_int32_t offset, - u_int32_t length) +static int +send_test(int connect_socket, struct sendfile_test test) { struct test_header th; struct sf_hdtr hdtr, *hdtrp; struct iovec headers; char *header; ssize_t len; + int length; off_t off; len = lseek(file_fd, 0, SEEK_SET); - if (len < 0) - err(1, "lseek"); if (len != 0) - errx(1, "lseek: %zd", len); + FAIL_ERR("lseek") - init_th(&th, header_length, offset, length); + if (test.length == 0) { + struct stat st; + if (fstat(file_fd, &st) < 0) + FAIL_ERR("fstat") + length = st.st_size - test.offset; + } + else { + length = test.length; + } + + init_th(&th, test.hdr_length, test.offset, length); len = write(connect_socket, &th, sizeof(th)); - if (len < 0) - err(1, "send"); if (len != sizeof(th)) - err(1, "send: %zd", len); + return (-1); - if (header_length != 0) { - header = malloc(header_length); + if (test.hdr_length != 0) { + header = malloc(test.hdr_length); if (header == NULL) - err(1, "malloc"); + FAIL_ERR("malloc") + hdtrp = &hdtr; bzero(&headers, sizeof(headers)); headers.iov_base = header; - headers.iov_len = header_length; + headers.iov_len = test.hdr_length; bzero(&hdtr, sizeof(hdtr)); hdtr.headers = &headers; hdtr.hdr_cnt = 1; @@ -222,148 +312,130 @@ send_test(int connect_socket, u_int32_t header = NULL; } - if (sendfile(file_fd, connect_socket, offset, length, hdtrp, &off, - 0) < 0) - err(1, "sendfile"); + if (sendfile(file_fd, connect_socket, test.offset, test.length, + hdtrp, &off, 0) < 0) { + if (header != NULL) + free(header); + FAIL_ERR("sendfile") + } if (length == 0) { struct stat sb; - if (fstat(file_fd, &sb) < 0) - err(1, "fstat"); - length = sb.st_size - offset; - } - - if (off != length) { - errx(1, "sendfile: off(%ju) != length(%ju)", - (uintmax_t)off, (uintmax_t)length); + if (fstat(file_fd, &sb) == 0) + length = sb.st_size - test.offset; } if (header != NULL) free(header); + + if (off != length) + FAIL("offset != length") + + return (0); } static void run_parent(void) { int connect_socket; + int status; + int test_num; + int pid; + + const int pagesize = getpagesize(); + + struct sendfile_test tests[10] = { + { .hdr_length = 0, .offset = 0, .length = 1 }, + { .hdr_length = 0, .offset = 0, .length = pagesize }, + { .hdr_length = 0, .offset = 1, .length = 1 }, + { .hdr_length = 0, .offset = 1, .length = pagesize }, + { .hdr_length = 0, .offset = pagesize, .length = pagesize }, + { .hdr_length = 0, .offset = 0, .length = 2*pagesize }, + { .hdr_length = 0, .offset = 0, .length = 0 }, + { .hdr_length = 0, .offset = pagesize, .length = 0 }, + { .hdr_length = 0, .offset = 2*pagesize, .length = 0 }, + { .hdr_length = 0, .offset = TEST_PAGES*pagesize, .length = 0 } + }; + + printf("1..10\n"); + + for (test_num = 1; test_num <= 10; test_num++) { + + pid = fork(); + if (pid == -1) { + printf("not ok %d\n", test_num); + continue; + } + + if (pid == 0) + run_child(); + + usleep(250000); + + if (new_test_socket(&connect_socket) != 0) { + printf("not ok %d\n", test_num); + kill(pid, SIGALRM); + close(connect_socket); + continue; + } + + if (send_test(connect_socket, tests[test_num-1]) != 0) { + printf("not ok %d\n", test_num); + kill(pid, SIGALRM); + close(connect_socket); + continue; + } + + close(connect_socket); + if (waitpid(pid, &status, 0) == pid) { + if (WIFEXITED(status) && WEXITSTATUS(status) == 0) + printf("%s %d\n", "ok", test_num); + else + printf("%s %d\n", "not ok", test_num); + } + else { + printf("not ok %d\n", test_num); + } + } +} - connect_socket = new_test_socket(); - send_test(connect_socket, 0, 0, 1); - close(connect_socket); - - sleep(1); - - connect_socket = new_test_socket(); - send_test(connect_socket, 0, 0, getpagesize()); - close(connect_socket); - - sleep(1); - - connect_socket = new_test_socket(); - send_test(connect_socket, 0, 1, 1); - close(connect_socket); - - sleep(1); - - connect_socket = new_test_socket(); - send_test(connect_socket, 0, 1, getpagesize()); - close(connect_socket); - - sleep(1); - - connect_socket = new_test_socket(); - send_test(connect_socket, 0, getpagesize(), getpagesize()); - close(connect_socket); - - sleep(1); - - connect_socket = new_test_socket(); - send_test(connect_socket, 0, 0, 2 * getpagesize()); - close(connect_socket); - - sleep(1); - - connect_socket = new_test_socket(); - send_test(connect_socket, 0, 0, 0); - close(connect_socket); - - sleep(1); - - connect_socket = new_test_socket(); - send_test(connect_socket, 0, getpagesize(), 0); - close(connect_socket); - - sleep(1); - - connect_socket = new_test_socket(); - send_test(connect_socket, 0, 2 * getpagesize(), 0); - close(connect_socket); - - sleep(1); - - connect_socket = new_test_socket(); - send_test(connect_socket, 0, TEST_PAGES * getpagesize(), 0); - close(connect_socket); - - sleep(1); - - (void)kill(child_pid, SIGKILL); +static void +cleanup(void) +{ + if (*path != '\0') + unlink(path); } int main(void) { - char path[PATH_MAX], *page_buffer; - struct sockaddr_in sin; + char *page_buffer; int pagesize; ssize_t len; + *path = '\0'; + pagesize = getpagesize(); page_buffer = malloc(TEST_PAGES * pagesize); if (page_buffer == NULL) - err(1, "malloc"); + FAIL_ERR("malloc") bzero(page_buffer, TEST_PAGES * pagesize); - listen_socket = socket(PF_INET, SOCK_STREAM, 0); - if (listen_socket < 0) - err(1, "socket"); - - bzero(&sin, sizeof(sin)); - sin.sin_len = sizeof(sin); - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - sin.sin_port = htons(TEST_PORT); - snprintf(path, PATH_MAX, "/tmp/sendfile.XXXXXXXXXXXX"); file_fd = mkstemp(path); - (void)unlink(path); + atexit(cleanup); len = write(file_fd, page_buffer, TEST_PAGES * pagesize); if (len < 0) - err(1, "write"); + FAIL_ERR("write") len = lseek(file_fd, 0, SEEK_SET); if (len < 0) - err(1, "lseek"); + FAIL_ERR("lseek") if (len != 0) - errx(1, "lseek: %zd", len); - - if (bind(listen_socket, (struct sockaddr *)&sin, sizeof(sin)) < 0) - err(1, "bind"); - - if (listen(listen_socket, -1) < 0) - err(1, "listen"); - - parent_pid = getpid(); - child_pid = fork(); - if (child_pid < 0) - err(1, "fork"); - if (child_pid == 0) { - child_pid = getpid(); - run_child(); - } else - run_parent(); + FAIL("len != 0") + run_parent(); return (0); } From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 03:49:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70F1C106566B; Thu, 25 Feb 2010 03:49:18 +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 5ED998FC17; Thu, 25 Feb 2010 03:49:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1P3nItR094167; Thu, 25 Feb 2010 03:49:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1P3nIYS094166; Thu, 25 Feb 2010 03:49:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201002250349.o1P3nIYS094166@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 25 Feb 2010 03:49: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: r204296 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 03:49:18 -0000 Author: nwhitehorn Date: Thu Feb 25 03:49:17 2010 New Revision: 204296 URL: http://svn.freebsd.org/changeset/base/204296 Log: Provide an implementation of pmap_dev_direct_mapped() on OEA64. This is required in order to be able to mmap the running kernel, which is turn required to avoid fstat returning gibberish. Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Thu Feb 25 00:46:51 2010 (r204295) +++ head/sys/powerpc/aim/mmu_oea64.c Thu Feb 25 03:49:17 2010 (r204296) @@ -2410,7 +2410,22 @@ moea64_clear_bit(vm_page_t m, u_int64_t boolean_t moea64_dev_direct_mapped(mmu_t mmu, vm_offset_t pa, vm_size_t size) { - return (EFAULT); + struct pvo_entry *pvo; + vm_offset_t ppa; + int error = 0; + + PMAP_LOCK(kernel_pmap); + for (ppa = pa & ~ADDR_POFF; ppa < pa + size; ppa += PAGE_SIZE) { + pvo = moea64_pvo_find_va(kernel_pmap, ppa, NULL); + if (pvo == NULL || + (pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN) != ppa) { + error = EFAULT; + break; + } + } + PMAP_UNLOCK(kernel_pmap); + + return (error); } /* From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 03:53:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD001106566C; Thu, 25 Feb 2010 03:53:21 +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 807188FC14; Thu, 25 Feb 2010 03:53:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1P3rLDh095093; Thu, 25 Feb 2010 03:53:21 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1P3rLxX095091; Thu, 25 Feb 2010 03:53:21 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201002250353.o1P3rLxX095091@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 25 Feb 2010 03:53: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: r204297 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 03:53:21 -0000 Author: nwhitehorn Date: Thu Feb 25 03:53:21 2010 New Revision: 204297 URL: http://svn.freebsd.org/changeset/base/204297 Log: Move the OEA64 scratchpage to the end of KVA from the beginning, and set its PVO to map physical address 0 instead of kernelstart. This fixes a situation in which a user process could attempt to return this address via KVM, have it fault while being modified, and then panic the kernel because (a) it is supposed to map a valid address and (b) it lies in the no-fault region between VM_MIN_KERNEL_ADDRESS and virtual_avail. While here, move msgbuf and dpcpu make into regular KVA space for consistency with other implementations. Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Thu Feb 25 03:49:17 2010 (r204296) +++ head/sys/powerpc/aim/mmu_oea64.c Thu Feb 25 03:53:21 2010 (r204297) @@ -970,10 +970,10 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o mtx_init(&moea64_scratchpage_mtx, "pvo zero page", NULL, MTX_DEF); for (i = 0; i < 2; i++) { - moea64_scratchpage_va[i] = virtual_avail; - virtual_avail += PAGE_SIZE; + moea64_scratchpage_va[i] = (virtual_end+1) - PAGE_SIZE; + virtual_end -= PAGE_SIZE; - moea64_kenter(mmup,moea64_scratchpage_va[i],kernelstart); + moea64_kenter(mmup,moea64_scratchpage_va[i],0); LOCK_TABLE(); moea64_scratchpage_pvo[i] = moea64_pvo_find_va(kernel_pmap, @@ -1004,20 +1004,25 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o * Allocate virtual address space for the message buffer. */ pa = msgbuf_phys = moea64_bootstrap_alloc(MSGBUF_SIZE, PAGE_SIZE); - msgbufp = (struct msgbuf *)msgbuf_phys; - while (pa - msgbuf_phys < MSGBUF_SIZE) { - moea64_kenter(mmup, pa, pa); + msgbufp = (struct msgbuf *)virtual_avail; + va = virtual_avail; + virtual_avail += round_page(MSGBUF_SIZE); + while (va < virtual_avail) { + moea64_kenter(mmup, va, pa); pa += PAGE_SIZE; + va += PAGE_SIZE; } /* * Allocate virtual address space for the dynamic percpu area. */ pa = moea64_bootstrap_alloc(DPCPU_SIZE, PAGE_SIZE); - dpcpu = (void *)pa; - while (pa - (vm_offset_t)dpcpu < DPCPU_SIZE) { - moea64_kenter(mmup, pa, pa); + dpcpu = (void *)virtual_avail; + virtual_avail += DPCPU_SIZE; + while (va < virtual_avail) { + moea64_kenter(mmup, va, pa); pa += PAGE_SIZE; + va += PAGE_SIZE; } dpcpu_init(dpcpu, 0); } From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 03:56:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AED681065670; Thu, 25 Feb 2010 03:56:17 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211]) by mx1.freebsd.org (Postfix) with ESMTP id 7A0B38FC14; Thu, 25 Feb 2010 03:56:17 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0KYD00D00PLS4Y00@smtpauth2.wiscmail.wisc.edu>; Wed, 24 Feb 2010 21:56:16 -0600 (CST) Received: from comporellon.tachypleus.net (adsl-76-233-146-74.dsl.mdsnwi.sbcglobal.net [76.233.146.74]) by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0KYD007SYPLQWH10@smtpauth2.wiscmail.wisc.edu>; Wed, 24 Feb 2010 21:56:15 -0600 (CST) Date: Wed, 24 Feb 2010 21:56:13 -0600 From: Nathan Whitehorn In-reply-to: <201002250353.o1P3rLxX095091@svn.freebsd.org> To: Nathan Whitehorn Message-id: <4B85F4DD.7040400@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.233.146.74 X-Spam-PmxInfo: Server=avs-14, Version=5.5.5.374460, Antispam-Engine: 2.7.1.369594, Antispam-Data: 2010.2.25.33930, SenderIP=76.233.146.74 References: <201002250353.o1P3rLxX095091@svn.freebsd.org> User-Agent: Thunderbird 2.0.0.23 (X11/20100206) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r204297 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 03:56:17 -0000 I can't seem to type the correct words tonight. This should have read: Move the OEA64 scratchpage to the end of KVA from the beginning, and set its PVO to map physical address 0 instead of kernelstart. This fixes a situation in which a user process could attempt to read this address via KVM, have it fault while being modified, and then panic the kernel because (a) it is supposed to map a valid address and (b) it lies in the no-fault region between VM_MIN_KERNEL_ADDRESS and virtual_avail. While here, move msgbuf and dpcpu back into regular KVA space for consistency with other implementations. -Nathan Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Thu Feb 25 03:53:21 2010 > New Revision: 204297 > URL: http://svn.freebsd.org/changeset/base/204297 > > Log: > Move the OEA64 scratchpage to the end of KVA from the beginning, and set > its PVO to map physical address 0 instead of kernelstart. This fixes a > situation in which a user process could attempt to return this address > via KVM, have it fault while being modified, and then panic the kernel > because (a) it is supposed to map a valid address and (b) it lies in the > no-fault region between VM_MIN_KERNEL_ADDRESS and virtual_avail. > > While here, move msgbuf and dpcpu make into regular KVA space for > consistency with other implementations. > > Modified: > head/sys/powerpc/aim/mmu_oea64.c > > Modified: head/sys/powerpc/aim/mmu_oea64.c > ============================================================================== > --- head/sys/powerpc/aim/mmu_oea64.c Thu Feb 25 03:49:17 2010 (r204296) > +++ head/sys/powerpc/aim/mmu_oea64.c Thu Feb 25 03:53:21 2010 (r204297) > @@ -970,10 +970,10 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o > > mtx_init(&moea64_scratchpage_mtx, "pvo zero page", NULL, MTX_DEF); > for (i = 0; i < 2; i++) { > - moea64_scratchpage_va[i] = virtual_avail; > - virtual_avail += PAGE_SIZE; > + moea64_scratchpage_va[i] = (virtual_end+1) - PAGE_SIZE; > + virtual_end -= PAGE_SIZE; > > - moea64_kenter(mmup,moea64_scratchpage_va[i],kernelstart); > + moea64_kenter(mmup,moea64_scratchpage_va[i],0); > > LOCK_TABLE(); > moea64_scratchpage_pvo[i] = moea64_pvo_find_va(kernel_pmap, > @@ -1004,20 +1004,25 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o > * Allocate virtual address space for the message buffer. > */ > pa = msgbuf_phys = moea64_bootstrap_alloc(MSGBUF_SIZE, PAGE_SIZE); > - msgbufp = (struct msgbuf *)msgbuf_phys; > - while (pa - msgbuf_phys < MSGBUF_SIZE) { > - moea64_kenter(mmup, pa, pa); > + msgbufp = (struct msgbuf *)virtual_avail; > + va = virtual_avail; > + virtual_avail += round_page(MSGBUF_SIZE); > + while (va < virtual_avail) { > + moea64_kenter(mmup, va, pa); > pa += PAGE_SIZE; > + va += PAGE_SIZE; > } > > /* > * Allocate virtual address space for the dynamic percpu area. > */ > pa = moea64_bootstrap_alloc(DPCPU_SIZE, PAGE_SIZE); > - dpcpu = (void *)pa; > - while (pa - (vm_offset_t)dpcpu < DPCPU_SIZE) { > - moea64_kenter(mmup, pa, pa); > + dpcpu = (void *)virtual_avail; > + virtual_avail += DPCPU_SIZE; > + while (va < virtual_avail) { > + moea64_kenter(mmup, va, pa); > pa += PAGE_SIZE; > + va += PAGE_SIZE; > } > dpcpu_init(dpcpu, 0); > } > From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 06:31:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FFB2106564A; Thu, 25 Feb 2010 06:31:06 +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 04A778FC15; Thu, 25 Feb 2010 06:31:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1P6V5Kc029862; Thu, 25 Feb 2010 06:31:05 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1P6V5JM029861; Thu, 25 Feb 2010 06:31:05 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201002250631.o1P6V5JM029861@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 25 Feb 2010 06:31: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: r204298 - head/contrib/tzdata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 06:31:06 -0000 Author: edwin Date: Thu Feb 25 06:31:05 2010 New Revision: 204298 URL: http://svn.freebsd.org/changeset/base/204298 Log: Copy share/zoneinfo to contrib/zoneinfo for the proper split of contributed data and FreeBSD specific data. Added: - copied from r204297, head/share/zoneinfo/ Directory Properties: head/contrib/tzdata/ (props changed) From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 06:35:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA3DE106566C; Thu, 25 Feb 2010 06:35:21 +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 8EDB98FC0C; Thu, 25 Feb 2010 06:35:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1P6ZLBD030843; Thu, 25 Feb 2010 06:35:21 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1P6ZLi9030842; Thu, 25 Feb 2010 06:35:21 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201002250635.o1P6ZLi9030842@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 25 Feb 2010 06:35: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: r204299 - head/contrib/tzdata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 06:35:21 -0000 Author: edwin Date: Thu Feb 25 06:35:21 2010 New Revision: 204299 URL: http://svn.freebsd.org/changeset/base/204299 Log: Remove Makefile, it is not part of the contributed data. Deleted: head/contrib/tzdata/Makefile From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 06:44:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 249C4106564A; Thu, 25 Feb 2010 06:44:17 +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 13AB68FC14; Thu, 25 Feb 2010 06:44:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1P6iGpn032820; Thu, 25 Feb 2010 06:44:16 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1P6iG7g032818; Thu, 25 Feb 2010 06:44:16 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201002250644.o1P6iG7g032818@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 25 Feb 2010 06: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: r204300 - head/share/zoneinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 06:44:17 -0000 Author: edwin Date: Thu Feb 25 06:44:16 2010 New Revision: 204300 URL: http://svn.freebsd.org/changeset/base/204300 Log: Officially speaking, the zoneinfo data files are contributed data. Therefore treat them as such. Deleted: head/share/zoneinfo/africa head/share/zoneinfo/antarctica head/share/zoneinfo/asia head/share/zoneinfo/australasia head/share/zoneinfo/backward head/share/zoneinfo/etcetera head/share/zoneinfo/europe head/share/zoneinfo/factory head/share/zoneinfo/leapseconds head/share/zoneinfo/northamerica head/share/zoneinfo/pacificnew head/share/zoneinfo/southamerica head/share/zoneinfo/systemv head/share/zoneinfo/yearistype.sh head/share/zoneinfo/zone.tab Modified: head/share/zoneinfo/Makefile Modified: head/share/zoneinfo/Makefile ============================================================================== --- head/share/zoneinfo/Makefile Thu Feb 25 06:35:21 2010 (r204299) +++ head/share/zoneinfo/Makefile Thu Feb 25 06:44:16 2010 (r204300) @@ -29,6 +29,8 @@ # CLEANFILES+= yearistype +CONTRIBDIR= ${.CURDIR}/../../contrib/tzdata/ +.PATH: ${CONTRIBDIR} .if defined(LEAPSECONDS) LEAPFILE= -L leapseconds @@ -44,6 +46,8 @@ POSIXRULES= America/New_York TZFILES+= backward systemv .endif +TZFILES:= ${TZFILES:S/^/${CONTRIBDIR}/} + all: yearistype beforeinstall: @@ -52,7 +56,7 @@ beforeinstall: -u ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ ${LEAPFILE} -y ${.OBJDIR}/yearistype ${TZFILES} ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ - ${.CURDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/ + ${CONTRIBDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/ afterinstall: # From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 06:50:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DDF6106566B; Thu, 25 Feb 2010 06:50:44 +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 711B68FC0A; Thu, 25 Feb 2010 06:50:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1P6oiDx034293; Thu, 25 Feb 2010 06:50:44 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1P6oi9G034292; Thu, 25 Feb 2010 06:50:44 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201002250650.o1P6oi9G034292@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 25 Feb 2010 06:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204301 - head/contrib/tzcode X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 06:50:44 -0000 Author: edwin Date: Thu Feb 25 06:50:44 2010 New Revision: 204301 URL: http://svn.freebsd.org/changeset/base/204301 Log: Provide an anchor below which the history of tzcode/zic and tzcode/stdtime will be preserved. Added: head/contrib/tzcode/ From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 06:53:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77CF2106564A; Thu, 25 Feb 2010 06:53:47 +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 4CD4A8FC0C; Thu, 25 Feb 2010 06:53:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1P6rlCO034990; Thu, 25 Feb 2010 06:53:47 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1P6rlUN034989; Thu, 25 Feb 2010 06:53:47 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201002250653.o1P6rlUN034989@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 25 Feb 2010 06:53: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: r204302 - head/contrib/tzcode/zic X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 06:53:47 -0000 Author: edwin Date: Thu Feb 25 06:53:46 2010 New Revision: 204302 URL: http://svn.freebsd.org/changeset/base/204302 Log: Copy usr.sbin/zic to contrib/tzcode/zic for the proper split of contributed code and FreeBSD specific code. Added: - copied from r204301, head/usr.sbin/zic/ Directory Properties: head/contrib/tzcode/zic/ (props changed) From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 09:51:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 398E71065670; Thu, 25 Feb 2010 09:51:15 +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 29DCF8FC14; Thu, 25 Feb 2010 09:51:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1P9pFDS074119; Thu, 25 Feb 2010 09:51:15 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1P9pF1P074118; Thu, 25 Feb 2010 09:51:15 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201002250951.o1P9pF1P074118@svn.freebsd.org> From: Robert Watson Date: Thu, 25 Feb 2010 09:51: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: r204303 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 09:51:15 -0000 Author: rwatson Date: Thu Feb 25 09:51:14 2010 New Revision: 204303 URL: http://svn.freebsd.org/changeset/base/204303 Log: Fix edge cases in several KASSERTs: use <= rather than < when testing that counters have not gone about MAXCPU or NETISR_MAXPROT. These problems caused panics on UP kernels with INVARIANTS when using sysctl -a, but would also have caused problems for 32-core boxes or if the netisr protocol vector was fully populated. Reported by: nwhitehorn, Neel Natu MFC after: 4 days Modified: head/sys/net/netisr.c Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Thu Feb 25 06:53:46 2010 (r204302) +++ head/sys/net/netisr.c Thu Feb 25 09:51:14 2010 (r204303) @@ -1167,7 +1167,7 @@ sysctl_netisr_proto(SYSCTL_HANDLER_ARGS) counter++; } NETISR_RUNLOCK(&tracker); - KASSERT(counter < NETISR_MAXPROT, + KASSERT(counter <= NETISR_MAXPROT, ("sysctl_netisr_proto: counter too big (%d)", counter)); error = SYSCTL_OUT(req, snp_array, sizeof(*snp_array) * counter); free(snp_array, M_TEMP); @@ -1220,7 +1220,7 @@ sysctl_netisr_workstream(SYSCTL_HANDLER_ counter++; } NETISR_RUNLOCK(&tracker); - KASSERT(counter < MAXCPU, + KASSERT(counter <= MAXCPU, ("sysctl_netisr_workstream: counter too big (%d)", counter)); error = SYSCTL_OUT(req, snws_array, sizeof(*snws_array) * counter); free(snws_array, M_TEMP); @@ -1281,7 +1281,7 @@ sysctl_netisr_work(SYSCTL_HANDLER_ARGS) } NWS_UNLOCK(nwsp); } - KASSERT(counter < MAXCPU * NETISR_MAXPROT, + KASSERT(counter <= MAXCPU * NETISR_MAXPROT, ("sysctl_netisr_work: counter too big (%d)", counter)); NETISR_RUNLOCK(&tracker); error = SYSCTL_OUT(req, snw_array, sizeof(*snw_array) * counter); From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 11:54:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C02D5106564A; Thu, 25 Feb 2010 11:54:10 +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 AFC9A8FC14; Thu, 25 Feb 2010 11:54:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1PBsAQ1002571; Thu, 25 Feb 2010 11:54:10 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PBsATM002569; Thu, 25 Feb 2010 11:54:10 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002251154.o1PBsATM002569@svn.freebsd.org> From: Warner Losh Date: Thu, 25 Feb 2010 11:54: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: r204305 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 11:54:10 -0000 Author: imp Date: Thu Feb 25 11:54:10 2010 New Revision: 204305 URL: http://svn.freebsd.org/changeset/base/204305 Log: Add CPU_CNMIPS for the core that's in Octeon CPUs. Modified: head/sys/conf/options.mips Modified: head/sys/conf/options.mips ============================================================================== --- head/sys/conf/options.mips Thu Feb 25 10:40:52 2010 (r204304) +++ head/sys/conf/options.mips Thu Feb 25 11:54:10 2010 (r204305) @@ -34,6 +34,7 @@ CPU_MIPS64 opt_global.h CPU_SENTRY5 opt_global.h CPU_HAVEFPU opt_global.h CPU_SB1 opt_global.h +CPU_CNMIPS opt_global.h ISA_MIPS1 opt_cputype.h ISA_MIPS3 opt_cputype.h From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 13:51:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AF9B106564A; Thu, 25 Feb 2010 13:51: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 0A1A98FC0A; Thu, 25 Feb 2010 13:51:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1PDpBUG028306; Thu, 25 Feb 2010 13:51:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PDpBUR028304; Thu, 25 Feb 2010 13:51:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002251351.o1PDpBUR028304@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 25 Feb 2010 13:51: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: r204307 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 13:51:12 -0000 Author: kib Date: Thu Feb 25 13:51:11 2010 New Revision: 204307 URL: http://svn.freebsd.org/changeset/base/204307 Log: Make pause(3) implementation not depended on the legacy sigcompat.c interfaces. Do not block rt signals during and after pause(3) calls. Use private libc namespace to call proper methods. MFC after: 1 week Modified: head/lib/libc/gen/pause.c Modified: head/lib/libc/gen/pause.c ============================================================================== --- head/lib/libc/gen/pause.c Thu Feb 25 13:28:05 2010 (r204306) +++ head/lib/libc/gen/pause.c Thu Feb 25 13:51:11 2010 (r204307) @@ -33,8 +33,10 @@ static char sccsid[] = "@(#)pause.c 8.1 #include __FBSDID("$FreeBSD$"); +#include "namespace.h" #include #include +#include "un-namespace.h" /* * Backwards compatible pause. @@ -42,7 +44,11 @@ __FBSDID("$FreeBSD$"); int __pause(void) { - return sigpause(sigblock(0L)); + sigset_t oset; + + if (_sigprocmask(SIG_BLOCK, NULL, &oset) == -1) + return (-1); + return (_sigsuspend(&oset)); } __weak_reference(__pause, pause); __weak_reference(__pause, _pause); From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 13:53:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3931B106564A; Thu, 25 Feb 2010 13:53:10 +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 284CB8FC1F; Thu, 25 Feb 2010 13:53:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1PDrApJ028765; Thu, 25 Feb 2010 13:53:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PDrABt028763; Thu, 25 Feb 2010 13:53:10 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002251353.o1PDrABt028763@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 25 Feb 2010 13:53: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: r204308 - head/bin/kill X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 13:53:10 -0000 Author: kib Date: Thu Feb 25 13:53:09 2010 New Revision: 204308 URL: http://svn.freebsd.org/changeset/base/204308 Log: Do not restrict the allowed signals that can be specified by number to the list of signals that has symbolic name. It was impossible to send rt signals with kill(1) due to the check. MFC after: 1 week Modified: head/bin/kill/kill.c Modified: head/bin/kill/kill.c ============================================================================== --- head/bin/kill/kill.c Thu Feb 25 13:51:11 2010 (r204307) +++ head/bin/kill/kill.c Thu Feb 25 13:53:09 2010 (r204308) @@ -108,7 +108,7 @@ main(int argc, char *argv[]) numsig = strtol(*argv, &ep, 10); if (!**argv || *ep) errx(1, "illegal signal number: %s", *argv); - if (numsig < 0 || numsig >= sys_nsig) + if (numsig < 0) nosig(*argv); } else nosig(*argv); From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 14:13:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71A861065679; Thu, 25 Feb 2010 14:13:40 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C27F8FC16; Thu, 25 Feb 2010 14:13:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1PEDebk033611; Thu, 25 Feb 2010 14:13:40 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PEDdKV033584; Thu, 25 Feb 2010 14:13:39 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201002251413.o1PEDdKV033584@svn.freebsd.org> From: Attilio Rao Date: Thu, 25 Feb 2010 14:13: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: r204309 - in head/sys: amd64/amd64 amd64/isa conf i386/bios i386/cpufreq i386/i386 i386/isa i386/xen isa modules/bios/smbios modules/bios/vpd modules/cpufreq pc98/pc98 x86 x86/bios x86/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 14:13:40 -0000 Author: attilio Date: Thu Feb 25 14:13:39 2010 New Revision: 204309 URL: http://svn.freebsd.org/changeset/base/204309 Log: Introduce the new kernel sub-tree x86 which should contain all the code shared and generalized between our current amd64, i386 and pc98. This is just an initial step that should lead to a more complete effort. For the moment, a very simple porting of cpufreq modules, BIOS calls and the whole MD specific ISA bus part is added to the sub-tree but ideally a lot of code might be added and more shared support should grow. Sponsored by: Sandvine Incorporated Reviewed by: emaste, kib, jhb, imp Discussed on: arch MFC: 3 weeks Added: head/sys/amd64/amd64/atpic_vector.S - copied unchanged from r203846, head/sys/amd64/isa/atpic_vector.S head/sys/i386/i386/atpic_vector.s - copied unchanged from r203846, head/sys/i386/isa/atpic_vector.s head/sys/x86/ head/sys/x86/bios/ - copied from r203846, head/sys/i386/bios/ head/sys/x86/cpufreq/ - copied from r203846, head/sys/i386/cpufreq/ head/sys/x86/isa/ head/sys/x86/isa/atpic.c - copied, changed from r203846, head/sys/i386/isa/atpic.c head/sys/x86/isa/atrtc.c - copied unchanged from r203846, head/sys/isa/atrtc.c head/sys/x86/isa/clock.c - copied, changed from r203846, head/sys/i386/isa/clock.c head/sys/x86/isa/elcr.c - copied unchanged from r203846, head/sys/i386/isa/elcr.c head/sys/x86/isa/icu.h - copied, changed from r203846, head/sys/i386/isa/icu.h head/sys/x86/isa/isa.c - copied, changed from r203846, head/sys/i386/isa/isa.c head/sys/x86/isa/isa.h - copied, changed from r203846, head/sys/i386/isa/isa.h head/sys/x86/isa/isa_dma.c - copied, changed from r203846, head/sys/i386/isa/isa_dma.c head/sys/x86/isa/nmi.c - copied unchanged from r203846, head/sys/i386/isa/nmi.c head/sys/x86/isa/orm.c - copied unchanged from r203846, head/sys/isa/orm.c Deleted: head/sys/amd64/isa/ head/sys/i386/bios/smbios.c head/sys/i386/bios/vpd.c head/sys/i386/cpufreq/ head/sys/i386/isa/atpic.c head/sys/i386/isa/atpic_vector.s head/sys/i386/isa/clock.c head/sys/i386/isa/elcr.c head/sys/i386/isa/icu.h head/sys/i386/isa/isa.c head/sys/i386/isa/isa.h head/sys/i386/isa/isa_dma.c head/sys/i386/isa/nmi.c head/sys/isa/atrtc.c head/sys/isa/orm.c head/sys/x86/bios/apm.c head/sys/x86/bios/apm.h head/sys/x86/bios/mca_machdep.c head/sys/x86/bios/mca_machdep.h head/sys/x86/bios/smapi.c head/sys/x86/bios/smapi_bios.S Modified: head/sys/amd64/amd64/exception.S head/sys/amd64/amd64/identcpu.c head/sys/amd64/amd64/intr_machdep.c head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/nexus.c head/sys/amd64/amd64/vm_machdep.c head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.pc98 head/sys/i386/i386/exception.s head/sys/i386/i386/machdep.c head/sys/i386/i386/nexus.c head/sys/i386/i386/vm_machdep.c head/sys/i386/xen/clock.c head/sys/modules/bios/smbios/Makefile head/sys/modules/bios/vpd/Makefile head/sys/modules/cpufreq/Makefile head/sys/pc98/pc98/machdep.c Copied: head/sys/amd64/amd64/atpic_vector.S (from r203846, head/sys/amd64/isa/atpic_vector.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/amd64/atpic_vector.S Thu Feb 25 14:13:39 2010 (r204309, copy of r203846, head/sys/amd64/isa/atpic_vector.S) @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 1989, 1990 William F. Jolitz. + * Copyright (c) 1990 The Regents of the University of California. + * 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. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + * + * from: vector.s, 386BSD 0.1 unknown origin + * $FreeBSD$ + */ + +/* + * Interrupt entry points for external interrupts triggered by the 8259A + * master and slave interrupt controllers. + */ + +#include + +#include "assym.s" + +/* + * Macros for interrupt entry, call to handler, and exit. + */ +#define INTR(irq_num, vec_name) \ + .text ; \ + SUPERALIGN_TEXT ; \ +IDTVEC(vec_name) ; \ + PUSH_FRAME ; \ + FAKE_MCOUNT(TF_RIP(%rsp)) ; \ + movq %rsp, %rsi ; \ + movl $irq_num, %edi; /* pass the IRQ */ \ + call atpic_handle_intr ; \ + MEXITCOUNT ; \ + jmp doreti + + INTR(0, atpic_intr0) + INTR(1, atpic_intr1) + INTR(2, atpic_intr2) + INTR(3, atpic_intr3) + INTR(4, atpic_intr4) + INTR(5, atpic_intr5) + INTR(6, atpic_intr6) + INTR(7, atpic_intr7) + INTR(8, atpic_intr8) + INTR(9, atpic_intr9) + INTR(10, atpic_intr10) + INTR(11, atpic_intr11) + INTR(12, atpic_intr12) + INTR(13, atpic_intr13) + INTR(14, atpic_intr14) + INTR(15, atpic_intr15) Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Thu Feb 25 13:53:09 2010 (r204308) +++ head/sys/amd64/amd64/exception.S Thu Feb 25 14:13:39 2010 (r204309) @@ -595,7 +595,7 @@ MCOUNT_LABEL(bintr) .text SUPERALIGN_TEXT -#include +#include #endif .text Modified: head/sys/amd64/amd64/identcpu.c ============================================================================== --- head/sys/amd64/amd64/identcpu.c Thu Feb 25 13:53:09 2010 (r204308) +++ head/sys/amd64/amd64/identcpu.c Thu Feb 25 14:13:39 2010 (r204309) @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include /* XXX - should be in header file: */ void printcpuinfo(void); Modified: head/sys/amd64/amd64/intr_machdep.c ============================================================================== --- head/sys/amd64/amd64/intr_machdep.c Thu Feb 25 13:53:09 2010 (r204308) +++ head/sys/amd64/amd64/intr_machdep.c Thu Feb 25 14:13:39 2010 (r204309) @@ -62,8 +62,8 @@ #include #include #include -#include -#include +#include +#include #endif #define MAX_STRAY_LOG 5 Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Thu Feb 25 13:53:09 2010 (r204308) +++ head/sys/amd64/amd64/machdep.c Thu Feb 25 14:13:39 2010 (r204309) @@ -128,7 +128,7 @@ __FBSDID("$FreeBSD$"); #endif #ifdef DEV_ATPIC -#include +#include #else #include #endif Modified: head/sys/amd64/amd64/nexus.c ============================================================================== --- head/sys/amd64/amd64/nexus.c Thu Feb 25 13:53:09 2010 (r204308) +++ head/sys/amd64/amd64/nexus.c Thu Feb 25 14:13:39 2010 (r204309) @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); #ifdef DEV_ISA #include -#include +#include #endif #include Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Thu Feb 25 13:53:09 2010 (r204308) +++ head/sys/amd64/amd64/vm_machdep.c Thu Feb 25 14:13:39 2010 (r204309) @@ -80,7 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include static void cpu_reset_real(void); #ifdef SMP Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Thu Feb 25 13:53:09 2010 (r204308) +++ head/sys/conf/files.amd64 Thu Feb 25 14:13:39 2010 (r204309) @@ -131,13 +131,6 @@ amd64/amd64/tsc.c standard amd64/amd64/uio_machdep.c standard amd64/amd64/uma_machdep.c standard amd64/amd64/vm_machdep.c standard -amd64/isa/atpic.c optional atpic isa -#amd64/isa/atpic_vector.S optional atpic isa -amd64/isa/clock.c standard -amd64/isa/elcr.c standard -amd64/isa/isa.c standard -amd64/isa/isa_dma.c standard -amd64/isa/nmi.c standard amd64/pci/pci_bus.c optional pci amd64/pci/pci_cfgreg.c optional pci crypto/blowfish/bf_enc.c optional crypto | ipsec @@ -228,8 +221,6 @@ dev/syscons/scvgarndr.c optional sc vga dev/syscons/scvtb.c optional sc dev/uart/uart_cpu_amd64.c optional uart dev/wpi/if_wpi.c optional wpi -isa/atrtc.c standard -isa/orm.c optional isa isa/syscons_isa.c optional sc isa/vga_isa.c optional vga kern/link_elf_obj.c standard @@ -289,12 +280,6 @@ compat/ndis/subr_ntoskrnl.c optional ndi compat/ndis/subr_pe.c optional ndisapi pci compat/ndis/subr_usbd.c optional ndisapi pci compat/ndis/winx64_wrap.S optional ndisapi pci -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 libkern/memset.c standard @@ -303,3 +288,20 @@ libkern/memset.c standard # compat/x86bios/x86bios.c optional x86bios | atkbd | dpms | vesa contrib/x86emu/x86emu.c optional x86bios | atkbd | dpms | vesa +# +# x86 shared code between IA32, AMD64 and PC98 architectures +# +x86/bios/smbios.c optional smbios +x86/bios/vpd.c optional vpd +x86/cpufreq/powernow.c optional cpufreq +x86/cpufreq/est.c optional cpufreq +x86/cpufreq/hwpstate.c optional cpufreq +x86/cpufreq/p4tcc.c optional cpufreq +x86/isa/atpic.c optional atpic isa +x86/isa/atrtc.c optional atpic +x86/isa/clock.c standard +x86/isa/elcr.c standard +x86/isa/isa.c standard +x86/isa/isa_dma.c standard +x86/isa/nmi.c standard +x86/isa/orm.c optional isa Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Thu Feb 25 13:53:09 2010 (r204308) +++ head/sys/conf/files.i386 Thu Feb 25 14:13:39 2010 (r204309) @@ -244,13 +244,6 @@ i386/bios/apm.c optional apm i386/bios/mca_machdep.c optional mca i386/bios/smapi.c optional smapi 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 #i386/i386/apic_vector.s optional apic i386/i386/atomic.c standard \ compile-with "${CC} -c ${CFLAGS} ${DEFINED_PROF:S/^$/-fomit-frame-pointer/} ${.IMPSRC}" @@ -329,17 +322,10 @@ i386/ibcs2/ibcs2_util.c optional ibcs2 i386/ibcs2/ibcs2_xenix.c optional ibcs2 i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2 i386/ibcs2/imgact_coff.c optional ibcs2 -i386/isa/atpic.c optional atpic -#i386/isa/atpic_vector.s standard -i386/isa/clock.c optional native i386/xen/clock.c optional xen i386/xen/xen_clock_util.c optional xen i386/xen/xen_rtc.c optional xen -i386/isa/elcr.c standard i386/isa/elink.c optional ep | ie -i386/isa/isa.c optional isa -i386/isa/isa_dma.c optional isa -i386/isa/nmi.c standard i386/isa/npx.c optional npx i386/isa/pmtimer.c optional pmtimer i386/isa/prof_machdep.c optional profiling-routine @@ -362,8 +348,6 @@ i386/svr4/svr4_locore.s optional compat warning "COMPAT_SVR4 is broken and should be avoided" i386/svr4/svr4_machdep.c optional compat_svr4 # -isa/atrtc.c optional atpic -isa/orm.c optional isa isa/syscons_isa.c optional sc isa/vga_isa.c optional vga kern/imgact_aout.c optional compat_aout @@ -387,3 +371,21 @@ i386/xbox/pic16l.s optional xbox # compat/x86bios/x86bios.c optional x86bios | atkbd | dpms | vesa contrib/x86emu/x86emu.c optional x86bios | atkbd | dpms | vesa +# +# x86 shared code between IA32, AMD64 and PC98 architectures +# +x86/bios/smbios.c optional smbios +x86/bios/vpd.c optional vpd +x86/cpufreq/est.c optional cpufreq +x86/cpufreq/hwpstate.c optional cpufreq +x86/cpufreq/p4tcc.c optional cpufreq +x86/cpufreq/powernow.c optional cpufreq +x86/cpufreq/smist.c optional cpufreq +x86/isa/atpic.c optional atpic +x86/isa/atrtc.c optional atpic +x86/isa/clock.c optional native +x86/isa/elcr.c standard +x86/isa/isa.c optional isa +x86/isa/isa_dma.c optional isa +x86/isa/nmi.c standard +x86/isa/orm.c optional isa Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Thu Feb 25 13:53:09 2010 (r204308) +++ head/sys/conf/files.pc98 Thu Feb 25 14:13:39 2010 (r204309) @@ -195,7 +195,6 @@ i386/ibcs2/ibcs2_xenix.c optional ibcs2 i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2 i386/ibcs2/imgact_coff.c optional ibcs2 i386/isa/atpic.c optional atpic -#i386/isa/atpic_vector.s standard i386/isa/elink.c optional ep | ie i386/isa/isa.c optional isa i386/isa/npx.c optional npx Copied: head/sys/i386/i386/atpic_vector.s (from r203846, head/sys/i386/isa/atpic_vector.s) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/i386/i386/atpic_vector.s Thu Feb 25 14:13:39 2010 (r204309, copy of r203846, head/sys/i386/isa/atpic_vector.s) @@ -0,0 +1,77 @@ +/*- + * Copyright (c) 1989, 1990 William F. Jolitz. + * Copyright (c) 1990 The Regents of the University of California. + * 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. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + * + * from: vector.s, 386BSD 0.1 unknown origin + * $FreeBSD$ + */ + +/* + * Interrupt entry points for external interrupts triggered by the 8259A + * master and slave interrupt controllers. + */ + +#include + +#include "assym.s" + +/* + * Macros for interrupt entry, call to handler, and exit. + */ +#define INTR(irq_num, vec_name) \ + .text ; \ + SUPERALIGN_TEXT ; \ +IDTVEC(vec_name) ; \ + PUSH_FRAME ; \ + SET_KERNEL_SREGS ; \ +; \ + FAKE_MCOUNT(TF_EIP(%esp)) ; \ + pushl %esp ; \ + pushl $irq_num; /* pass the IRQ */ \ + call atpic_handle_intr ; \ + addl $8, %esp ; /* discard the parameters */ \ +; \ + MEXITCOUNT ; \ + jmp doreti + + INTR(0, atpic_intr0) + INTR(1, atpic_intr1) + INTR(2, atpic_intr2) + INTR(3, atpic_intr3) + INTR(4, atpic_intr4) + INTR(5, atpic_intr5) + INTR(6, atpic_intr6) + INTR(7, atpic_intr7) + INTR(8, atpic_intr8) + INTR(9, atpic_intr9) + INTR(10, atpic_intr10) + INTR(11, atpic_intr11) + INTR(12, atpic_intr12) + INTR(13, atpic_intr13) + INTR(14, atpic_intr14) + INTR(15, atpic_intr15) Modified: head/sys/i386/i386/exception.s ============================================================================== --- head/sys/i386/i386/exception.s Thu Feb 25 13:53:09 2010 (r204308) +++ head/sys/i386/i386/exception.s Thu Feb 25 14:13:39 2010 (r204309) @@ -294,7 +294,7 @@ ENTRY(fork_trampoline) SUPERALIGN_TEXT MCOUNT_LABEL(bintr) -#include +#include #ifdef DEV_APIC .data Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Thu Feb 25 13:53:09 2010 (r204308) +++ head/sys/i386/i386/machdep.c Thu Feb 25 14:13:39 2010 (r204309) @@ -132,7 +132,7 @@ __FBSDID("$FreeBSD$"); #endif #ifdef DEV_ISA -#include +#include #endif #ifdef XBOX Modified: head/sys/i386/i386/nexus.c ============================================================================== --- head/sys/i386/i386/nexus.c Thu Feb 25 13:53:09 2010 (r204308) +++ head/sys/i386/i386/nexus.c Thu Feb 25 14:13:39 2010 (r204309) @@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$"); #ifdef PC98 #include #else -#include +#include #endif #endif #include Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Thu Feb 25 13:53:09 2010 (r204308) +++ head/sys/i386/i386/vm_machdep.c Thu Feb 25 14:13:39 2010 (r204309) @@ -95,7 +95,7 @@ __FBSDID("$FreeBSD$"); #ifdef PC98 #include #else -#include +#include #endif #ifdef XBOX Modified: head/sys/i386/xen/clock.c ============================================================================== --- head/sys/i386/xen/clock.c Thu Feb 25 13:53:09 2010 (r204308) +++ head/sys/i386/xen/clock.c Thu Feb 25 14:13:39 2010 (r204309) @@ -74,8 +74,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include +#include #include #include Modified: head/sys/modules/bios/smbios/Makefile ============================================================================== --- head/sys/modules/bios/smbios/Makefile Thu Feb 25 13:53:09 2010 (r204308) +++ head/sys/modules/bios/smbios/Makefile Thu Feb 25 14:13:39 2010 (r204309) @@ -1,7 +1,7 @@ # $FreeBSD$ # -.PATH: ${.CURDIR}/../../../i386/bios +.PATH: ${.CURDIR}/../../../x86/bios KMOD= smbios SRCS= smbios.c \ Modified: head/sys/modules/bios/vpd/Makefile ============================================================================== --- head/sys/modules/bios/vpd/Makefile Thu Feb 25 13:53:09 2010 (r204308) +++ head/sys/modules/bios/vpd/Makefile Thu Feb 25 14:13:39 2010 (r204309) @@ -1,7 +1,7 @@ # $FreeBSD$ # -.PATH: ${.CURDIR}/../../../i386/bios +.PATH: ${.CURDIR}/../../../x86/bios KMOD= vpd SRCS= vpd.c \ Modified: head/sys/modules/cpufreq/Makefile ============================================================================== --- head/sys/modules/cpufreq/Makefile Thu Feb 25 13:53:09 2010 (r204308) +++ head/sys/modules/cpufreq/Makefile Thu Feb 25 14:13:39 2010 (r204309) @@ -8,7 +8,7 @@ SRCS= ichss.c SRCS+= bus_if.h cpufreq_if.h device_if.h pci_if.h .if ${MACHINE} == "i386" || ${MACHINE} == "amd64" -.PATH: ${.CURDIR}/../../i386/cpufreq +.PATH: ${.CURDIR}/../../x86/cpufreq SRCS+= acpi_if.h opt_acpi.h SRCS+= est.c hwpstate.c p4tcc.c powernow.c Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Thu Feb 25 13:53:09 2010 (r204308) +++ head/sys/pc98/pc98/machdep.c Thu Feb 25 14:13:39 2010 (r204309) @@ -129,7 +129,7 @@ __FBSDID("$FreeBSD$"); #endif #ifdef DEV_ISA -#include +#include #endif /* Sanity check for __curthread() */ Copied and modified: head/sys/x86/isa/atpic.c (from r203846, head/sys/i386/isa/atpic.c) ============================================================================== --- head/sys/i386/isa/atpic.c Sat Feb 13 19:17:06 2010 (r203846, copy source) +++ head/sys/x86/isa/atpic.c Thu Feb 25 14:13:39 2010 (r204309) @@ -53,14 +53,22 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #ifdef PC98 #include #else -#include +#include #endif #include +#ifdef __amd64__ +#define SDT_ATPIC SDT_SYSIGT +#define GSEL_ATPIC 0 +#else +#define SDT_ATPIC SDT_SYS386IGT +#define GSEL_ATPIC GSEL(GCODE_SEL, SEL_KPL) +#endif + #define MASTER 0 #define SLAVE 1 @@ -468,8 +476,7 @@ atpic_startup(void) ai->at_intsrc.is_count = &ai->at_count; ai->at_intsrc.is_straycount = &ai->at_straycount; setidt(((struct atpic *)ai->at_intsrc.is_pic)->at_intbase + - ai->at_irq, ai->at_intr, SDT_SYS386IGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); + ai->at_irq, ai->at_intr, SDT_ATPIC, SEL_KPL, GSEL_ATPIC); } #ifdef DEV_MCA Copied: head/sys/x86/isa/atrtc.c (from r203846, head/sys/isa/atrtc.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/isa/atrtc.c Thu Feb 25 14:13:39 2010 (r204309, copy of r203846, head/sys/isa/atrtc.c) @@ -0,0 +1,331 @@ +/*- + * Copyright (c) 2008 Poul-Henning Kamp + * 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. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_isa.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#ifdef DEV_ISA +#include +#include +#endif + +#define RTC_LOCK mtx_lock_spin(&clock_lock) +#define RTC_UNLOCK mtx_unlock_spin(&clock_lock) + +int atrtcclock_disable = 0; + +static int rtc_reg = -1; +static u_char rtc_statusa = RTCSA_DIVIDER | RTCSA_NOPROF; +static u_char rtc_statusb = RTCSB_24HR; + +/* + * RTC support routines + */ + +int +rtcin(int reg) +{ + u_char val; + + RTC_LOCK; + if (rtc_reg != reg) { + inb(0x84); + outb(IO_RTC, reg); + rtc_reg = reg; + inb(0x84); + } + val = inb(IO_RTC + 1); + RTC_UNLOCK; + return (val); +} + +void +writertc(int reg, u_char val) +{ + + RTC_LOCK; + if (rtc_reg != reg) { + inb(0x84); + outb(IO_RTC, reg); + rtc_reg = reg; + inb(0x84); + } + outb(IO_RTC + 1, val); + inb(0x84); + RTC_UNLOCK; +} + +static __inline int +readrtc(int port) +{ + return(bcd2bin(rtcin(port))); +} + +void +atrtc_start(void) +{ + + writertc(RTC_STATUSA, rtc_statusa); + writertc(RTC_STATUSB, RTCSB_24HR); +} + +void +atrtc_rate(unsigned rate) +{ + + rtc_statusa = RTCSA_DIVIDER | rate; + writertc(RTC_STATUSA, rtc_statusa); +} + +void +atrtc_enable_intr(void) +{ + + rtc_statusb |= RTCSB_PINTR; + writertc(RTC_STATUSB, rtc_statusb); + rtcin(RTC_INTR); +} + +void +atrtc_restore(void) +{ + + /* Restore all of the RTC's "status" (actually, control) registers. */ + rtcin(RTC_STATUSA); /* dummy to get rtc_reg set */ + writertc(RTC_STATUSB, RTCSB_24HR); + writertc(RTC_STATUSA, rtc_statusa); + writertc(RTC_STATUSB, rtc_statusb); + rtcin(RTC_INTR); +} + +int +atrtc_setup_clock(void) +{ + int diag; + + if (atrtcclock_disable) + return (0); + + diag = rtcin(RTC_DIAG); + if (diag != 0) { + printf("RTC BIOS diagnostic error %b\n", + diag, RTCDG_BITS); + return (0); + } + + stathz = RTC_NOPROFRATE; + profhz = RTC_PROFRATE; + + return (1); +} + +/********************************************************************** + * RTC driver for subr_rtc + */ + +#include "clock_if.h" + +#include + +struct atrtc_softc { + int port_rid, intr_rid; + struct resource *port_res; + struct resource *intr_res; +}; + +/* + * Attach to the ISA PnP descriptors for the timer and realtime clock. + */ +static struct isa_pnp_id atrtc_ids[] = { + { 0x000bd041 /* PNP0B00 */, "AT realtime clock" }, + { 0 } +}; + +static int +atrtc_probe(device_t dev) +{ + int result; + + device_set_desc(dev, "AT Real Time Clock"); + result = ISA_PNP_PROBE(device_get_parent(dev), dev, atrtc_ids); + /* ENXIO if wrong PnP-ID, ENOENT ifno PnP-ID, zero if good PnP-iD */ + if (result != ENOENT) + return(result); + /* All PC's have an RTC, and we're hosed without it, so... */ + return (BUS_PROBE_LOW_PRIORITY); +} + +static int +atrtc_attach(device_t dev) +{ + struct atrtc_softc *sc; + int i; + + /* + * Not that we need them or anything, but grab our resources + * so they show up, correctly attributed, in the big picture. + */ + + sc = device_get_softc(dev); + if (!(sc->port_res = bus_alloc_resource(dev, SYS_RES_IOPORT, + &sc->port_rid, IO_RTC, IO_RTC + 1, 2, RF_ACTIVE))) + device_printf(dev,"Warning: Couldn't map I/O.\n"); + if (!(sc->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, + &sc->intr_rid, 8, 8, 1, RF_ACTIVE))) + device_printf(dev,"Warning: Couldn't map Interrupt.\n"); + clock_register(dev, 1000000); + if (resource_int_value("atrtc", 0, "clock", &i) == 0 && i == 0) + atrtcclock_disable = 1; + return(0); +} + +static int +atrtc_resume(device_t dev) +{ + + atrtc_restore(); + return(0); +} + +static int +atrtc_settime(device_t dev __unused, struct timespec *ts) +{ + struct clocktime ct; + + clock_ts_to_ct(ts, &ct); + + /* Disable RTC updates and interrupts. */ + writertc(RTC_STATUSB, RTCSB_HALT | RTCSB_24HR); + + writertc(RTC_SEC, bin2bcd(ct.sec)); /* Write back Seconds */ + writertc(RTC_MIN, bin2bcd(ct.min)); /* Write back Minutes */ + writertc(RTC_HRS, bin2bcd(ct.hour)); /* Write back Hours */ + + writertc(RTC_WDAY, ct.dow + 1); /* Write back Weekday */ + writertc(RTC_DAY, bin2bcd(ct.day)); /* Write back Day */ + writertc(RTC_MONTH, bin2bcd(ct.mon)); /* Write back Month */ + writertc(RTC_YEAR, bin2bcd(ct.year % 100)); /* Write back Year */ +#ifdef USE_RTC_CENTURY + writertc(RTC_CENTURY, bin2bcd(ct.year / 100)); /* ... and Century */ +#endif + + /* Reenable RTC updates and interrupts. */ + writertc(RTC_STATUSB, rtc_statusb); + rtcin(RTC_INTR); + return (0); +} + +static int +atrtc_gettime(device_t dev, struct timespec *ts) +{ + struct clocktime ct; + int s; + + /* Look if we have a RTC present and the time is valid */ + if (!(rtcin(RTC_STATUSD) & RTCSD_PWR)) { + device_printf(dev, "WARNING: Battery failure indication\n"); + return (EINVAL); + } + + /* wait for time update to complete */ + /* If RTCSA_TUP is zero, we have at least 244us before next update */ + s = splhigh(); + while (rtcin(RTC_STATUSA) & RTCSA_TUP) { + splx(s); + s = splhigh(); + } + ct.nsec = 0; + ct.sec = readrtc(RTC_SEC); + ct.min = readrtc(RTC_MIN); + ct.hour = readrtc(RTC_HRS); + ct.day = readrtc(RTC_DAY); + ct.dow = readrtc(RTC_WDAY) - 1; + ct.mon = readrtc(RTC_MONTH); + ct.year = readrtc(RTC_YEAR); +#ifdef USE_RTC_CENTURY + ct.year += readrtc(RTC_CENTURY) * 100; +#else + ct.year += 2000; +#endif + /* Set dow = -1 because some clocks don't set it correctly. */ + ct.dow = -1; + return (clock_ct_to_ts(&ct, ts)); +} + +static device_method_t atrtc_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, atrtc_probe), + DEVMETHOD(device_attach, atrtc_attach), + DEVMETHOD(device_detach, bus_generic_detach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + /* XXX stop statclock? */ + DEVMETHOD(device_resume, atrtc_resume), + + /* clock interface */ + DEVMETHOD(clock_gettime, atrtc_gettime), + DEVMETHOD(clock_settime, atrtc_settime), + + { 0, 0 } +}; + +static driver_t atrtc_driver = { + "atrtc", + atrtc_methods, + sizeof(struct atrtc_softc), +}; + +static devclass_t atrtc_devclass; + +DRIVER_MODULE(atrtc, isa, atrtc_driver, atrtc_devclass, 0, 0); +DRIVER_MODULE(atrtc, acpi, atrtc_driver, atrtc_devclass, 0, 0); + +#include "opt_ddb.h" +#ifdef DDB +#include + +DB_SHOW_COMMAND(rtc, rtc) +{ + printf("%02x/%02x/%02x %02x:%02x:%02x, A = %02x, B = %02x, C = %02x\n", + rtcin(RTC_YEAR), rtcin(RTC_MONTH), rtcin(RTC_DAY), + rtcin(RTC_HRS), rtcin(RTC_MIN), rtcin(RTC_SEC), + rtcin(RTC_STATUSA), rtcin(RTC_STATUSB), rtcin(RTC_INTR)); +} +#endif /* DDB */ Copied and modified: head/sys/x86/isa/clock.c (from r203846, head/sys/i386/isa/clock.c) ============================================================================== --- head/sys/i386/isa/clock.c Sat Feb 13 19:17:06 2010 (r203846, copy source) +++ head/sys/x86/isa/clock.c Thu Feb 25 14:13:39 2010 (r204309) @@ -39,12 +39,13 @@ __FBSDID("$FreeBSD$"); * Routines to handle clock hardware. */ +#ifndef __amd64__ #include "opt_apic.h" +#endif #include "opt_clock.h" #include "opt_kdtrace.h" #include "opt_isa.h" #include "opt_mca.h" -#include "opt_xbox.h" #include #include @@ -62,7 +63,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -480,12 +480,15 @@ i8254_restore(void) mtx_unlock_spin(&clock_lock); } +#ifndef __amd64__ /* * Restore all the timers non-atomically (XXX: should be atomically). * * This function is called from pmtimer_resume() to restore all the timers. * This should not be necessary, but there are broken laptops that do not * restore all the timers on resume. + * As long as pmtimer is not part of amd64 suport, skip this for the amd64 + * case. */ void timer_restore(void) @@ -494,6 +497,7 @@ timer_restore(void) i8254_restore(); /* restore i8254_freq and hz */ atrtc_restore(); /* reenable RTC interrupts */ } +#endif /* This is separate from startrtclock() so that it can be called early. */ void @@ -523,7 +527,7 @@ void cpu_initclocks() { -#ifdef DEV_APIC +#if defined(__amd64__) || defined(DEV_APIC) using_lapic_timer = lapic_setup_clock(); #endif /* @@ -625,11 +629,15 @@ i8254_simple_get_timecount(struct timeco static unsigned i8254_get_timecount(struct timecounter *tc) { + register_t flags; u_int count; u_int high, low; - u_int eflags; - eflags = read_eflags(); +#ifdef __amd64__ + flags = read_rflags(); +#else + flags = read_eflags(); +#endif mtx_lock_spin(&clock_lock); /* Select timer0 and latch counter value. */ @@ -640,7 +648,7 @@ i8254_get_timecount(struct timecounter * count = i8254_max_count - ((high << 8) | low); if (count < i8254_lastcount || (!i8254_ticked && (clkintr_pending || - ((count < 20 || (!(eflags & PSL_I) && + ((count < 20 || (!(flags & PSL_I) && count < i8254_max_count / 2u)) && i8254_pending != NULL && i8254_pending(i8254_intsrc))))) { i8254_ticked = 1; @@ -678,6 +686,14 @@ attimer_attach(device_t dev) return(0); } +static int +attimer_resume(device_t dev) +{ + + i8254_restore(); + return (0); +} + static device_method_t attimer_methods[] = { /* Device interface */ DEVMETHOD(device_probe, attimer_probe), @@ -685,7 +701,7 @@ static device_method_t attimer_methods[] DEVMETHOD(device_detach, bus_generic_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_resume, attimer_resume), { 0, 0 } }; Copied: head/sys/x86/isa/elcr.c (from r203846, head/sys/i386/isa/elcr.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/isa/elcr.c Thu Feb 25 14:13:39 2010 (r204309, copy of r203846, head/sys/i386/isa/elcr.c) @@ -0,0 +1,139 @@ +/*- + * Copyright (c) 2004 John Baldwin + * 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. + * 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. + * + * 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$"); + +/* + * The ELCR is a register that controls the trigger mode and polarity of + * EISA and ISA interrupts. In FreeBSD 3.x and 4.x, the ELCR was only + * consulted for determining the appropriate trigger mode of EISA + * interrupts when using an APIC. However, it seems that almost all + * systems that include PCI also include an ELCR that manages the ISA + * IRQs 0 through 15. Thus, we check for the presence of an ELCR on + * every machine by checking to see if the values found at bootup are + * sane. Note that the polarity of ISA and EISA IRQs are linked to the + * trigger mode. All edge triggered IRQs use active-hi polarity, and + * all level triggered interrupts use active-lo polarity. + * + * The format of the ELCR is simple: it is a 16-bit bitmap where bit 0 + * controls IRQ 0, bit 1 controls IRQ 1, etc. If the bit is zero, the + * associated IRQ is edge triggered. If the bit is one, the IRQ is + * level triggered. + */ + +#include +#include +#include +#include + +#define ELCR_PORT 0x4d0 +#define ELCR_MASK(irq) (1 << (irq)) + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 14:36:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91E371065672; Thu, 25 Feb 2010 14:36:52 +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 7F7278FC0C; Thu, 25 Feb 2010 14:36:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1PEaqmm039134; Thu, 25 Feb 2010 14:36:52 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PEap20039133; Thu, 25 Feb 2010 14:36:51 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201002251436.o1PEap20039133@svn.freebsd.org> From: Ruslan Ermilov Date: Thu, 25 Feb 2010 14:36: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: r204310 - in head/tools/tools: mcgrab mctest X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 14:36:52 -0000 Author: ru Date: Thu Feb 25 14:36:50 2010 New Revision: 204310 URL: http://svn.freebsd.org/changeset/base/204310 Log: Moved mcgrab(1) into a separate directory -- our .mk infrastructure doesn't currently have support for building multiple programs in a single makefile. While here, fixed manpages and makefiles (missing dependencies). Added: head/tools/tools/mcgrab/ head/tools/tools/mcgrab/Makefile (contents, props changed) head/tools/tools/mcgrab/mcgrab.1 - copied, changed from r204302, head/tools/tools/mctest/mcgrab.1 head/tools/tools/mcgrab/mcgrab.cc - copied unchanged from r204302, head/tools/tools/mctest/mcgrab.cc Deleted: head/tools/tools/mctest/mcgrab.1 head/tools/tools/mctest/mcgrab.cc Modified: head/tools/tools/mctest/Makefile head/tools/tools/mctest/mctest.1 Added: head/tools/tools/mcgrab/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/mcgrab/Makefile Thu Feb 25 14:36:50 2010 (r204310) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +PROG_CXX= mcgrab +CFLAGS+= -I${.CURDIR}/../mctest + +.include Copied and modified: head/tools/tools/mcgrab/mcgrab.1 (from r204302, head/tools/tools/mctest/mcgrab.1) ============================================================================== --- head/tools/tools/mctest/mcgrab.1 Thu Feb 25 06:53:46 2010 (r204302, copy source) +++ head/tools/tools/mcgrab/mcgrab.1 Thu Feb 25 14:36:50 2010 (r204310) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd July 9, 2008 -.Dt mcgrab 1 +.Dt MCGRAB 1 .Os .Sh NAME .Nm mcgrab @@ -36,23 +36,27 @@ .Op Fl g Ar group .Op Fl n Ar number .Sh DESCRIPTION -The +The .Nm command implements a multicast test which grabs and holds -N multicast addresses. The purpose of the test is to see what +N multicast addresses. +The purpose of the test is to see what happens when a network interface is no longer able to filter -multicasts in hardware and has to switch to promiscious or -multicast promiscious mode. A successful test does not have any +multicasts in hardware and has to switch to promiscuous or +multicast promiscuous mode. +A successful test does not have any result, but an unsuccessful test will have deleterious side effects. Packet size in bytes. The options are as follows: -.Bl -tag -width ".Fl d Ar argument" +.Bl -tag -width ".Fl i Ar interface" .It Fl i Ar interface -Network interface, which can be found with ifconfig(1). -.It Fl i Ar group -Multicast group +Network interface, which can be found with +.Xr ifconfig 8 . +.It Fl g Ar group +Multicast group. .It Fl n Ar number Number of groups to join. +.El .Sh EXAMPLES The following is an example of a typical usage of the @@ -62,9 +66,9 @@ command: .Dl "mcgrab -i em0 -g 239.255.255.1 -n 1024" .Sh SEE ALSO .Xr mctest 1 , -.Xr ifconfig 8 , .Xr netstat 1 , -.Xr nanosleep 2 . +.Xr nanosleep 2 , +.Xr ifconfig 8 .Sh HISTORY The .Nm @@ -75,4 +79,5 @@ This manual page was written by .An George V. Neville-Neil Aq gnn@FreeBSD.org . .Sh BUGS -Should be reported to the author or to net@freebsd.org. +Should be reported to the author or to +.Aq net@FreeBSD.org . Copied: head/tools/tools/mcgrab/mcgrab.cc (from r204302, head/tools/tools/mctest/mcgrab.cc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/mcgrab/mcgrab.cc Thu Feb 25 14:36:50 2010 (r204310, copy of r204302, head/tools/tools/mctest/mcgrab.cc) @@ -0,0 +1,189 @@ +// +// Copyright (c) 2008, Neville-Neil Consulting +// 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. +// +// This test simply grabs N multicast addresses starting +// from a base address. The purpose is to make sure that switching a device +// from using a multicast filtering table or function to promiscuous +// multicast listening mode does not cause deleterious side effects. +// + +#include +__FBSDID("$FreeBSD$"); + +// C++ STL and other related includes +#include +#include +#include +#include +#include + +// Operating System and other C based includes +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Private include files +#include "mctest.h" + +using namespace std; + +// +// usage - just the program's usage line +// +// +void usage() +{ + cout << "mcgrab -i interface -g multicast group -n number of groups\n"; + exit(-1); +} + +// +// usage - print out the usage with a possible message and exit +// +// \param message optional string +// +// +void usage(string message) +{ + + cerr << message << endl; + usage(); +} + + +// +// grab a set of addresses +// +// @param interface ///< text name of the interface (em0 etc.) +// @param group ///< multicast group +// @param number ///< number of addresses to grab +// +// @return 0 for 0K, -1 for error, sets errno +// +void grab(char *interface, struct in_addr *group, int number) { + + + int sock; + struct ip_mreq mreq; + struct ifreq ifreq; + struct in_addr lgroup; + + if (group == NULL) { + group = &lgroup; + if (inet_pton(AF_INET, DEFAULT_GROUP, group) < 1) + return; + } + + if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { + perror("failed to open datagram socket"); + return; + } + + for (int i = 0; i < number; i++) { + bzero((struct ip_mreq *)&mreq, sizeof(mreq)); + bzero((struct ifreq *)&ifreq, sizeof(ifreq)); + + strncpy(ifreq.ifr_name, interface, IFNAMSIZ); + if (ioctl(sock, SIOCGIFADDR, &ifreq) < 0) { + perror("no such interface"); + return; + } + + memcpy(&mreq.imr_interface, + &((struct sockaddr_in*) &ifreq.ifr_addr)->sin_addr, + sizeof(struct in_addr)); + + mreq.imr_multiaddr.s_addr = group->s_addr; + if (setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, + sizeof(mreq)) < 0) { + + perror("failed to add membership"); + return; + } + + if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_IF, + &((struct sockaddr_in *) &ifreq.ifr_addr)->sin_addr, + sizeof(struct in_addr)) < 0) { + perror("failed to bind interface"); + return; + } + + group->s_addr = htonl(ntohl(group->s_addr) + 1); + } + printf("Press Control-C to exit.\n"); + sleep(INT_MAX); + +} + + +// +// main - the main program +// +// \param -g multicast group address which we will hold +// \param -i interface on which we're holding the address +// +// +int main(int argc, char**argv) +{ + + char ch; ///< character from getopt() + extern char* optarg; ///< option argument + + char* interface = 0; ///< Name of the interface + struct in_addr *group = NULL; ///< the multicast group address + int number = 0; ///< Number of addresses to grab + + if (argc != 7) + usage(); + + while ((ch = getopt(argc, argv, "g:i:n:h")) != -1) { + switch (ch) { + case 'g': + group = new (struct in_addr ); + if (inet_pton(AF_INET, optarg, group) < 1) + usage(argv[0] + string(" Error: invalid multicast group") + + optarg); + break; + case 'i': + interface = optarg; + break; + case 'n': + number = atoi(optarg); + break; + case 'h': + usage(string("Help\n")); + break; + } + } + + grab(interface, group, number); + +} Modified: head/tools/tools/mctest/Makefile ============================================================================== --- head/tools/tools/mctest/Makefile Thu Feb 25 14:13:39 2010 (r204309) +++ head/tools/tools/mctest/Makefile Thu Feb 25 14:36:50 2010 (r204310) @@ -1,11 +1,7 @@ -# # $FreeBSD$ -# -# A Makefile that builds both the mctest program and its manual page. PROG_CXX= mctest -PROG_CXX= mcgrab - -LDADD+= -lpthread +DPADD= ${LIBPTHREAD} +LDADD= -lpthread .include Modified: head/tools/tools/mctest/mctest.1 ============================================================================== --- head/tools/tools/mctest/mctest.1 Thu Feb 25 14:13:39 2010 (r204309) +++ head/tools/tools/mctest/mctest.1 Thu Feb 25 14:36:50 2010 (r204310) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd April 3, 2008 -.Dt mctest 1 +.Dt MCTEST 1 .Os .Sh NAME .Nm mctest @@ -40,29 +40,34 @@ .Op Fl t Ar inter-packet gap .Op Fl M Ar number of clients (source only) .Op Fl m Ar my client number (sink only) -.Op Fl r +.Op Fl r .Sh DESCRIPTION -The +The .Nm -command implements a multicast test which involved a source -and a sink. The source sends packets to a pre-configured -multicast address over the interface given as a command line -argument. The sink listens for multicast packets, records -the time at which they're received and then reflects them back -over unicast to the source. When the source has captured all +command implements a multicast test which involves a source +and a sink. +The source sends packets to a pre-configured +multicast address over the interface given as a command line +argument. +The sink listens for multicast packets, records +the time at which they are received and then reflects them back +over unicast to the source. +When the source has captured all the reflected packets it prints out the round trip time of each. .Pp The source prints out the round trip time of packets sent to the -sinks. The sink prints out the time between the packets received. +sinks. +The sink prints out the time between the packets received. .Pp The options are as follows: -.Bl -tag -width ".Fl d Ar argument" +.Bl -tag -width ".Fl i Ar interface" .It Fl i Ar interface -Network interface, which can be found with ifconfig(1). +Network interface, which can be found with +.Xr ifconfig 8 . .It Fl g Ar group -Multicast group +Multicast group. .It Fl b Ar base port -Port on which to listen +Port on which to listen. .It Fl s Ar size Packet size in bytes. .It Fl n Ar number @@ -70,14 +75,15 @@ Number of packets. .It Fl t Ar gap Inter-packet gap in nanoseconds. .It Fl M Ar clients -The number of clients that are listening +The number of clients that are listening. .It Fl m Ar my number The client's number 0, 1, etc. .It Fl r This version of .Nm -is the receiver aka the sink. This option MUST -only be used with one copy of the program at a time. +is the receiver aka the sink. +This option MUST +only be used with one copy of the program at a time. .El .Sh EXAMPLES The following is an example of a typical usage @@ -92,14 +98,15 @@ Sink .Pp Send 100 packets of 1024 bytes, with an inter-packet gap of 1 nanosecond. .Pp -Gaps are measured with +Gaps are measured with .Xr nanosleep 2 , and so are not accurate down to nanoseconds -but depend on the setting of kern.hz. +but depend on the setting of +.Va kern.hz . .Sh SEE ALSO -.Xr ifconfig 8 , .Xr netstat 1 , -.Xr nanosleep 2 . +.Xr nanosleep 2 , +.Xr ifconfig 8 .Sh HISTORY The .Nm @@ -110,4 +117,5 @@ This manual page was written by .An George V. Neville-Neil Aq gnn@FreeBSD.org . .Sh BUGS -Should be reported to the author or to net@freebsd.org. +Should be reported to the author or to +.Aq net@FreeBSD.org . From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 14:42:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F534106566B; Thu, 25 Feb 2010 14:42:28 +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 7B9BB8FC12; Thu, 25 Feb 2010 14:42:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1PEgSJA040452; Thu, 25 Feb 2010 14:42:28 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PEgRui040427; Thu, 25 Feb 2010 14:42:27 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201002251442.o1PEgRui040427@svn.freebsd.org> From: Ruslan Ermilov Date: Thu, 25 Feb 2010 14:42: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: r204311 - in head: share/mk tools/regression/file/closefrom tools/regression/file/flock tools/regression/gaithrstress tools/regression/kgssapi tools/regression/mqueue/mqtest1 tools/regr... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 14:42:28 -0000 Author: ru Date: Thu Feb 25 14:42:26 2010 New Revision: 204311 URL: http://svn.freebsd.org/changeset/base/204311 Log: Fixed missing or broken library dependencies. Modified: head/share/mk/bsd.libnames.mk head/tools/regression/file/closefrom/Makefile head/tools/regression/file/flock/Makefile head/tools/regression/gaithrstress/Makefile head/tools/regression/kgssapi/Makefile head/tools/regression/mqueue/mqtest1/Makefile head/tools/regression/mqueue/mqtest2/Makefile head/tools/regression/mqueue/mqtest3/Makefile head/tools/regression/mqueue/mqtest4/Makefile head/tools/regression/mqueue/mqtest5/Makefile head/tools/regression/netipx/ipxdgramloopback/Makefile head/tools/regression/netipx/spxabort/Makefile head/tools/regression/netipx/spxloopback/Makefile head/tools/regression/pthread/cv_cancel1/Makefile head/tools/regression/pthread/mutex_isowned_np/Makefile head/tools/regression/rpcsec_gss/Makefile head/tools/regression/sigqueue/sigqtest1/Makefile head/tools/regression/sigqueue/sigqtest2/Makefile head/tools/regression/sockets/sendfile/Makefile head/tools/regression/tls/libxx/Makefile head/tools/regression/tls/libyy/Makefile head/tools/regression/tls/ttls1/Makefile head/tools/regression/tls/ttls2/Makefile head/tools/regression/tls/ttls4/Makefile head/tools/tools/ether_reflect/Makefile head/tools/tools/net80211/stumbler/Makefile head/tools/tools/net80211/w00t/Makefile.inc Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Thu Feb 25 14:36:50 2010 (r204310) +++ head/share/mk/bsd.libnames.mk Thu Feb 25 14:42:26 2010 (r204311) @@ -135,6 +135,8 @@ LIBRADIUS?= ${DESTDIR}${LIBDIR}/libradiu LIBREADLINE?= ${DESTDIR}${LIBDIR}/libreadline.a LIBROKEN?= ${DESTDIR}${LIBDIR}/libroken.a LIBRPCSVC?= ${DESTDIR}${LIBDIR}/librpcsvc.a +LIBRPCSEC_GSS?= ${DESTDIR}${LIBDIR}/librpcsec_gss.a +LIBRT?= ${DESTDIR}${LIBDIR}/librt.a LIBSBUF?= ${DESTDIR}${LIBDIR}/libsbuf.a LIBSDP?= ${DESTDIR}${LIBDIR}/libsdp.a LIBSMB?= ${DESTDIR}${LIBDIR}/libsmb.a Modified: head/tools/regression/file/closefrom/Makefile ============================================================================== --- head/tools/regression/file/closefrom/Makefile Thu Feb 25 14:36:50 2010 (r204310) +++ head/tools/regression/file/closefrom/Makefile Thu Feb 25 14:42:26 2010 (r204311) @@ -3,7 +3,7 @@ PROG= closefrom MAN= WARNS?= 6 - +DPADD= ${LIBUTIL} LDADD= -lutil .include Modified: head/tools/regression/file/flock/Makefile ============================================================================== --- head/tools/regression/file/flock/Makefile Thu Feb 25 14:36:50 2010 (r204310) +++ head/tools/regression/file/flock/Makefile Thu Feb 25 14:42:26 2010 (r204311) @@ -3,7 +3,7 @@ PROG= flock NO_MAN= WARNS?= 6 - -LDADD+= -lpthread +DPADD= ${LIBPTHREAD} +LDADD= -lpthread .include Modified: head/tools/regression/gaithrstress/Makefile ============================================================================== --- head/tools/regression/gaithrstress/Makefile Thu Feb 25 14:36:50 2010 (r204310) +++ head/tools/regression/gaithrstress/Makefile Thu Feb 25 14:42:26 2010 (r204311) @@ -1,7 +1,8 @@ # $FreeBSD$ PROG= gaithrstress -LDADD+= -pthread +DPADD= ${LIBPTHREAD} +LDADD= -lpthread NO_MAN= .include Modified: head/tools/regression/kgssapi/Makefile ============================================================================== --- head/tools/regression/kgssapi/Makefile Thu Feb 25 14:36:50 2010 (r204310) +++ head/tools/regression/kgssapi/Makefile Thu Feb 25 14:42:26 2010 (r204311) @@ -3,6 +3,7 @@ PROG= gsstest NO_MAN= WARNS?= 2 +DPADD= ${LIBGSSAPI} ${LIBGSSAPI_KRB5} LDADD= -lgssapi -lgssapi_krb5 DEBUG_FLAGS= -g -O0 Modified: head/tools/regression/mqueue/mqtest1/Makefile ============================================================================== --- head/tools/regression/mqueue/mqtest1/Makefile Thu Feb 25 14:36:50 2010 (r204310) +++ head/tools/regression/mqueue/mqtest1/Makefile Thu Feb 25 14:42:26 2010 (r204311) @@ -1,7 +1,8 @@ # $FreeBSD$ PROG=mqtest1 -LDADD+=-lrt +DPADD= ${LIBRT} +LDADD= -lrt NO_MAN= DEBUG_FLAGS=-g Modified: head/tools/regression/mqueue/mqtest2/Makefile ============================================================================== --- head/tools/regression/mqueue/mqtest2/Makefile Thu Feb 25 14:36:50 2010 (r204310) +++ head/tools/regression/mqueue/mqtest2/Makefile Thu Feb 25 14:42:26 2010 (r204311) @@ -1,7 +1,8 @@ # $FreeBSD$ PROG=mqtest2 -LDADD+=-lrt +DPADD= ${LIBRT} +LDADD= -lrt NO_MAN= DEBUG_FLAGS=-g Modified: head/tools/regression/mqueue/mqtest3/Makefile ============================================================================== --- head/tools/regression/mqueue/mqtest3/Makefile Thu Feb 25 14:36:50 2010 (r204310) +++ head/tools/regression/mqueue/mqtest3/Makefile Thu Feb 25 14:42:26 2010 (r204311) @@ -1,7 +1,8 @@ # $FreeBSD$ PROG=mqtest3 -LDADD+=-lrt +DPADD= ${LIBRT} +LDADD= -lrt NO_MAN= DEBUG_FLAGS=-g Modified: head/tools/regression/mqueue/mqtest4/Makefile ============================================================================== --- head/tools/regression/mqueue/mqtest4/Makefile Thu Feb 25 14:36:50 2010 (r204310) +++ head/tools/regression/mqueue/mqtest4/Makefile Thu Feb 25 14:42:26 2010 (r204311) @@ -1,7 +1,8 @@ # $FreeBSD$ PROG=mqtest4 -LDADD+=-lrt +DPADD= ${LIBRT} +LDADD= -lrt NO_MAN= DEBUG_FLAGS=-g Modified: head/tools/regression/mqueue/mqtest5/Makefile ============================================================================== --- head/tools/regression/mqueue/mqtest5/Makefile Thu Feb 25 14:36:50 2010 (r204310) +++ head/tools/regression/mqueue/mqtest5/Makefile Thu Feb 25 14:42:26 2010 (r204311) @@ -1,7 +1,8 @@ # $FreeBSD$ PROG=mqtest5 -LDADD+=-lrt +DPADD= ${LIBRT} +LDADD= -lrt NO_MAN= DEBUG_FLAGS=-g Modified: head/tools/regression/netipx/ipxdgramloopback/Makefile ============================================================================== --- head/tools/regression/netipx/ipxdgramloopback/Makefile Thu Feb 25 14:36:50 2010 (r204310) +++ head/tools/regression/netipx/ipxdgramloopback/Makefile Thu Feb 25 14:42:26 2010 (r204311) @@ -5,7 +5,7 @@ PROG= ipxdgramloopback NO_MAN= -DPADD= ${LIBIPX}; +DPADD= ${LIBIPX} LDADD= -lipx WARNS?= 3 Modified: head/tools/regression/netipx/spxabort/Makefile ============================================================================== --- head/tools/regression/netipx/spxabort/Makefile Thu Feb 25 14:36:50 2010 (r204310) +++ head/tools/regression/netipx/spxabort/Makefile Thu Feb 25 14:42:26 2010 (r204311) @@ -5,7 +5,7 @@ PROG= spxabort NO_MAN= -DPADD= ${LIBIPX}; +DPADD= ${LIBIPX} LDADD= -lipx WARNS?= 3 Modified: head/tools/regression/netipx/spxloopback/Makefile ============================================================================== --- head/tools/regression/netipx/spxloopback/Makefile Thu Feb 25 14:36:50 2010 (r204310) +++ head/tools/regression/netipx/spxloopback/Makefile Thu Feb 25 14:42:26 2010 (r204311) @@ -5,7 +5,7 @@ PROG= spxloopback NO_MAN= -DPADD= ${LIBIPX}; +DPADD= ${LIBIPX} LDADD= -lipx WARNS?= 3 Modified: head/tools/regression/pthread/cv_cancel1/Makefile ============================================================================== --- head/tools/regression/pthread/cv_cancel1/Makefile Thu Feb 25 14:36:50 2010 (r204310) +++ head/tools/regression/pthread/cv_cancel1/Makefile Thu Feb 25 14:42:26 2010 (r204311) @@ -2,7 +2,7 @@ PROG= cv_cancel1 NO_MAN= - +DPADD= ${LIBPTHREAD} LDADD= -lpthread .include Modified: head/tools/regression/pthread/mutex_isowned_np/Makefile ============================================================================== --- head/tools/regression/pthread/mutex_isowned_np/Makefile Thu Feb 25 14:36:50 2010 (r204310) +++ head/tools/regression/pthread/mutex_isowned_np/Makefile Thu Feb 25 14:42:26 2010 (r204311) @@ -2,7 +2,7 @@ PROG= mutex_isowned_np NO_MAN= - +DPADD= ${LIBPTHREAD} LDADD= -lpthread .include Modified: head/tools/regression/rpcsec_gss/Makefile ============================================================================== --- head/tools/regression/rpcsec_gss/Makefile Thu Feb 25 14:36:50 2010 (r204310) +++ head/tools/regression/rpcsec_gss/Makefile Thu Feb 25 14:42:26 2010 (r204311) @@ -3,6 +3,7 @@ PROG= rpctest NO_MAN= WARNS?= 6 +DPADD= ${LIBRPCSEC_GSS} LDADD= -lrpcsec_gss DEBUG_FLAGS= -g -O0 Modified: head/tools/regression/sigqueue/sigqtest1/Makefile ============================================================================== --- head/tools/regression/sigqueue/sigqtest1/Makefile Thu Feb 25 14:36:50 2010 (r204310) +++ head/tools/regression/sigqueue/sigqtest1/Makefile Thu Feb 25 14:42:26 2010 (r204311) @@ -1,7 +1,6 @@ # $FreeBSD$ PROG=sigqtest1 -LDADD+= NO_MAN= DEBUG_FLAGS=-g Modified: head/tools/regression/sigqueue/sigqtest2/Makefile ============================================================================== --- head/tools/regression/sigqueue/sigqtest2/Makefile Thu Feb 25 14:36:50 2010 (r204310) +++ head/tools/regression/sigqueue/sigqtest2/Makefile Thu Feb 25 14:42:26 2010 (r204311) @@ -1,7 +1,6 @@ # $FreeBSD$ PROG=sigqtest2 -LDADD+= NO_MAN= DEBUG_FLAGS=-g Modified: head/tools/regression/sockets/sendfile/Makefile ============================================================================== --- head/tools/regression/sockets/sendfile/Makefile Thu Feb 25 14:36:50 2010 (r204310) +++ head/tools/regression/sockets/sendfile/Makefile Thu Feb 25 14:42:26 2010 (r204311) @@ -5,6 +5,7 @@ PROG= sendfile NO_MAN= WARNS?= 6 -LDADD = -lmd +DPADD= ${LIBMD} +LDADD= -lmd .include Modified: head/tools/regression/tls/libxx/Makefile ============================================================================== --- head/tools/regression/tls/libxx/Makefile Thu Feb 25 14:36:50 2010 (r204310) +++ head/tools/regression/tls/libxx/Makefile Thu Feb 25 14:42:26 2010 (r204311) @@ -1,7 +1,6 @@ # $FreeBSD$ -LIB= xx -SHLIB_MAJOR= 1 +SHLIB_NAME= libxx.so SRCS= xx.c #CFLAGS+=-mtls-dialect=sun Modified: head/tools/regression/tls/libyy/Makefile ============================================================================== --- head/tools/regression/tls/libyy/Makefile Thu Feb 25 14:36:50 2010 (r204310) +++ head/tools/regression/tls/libyy/Makefile Thu Feb 25 14:42:26 2010 (r204311) @@ -1,7 +1,6 @@ # $FreeBSD$ -LIB= yy -SHLIB_MAJOR= 1 +SHLIB_NAME= libyy.so SRCS= yy.c CFLAGS+=-fpic Modified: head/tools/regression/tls/ttls1/Makefile ============================================================================== --- head/tools/regression/tls/ttls1/Makefile Thu Feb 25 14:36:50 2010 (r204310) +++ head/tools/regression/tls/ttls1/Makefile Thu Feb 25 14:42:26 2010 (r204311) @@ -1,8 +1,8 @@ # $FreeBSD$ PROG= ttls1 -LDADD+= -L../libxx -lxx -Wl,--rpath=${.OBJDIR}/../libxx -LDADD+= -L../libyy -lyy -Wl,--rpath=${.OBJDIR}/../libyy +LDFLAGS+= -L../libxx -lxx -Wl,--rpath=${.OBJDIR}/../libxx +LDFLAGS+= -L../libyy -lyy -Wl,--rpath=${.OBJDIR}/../libyy NO_MAN= DEBUG_FLAGS= -g Modified: head/tools/regression/tls/ttls2/Makefile ============================================================================== --- head/tools/regression/tls/ttls2/Makefile Thu Feb 25 14:36:50 2010 (r204310) +++ head/tools/regression/tls/ttls2/Makefile Thu Feb 25 14:42:26 2010 (r204311) @@ -1,7 +1,8 @@ # $FreeBSD$ PROG= ttls2 -LDADD+= -lpthread +DPADD= ${LIBPTHREAD} +LDADD= -lpthread NO_MAN= DEBUG_FLAGS= -g Modified: head/tools/regression/tls/ttls4/Makefile ============================================================================== --- head/tools/regression/tls/ttls4/Makefile Thu Feb 25 14:36:50 2010 (r204310) +++ head/tools/regression/tls/ttls4/Makefile Thu Feb 25 14:42:26 2010 (r204311) @@ -1,7 +1,8 @@ # $FreeBSD$ PROG= ttls4 -LDADD+= -lpthread +DPADD= ${LIBPTHREAD} +LDADD= -lpthread NO_MAN= DEBUG_FLAGS= -g Modified: head/tools/tools/ether_reflect/Makefile ============================================================================== --- head/tools/tools/ether_reflect/Makefile Thu Feb 25 14:36:50 2010 (r204310) +++ head/tools/tools/ether_reflect/Makefile Thu Feb 25 14:42:26 2010 (r204311) @@ -4,7 +4,7 @@ # A Makefile that builds both the ether_reflect program and its manual page. PROG= ether_reflect - -LDADD+= -lpcap +DPADD= ${LIBPCAP} +LDADD= -lpcap .include Modified: head/tools/tools/net80211/stumbler/Makefile ============================================================================== --- head/tools/tools/net80211/stumbler/Makefile Thu Feb 25 14:36:50 2010 (r204310) +++ head/tools/tools/net80211/stumbler/Makefile Thu Feb 25 14:42:26 2010 (r204311) @@ -2,7 +2,7 @@ PROG= stumbler BINDIR= /usr/local/bin -DPADD= ${LIBPCAP} +DPADD= ${LIBPCAP} ${LIBNCURSES} LDADD= -lpcap -lncurses CFLAGS=-g NO_MAN= Modified: head/tools/tools/net80211/w00t/Makefile.inc ============================================================================== --- head/tools/tools/net80211/w00t/Makefile.inc Thu Feb 25 14:36:50 2010 (r204310) +++ head/tools/tools/net80211/w00t/Makefile.inc Thu Feb 25 14:42:26 2010 (r204311) @@ -3,7 +3,8 @@ W00T= ../libw00t # NB: we get crc32 from -lz DPADD= ${W00T}/libw00t.a ${LIBCRYPTO} ${LIBZ} -LDADD= -L${W00T} -lw00t -lcrypto -lz +LDFLAGS= -L${W00T} +LDADD= -lw00t -lcrypto -lz BINDIR= /usr/local/bin CFLAGS= -g -I${W00T} From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 14:51:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 696FD106564A; Thu, 25 Feb 2010 14:51:07 +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 5848E8FC1B; Thu, 25 Feb 2010 14:51:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1PEp7fr042501; Thu, 25 Feb 2010 14:51:07 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PEp6iE042500; Thu, 25 Feb 2010 14:51:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201002251451.o1PEp6iE042500@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 25 Feb 2010 14:51: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: r204312 - head/sys/powerpc/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 14:51:07 -0000 Author: nwhitehorn Date: Thu Feb 25 14:51:06 2010 New Revision: 204312 URL: http://svn.freebsd.org/changeset/base/204312 Log: Fix another bug involving /dev/mem and the OEA64 scratchpage. When the scratchpage is updated, the PVO's physical address is updated as well. This makes pmap_extract() begin returning non-zero values again, causing the panic partially fixed in r204297. Fix this by excluding addresses beyond virtual_end from consideration as KVA addresses, instead of allowing addresses up to VM_MAX_KERNEL_ADDRESS. Modified: head/sys/powerpc/powerpc/mem.c Modified: head/sys/powerpc/powerpc/mem.c ============================================================================== --- head/sys/powerpc/powerpc/mem.c Thu Feb 25 14:42:26 2010 (r204311) +++ head/sys/powerpc/powerpc/mem.c Thu Feb 25 14:51:06 2010 (r204312) @@ -121,8 +121,7 @@ kmem_direct_mapped: v = uio->uio_offset; else if (dev2unit(dev) == CDEV_MINOR_KMEM) { va = uio->uio_offset; - if ((va < VM_MIN_KERNEL_ADDRESS) - || (va > VM_MAX_KERNEL_ADDRESS)) + if ((va < VM_MIN_KERNEL_ADDRESS) || (va > virtual_end)) goto kmem_direct_mapped; va = trunc_page(uio->uio_offset); @@ -135,8 +134,7 @@ kmem_direct_mapped: v = uio->uio_offset; */ for (; va < eva; va += PAGE_SIZE) - if (pmap_extract(kernel_pmap, va) - == 0) + if (pmap_extract(kernel_pmap, va) == 0) return (EFAULT); prot = (uio->uio_rw == UIO_READ) From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 15:00:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F7D41065670; Thu, 25 Feb 2010 15:00:29 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F233E8FC2A; Thu, 25 Feb 2010 15:00:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1PF0SAq044644; Thu, 25 Feb 2010 15:00:28 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PF0RUh044643; Thu, 25 Feb 2010 15:00:27 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201002251500.o1PF0RUh044643@svn.freebsd.org> From: Attilio Rao Date: Thu, 25 Feb 2010 15:00: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: r204313 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 15:00:29 -0000 Author: attilio Date: Thu Feb 25 15:00:27 2010 New Revision: 204313 URL: http://svn.freebsd.org/changeset/base/204313 Log: Fix a mis-change about the compiling of atrtc.c. Sponsored by: Sandvine Incorporated Reported by: Giovanni Trematerra MFC: 3 weeks X-MFC: r204309 Modified: head/sys/conf/files.amd64 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Thu Feb 25 14:51:06 2010 (r204312) +++ head/sys/conf/files.amd64 Thu Feb 25 15:00:27 2010 (r204313) @@ -298,7 +298,7 @@ x86/cpufreq/est.c optional cpufreq x86/cpufreq/hwpstate.c optional cpufreq x86/cpufreq/p4tcc.c optional cpufreq x86/isa/atpic.c optional atpic isa -x86/isa/atrtc.c optional atpic +x86/isa/atrtc.c standard x86/isa/clock.c standard x86/isa/elcr.c standard x86/isa/isa.c standard From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 15:03:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEFAF106566B; Thu, 25 Feb 2010 15:03:58 +0000 (UTC) (envelope-from wilko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DDD938FC08; Thu, 25 Feb 2010 15:03:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1PF3wow045701; Thu, 25 Feb 2010 15:03:58 GMT (envelope-from wilko@svn.freebsd.org) Received: (from wilko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PF3vac045698; Thu, 25 Feb 2010 15:03:57 GMT (envelope-from wilko@svn.freebsd.org) Message-Id: <201002251503.o1PF3vac045698@svn.freebsd.org> From: Wilko Bulte Date: Thu, 25 Feb 2010 15:03: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: r204314 - head/games/fortune/datfiles X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 15:03:59 -0000 Author: wilko Date: Thu Feb 25 15:03:57 2010 New Revision: 204314 URL: http://svn.freebsd.org/changeset/base/204314 Log: On the (non)sense of legal disclaimers in emails. Modified: head/games/fortune/datfiles/fortunes Modified: head/games/fortune/datfiles/fortunes ============================================================================== --- head/games/fortune/datfiles/fortunes Thu Feb 25 15:00:27 2010 (r204313) +++ head/games/fortune/datfiles/fortunes Thu Feb 25 15:03:57 2010 (r204314) @@ -59620,3 +59620,19 @@ since I first called my brother's father Zymurgy's Law of Volunteer Labor: People are always available for work in the past tense. % +This email and any files transmitted with it are confidential and +intended solely for the use of the individual or entity to which they +are addressed. If you are not the intended recipient of this +transmission, please delete it immediately. + +Obviously, I am the idiot who sent it to you by mistake. Furthermore, +there is no way I can force you to delete it. Worse, by the time you +have reached this disclaimer you have all ready read the document. +Telling you to forget it would seem absurd. In any event, I have no +legal right to force you to take any action upon this email anyway. + +This entire disclaimer is just a waste of everyone's time and +bandwidth. Therefore, let us just forget the whole thing and enjoy a +cold beer instead. + -- found on the dovecot mailinglist +% From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 15:21:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0287106566B; Thu, 25 Feb 2010 15:21:37 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF3568FC0A; Thu, 25 Feb 2010 15:21:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1PFLbKY050089; Thu, 25 Feb 2010 15:21:37 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PFLb6K050086; Thu, 25 Feb 2010 15:21:37 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201002251521.o1PFLb6K050086@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 25 Feb 2010 15:21: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: r204315 - head/sys/boot/powerpc/uboot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 15:21:38 -0000 Author: raj Date: Thu Feb 25 15:21:37 2010 New Revision: 204315 URL: http://svn.freebsd.org/changeset/base/204315 Log: Enable U-Boot storage for PowerPC. While there fix loader(8) help file name. MFC after: 1 week Modified: head/sys/boot/powerpc/uboot/Makefile head/sys/boot/powerpc/uboot/conf.c Modified: head/sys/boot/powerpc/uboot/Makefile ============================================================================== --- head/sys/boot/powerpc/uboot/Makefile Thu Feb 25 15:03:57 2010 (r204314) +++ head/sys/boot/powerpc/uboot/Makefile Thu Feb 25 15:21:37 2010 (r204315) @@ -9,8 +9,8 @@ NO_MAN= # Architecture-specific loader code SRCS= start.S conf.c vers.c -LOADER_DISK_SUPPORT?= no -LOADER_UFS_SUPPORT?= no +LOADER_DISK_SUPPORT?= yes +LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= no LOADER_NET_SUPPORT?= yes @@ -85,11 +85,11 @@ LDADD= ${LIBFICL} ${LIBUBOOT} -lstand vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} -${PROG}.help: help.common help.uboot +loader.help: help.common help.uboot cat ${.ALLSRC} | \ awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} .PATH: ${.CURDIR}/../../forth -FILES= ${PROG}.help +FILES= loader.help .include Modified: head/sys/boot/powerpc/uboot/conf.c ============================================================================== --- head/sys/boot/powerpc/uboot/conf.c Thu Feb 25 15:03:57 2010 (r204314) +++ head/sys/boot/powerpc/uboot/conf.c Thu Feb 25 15:21:37 2010 (r204315) @@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$"); /* Exported for libstand */ struct devsw *devsw[] = { #if defined(LOADER_DISK_SUPPORT) || defined(LOADER_CD9660_SUPPORT) - &uboot_disk, + &uboot_storage, #endif #if defined(LOADER_NET_SUPPORT) &netdev, From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 15:27:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A49C3106566C; Thu, 25 Feb 2010 15:27:13 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 938FD8FC16; Thu, 25 Feb 2010 15:27:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1PFRDCR051370; Thu, 25 Feb 2010 15:27:13 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PFRDYo051368; Thu, 25 Feb 2010 15:27:13 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201002251527.o1PFRDYo051368@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 25 Feb 2010 15:27: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: r204316 - head/sys/boot/uboot/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 15:27:13 -0000 Author: raj Date: Thu Feb 25 15:27:13 2010 New Revision: 204316 URL: http://svn.freebsd.org/changeset/base/204316 Log: Let loader(8) for U-Boot use default storage more flexibly. Obtained from: Semihalf MFC after: 1 week Modified: head/sys/boot/uboot/common/main.c Modified: head/sys/boot/uboot/common/main.c ============================================================================== --- head/sys/boot/uboot/common/main.c Thu Feb 25 15:21:37 2010 (r204315) +++ head/sys/boot/uboot/common/main.c Thu Feb 25 15:27:13 2010 (r204316) @@ -117,6 +117,7 @@ main(void) { struct api_signature *sig = NULL; int i; + struct open_file f; if (!api_search_sig(&sig)) return (-1); @@ -168,18 +169,28 @@ main(void) printf("(%s, %s)\n", bootprog_maker, bootprog_date); meminfo(); - /* XXX only support netbooting for now */ - for (i = 0; devsw[i] != NULL; i++) + for (i = 0; devsw[i] != NULL; i++) { + printf("\nDevice %d: %s\n", i, devsw[i]->dv_name); + + currdev.d_dev = devsw[i]; + currdev.d_type = currdev.d_dev->dv_type; + currdev.d_unit = 0; + + if (strncmp(devsw[i]->dv_name, "disk", + strlen(devsw[i]->dv_name)) == 0) { + f.f_devdata = &currdev; + currdev.d_disk.pnum = 0; + if (devsw[i]->dv_open(&f,&currdev) == 0) + break; + } + if (strncmp(devsw[i]->dv_name, "net", strlen(devsw[i]->dv_name)) == 0) break; + } if (devsw[i] == NULL) - panic("no network devices?!"); - - currdev.d_dev = devsw[i]; - currdev.d_type = currdev.d_dev->dv_type; - currdev.d_unit = 0; + panic("No boot device found!"); env_setenv("currdev", EV_VOLATILE, uboot_fmtdev(&currdev), uboot_setcurrdev, env_nounset); From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 15:29:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABF29106567B; Thu, 25 Feb 2010 15:29:41 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B2F28FC1D; Thu, 25 Feb 2010 15:29:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1PFTfqM051964; Thu, 25 Feb 2010 15:29:41 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PFTfUJ051963; Thu, 25 Feb 2010 15:29:41 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201002251529.o1PFTfUJ051963@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 25 Feb 2010 15:29: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: r204317 - head/sys/boot/uboot/lib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 15:29:41 -0000 Author: raj Date: Thu Feb 25 15:29:41 2010 New Revision: 204317 URL: http://svn.freebsd.org/changeset/base/204317 Log: Fix handling of GPT disk partition index. Obtained from: Semihalf MFC after: 1 week Modified: head/sys/boot/uboot/lib/disk.c Modified: head/sys/boot/uboot/lib/disk.c ============================================================================== --- head/sys/boot/uboot/lib/disk.c Thu Feb 25 15:27:13 2010 (r204316) +++ head/sys/boot/uboot/lib/disk.c Thu Feb 25 15:29:41 2010 (r204317) @@ -376,6 +376,14 @@ stor_open_gpt(struct open_dev *od, struc } dev->d_disk.ptype = PTYPE_GPT; + /* + * If index of partition to open (dev->d_disk.pnum) is not defined + * we set it to the index of the first existing partition. This + * handles cases when only a disk device is specified (without full + * partition information) by the caller. + */ + if ((od->od_nparts > 0) && (dev->d_disk.pnum == 0)) + dev->d_disk.pnum = od->od_partitions[0].gp_index; for (i = 0; i < od->od_nparts; i++) if (od->od_partitions[i].gp_index == dev->d_disk.pnum) From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 15:30:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3F8F1065688; Thu, 25 Feb 2010 15:30:26 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA4F88FC44; Thu, 25 Feb 2010 15:30:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1PFUQYi052179; Thu, 25 Feb 2010 15:30:26 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PFUQpq052177; Thu, 25 Feb 2010 15:30:26 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201002251530.o1PFUQpq052177@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 25 Feb 2010 15:30: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: r204318 - head/sys/boot/uboot/lib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 15:30:27 -0000 Author: raj Date: Thu Feb 25 15:30:26 2010 New Revision: 204318 URL: http://svn.freebsd.org/changeset/base/204318 Log: Minor style correction. Modified: head/sys/boot/uboot/lib/time.c Modified: head/sys/boot/uboot/lib/time.c ============================================================================== --- head/sys/boot/uboot/lib/time.c Thu Feb 25 15:29:41 2010 (r204317) +++ head/sys/boot/uboot/lib/time.c Thu Feb 25 15:30:26 2010 (r204318) @@ -48,7 +48,7 @@ time(time_t *tloc) } int -getsecs() +getsecs(void) { return (time(NULL)); From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 15:44:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 883CB1065670; Thu, 25 Feb 2010 15:44:57 +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 777BB8FC17; Thu, 25 Feb 2010 15:44:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1PFivI6055509; Thu, 25 Feb 2010 15:44:57 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PFiuK7055508; Thu, 25 Feb 2010 15:44:56 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201002251544.o1PFiuK7055508@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 25 Feb 2010 15:44:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204319 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 15:44:57 -0000 Author: nyan Date: Thu Feb 25 15:44:54 2010 New Revision: 204319 URL: http://svn.freebsd.org/changeset/base/204319 Log: MFi386: the part of r204309 to fix pc98 kernel Introduce the new kernel sub-tree x86 which should contain all the code shared and generalized between our current amd64, i386 and pc98. Modified: head/sys/conf/files.pc98 Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Thu Feb 25 15:30:26 2010 (r204318) +++ head/sys/conf/files.pc98 Thu Feb 25 15:44:54 2010 (r204319) @@ -194,9 +194,7 @@ i386/ibcs2/ibcs2_util.c optional ibcs2 i386/ibcs2/ibcs2_xenix.c optional ibcs2 i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2 i386/ibcs2/imgact_coff.c optional ibcs2 -i386/isa/atpic.c optional atpic i386/isa/elink.c optional ep | ie -i386/isa/isa.c optional isa i386/isa/npx.c optional npx i386/isa/pmtimer.c optional pmtimer i386/isa/prof_machdep.c optional profiling-routine @@ -254,3 +252,8 @@ pc98/pc98/canbus.c optional canbus pc98/pc98/canbus_if.m optional canbus pc98/pc98/machdep.c standard pc98/pc98/pc98_machdep.c standard +# +# x86 shared code between IA32, AMD64 and PC98 architectures +# +x86/isa/atpic.c optional atpic +x86/isa/isa.c optional isa From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 15:57:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 827F81065674; Thu, 25 Feb 2010 15:57:11 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-iw0-f185.google.com (mail-iw0-f185.google.com [209.85.223.185]) by mx1.freebsd.org (Postfix) with ESMTP id 1B6948FC16; Thu, 25 Feb 2010 15:57:10 +0000 (UTC) Received: by iwn15 with SMTP id 15so5216957iwn.7 for ; Thu, 25 Feb 2010 07:57:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=gFH4iD1axC68+X2mf0owq1/brHI4GGRF2KGOJoZKcv8=; b=R7xY9xooLwJF1SpeSqPVL8vPQHRyl7B0WdKSgnxtrV2nDopeGVCgXKVOaAzSCjv6uP LT1H+qc3amkakfULKq80QfwVlLxE+VYBCoPa0GssMc6TVzyZxFp6mhNc+Ooj1vxRc1vw ZaO95cHCF04/UnVQM2OU8b4/K0PljU8YpsuPw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=FhTzE0PfL8+oiFJW+fWai2CfVdJnItbQuhvUSZBwOPgRenMMA0r7N+86GY1uW52U+L ffYsUV7g+ah+S2+1bBpBoweYsK3+J9rbGqqs+TDjfriyPsJw0MRru1CxET91Qn31/bt4 BhU2Cl3wwkssbYYUmMiKOCce8n78NcKq3nBNQ= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.231.145.5 with SMTP id b5mr243332ibv.70.1267113430530; Thu, 25 Feb 2010 07:57:10 -0800 (PST) In-Reply-To: <201002251544.o1PFiuK7055508@svn.freebsd.org> References: <201002251544.o1PFiuK7055508@svn.freebsd.org> Date: Thu, 25 Feb 2010 16:57:10 +0100 X-Google-Sender-Auth: aafa404890cc4d2e Message-ID: <3bbf2fe11002250757ic1d42f0l6a804002a7457731@mail.gmail.com> From: Attilio Rao To: Takahashi Yoshihiro Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r204319 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 15:57:11 -0000 2010/2/25 Takahashi Yoshihiro : > Author: nyan > Date: Thu Feb 25 15:44:54 2010 > New Revision: 204319 > URL: http://svn.freebsd.org/changeset/base/204319 > > Log: > =C2=A0MFi386: the part of r204309 to fix pc98 kernel > > =C2=A0 =C2=A0Introduce the new kernel sub-tree x86 which should contain a= ll the code > =C2=A0 =C2=A0shared and generalized between our current amd64, i386 and p= c98. Gosh, sorry, I meant to send you for testing before to commit but I completely forgot. Thanks, Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 19:42:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1EC7106566C; Thu, 25 Feb 2010 19:42:51 +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 C7FEC8FC31; Thu, 25 Feb 2010 19:42:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1PJgp40044424; Thu, 25 Feb 2010 19:42:51 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PJgpgX044420; Thu, 25 Feb 2010 19:42:51 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201002251942.o1PJgpgX044420@svn.freebsd.org> From: Weongyo Jeong Date: Thu, 25 Feb 2010 19:42: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: r204326 - head/sys/modules X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 19:42:52 -0000 Author: weongyo Date: Thu Feb 25 19:42:51 2010 New Revision: 204326 URL: http://svn.freebsd.org/changeset/base/204326 Log: Add bwn(4) driver to the build. Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu Feb 25 18:02:52 2010 (r204325) +++ head/sys/modules/Makefile Thu Feb 25 19:42:51 2010 (r204326) @@ -42,6 +42,7 @@ SUBDIR= ${_3dfx} \ ${_bm} \ bridgestp \ bwi \ + bwn \ cam \ ${_canbepm} \ ${_canbus} \ From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 19:43:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4C72106566C; Thu, 25 Feb 2010 19:43:22 +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 9AA008FC19; Thu, 25 Feb 2010 19:43:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1PJhM0A044904; Thu, 25 Feb 2010 19:43:22 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PJhMah044902; Thu, 25 Feb 2010 19:43:22 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201002251943.o1PJhMah044902@svn.freebsd.org> From: Weongyo Jeong Date: Thu, 25 Feb 2010 19:43: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: r204327 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 19:43:22 -0000 Author: weongyo Date: Thu Feb 25 19:43:22 2010 New Revision: 204327 URL: http://svn.freebsd.org/changeset/base/204327 Log: Connect bwn.4 to the build. Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Feb 25 19:42:51 2010 (r204326) +++ head/share/man/man4/Makefile Thu Feb 25 19:43:22 2010 (r204327) @@ -62,6 +62,7 @@ MAN= aac.4 \ bridge.4 \ bt.4 \ bwi.4 \ + bwn.4 \ cardbus.4 \ carp.4 \ cas.4 \ From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 19:47:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 626C01065670; Thu, 25 Feb 2010 19:47:48 +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 51D5E8FC1A; Thu, 25 Feb 2010 19:47:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1PJlmwd048859; Thu, 25 Feb 2010 19:47:48 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PJlmCs048856; Thu, 25 Feb 2010 19:47:48 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201002251947.o1PJlmCs048856@svn.freebsd.org> From: Weongyo Jeong Date: Thu, 25 Feb 2010 19:47: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: r204328 - in head: sys/boot/forth usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 19:47:48 -0000 Author: weongyo Date: Thu Feb 25 19:47:47 2010 New Revision: 204328 URL: http://svn.freebsd.org/changeset/base/204328 Log: Add bwn(4) driver. Modified: head/sys/boot/forth/loader.conf head/usr.sbin/sysinstall/devices.c Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Thu Feb 25 19:43:22 2010 (r204327) +++ head/sys/boot/forth/loader.conf Thu Feb 25 19:47:47 2010 (r204328) @@ -225,6 +225,7 @@ if_axe_load="NO" # ASIX Electronics AX8 if_bce_load="NO" # Broadcom NetXtreme II Gigabit Ethernet if_bfe_load="NO" # Broadcom BCM4401 if_bge_load="NO" # Broadcom BCM570x PCI Gigabit Ethernet +if_bwn_load="NO" # Broadcom BCM43xx IEEE 802.11 wireless NICs if_cas_load="NO" # Sun Cassini/Cassini+ and NS DP83065 Saturn if_cm_load="NO" # SMC (90c26, 90c56, 90c66) if_cs_load="NO" # Crystal Semiconductor CS8920 Modified: head/usr.sbin/sysinstall/devices.c ============================================================================== --- head/usr.sbin/sysinstall/devices.c Thu Feb 25 19:43:22 2010 (r204327) +++ head/usr.sbin/sysinstall/devices.c Thu Feb 25 19:47:47 2010 (r204328) @@ -105,6 +105,7 @@ static struct _devname { NETWORK("bfe", "Broadcom BCM440x PCI Ethernet card"), NETWORK("bge", "Broadcom BCM570x PCI Gigabit Ethernet card"), NETWORK("bm", "Apple BMAC Built-in Ethernet"), + NETWORK("bwn", "Broadcom BCM43xx IEEE 802.11 wireless adapter"), NETWORK("cas", "Sun Cassini/Cassini+ or NS DP83065 Saturn Ethernet"), NETWORK("cue", "CATC USB Ethernet adapter"), NETWORK("cxgb", "Chelsio T3 10Gb Ethernet card"), From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 19:51:46 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F054106564A; Thu, 25 Feb 2010 19:51:46 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw02.mail.saunalahti.fi (gw02.mail.saunalahti.fi [195.197.172.116]) by mx1.freebsd.org (Postfix) with ESMTP id 4B88D8FC25; Thu, 25 Feb 2010 19:51:46 +0000 (UTC) Received: from a91-153-117-195.elisa-laajakaista.fi (a91-153-117-195.elisa-laajakaista.fi [91.153.117.195]) by gw02.mail.saunalahti.fi (Postfix) with SMTP id C33A7139529; Thu, 25 Feb 2010 21:51:38 +0200 (EET) Date: Thu, 25 Feb 2010 21:51:38 +0200 From: Jaakko Heinonen To: Bruce Evans Message-ID: <20100225195138.GA3323@a91-153-117-195.elisa-laajakaista.fi> References: <6413.1266433105@critter.freebsd.dk> <20100218064545.J2074@besplex.bde.org> <20100218095538.GA2318@a91-153-117-195.elisa-laajakaista.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100218095538.GA2318@a91-153-117-195.elisa-laajakaista.fi> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, Poul-Henning Kamp , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r203990 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 19:51:46 -0000 On 2010-02-18, Jaakko Heinonen wrote: > > namei() returns EISDIR for "/" (due to DELETE and and the special handling > > of the degenerate case which includes "/" and not much else, else the bug > > would affect more cases). > > This causes a problem also for mkdir(2), rmdir(2) and rename(2). All of > them incorrectly return EISDIR for "/". Here is a patch which attempts to fix mkdir(2), rmdir(2), rename(2) and unlink(2) errno return value for "/". http://people.freebsd.org/~jh/patches/lookup-root.diff -- Jaakko From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 20:24:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB871106566B; Thu, 25 Feb 2010 20:24:19 +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 995038FC17; Thu, 25 Feb 2010 20:24:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1PKOJFD082594; Thu, 25 Feb 2010 20:24:19 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PKOJww082583; Thu, 25 Feb 2010 20:24:19 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201002252024.o1PKOJww082583@svn.freebsd.org> From: Ruslan Ermilov Date: Thu, 25 Feb 2010 20:24: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: r204329 - in head: lib/librt sbin/geom/class/part sbin/ifconfig sbin/ipfw usr.bin/cpio usr.bin/gcore usr.bin/systat usr.bin/tar usr.sbin/mfiutil usr.sbin/pmcstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 20:24:19 -0000 Author: ru Date: Thu Feb 25 20:24:19 2010 New Revision: 204329 URL: http://svn.freebsd.org/changeset/base/204329 Log: Fixed dependencies (make checkdpadd). Modified: head/lib/librt/Makefile head/sbin/geom/class/part/Makefile head/sbin/ifconfig/Makefile head/sbin/ipfw/Makefile head/usr.bin/cpio/Makefile head/usr.bin/gcore/Makefile head/usr.bin/systat/Makefile head/usr.bin/tar/Makefile head/usr.sbin/mfiutil/Makefile head/usr.sbin/pmcstat/Makefile Modified: head/lib/librt/Makefile ============================================================================== --- head/lib/librt/Makefile Thu Feb 25 19:47:47 2010 (r204328) +++ head/lib/librt/Makefile Thu Feb 25 20:24:19 2010 (r204329) @@ -4,7 +4,8 @@ LIB=rt SHLIB_MAJOR= 1 CFLAGS+=-I${.CURDIR}/../libc/include -I${.CURDIR} CFLAGS+=-Winline -Wall -g -LDADD+=-lpthread +DPADD= ${LIBPTHREAD} +LDADD= -lpthread WARNS?= 2 Modified: head/sbin/geom/class/part/Makefile ============================================================================== --- head/sbin/geom/class/part/Makefile Thu Feb 25 19:47:47 2010 (r204328) +++ head/sbin/geom/class/part/Makefile Thu Feb 25 20:24:19 2010 (r204329) @@ -4,6 +4,7 @@ CLASS= part +DPADD= ${LIBUTIL} LDADD= -lutil .include Modified: head/sbin/ifconfig/Makefile ============================================================================== --- head/sbin/ifconfig/Makefile Thu Feb 25 19:47:47 2010 (r204328) +++ head/sbin/ifconfig/Makefile Thu Feb 25 20:24:19 2010 (r204329) @@ -28,7 +28,7 @@ SRCS+= ifgre.c # GRE keys etc SRCS+= ifgif.c # GIF reversed header workaround SRCS+= ifieee80211.c regdomain.c # SIOC[GS]IEEE80211 support -DPADD+= ${LIBBSDXML} ${LIBSBUF} ${LIBJAIL} +DPADD+= ${LIBBSDXML} ${LIBJAIL} ${LIBSBUF} LDADD+= -lbsdxml -ljail -lsbuf SRCS+= ifcarp.c # SIOC[GS]VH support Modified: head/sbin/ipfw/Makefile ============================================================================== --- head/sbin/ipfw/Makefile Thu Feb 25 19:47:47 2010 (r204328) +++ head/sbin/ipfw/Makefile Thu Feb 25 20:24:19 2010 (r204329) @@ -3,6 +3,7 @@ PROG= ipfw SRCS= ipfw2.c dummynet.c ipv6.c main.c nat.c altq.c WARNS?= 2 +DPADD= ${LIBUTIL} LDADD= -lutil MAN= ipfw.8 Modified: head/usr.bin/cpio/Makefile ============================================================================== --- head/usr.bin/cpio/Makefile Thu Feb 25 19:47:47 2010 (r204328) +++ head/usr.bin/cpio/Makefile Thu Feb 25 20:24:19 2010 (r204329) @@ -5,7 +5,6 @@ PROG= bsdcpio BSDCPIO_VERSION_STRING=2.7.0 SRCS= cpio.c cmdline.c err.c matching.c pathmatch.c -DPADD= ${LIBARCHIVE} ${LIBZ} ${LIBBZ2} CFLAGS+= -DBSDCPIO_VERSION_STRING=\"${BSDCPIO_VERSION_STRING}\" CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\" .ifdef RELEASE_CRUNCH @@ -13,8 +12,10 @@ CFLAGS+= -DPLATFORM_CONFIG_H=\"config_fr # statically linked, cannot use -lcrypto, and are size sensitive. CFLAGS+= -DSMALLER .endif -LDADD+= -larchive -lz -lbz2 -lmd +DPADD= ${LIBARCHIVE} ${LIBZ} ${LIBBZ2} ${LIBMD} +LDADD= -larchive -lz -lbz2 -lmd .if ${MK_OPENSSL} != "no" +DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto .endif Modified: head/usr.bin/gcore/Makefile ============================================================================== --- head/usr.bin/gcore/Makefile Thu Feb 25 19:47:47 2010 (r204328) +++ head/usr.bin/gcore/Makefile Thu Feb 25 20:24:19 2010 (r204329) @@ -1,9 +1,10 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ -LDADD+= -lutil PROG= gcore SRCS= elfcore.c gcore.c +DPADD= ${LIBUTIL} +LDADD= -lutil WARNS?= 1 Modified: head/usr.bin/systat/Makefile ============================================================================== --- head/usr.bin/systat/Makefile Thu Feb 25 19:47:47 2010 (r204328) +++ head/usr.bin/systat/Makefile Thu Feb 25 20:24:19 2010 (r204329) @@ -16,7 +16,7 @@ CFLAGS+= -DINET6 WARNS?= 0 -DPADD= ${LIBCURSES} ${LIBM} ${LIBDEVSTAT} ${LIBKVM} -LDADD= -lcursesw -lm -ldevstat -lkvm +DPADD= ${LIBNCURSESW} ${LIBM} ${LIBDEVSTAT} ${LIBKVM} +LDADD= -lncursesw -lm -ldevstat -lkvm .include Modified: head/usr.bin/tar/Makefile ============================================================================== --- head/usr.bin/tar/Makefile Thu Feb 25 19:47:47 2010 (r204328) +++ head/usr.bin/tar/Makefile Thu Feb 25 20:24:19 2010 (r204329) @@ -15,9 +15,10 @@ SRCS= bsdtar.c \ tree.c \ util.c \ write.c -DPADD= ${LIBARCHIVE} ${LIBBZ2} ${LIBZ} +DPADD= ${LIBARCHIVE} ${LIBBZ2} ${LIBZ} ${LIBMD} LDADD= -larchive -lbz2 -lz -lmd .if ${MK_OPENSSL} != "no" +DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto .endif CFLAGS+= -DBSDTAR_VERSION_STRING=\"${BSDTAR_VERSION_STRING}\" Modified: head/usr.sbin/mfiutil/Makefile ============================================================================== --- head/usr.sbin/mfiutil/Makefile Thu Feb 25 19:47:47 2010 (r204328) +++ head/usr.sbin/mfiutil/Makefile Thu Feb 25 20:24:19 2010 (r204329) @@ -8,6 +8,7 @@ MAN8= mfiutil.8 CFLAGS+= -fno-builtin-strftime WARNS?=3 +DPADD= ${LIBUTIL} LDADD= -lutil # Here be dragons Modified: head/usr.sbin/pmcstat/Makefile ============================================================================== --- head/usr.sbin/pmcstat/Makefile Thu Feb 25 19:47:47 2010 (r204328) +++ head/usr.sbin/pmcstat/Makefile Thu Feb 25 20:24:19 2010 (r204329) @@ -5,7 +5,7 @@ PROG= pmcstat MAN= pmcstat.8 -DPADD= ${LIBELF} ${LIBKVM} ${LIBPMC} ${LIBM} +DPADD= ${LIBELF} ${LIBKVM} ${LIBPMC} ${LIBM} ${LIBNCURSES} LDADD= -lelf -lkvm -lpmc -lm -lncurses SRCS= pmcstat.c pmcstat.h pmcstat_log.c \ From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 21:10:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49237106564A; Thu, 25 Feb 2010 21:10:28 +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 384BF8FC20; Thu, 25 Feb 2010 21:10:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1PLASDT025420; Thu, 25 Feb 2010 21:10:28 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PLASfh025417; Thu, 25 Feb 2010 21:10:28 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201002252110.o1PLASfh025417@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 25 Feb 2010 21:10: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: r204332 - in head: contrib/tzcode/zic usr.sbin/zic usr.sbin/zic/zdump usr.sbin/zic/zic X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 21:10:28 -0000 Author: edwin Date: Thu Feb 25 21:10:27 2010 New Revision: 204332 URL: http://svn.freebsd.org/changeset/base/204332 Log: From contrib/tzcode: The Makefiles are leftovers from the copies and should live in usr.sbin/zic/* From usr.sbin/zic: The sources are from a vendor contributed source, therefore should live in contrib/tzcode/zic. Deleted: head/contrib/tzcode/zic/Makefile head/contrib/tzcode/zic/Makefile.inc head/usr.sbin/zic/Theory head/usr.sbin/zic/ialloc.c head/usr.sbin/zic/private.h head/usr.sbin/zic/scheck.c head/usr.sbin/zic/zdump.8 head/usr.sbin/zic/zdump.c head/usr.sbin/zic/zic.8 head/usr.sbin/zic/zic.c Modified: head/usr.sbin/zic/zdump/Makefile head/usr.sbin/zic/zic/Makefile Modified: head/usr.sbin/zic/zdump/Makefile ============================================================================== --- head/usr.sbin/zic/zdump/Makefile Thu Feb 25 20:54:54 2010 (r204331) +++ head/usr.sbin/zic/zdump/Makefile Thu Feb 25 21:10:27 2010 (r204332) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/.. +.PATH: ${.CURDIR}/../../../contrib/tzcode/zic PROG= zdump MAN= zdump.8 Modified: head/usr.sbin/zic/zic/Makefile ============================================================================== --- head/usr.sbin/zic/zic/Makefile Thu Feb 25 20:54:54 2010 (r204331) +++ head/usr.sbin/zic/zic/Makefile Thu Feb 25 21:10:27 2010 (r204332) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/.. +.PATH: ${.CURDIR}/../../../contrib/tzcode/zic PROG= zic MAN= zic.8 From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 21:21:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6903F106564A; Thu, 25 Feb 2010 21:21:35 +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 3F1028FC12; Thu, 25 Feb 2010 21:21:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1PLLZpK035473; Thu, 25 Feb 2010 21:21:35 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PLLZcU035472; Thu, 25 Feb 2010 21:21:35 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201002252121.o1PLLZcU035472@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 25 Feb 2010 21:21: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: r204333 - head/contrib/tzcode/stdtime X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 21:21:35 -0000 Author: edwin Date: Thu Feb 25 21:21:34 2010 New Revision: 204333 URL: http://svn.freebsd.org/changeset/base/204333 Log: Copy lib/libc/stdtime to contrib/tzcode/stdtime for the proper split of contributed code and FreeBSD specific code. Added: - copied from r204332, head/lib/libc/stdtime/ Directory Properties: head/contrib/tzcode/stdtime/ (props changed) From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 21:26:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0D2C106564A; Thu, 25 Feb 2010 21:26:50 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D12AF8FC0A; Thu, 25 Feb 2010 21:26:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1PLQoZp040495; Thu, 25 Feb 2010 21:26:50 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PLQolo040493; Thu, 25 Feb 2010 21:26:50 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201002252126.o1PLQolo040493@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Thu, 25 Feb 2010 21:26: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: r204334 - head/secure/libexec/sftp-server X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 21:26:51 -0000 Author: des Date: Thu Feb 25 21:26:50 2010 New Revision: 204334 URL: http://svn.freebsd.org/changeset/base/204334 Log: Remove -static; it was a failed experiment that got committed by accident. Modified: head/secure/libexec/sftp-server/Makefile Modified: head/secure/libexec/sftp-server/Makefile ============================================================================== --- head/secure/libexec/sftp-server/Makefile Thu Feb 25 21:21:34 2010 (r204333) +++ head/secure/libexec/sftp-server/Makefile Thu Feb 25 21:26:50 2010 (r204334) @@ -5,8 +5,11 @@ SRCS= sftp-server.c sftp-common.c sftp MAN= sftp-server.8 CFLAGS+=-I${SSHDIR} -include ssh_namespace.h +# required when linking with a dynamic libssh +SRCS+= roaming_dummy.c + DPADD= ${LIBSSH} ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ} -LDADD= -lcrypt -lcrypto -lz -static -lssh +LDADD= -lcrypt -lcrypto -lz -lssh .include From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 21:29:00 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AF3A1065673; Thu, 25 Feb 2010 21:29:00 +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 891C48FC14; Thu, 25 Feb 2010 21:29:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1PLT0Tc042636; Thu, 25 Feb 2010 21:29:00 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PLT087042630; Thu, 25 Feb 2010 21:29:00 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201002252129.o1PLT087042630@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 25 Feb 2010 21:29: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: r204335 - in head: . gnu/usr.bin/gdb gnu/usr.bin/gdb/gdbserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 21:29:00 -0000 Author: jkim Date: Thu Feb 25 21:29:00 2010 New Revision: 204335 URL: http://svn.freebsd.org/changeset/base/204335 Log: Initial gdbserver support for amd64. Added: head/gnu/usr.bin/gdb/gdbserver/fbsd-amd64-low.c (contents, props changed) head/gnu/usr.bin/gdb/gdbserver/reg-x86-64.c (contents, props changed) Modified: head/ObsoleteFiles.inc head/gnu/usr.bin/gdb/Makefile head/gnu/usr.bin/gdb/gdbserver/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Feb 25 21:26:50 2010 (r204334) +++ head/ObsoleteFiles.inc Thu Feb 25 21:29:00 2010 (r204335) @@ -2275,7 +2275,7 @@ OLD_FILES+=usr/lib/libpam_ssh.a OLD_FILES+=usr/lib/libpam_ssh_p.a OLD_FILES+=usr/bin/help OLD_FILES+=usr/bin/sccs -.if ${TARGET_ARCH} != "arm" && ${TARGET_ARCH} != "i386" && ${TARGET_ARCH} != "powerpc" +.if ${TARGET_ARCH} != "amd64" && ${TARGET_ARCH} != "arm" && ${TARGET_ARCH} != "i386" && ${TARGET_ARCH} != "powerpc" OLD_FILES+=usr/bin/gdbserver .endif OLD_FILES+=usr/bin/ssh-keysign Modified: head/gnu/usr.bin/gdb/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/Makefile Thu Feb 25 21:26:50 2010 (r204334) +++ head/gnu/usr.bin/gdb/Makefile Thu Feb 25 21:29:00 2010 (r204335) @@ -2,7 +2,7 @@ SUBDIR= doc libgdb gdb gdbtui kgdb -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "powerpc" +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" SUBDIR+=gdbserver .endif Modified: head/gnu/usr.bin/gdb/gdbserver/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/gdbserver/Makefile Thu Feb 25 21:26:50 2010 (r204334) +++ head/gnu/usr.bin/gdb/gdbserver/Makefile Thu Feb 25 21:29:00 2010 (r204335) @@ -14,14 +14,18 @@ SRCS= inferiors.c mem-break.c regcache.c server.c signals.c target.c utils.c SRCS+= fbsd-low.c -.if ${MACHINE_ARCH} == "i386" -SRCS+= fbsd-i386-low.c i387-fp.c reg-i386.c +.if ${MACHINE_ARCH} == "amd64" +SRCS+= fbsd-amd64-low.c i387-fp.c reg-x86-64.c .endif .if ${MACHINE_ARCH} == "arm" SRCS+= fbsd-arm-low.c reg-arm.c .endif +.if ${MACHINE_ARCH} == "i386" +SRCS+= fbsd-i386-low.c i387-fp.c reg-i386.c +.endif + .if ${MACHINE_ARCH} == "powerpc" SRCS+= fbsd-ppc-low.c reg-ppc.c .endif Added: head/gnu/usr.bin/gdb/gdbserver/fbsd-amd64-low.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/gnu/usr.bin/gdb/gdbserver/fbsd-amd64-low.c Thu Feb 25 21:29:00 2010 (r204335) @@ -0,0 +1,213 @@ +/* GNU/FreeBSD/amd64 specific low level interface, for the remote server for GDB. + Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002 + Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +__FBSDID("$FreeBSD$"); + +#include "server.h" +#include "fbsd-low.h" +#include "i387-fp.h" + +#include +#include +#include +#include + +/* Mapping between the general-purpose registers in `struct user' + format and GDB's register array layout. */ +static int amd64_regmap[] = { + offsetof(struct reg, r_rax), + offsetof(struct reg, r_rbx), + offsetof(struct reg, r_rcx), + offsetof(struct reg, r_rdx), + offsetof(struct reg, r_rsi), + offsetof(struct reg, r_rdi), + offsetof(struct reg, r_rbp), + offsetof(struct reg, r_rsp), + offsetof(struct reg, r_r8), + offsetof(struct reg, r_r9), + offsetof(struct reg, r_r10), + offsetof(struct reg, r_r11), + offsetof(struct reg, r_r12), + offsetof(struct reg, r_r13), + offsetof(struct reg, r_r14), + offsetof(struct reg, r_r15), + offsetof(struct reg, r_rip), + offsetof(struct reg, r_rflags), /* XXX 64-bit */ + offsetof(struct reg, r_cs), + offsetof(struct reg, r_ss), + offsetof(struct reg, r_ds), + offsetof(struct reg, r_es), + offsetof(struct reg, r_fs), + offsetof(struct reg, r_gs), +}; +#define AMD64_NUM_REGS (sizeof(amd64_regmap) / sizeof(amd64_regmap[0])) + +static const char amd64_breakpoint[] = { 0xCC }; +#define AMD64_BP_LEN 1 + +extern int debug_threads; + +static int +amd64_cannot_store_register(int regno) +{ + + return (regno >= AMD64_NUM_REGS); +} + +static int +amd64_cannot_fetch_register(int regno) +{ + + return (regno >= AMD64_NUM_REGS); +} + +static void +amd64_fill_gregset(void *buf) +{ + int i; + + for (i = 0; i < AMD64_NUM_REGS; i++) + collect_register(i, ((char *)buf) + amd64_regmap[i]); +} + +static void +amd64_store_gregset(const void *buf) +{ + int i; + + for (i = 0; i < AMD64_NUM_REGS; i++) + supply_register(i, ((char *)buf) + amd64_regmap[i]); +} + +static void +amd64_fill_fpregset(void *buf) +{ + + i387_cache_to_fsave(buf); +} + +static void +amd64_store_fpregset(const void *buf) +{ + + i387_fsave_to_cache(buf); +} + +static void +amd64_fill_fpxregset(void *buf) +{ + + i387_cache_to_fxsave(buf); +} + +static void +amd64_store_fpxregset(const void *buf) +{ + + i387_fxsave_to_cache(buf); +} + + +struct regset_info target_regsets[] = { + { + PT_GETREGS, + PT_SETREGS, + sizeof(struct reg), + GENERAL_REGS, + amd64_fill_gregset, + amd64_store_gregset, + }, +#ifdef HAVE_PTRACE_GETFPXREGS + { + PTRACE_GETFPXREGS, + PTRACE_SETFPXREGS, + sizeof(elf_fpxregset_t), + EXTENDED_REGS, + amd64_fill_fpxregset, + amd64_store_fpxregset, + }, +#endif + { + PT_GETFPREGS, + PT_SETFPREGS, + sizeof(struct fpreg), + FP_REGS, + amd64_fill_fpregset, + amd64_store_fpregset, + }, + { + 0, + 0, + -1, + -1, + NULL, + NULL, + } +}; + +static CORE_ADDR +amd64_get_pc(void) +{ + unsigned long pc; + + collect_register_by_name("rip", &pc); + + if (debug_threads) + fprintf(stderr, "stop pc (before any decrement) is %016lx\n", pc); + + return (pc); +} + +static void +amd64_set_pc(CORE_ADDR newpc) +{ + + if (debug_threads) + fprintf(stderr, "set pc to %016lx\n", (long)newpc); + supply_register_by_name("rip", &newpc); +} + +static int +amd64_breakpoint_at(CORE_ADDR pc) +{ + unsigned char c; + + read_inferior_memory(pc, &c, 1); + if (c == 0xCC) + return (1); + + return (0); +} + +struct fbsd_target_ops the_low_target = { + AMD64_NUM_REGS, + amd64_regmap, + amd64_cannot_fetch_register, + amd64_cannot_store_register, + amd64_get_pc, + amd64_set_pc, + amd64_breakpoint, + AMD64_BP_LEN, + NULL, + 1, + amd64_breakpoint_at, +}; Added: head/gnu/usr.bin/gdb/gdbserver/reg-x86-64.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/gnu/usr.bin/gdb/gdbserver/reg-x86-64.c Thu Feb 25 21:29:00 2010 (r204335) @@ -0,0 +1,99 @@ +/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */ + +/* A register protocol for GDB, the GNU debugger. + Copyright 2001, 2002 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* This file was created with the aid of ``regdat.sh'' and ``../../../../contrib/gdb/gdb/regformats/reg-x86-64.dat''. */ + +#include +__FBSDID("$FreeBSD$"); + +#include "regdef.h" +#include "regcache.h" + +struct reg regs_x86_64[] = { + { "rax", 0, 64 }, + { "rbx", 64, 64 }, + { "rcx", 128, 64 }, + { "rdx", 192, 64 }, + { "rsi", 256, 64 }, + { "rdi", 320, 64 }, + { "rbp", 384, 64 }, + { "rsp", 448, 64 }, + { "r8", 512, 64 }, + { "r9", 576, 64 }, + { "r10", 640, 64 }, + { "r11", 704, 64 }, + { "r12", 768, 64 }, + { "r13", 832, 64 }, + { "r14", 896, 64 }, + { "r15", 960, 64 }, + { "rip", 1024, 64 }, + { "eflags", 1088, 32 }, + { "cs", 1120, 32 }, + { "ss", 1152, 32 }, + { "ds", 1184, 32 }, + { "es", 1216, 32 }, + { "fs", 1248, 32 }, + { "gs", 1280, 32 }, + { "st0", 1312, 80 }, + { "st1", 1392, 80 }, + { "st2", 1472, 80 }, + { "st3", 1552, 80 }, + { "st4", 1632, 80 }, + { "st5", 1712, 80 }, + { "st6", 1792, 80 }, + { "st7", 1872, 80 }, + { "fctrl", 1952, 32 }, + { "fstat", 1984, 32 }, + { "ftag", 2016, 32 }, + { "fiseg", 2048, 32 }, + { "fioff", 2080, 32 }, + { "foseg", 2112, 32 }, + { "fooff", 2144, 32 }, + { "fop", 2176, 32 }, + { "xmm0", 2208, 128 }, + { "xmm1", 2336, 128 }, + { "xmm2", 2464, 128 }, + { "xmm3", 2592, 128 }, + { "xmm4", 2720, 128 }, + { "xmm5", 2848, 128 }, + { "xmm6", 2976, 128 }, + { "xmm7", 3104, 128 }, + { "xmm8", 3232, 128 }, + { "xmm9", 3360, 128 }, + { "xmm10", 3488, 128 }, + { "xmm11", 3616, 128 }, + { "xmm12", 3744, 128 }, + { "xmm13", 3872, 128 }, + { "xmm14", 4000, 128 }, + { "xmm15", 4128, 128 }, + { "mxcsr", 4256, 32 }, +}; + +const char *expedite_regs_x86_64[] = { "rbp", "rsp", "rip", 0 }; + +void +init_registers () +{ + set_register_cache (regs_x86_64, + sizeof (regs_x86_64) / sizeof (regs_x86_64[0])); + gdbserver_expedite_regs = expedite_regs_x86_64; +} From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 21:29:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A05341065674; Thu, 25 Feb 2010 21:29:40 +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 764498FC1D; Thu, 25 Feb 2010 21:29:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1PLTeHL043279; Thu, 25 Feb 2010 21:29:40 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PLTeGu043275; Thu, 25 Feb 2010 21:29:40 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201002252129.o1PLTeGu043275@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 25 Feb 2010 21:29: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: r204336 - head/contrib/tzcode/stdtime X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 21:29:40 -0000 Author: edwin Date: Thu Feb 25 21:29:40 2010 New Revision: 204336 URL: http://svn.freebsd.org/changeset/base/204336 Log: Remove non-contributed code. Deleted: head/contrib/tzcode/stdtime/Makefile.inc head/contrib/tzcode/stdtime/Symbol.map head/contrib/tzcode/stdtime/strftime.3 head/contrib/tzcode/stdtime/strftime.c head/contrib/tzcode/stdtime/strptime.3 head/contrib/tzcode/stdtime/strptime.c head/contrib/tzcode/stdtime/time32.c head/contrib/tzcode/stdtime/timelocal.c head/contrib/tzcode/stdtime/timelocal.h From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 22:16:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 472AD1065672; Thu, 25 Feb 2010 22:16:31 +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 373878FC12; Thu, 25 Feb 2010 22:16:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1PMGVjk087797; Thu, 25 Feb 2010 22:16:31 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PMGVne087794; Thu, 25 Feb 2010 22:16:31 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201002252216.o1PMGVne087794@svn.freebsd.org> From: Ruslan Ermilov Date: Thu, 25 Feb 2010 22:16: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: r204338 - in head/lib: libdwarf libproc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 22:16:31 -0000 Author: ru Date: Thu Feb 25 22:16:30 2010 New Revision: 204338 URL: http://svn.freebsd.org/changeset/base/204338 Log: Removed redundant -I. from CFLAGS and "yes" from WITHOUT_MAN. Modified: head/lib/libdwarf/Makefile head/lib/libproc/Makefile Modified: head/lib/libdwarf/Makefile ============================================================================== --- head/lib/libdwarf/Makefile Thu Feb 25 21:38:56 2010 (r204337) +++ head/lib/libdwarf/Makefile Thu Feb 25 22:16:30 2010 (r204338) @@ -19,10 +19,10 @@ SRCS= \ INCS= dwarf.h libdwarf.h -CFLAGS+= -I. -I${.CURDIR} +CFLAGS+= -I${.CURDIR} SHLIB_MAJOR= 2 -WITHOUT_MAN= yes +WITHOUT_MAN= .include Modified: head/lib/libproc/Makefile ============================================================================== --- head/lib/libproc/Makefile Thu Feb 25 21:38:56 2010 (r204337) +++ head/lib/libproc/Makefile Thu Feb 25 22:16:30 2010 (r204338) @@ -9,10 +9,10 @@ SRCS= \ INCS= libproc.h -CFLAGS+= -I. -I${.CURDIR} +CFLAGS+= -I${.CURDIR} SHLIB_MAJOR= 2 -WITHOUT_MAN= yes +WITHOUT_MAN= .include From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 22:18:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4FF3106566B; Thu, 25 Feb 2010 22:18:35 +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 9337A8FC18; Thu, 25 Feb 2010 22:18:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1PMIZsW089741; Thu, 25 Feb 2010 22:18:35 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PMIZNc089734; Thu, 25 Feb 2010 22:18:35 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201002252218.o1PMIZNc089734@svn.freebsd.org> From: Ruslan Ermilov Date: Thu, 25 Feb 2010 22:18: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: r204339 - in head/cddl: usr.bin/ctfconvert usr.bin/ctfdump usr.bin/ctfmerge usr.bin/zinject usr.sbin/dtrace usr.sbin/lockstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 22:18:35 -0000 Author: ru Date: Thu Feb 25 22:18:35 2010 New Revision: 204339 URL: http://svn.freebsd.org/changeset/base/204339 Log: Fixed dependencies (make checkdpadd). Modified: head/cddl/usr.bin/ctfconvert/Makefile head/cddl/usr.bin/ctfdump/Makefile head/cddl/usr.bin/ctfmerge/Makefile head/cddl/usr.bin/zinject/Makefile head/cddl/usr.sbin/dtrace/Makefile head/cddl/usr.sbin/lockstat/Makefile Modified: head/cddl/usr.bin/ctfconvert/Makefile ============================================================================== --- head/cddl/usr.bin/ctfconvert/Makefile Thu Feb 25 22:16:30 2010 (r204338) +++ head/cddl/usr.bin/ctfconvert/Makefile Thu Feb 25 22:18:35 2010 (r204339) @@ -40,7 +40,8 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ -I${OPENSOLARIS_USR_DISTDIR}/tools/ctf/cvt \ -I${OPENSOLARIS_SYS_DISTDIR}/uts/common -LDADD+= -lctf -ldwarf -lelf -lz -lthr +DPADD= ${LIBCTF} ${LIBDWARF} ${LIBELF} ${LIBZ} ${LIBPTHREAD} +LDADD= -lctf -ldwarf -lelf -lz -lpthread .PATH: ${.CURDIR} .PATH: ${OPENSOLARIS_USR_DISTDIR}/tools/ctf/common Modified: head/cddl/usr.bin/ctfdump/Makefile ============================================================================== --- head/cddl/usr.bin/ctfdump/Makefile Thu Feb 25 22:16:30 2010 (r204338) +++ head/cddl/usr.bin/ctfdump/Makefile Thu Feb 25 22:18:35 2010 (r204339) @@ -19,9 +19,8 @@ CFLAGS+= -I${OPENSOLARIS_USR_DISTDIR} \ -I${OPENSOLARIS_USR_DISTDIR}/tools/ctf/common \ -I${OPENSOLARIS_SYS_DISTDIR}/uts/common -LDFLAGS+= -pthread - -LDADD+= -lelf -lz +DPADD= ${LIBPTHREAD} ${LIBELF} ${LIBZ} +LDADD= -lpthread -lelf -lz .PATH: ${OPENSOLARIS_USR_DISTDIR}/tools/ctf/common .PATH: ${OPENSOLARIS_USR_DISTDIR}/tools/ctf/dump Modified: head/cddl/usr.bin/ctfmerge/Makefile ============================================================================== --- head/cddl/usr.bin/ctfmerge/Makefile Thu Feb 25 22:16:30 2010 (r204338) +++ head/cddl/usr.bin/ctfmerge/Makefile Thu Feb 25 22:18:35 2010 (r204339) @@ -37,7 +37,8 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ -I${OPENSOLARIS_USR_DISTDIR}/tools/ctf/cvt \ -I${OPENSOLARIS_SYS_DISTDIR}/uts/common -LDADD+= -lctf -ldwarf -lelf -lz -lthr +DPADD= ${LIBCTF} ${LIBDWARF} ${LIBELF} ${LIBZ} ${LIBPTHREAD} +LDADD= -lctf -ldwarf -lelf -lz -lpthread .PATH: ${OPENSOLARIS_USR_DISTDIR}/tools/ctf/common .PATH: ${OPENSOLARIS_USR_DISTDIR}/tools/ctf/cvt Modified: head/cddl/usr.bin/zinject/Makefile ============================================================================== --- head/cddl/usr.bin/zinject/Makefile Thu Feb 25 22:16:30 2010 (r204338) +++ head/cddl/usr.bin/zinject/Makefile Thu Feb 25 22:18:35 2010 (r204339) @@ -19,7 +19,7 @@ CFLAGS+= -I${.CURDIR}/../../contrib/open CFLAGS+= -I${.CURDIR}/../../lib/libumem DPADD= ${LIBAVL} ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBUUTIL} \ - ${LIBZFS} ${LIBZPOOL} ${LIBUUTIL} + ${LIBZFS} ${LIBZPOOL} LDADD= -lavl -lgeom -lm -lnvpair -lumem -luutil -lzfs -lzpool .include Modified: head/cddl/usr.sbin/dtrace/Makefile ============================================================================== --- head/cddl/usr.sbin/dtrace/Makefile Thu Feb 25 22:16:30 2010 (r204338) +++ head/cddl/usr.sbin/dtrace/Makefile Thu Feb 25 22:18:35 2010 (r204339) @@ -24,14 +24,7 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ #CFLAGS+= -DNEED_ERRLOC #YFLAGS+= -d -LDFLAGS+= -pthread \ - -L${.OBJDIR}/../../lib/libdtrace \ - -L${.OBJDIR}/../../lib/libproc \ - -L${.OBJDIR}/../../lib/libctf \ - -L${.OBJDIR}/../../../lib/libelf - -LDADD+= -ldtrace -ly -ll -lproc -lctf -lelf -lz - -DPADD+= ${LIBDTRACE} ${LIBCTF} ${LIBELF} ${LIBPTHREAD} ${LIBL} ${LIBY} ${LIBZ} +DPADD= ${LIBPTHREAD} ${LIBDTRACE} ${LIBY} ${LIBL} ${LIBPROC} ${LIBCTF} ${LIBELF} ${LIBZ} +LDADD= -lpthread -ldtrace -ly -ll -lproc -lctf -lelf -lz .include Modified: head/cddl/usr.sbin/lockstat/Makefile ============================================================================== --- head/cddl/usr.sbin/lockstat/Makefile Thu Feb 25 22:16:30 2010 (r204338) +++ head/cddl/usr.sbin/lockstat/Makefile Thu Feb 25 22:18:35 2010 (r204339) @@ -25,15 +25,8 @@ CFLAGS+= -DNEED_ERRLOC -g #YFLAGS+= -d -LDFLAGS+= -pthread \ - -L${.OBJDIR}/../../lib/libdtrace \ - -L${.OBJDIR}/../../lib/libproc \ - -L${.OBJDIR}/../../lib/libctf \ - -L${.OBJDIR}/../../../lib/libelf - -LDADD+= -ldtrace -ly -ll -lproc -lctf -lelf -lz -lrt - -#DPADD+= ${LIBDTRACE} ${LIBPTHREAD} ${LIBL} ${LIBY} ${LIBZ} +DPADD= ${LIBPTHREAD} ${LIBDTRACE} ${LIBY} ${LIBL} ${LIBPROC} ${LIBCTF} ${LIBELF} ${LIBZ} ${LIBRT} +LDADD= -lpthread -ldtrace -ly -ll -lproc -lctf -lelf -lz -lrt NO_MAN= From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 22:44:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59D5C106566B; Thu, 25 Feb 2010 22:44:24 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 495958FC16; Thu, 25 Feb 2010 22:44:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1PMiO4k014108; Thu, 25 Feb 2010 22:44:24 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1PMiOC1014106; Thu, 25 Feb 2010 22:44:24 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201002252244.o1PMiOC1014106@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Thu, 25 Feb 2010 22:44: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: r204340 - head/secure/libexec/sftp-server X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 22:44:24 -0000 Author: des Date: Thu Feb 25 22:44:23 2010 New Revision: 204340 URL: http://svn.freebsd.org/changeset/base/204340 Log: Fix 'make checkdpadd' Submitted by: ru@ Modified: head/secure/libexec/sftp-server/Makefile Modified: head/secure/libexec/sftp-server/Makefile ============================================================================== --- head/secure/libexec/sftp-server/Makefile Thu Feb 25 22:18:35 2010 (r204339) +++ head/secure/libexec/sftp-server/Makefile Thu Feb 25 22:44:23 2010 (r204340) @@ -9,7 +9,7 @@ CFLAGS+=-I${SSHDIR} -include ssh_namespa SRCS+= roaming_dummy.c DPADD= ${LIBSSH} ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ} -LDADD= -lcrypt -lcrypto -lz -lssh +LDADD= -lssh -lcrypt -lcrypto -lz .include From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 23:33:34 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 281F81065700; Thu, 25 Feb 2010 23:33:34 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id 986768FC08; Thu, 25 Feb 2010 23:33:33 +0000 (UTC) Received: from c122-106-157-14.carlnfd1.nsw.optusnet.com.au (c122-106-157-14.carlnfd1.nsw.optusnet.com.au [122.106.157.14]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o1PNXReH028773 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 26 Feb 2010 10:33:29 +1100 Date: Fri, 26 Feb 2010 10:33:27 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Jaakko Heinonen In-Reply-To: <20100225195138.GA3323@a91-153-117-195.elisa-laajakaista.fi> Message-ID: <20100226091923.X2605@delplex.bde.org> References: <6413.1266433105@critter.freebsd.dk> <20100218064545.J2074@besplex.bde.org> <20100218095538.GA2318@a91-153-117-195.elisa-laajakaista.fi> <20100225195138.GA3323@a91-153-117-195.elisa-laajakaista.fi> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, Poul-Henning Kamp , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r203990 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 23:33:34 -0000 On Thu, 25 Feb 2010, Jaakko Heinonen wrote: > On 2010-02-18, Jaakko Heinonen wrote: >>> namei() returns EISDIR for "/" (due to DELETE and and the special handling >>> of the degenerate case which includes "/" and not much else, else the bug >>> would affect more cases). >> >> This causes a problem also for mkdir(2), rmdir(2) and rename(2). All of >> them incorrectly return EISDIR for "/". > > Here is a patch which attempts to fix mkdir(2), rmdir(2), rename(2) and > unlink(2) errno return value for "/". > > http://people.freebsd.org/~jh/patches/lookup-root.diff Please enclose patches in mail so that they can be seen easily and quoted normally. % Index: sys/kern/vfs_lookup.c % =================================================================== % --- sys/kern/vfs_lookup.c (revision 204273) % +++ sys/kern/vfs_lookup.c (working copy) I'm still not sure if the problem should be fixed mainly in this file. Translation of the errno is still needed in some cases, since the correct errno is context-dependent and it would be ugly to pass the context here and uglier to guess it. The switches on on cnp->cn_nameiop are little more than guessing. On second thoughts, the context is already passed unambigously for the RENAME op so setting the errno here for RENAME is good. % @@ -565,19 +565,22 @@ dirloop: % } % % /* % - * Check for degenerate name (e.g. / or "") % - * which is a way of talking about a directory, % - * e.g. like "/." or ".". % + * Check for "" which is a way of talking about the root directory. This comment is still misleading. "" is a pathname for a directory entry that cannot exist, not a way of talking about the root directory. However, we have replaced any trailing slashes by a NUL and have thus corrupted the pathname if it was "/". Perhaps we shouldn't have done that, but reducing "/[/]*" to "" and then checking (cnp->cn_nameptr[0] == '\0') seems to be the simplest way to check for the original pathname being the root directory. % + * We can't provide a parent node for CREATE, DELETE and RENAME % + * operations. % */ % if (cnp->cn_nameptr[0] == '\0') { % - if (dp->v_type != VDIR) { % - error = ENOTDIR; % + KASSERT(dp->v_type == VDIR, ("dp is not a directory")); % + switch (cnp->cn_nameiop) { % + case CREATE: % + error = EEXIST; % goto bad; % - } % - if (cnp->cn_nameiop != LOOKUP) { % - error = EISDIR; % + case DELETE: % + case RENAME: % + error = EBUSY; % goto bad; % } EISDIR is also returned by ufs_lookup(), so it was not unique enough here. EBUSY seems to be unique. EEXIST seems to be unique too, but is less generic. % + KASSERT(cnp->cn_nameiop == LOOKUP, ("nameiop must be LOOKUP")); Clearer to put this in the switch. % if (wantparent) { Doesn't the comment about not being able to provide a parent belong here? % ndp->ni_dvp = dp; % VREF(dp); % @@ -948,19 +951,22 @@ relookup(struct vnode *dvp, struct vnode % #endif % % /* % - * Check for degenerate name (e.g. / or "") % - * which is a way of talking about a directory, % - * e.g. like "/." or ".". % + * Check for "" which is a way of talking about the root directory. % + * We can't provide a parent node for CREATE, DELETE and RENAME % + * operations. % */ % if (cnp->cn_nameptr[0] == '\0') { % - if (cnp->cn_nameiop != LOOKUP || wantparent) { % - error = EISDIR; % + KASSERT(dp->v_type == VDIR, ("dp is not a directory")); % + switch (cnp->cn_nameiop) { % + case CREATE: % + error = EEXIST; % goto bad; % - } % - if (dp->v_type != VDIR) { % - error = ENOTDIR; % + case DELETE: % + case RENAME: % + error = EBUSY; % goto bad; % } % + KASSERT(cnp->cn_nameiop == LOOKUP, ("nameiop must be LOOKUP")); % if (!(cnp->cn_flags & LOCKLEAF)) % VOP_UNLOCK(dp, 0); % *vpp = dp; This is in relookup(). I think relookup() is only called from rename(), so the failing case is unreachable (since the root directory cannot have moved, so any possible failure would already have occurred), and lots more of the code for the non-failing case is dead too (since being for rename() implies (cnp->cn_nameiop == RENAME && wantparent ...). Also, if the op is somehow not RENAME and failure occurs, then its errno should probably always be EBUSY and never EEXIST, since failure of relookup() implies a topology change and EBUSY is closest to describing that, while EEXIST is a stupid errno for failure to re-look-up something which you hope still exists. % Index: sys/kern/vfs_syscalls.c % =================================================================== % --- sys/kern/vfs_syscalls.c (revision 204273) % +++ sys/kern/vfs_syscalls.c (working copy) % @@ -1841,7 +1841,7 @@ restart: % NDINIT_AT(&nd, DELETE, LOCKPARENT | LOCKLEAF | MPSAFE | AUDITVNODE1, % pathseg, path, fd, td); % if ((error = namei(&nd)) != 0) % - return (error == EINVAL ? EPERM : error); % + return ((error == EINVAL || error == EBUSY) ? EPERM : error); The parentheses are not needed. % vfslocked = NDHASGIANT(&nd); % vp = nd.ni_vp; % if (vp->v_type == VDIR && oldinum == 0) { % @@ -3618,9 +3618,6 @@ kern_renameat(struct thread *td, int old % if (fromnd.ni_vp->v_type == VDIR) % tond.ni_cnd.cn_flags |= WILLBEDIR; % if ((error = namei(&tond)) != 0) { % - /* Translate error code for rename("dir1", "dir2/."). */ % - if (error == EISDIR && fvp->v_type == VDIR) % - error = EINVAL; I think this has nothing to do with the root directory (as its comment says), but it is to translate the EISDIR returned by ufs_lookup(), etc., when `tond' is for a (directory) pathname ending in ".". So it should not be removed, except possibly after changing ufs_lookup(), etc., to return EINVAL. The EISDIR in ufs_lookup() is only for RENAME, so it is strange that any translation is needed. I apparently put the translation here to avoid looking at all leaf file systems. % NDFREE(&fromnd, NDF_ONLY_PNBUF); % vrele(fromnd.ni_dvp); % vrele(fvp); Bruce From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 23:46:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80D67106564A; Thu, 25 Feb 2010 23:46:51 +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 3D9438FC14; Thu, 25 Feb 2010 23:46:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o1PNce1S085931; Thu, 25 Feb 2010 16:38:40 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Thu, 25 Feb 2010 16:38:50 -0700 (MST) Message-Id: <20100225.163850.864172011105110621.imp@bsdimp.com> To: attilio@freebsd.org From: "M. Warner Losh" In-Reply-To: <201002251413.o1PEDdKV033584@svn.freebsd.org> References: <201002251413.o1PEDdKV033584@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.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: r204309 - in head/sys: amd64/amd64 amd64/isa conf i386/bios i386/cpufreq i386/i386 i386/isa i386/xen isa modules/bios/smbios modules/bios/vpd modules/cpufreq pc98/pc98 x86 x86/bios x86/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 23:46:51 -0000 In message: <201002251413.o1PEDdKV033584@svn.freebsd.org> Attilio Rao writes: : Author: attilio : Date: Thu Feb 25 14:13:39 2010 : New Revision: 204309 : URL: http://svn.freebsd.org/changeset/base/204309 : : Log: : Introduce the new kernel sub-tree x86 which should contain all the code : shared and generalized between our current amd64, i386 and pc98. : : This is just an initial step that should lead to a more complete effort. : For the moment, a very simple porting of cpufreq modules, BIOS calls and : the whole MD specific ISA bus part is added to the sub-tree but ideally : a lot of code might be added and more shared support should grow. Cool! : Sponsored by: Sandvine Incorporated : Reviewed by: emaste, kib, jhb, imp : Discussed on: arch : MFC: 3 weeks Is this really wise? Are these changes KPI neutral? Warner From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 23:49:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C1CF106564A; Thu, 25 Feb 2010 23:49:04 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-iw0-f185.google.com (mail-iw0-f185.google.com [209.85.223.185]) by mx1.freebsd.org (Postfix) with ESMTP id A5DD98FC17; Thu, 25 Feb 2010 23:49:03 +0000 (UTC) Received: by iwn15 with SMTP id 15so5679305iwn.7 for ; Thu, 25 Feb 2010 15:48:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=NrqohBjzkNoa2qU5+KboESltpIu4umD8SX3Gg0ICPPU=; b=sSbmKECF60rP2CeFdlT0CU9LodHYQqncxprYm8FiedGQolRyF1PMfY3YFA/8rlL/DD aJGYP8GD8ITv0qwOz2Ro/2u9y3JvDBBDqMigQbJrk2cehuOhd7R/gO8fwqC1XqAYwDr8 65L7ySjuGBpSVa6qsRCV/OeTf/iE0yiP5CIC4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=uuBG93XDn6jWcTj8xOuoQbtopulexyg/C5BajrtFvkb1o9EPdwG+FwLw1rFB4NEkoM VvCkM8UTrV5sG1BWrPAmRpJ+dLl1f3kCwyO8dFHnquaxgA3eKhM03Nc8rX+fQi8zuB8v +JbQ83nB8i1On512eGlqceEEX6NCJ5Pa2FHHQ= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.231.183.133 with SMTP id cg5mr82414ibb.12.1267141736025; Thu, 25 Feb 2010 15:48:56 -0800 (PST) In-Reply-To: <20100225.163850.864172011105110621.imp@bsdimp.com> References: <201002251413.o1PEDdKV033584@svn.freebsd.org> <20100225.163850.864172011105110621.imp@bsdimp.com> Date: Fri, 26 Feb 2010 00:48:55 +0100 X-Google-Sender-Auth: bfa4b23c44ae2141 Message-ID: <3bbf2fe11002251548y773c661gd4946f371bcbbd6f@mail.gmail.com> From: Attilio Rao To: "M. Warner Losh" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r204309 - in head/sys: amd64/amd64 amd64/isa conf i386/bios i386/cpufreq i386/i386 i386/isa i386/xen isa modules/bios/smbios modules/bios/vpd modules/cpufreq pc98/pc98 x86 x86/bios x86/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 23:49:04 -0000 2010/2/26 M. Warner Losh : > In message: <201002251413.o1PEDdKV033584@svn.freebsd.org> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Attilio Rao writes: > : Author: attilio > : Date: Thu Feb 25 14:13:39 2010 > : New Revision: 204309 > : URL: http://svn.freebsd.org/changeset/base/204309 > : > : Log: > : =C2=A0 Introduce the new kernel sub-tree x86 which should contain all t= he code > : =C2=A0 shared and generalized between our current amd64, i386 and pc98. > : > : =C2=A0 This is just an initial step that should lead to a more complete= effort. > : =C2=A0 For the moment, a very simple porting of cpufreq modules, BIOS c= alls and > : =C2=A0 the whole MD specific ISA bus part is added to the sub-tree but = ideally > : =C2=A0 a lot of code might be added and more shared support should grow= . > > Cool! > > : =C2=A0 Sponsored by: =C2=A0 =C2=A0 =C2=A0 Sandvine Incorporated > : =C2=A0 Reviewed by: =C2=A0 =C2=A0 =C2=A0 =C2=A0emaste, kib, jhb, imp > : =C2=A0 Discussed on: =C2=A0 =C2=A0 =C2=A0 arch > : =C2=A0 MFC: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A03 we= eks > > Is this really wise? =C2=A0Are these changes KPI neutral? I don't think there are (still) KPI changes. Which one are you referring to? Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 00:37:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A07A51065670; Fri, 26 Feb 2010 00:37:49 +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 8F4C28FC15; Fri, 26 Feb 2010 00:37:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1Q0bnkd022138; Fri, 26 Feb 2010 00:37:49 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1Q0bnEf022136; Fri, 26 Feb 2010 00:37:49 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201002260037.o1Q0bnEf022136@svn.freebsd.org> From: Weongyo Jeong Date: Fri, 26 Feb 2010 00:37: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: r204343 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 00:37:49 -0000 Author: weongyo Date: Fri Feb 26 00:37:49 2010 New Revision: 204343 URL: http://svn.freebsd.org/changeset/base/204343 Log: Updates what firmware module should be used for LP (low power) PHY users and bumps date. Modified: head/share/man/man4/bwn.4 Modified: head/share/man/man4/bwn.4 ============================================================================== --- head/share/man/man4/bwn.4 Fri Feb 26 00:12:48 2010 (r204342) +++ head/share/man/man4/bwn.4 Fri Feb 26 00:37:49 2010 (r204343) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2010 +.Dd February 25, 2010 .Dt BWN 4 .Os .Sh NAME @@ -69,6 +69,8 @@ The port needs to be installed before .Xr ifconfig 8 will work. +Most cases you need to use bwn_v4_ucode module but if you are a +LP (low power) PHY user please uses bwn_v4_lp_ucode module. .Sh HARDWARE The .Nm From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 01:08:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D1D5106566B; Fri, 26 Feb 2010 01:08:41 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 29C818FC1B; Fri, 26 Feb 2010 01:08:40 +0000 (UTC) Received: by pwj7 with SMTP id 7so6899413pwj.13 for ; Thu, 25 Feb 2010 17:08:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=pVYYbz1U1RSRAgUrfC6OYcGzkfvz180IwrBQP6LuKmk=; b=DRqeDVTMaHiGnvtsJC8v21cAdfUpadeVyMOFbg9bfU19kJ5nCKaff0wXTAaIQaLjz0 cJ+Td73Y8lm5gahrxiSybvNYdry8xKT6ZL752WoYcwuDBOcNDCdWDFJZqaeyC6f1ajEI yIe7vZw3vpWjjZO0I6c9wwgVykmGdrWePPusU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=NAb0C1bhvWr2X9Fd95dClAg3Qx9p50B+ZRwgB4khVaFM8oppLCbwq9V2R5UREiF+XC ZqlYnrm+ThN+ny5GKOYcA6iFSwWNOomxASoa8bMNVLzdZNq0TnGI/HaoHud7hsGGWDxE KkwNL0Jwm8GhUxbEtNwjPPs/StbyTOnq0fs0s= MIME-Version: 1.0 Received: by 10.114.214.2 with SMTP id m2mr333897wag.62.1267146518187; Thu, 25 Feb 2010 17:08:38 -0800 (PST) In-Reply-To: <3bbf2fe11002251548y773c661gd4946f371bcbbd6f@mail.gmail.com> References: <201002251413.o1PEDdKV033584@svn.freebsd.org> <20100225.163850.864172011105110621.imp@bsdimp.com> <3bbf2fe11002251548y773c661gd4946f371bcbbd6f@mail.gmail.com> Date: Thu, 25 Feb 2010 17:08:38 -0800 Message-ID: From: Xin LI To: Attilio Rao Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "M. Warner Losh" Subject: Re: svn commit: r204309 - in head/sys: amd64/amd64 amd64/isa conf i386/bios i386/cpufreq i386/i386 i386/isa i386/xen isa modules/bios/smbios modules/bios/vpd modules/cpufreq pc98/pc98 x86 x86/bios x86/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 01:08:41 -0000 On Thu, Feb 25, 2010 at 3:48 PM, Attilio Rao wrote: > 2010/2/26 M. Warner Losh : >> In message: <201002251413.o1PEDdKV033584@svn.freebsd.org> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Attilio Rao writes: >> : Author: attilio >> : Date: Thu Feb 25 14:13:39 2010 >> : New Revision: 204309 >> : URL: http://svn.freebsd.org/changeset/base/204309 >> : >> : Log: >> : =C2=A0 Introduce the new kernel sub-tree x86 which should contain all = the code >> : =C2=A0 shared and generalized between our current amd64, i386 and pc98= . >> : >> : =C2=A0 This is just an initial step that should lead to a more complet= e effort. >> : =C2=A0 For the moment, a very simple porting of cpufreq modules, BIOS = calls and >> : =C2=A0 the whole MD specific ISA bus part is added to the sub-tree but= ideally >> : =C2=A0 a lot of code might be added and more shared support should gro= w. >> >> Cool! >> >> : =C2=A0 Sponsored by: =C2=A0 =C2=A0 =C2=A0 Sandvine Incorporated >> : =C2=A0 Reviewed by: =C2=A0 =C2=A0 =C2=A0 =C2=A0emaste, kib, jhb, imp >> : =C2=A0 Discussed on: =C2=A0 =C2=A0 =C2=A0 arch >> : =C2=A0 MFC: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A03 w= eeks >> >> Is this really wise? =C2=A0Are these changes KPI neutral? > > I don't think there are (still) KPI changes. > Which one are you referring to? I think Warner means that there will be some header files to change their location, making certain (I doubt there is any but just in case) kernel modules maintained by third party to break (technically these are not part of KPI but something that _could_ make third party developers unhappy I guess). Cheers, --=20 Xin LI http://www.delphij.net From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 01:32:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE647106567C; Fri, 26 Feb 2010 01:32:23 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-iw0-f198.google.com (mail-iw0-f198.google.com [209.85.223.198]) by mx1.freebsd.org (Postfix) with ESMTP id 51B748FC20; Fri, 26 Feb 2010 01:32:23 +0000 (UTC) Received: by iwn36 with SMTP id 36so5812058iwn.28 for ; Thu, 25 Feb 2010 17:32:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=zwbxN3Ebdh5eju8WEvQc7WSCyMdM8TjxO0zzmroICQ8=; b=Wm8WNWNDJXKSVOqJDXEZiicvy6Ftn62IGUOYbrrTXYAW4A0qEXTyHsN9N0uBFA18MI t2Xj38HtM7n3kYWx/ufX8vaqD3pU8SK7Q7+qu/5fJeGBVcv2lx8MsNs99oloUCnkEEDp heM6ziIHsV0hMl1L3/K1F0qFdRKH2L+XZZaEU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=CN0cY9O80j912iMAGl2plFSoC41p9LxxpsNALuDeArl/vbpva6YXKx0VqQ/PB0Rr9G RMp75+HpnnYRpQ/o8IayCWLIMvl6m7a+JemBk8NAw83qFQwKtWBlEDmVANo1K4Jo6wVo alfdgsCK164VQi9Ll5eFAinoF67NVp2xSZISo= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.231.191.147 with SMTP id dm19mr433958ibb.86.1267147939393; Thu, 25 Feb 2010 17:32:19 -0800 (PST) In-Reply-To: References: <201002251413.o1PEDdKV033584@svn.freebsd.org> <20100225.163850.864172011105110621.imp@bsdimp.com> <3bbf2fe11002251548y773c661gd4946f371bcbbd6f@mail.gmail.com> Date: Fri, 26 Feb 2010 02:32:19 +0100 X-Google-Sender-Auth: 11c7ec58e0c18927 Message-ID: <3bbf2fe11002251732t35179d9ar3c3f39aafe75d5c2@mail.gmail.com> From: Attilio Rao To: Xin LI Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "M. Warner Losh" Subject: Re: svn commit: r204309 - in head/sys: amd64/amd64 amd64/isa conf i386/bios i386/cpufreq i386/i386 i386/isa i386/xen isa modules/bios/smbios modules/bios/vpd modules/cpufreq pc98/pc98 x86 x86/bios x86/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 01:32:23 -0000 2010/2/26 Xin LI : > On Thu, Feb 25, 2010 at 3:48 PM, Attilio Rao wrote: >> 2010/2/26 M. Warner Losh : >>> In message: <201002251413.o1PEDdKV033584@svn.freebsd.org> >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Attilio Rao writes: >>> : Author: attilio >>> : Date: Thu Feb 25 14:13:39 2010 >>> : New Revision: 204309 >>> : URL: http://svn.freebsd.org/changeset/base/204309 >>> : >>> : Log: >>> : =C2=A0 Introduce the new kernel sub-tree x86 which should contain all= the code >>> : =C2=A0 shared and generalized between our current amd64, i386 and pc9= 8. >>> : >>> : =C2=A0 This is just an initial step that should lead to a more comple= te effort. >>> : =C2=A0 For the moment, a very simple porting of cpufreq modules, BIOS= calls and >>> : =C2=A0 the whole MD specific ISA bus part is added to the sub-tree bu= t ideally >>> : =C2=A0 a lot of code might be added and more shared support should gr= ow. >>> >>> Cool! >>> >>> : =C2=A0 Sponsored by: =C2=A0 =C2=A0 =C2=A0 Sandvine Incorporated >>> : =C2=A0 Reviewed by: =C2=A0 =C2=A0 =C2=A0 =C2=A0emaste, kib, jhb, imp >>> : =C2=A0 Discussed on: =C2=A0 =C2=A0 =C2=A0 arch >>> : =C2=A0 MFC: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A03 = weeks >>> >>> Is this really wise? =C2=A0Are these changes KPI neutral? >> >> I don't think there are (still) KPI changes. >> Which one are you referring to? > > I think Warner means that there will be some header files to change > their location, making certain (I doubt there is any but just in case) > kernel modules maintained by third party to break (technically these > are not part of KPI but something that _could_ make third party > developers unhappy I guess). Yes but what is already compiled (thirdy-part modules included) will keep working without a glance. I think there have been already MFCed patches doing headers movements in the past. Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 02:02:28 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 710FE106564A; Fri, 26 Feb 2010 02:02:28 +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 0B5458FC08; Fri, 26 Feb 2010 02:02:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o1Q1ugbg087471; Thu, 25 Feb 2010 18:56:43 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Thu, 25 Feb 2010 18:56:53 -0700 (MST) Message-Id: <20100225.185653.364718154403387259.imp@bsdimp.com> To: attilio@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <3bbf2fe11002251732t35179d9ar3c3f39aafe75d5c2@mail.gmail.com> References: <3bbf2fe11002251548y773c661gd4946f371bcbbd6f@mail.gmail.com> <3bbf2fe11002251732t35179d9ar3c3f39aafe75d5c2@mail.gmail.com> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, delphij@gmail.com Subject: Re: svn commit: r204309 - in head/sys: amd64/amd64 amd64/isa conf i386/bios i386/cpufreq i386/i386 i386/isa i386/xen isa modules/bios/smbios modules/bios/vpd modules/cpufreq pc98/pc98 x86 x86/bios x86/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 02:02:28 -0000 In message: <3bbf2fe11002251732t35179d9ar3c3f39aafe75d5c2@mail.gmail.co= m> Attilio Rao writes: : 2010/2/26 Xin LI : : > On Thu, Feb 25, 2010 at 3:48 PM, Attilio Rao = wrote: : >> 2010/2/26 M. Warner Losh : : >>> In message: <201002251413.o1PEDdKV033584@svn.freebsd.org> : >>> =A0 =A0 =A0 =A0 =A0 =A0Attilio Rao writes: : >>> : Author: attilio : >>> : Date: Thu Feb 25 14:13:39 2010 : >>> : New Revision: 204309 : >>> : URL: http://svn.freebsd.org/changeset/base/204309 : >>> : : >>> : Log: : >>> : =A0 Introduce the new kernel sub-tree x86 which should contain = all the code : >>> : =A0 shared and generalized between our current amd64, i386 and = pc98. : >>> : : >>> : =A0 This is just an initial step that should lead to a more com= plete effort. : >>> : =A0 For the moment, a very simple porting of cpufreq modules, B= IOS calls and : >>> : =A0 the whole MD specific ISA bus part is added to the sub-tree= but ideally : >>> : =A0 a lot of code might be added and more shared support should= grow. : >>> : >>> Cool! : >>> : >>> : =A0 Sponsored by: =A0 =A0 =A0 Sandvine Incorporated : >>> : =A0 Reviewed by: =A0 =A0 =A0 =A0emaste, kib, jhb, imp : >>> : =A0 Discussed on: =A0 =A0 =A0 arch : >>> : =A0 MFC: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A03 weeks : >>> : >>> Is this really wise? =A0Are these changes KPI neutral? : >> : >> I don't think there are (still) KPI changes. : >> Which one are you referring to? : > : > I think Warner means that there will be some header files to change= : > their location, making certain (I doubt there is any but just in ca= se) : > kernel modules maintained by third party to break (technically thes= e : > are not part of KPI but something that _could_ make third party : > developers unhappy I guess). : = : Yes but what is already compiled (thirdy-part modules included) will : keep working without a glance. Yes, but modules can't be recompiled. That's why I said KPI rather than KBI. : I think there have been already MFCed patches doing headers movements= : in the past. We've tried to keep the KPI upwardly compatible. If files move, then old code will potentially break. Warner From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 06:44:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3247F106566C; Fri, 26 Feb 2010 06:44:01 +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 165108FC15; Fri, 26 Feb 2010 06:44:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1Q6i0Ro060379; Fri, 26 Feb 2010 06:44:00 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1Q6i06B060374; Fri, 26 Feb 2010 06:44:00 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201002260644.o1Q6i06B060374@svn.freebsd.org> From: Edwin Groothuis Date: Fri, 26 Feb 2010 06:44: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: r204347 - in head: lib/libc/gen lib/libc/stdtime usr.sbin/zic/zdump usr.sbin/zic/zic X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 06:44:01 -0000 Author: edwin Date: Fri Feb 26 06:44:00 2010 New Revision: 204347 URL: http://svn.freebsd.org/changeset/base/204347 Log: Split the contributed code from libc/stdtime from lib/libc/stdtime to contrib/tzcode/stdtime. Deleted: head/lib/libc/stdtime/asctime.c head/lib/libc/stdtime/ctime.3 head/lib/libc/stdtime/difftime.c head/lib/libc/stdtime/localtime.c head/lib/libc/stdtime/private.h head/lib/libc/stdtime/time2posix.3 head/lib/libc/stdtime/tzfile.5 head/lib/libc/stdtime/tzfile.h Modified: head/lib/libc/gen/sysconf.c head/lib/libc/stdtime/Makefile.inc head/usr.sbin/zic/zdump/Makefile head/usr.sbin/zic/zic/Makefile Modified: head/lib/libc/gen/sysconf.c ============================================================================== --- head/lib/libc/gen/sysconf.c Fri Feb 26 06:35:24 2010 (r204346) +++ head/lib/libc/gen/sysconf.c Fri Feb 26 06:44:00 2010 (r204347) @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include "../stdlib/atexit.h" -#include "../stdtime/tzfile.h" +#include "tzfile.h" /* from ../../../contrib/tzcode/stdtime */ #define _PATH_ZONEINFO TZDIR /* from tzfile.h */ Modified: head/lib/libc/stdtime/Makefile.inc ============================================================================== --- head/lib/libc/stdtime/Makefile.inc Fri Feb 26 06:35:24 2010 (r204346) +++ head/lib/libc/stdtime/Makefile.inc Fri Feb 26 06:44:00 2010 (r204347) @@ -1,13 +1,16 @@ # Makefile.inc,v 1.2 1994/09/13 21:26:01 wollman Exp # $FreeBSD$ -.PATH: ${.CURDIR}/stdtime ${.CURDIR}/../locale +.PATH: ${.CURDIR}/stdtime ${.CURDIR}/../locale \ + ${.CURDIR}/../../contrib/tzcode/stdtime SRCS+= asctime.c difftime.c localtime.c strftime.c strptime.c timelocal.c \ time32.c SYM_MAPS+= ${.CURDIR}/stdtime/Symbol.map +CFLAGS+= -I${.CURDIR}/../../contrib/tzcode/stdtime -I${.CURDIR}/stdtime + MAN+= ctime.3 strftime.3 strptime.3 time2posix.3 MAN+= tzfile.5 Modified: head/usr.sbin/zic/zdump/Makefile ============================================================================== --- head/usr.sbin/zic/zdump/Makefile Fri Feb 26 06:35:24 2010 (r204346) +++ head/usr.sbin/zic/zdump/Makefile Fri Feb 26 06:44:00 2010 (r204347) @@ -8,7 +8,7 @@ SRCS= zdump.c ialloc.c scheck.c CFLAGS+= -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone -DSTD_INSPIRED -DPCTS CFLAGS+= -DHAVE_LONG_DOUBLE -DTZDIR=\"/usr/share/zoneinfo\" -Demkdir=mkdir -CFLAGS+= -I${.CURDIR}/.. -I${.CURDIR}/../../../lib/libc/stdtime +CFLAGS+= -I${.CURDIR}/.. -I${.CURDIR}/../../../contrib/tzcode/stdtime WARNS?= 2 Modified: head/usr.sbin/zic/zic/Makefile ============================================================================== --- head/usr.sbin/zic/zic/Makefile Fri Feb 26 06:35:24 2010 (r204346) +++ head/usr.sbin/zic/zic/Makefile Fri Feb 26 06:44:00 2010 (r204347) @@ -9,7 +9,7 @@ SRCS= zic.c ialloc.c scheck.c CFLAGS+= -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone -DSTD_INSPIRED -DPCTS CFLAGS+= -DHAVE_LONG_DOUBLE -DTZDIR=\"/usr/share/zoneinfo\" -Demkdir=mkdir CFLAGS+= -DHAVE_STRERROR -DHAVE_UNISTD_H -CFLAGS+= -I${.CURDIR}/.. -I${.CURDIR}/../../../lib/libc/stdtime +CFLAGS+= -I${.CURDIR}/.. -I${.CURDIR}/../../../contrib/tzcode/stdtime WARNS?= 2 From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 07:08:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE6C0106564A; Fri, 26 Feb 2010 07:08:44 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD0BB8FC1A; Fri, 26 Feb 2010 07:08:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1Q78ili066032; Fri, 26 Feb 2010 07:08:44 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1Q78ih5066029; Fri, 26 Feb 2010 07:08:44 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201002260708.o1Q78ih5066029@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 26 Feb 2010 07:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204348 - head/sys/dev/cxgb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 07:08:45 -0000 Author: np Date: Fri Feb 26 07:08:44 2010 New Revision: 204348 URL: http://svn.freebsd.org/changeset/base/204348 Log: Support IFCAP_VLANHWTSO in cxgb(4). It works with or without vlanhwtag. While here, remove old DPRINTFs and tidy up the capability code a bit. Modified: head/sys/dev/cxgb/cxgb_main.c head/sys/dev/cxgb/cxgb_sge.c Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Fri Feb 26 06:44:00 2010 (r204347) +++ head/sys/dev/cxgb/cxgb_main.c Fri Feb 26 07:08:44 2010 (r204348) @@ -972,7 +972,8 @@ cxgb_makedev(struct port_info *pi) } #define CXGB_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | \ - IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO) + IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO | \ + IFCAP_VLAN_HWTSO) #define CXGB_CAP_ENABLE (CXGB_CAP & ~IFCAP_TSO6) static int @@ -1015,8 +1016,8 @@ cxgb_port_attach(device_t dev) * Disable TSO on 4-port - it isn't supported by the firmware. */ if (sc->params.nports > 2) { - ifp->if_capabilities &= ~IFCAP_TSO; - ifp->if_capenable &= ~IFCAP_TSO; + ifp->if_capabilities &= ~(IFCAP_TSO | IFCAP_VLAN_HWTSO); + ifp->if_capenable &= ~(IFCAP_TSO | IFCAP_VLAN_HWTSO); ifp->if_hwassist &= ~CSUM_TSO; } @@ -2045,28 +2046,34 @@ fail: mask = ifr->ifr_reqcap ^ ifp->if_capenable; if (mask & IFCAP_TXCSUM) { - if (IFCAP_TXCSUM & ifp->if_capenable) { - ifp->if_capenable &= ~(IFCAP_TXCSUM|IFCAP_TSO4); - ifp->if_hwassist &= ~(CSUM_TCP | CSUM_UDP - | CSUM_IP | CSUM_TSO); - } else { - ifp->if_capenable |= IFCAP_TXCSUM; - ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP - | CSUM_IP); + ifp->if_capenable ^= IFCAP_TXCSUM; + ifp->if_hwassist ^= (CSUM_TCP | CSUM_UDP | CSUM_IP); + + if (IFCAP_TSO & ifp->if_capenable && + !(IFCAP_TXCSUM & ifp->if_capenable)) { + ifp->if_capenable &= ~IFCAP_TSO; + ifp->if_hwassist &= ~CSUM_TSO; + if_printf(ifp, + "tso disabled due to -txcsum.\n"); } } - if (mask & IFCAP_RXCSUM) { + if (mask & IFCAP_RXCSUM) ifp->if_capenable ^= IFCAP_RXCSUM; - } if (mask & IFCAP_TSO4) { - if (IFCAP_TSO4 & ifp->if_capenable) { - ifp->if_capenable &= ~IFCAP_TSO4; - ifp->if_hwassist &= ~CSUM_TSO; - } else if (IFCAP_TXCSUM & ifp->if_capenable) { - ifp->if_capenable |= IFCAP_TSO4; - ifp->if_hwassist |= CSUM_TSO; + ifp->if_capenable ^= IFCAP_TSO4; + + if (IFCAP_TSO & ifp->if_capenable) { + if (IFCAP_TXCSUM & ifp->if_capenable) + ifp->if_hwassist |= CSUM_TSO; + else { + ifp->if_capenable &= ~IFCAP_TSO; + ifp->if_hwassist &= ~CSUM_TSO; + if_printf(ifp, + "enable txcsum first.\n"); + error = EAGAIN; + } } else - error = EINVAL; + ifp->if_hwassist &= ~CSUM_TSO; } if (mask & IFCAP_LRO) { ifp->if_capenable ^= IFCAP_LRO; @@ -2090,6 +2097,8 @@ fail: PORT_UNLOCK(p); } } + if (mask & IFCAP_VLAN_HWTSO) + ifp->if_capenable ^= IFCAP_VLAN_HWTSO; if (mask & IFCAP_VLAN_HWCSUM) ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Fri Feb 26 06:44:00 2010 (r204347) +++ head/sys/dev/cxgb/cxgb_sge.c Fri Feb 26 07:08:44 2010 (r204348) @@ -50,8 +50,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include +#include +#include #include #include @@ -1362,8 +1366,8 @@ write_wr_hdr_sgl(unsigned int ndesc, str } } -/* sizeof(*eh) + sizeof(*vhdr) + sizeof(*ip) + sizeof(*tcp) */ -#define TCPPKTHDRSIZE (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN + 20 + 20) +/* sizeof(*eh) + sizeof(*ip) + sizeof(*tcp) */ +#define TCPPKTHDRSIZE (ETHER_HDR_LEN + 20 + 20) #define GET_VTAG(cntrl, m) \ do { \ @@ -1399,10 +1403,7 @@ t3_encap(struct sge_qset *qs, struct mbu prefetch(txd); m0 = *m; - - DPRINTF("t3_encap port_id=%d qsidx=%d ", pi->port_id, pi->first_qset); - DPRINTF("mlen=%d txpkt_intf=%d tx_chan=%d\n", m[0]->m_pkthdr.len, pi->txpkt_intf, pi->tx_chan); - + mtx_assert(&qs->lock, MA_OWNED); cntrl = V_TXPKT_INTF(pi->txpkt_intf); KASSERT(m0->m_flags & M_PKTHDR, ("not packet header\n")); @@ -1475,11 +1476,11 @@ t3_encap(struct sge_qset *qs, struct mbu check_ring_tx_db(sc, txq); return (0); } else if (tso_info) { - int min_size = TCPPKTHDRSIZE, eth_type, tagged; + int eth_type; struct cpl_tx_pkt_lso *hdr = (struct cpl_tx_pkt_lso *)txd; + struct ether_header *eh; struct ip *ip; struct tcphdr *tcp; - char *pkthdr; txd->flit[2] = 0; GET_VTAG(cntrl, m0); @@ -1487,13 +1488,7 @@ t3_encap(struct sge_qset *qs, struct mbu hdr->cntrl = htonl(cntrl); hdr->len = htonl(mlen | 0x80000000); - DPRINTF("tso buf len=%d\n", mlen); - - tagged = m0->m_flags & M_VLANTAG; - if (!tagged) - min_size -= ETHER_VLAN_ENCAP_LEN; - - if (__predict_false(mlen < min_size)) { + if (__predict_false(mlen < TCPPKTHDRSIZE)) { printf("mbuf=%p,len=%d,tso_segsz=%d,csum_flags=%#x,flags=%#x", m0, mlen, m0->m_pkthdr.tso_segsz, m0->m_pkthdr.csum_flags, m0->m_flags); @@ -1501,25 +1496,23 @@ t3_encap(struct sge_qset *qs, struct mbu } /* Make sure that ether, ip, tcp headers are all in m0 */ - if (__predict_false(m0->m_len < min_size)) { - m0 = m_pullup(m0, min_size); + if (__predict_false(m0->m_len < TCPPKTHDRSIZE)) { + m0 = m_pullup(m0, TCPPKTHDRSIZE); if (__predict_false(m0 == NULL)) { /* XXX panic probably an overreaction */ panic("couldn't fit header into mbuf"); } } - pkthdr = m0->m_data; - if (tagged) { + eh = mtod(m0, struct ether_header *); + if (eh->ether_type == htons(ETHERTYPE_VLAN)) { eth_type = CPL_ETH_II_VLAN; - ip = (struct ip *)(pkthdr + ETHER_HDR_LEN + - ETHER_VLAN_ENCAP_LEN); + ip = (struct ip *)((struct ether_vlan_header *)eh + 1); } else { eth_type = CPL_ETH_II; - ip = (struct ip *)(pkthdr + ETHER_HDR_LEN); + ip = (struct ip *)(eh + 1); } - tcp = (struct tcphdr *)((uint8_t *)ip + - sizeof(*ip)); + tcp = (struct tcphdr *)(ip + 1); tso_info |= V_LSO_ETH_TYPE(eth_type) | V_LSO_IPHDR_WORDS(ip->ip_hl) | @@ -1527,12 +1520,10 @@ t3_encap(struct sge_qset *qs, struct mbu hdr->lso_info = htonl(tso_info); if (__predict_false(mlen <= PIO_LEN)) { - /* pkt not undersized but fits in PIO_LEN + /* + * pkt not undersized but fits in PIO_LEN * Indicates a TSO bug at the higher levels. - * */ - DPRINTF("**5592 Fix** mbuf=%p,len=%d,tso_segsz=%d,csum_flags=%#x,flags=%#x", - m0, mlen, m0->m_pkthdr.tso_segsz, m0->m_pkthdr.csum_flags, m0->m_flags); txsd->m = NULL; m_copydata(m0, 0, mlen, (caddr_t)&txd->flit[3]); flits = (mlen + 7) / 8 + 3; From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 09:31:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50BF91065675; Fri, 26 Feb 2010 09:31:51 +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 3FCAA8FC13; Fri, 26 Feb 2010 09:31:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1Q9Vpx7097622; Fri, 26 Feb 2010 09:31:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1Q9VpBB097620; Fri, 26 Feb 2010 09:31:51 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002260931.o1Q9VpBB097620@svn.freebsd.org> From: Alexander Motin Date: Fri, 26 Feb 2010 09:31: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: r204351 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 09:31:51 -0000 Author: mav Date: Fri Feb 26 09:31:50 2010 New Revision: 204351 URL: http://svn.freebsd.org/changeset/base/204351 Log: Fix bug in headphones audio redirection using separate DAC. It was exposed by removing channel duplication during multichannel audio implementation. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Fri Feb 26 07:22:07 2010 (r204350) +++ head/sys/dev/sound/pci/hda/hdac.c Fri Feb 26 09:31:50 2010 (r204351) @@ -86,7 +86,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20100122_0141" +#define HDA_DRV_TEST_REV "20100226_0142" SND_DECLARE_FILE("$FreeBSD$"); @@ -3503,7 +3503,7 @@ hdac_stream_setup(struct hdac_chan *ch) /* If HP redirection is enabled, but failed to use same DAC, make last DAC to duplicate first one. */ - if (as->hpredir >= 0 && i == as->pincnt) { + if (as->fakeredir && i == (as->pincnt - 1)) { c = (ch->sid << 4); } else { if (map >= 0) /* Map known speaker setups. */ From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 09:41:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 751D2106564A; Fri, 26 Feb 2010 09:41:16 +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 622738FC19; Fri, 26 Feb 2010 09:41:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1Q9fG5S099729; Fri, 26 Feb 2010 09:41:16 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1Q9fGiO099720; Fri, 26 Feb 2010 09:41:16 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201002260941.o1Q9fGiO099720@svn.freebsd.org> From: Ruslan Ermilov Date: Fri, 26 Feb 2010 09:41: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: r204352 - in head: libexec/rpc.rstatd libexec/ulog-helper sbin/hastd usr.bin/fetch usr.bin/unzip usr.sbin/auditd usr.sbin/boot0cfg usr.sbin/mptutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 09:41:16 -0000 Author: ru Date: Fri Feb 26 09:41:16 2010 New Revision: 204352 URL: http://svn.freebsd.org/changeset/base/204352 Log: Fixed static linkage. Modified: head/libexec/rpc.rstatd/Makefile head/libexec/ulog-helper/Makefile head/sbin/hastd/Makefile head/usr.bin/fetch/Makefile head/usr.bin/unzip/Makefile head/usr.sbin/auditd/Makefile head/usr.sbin/boot0cfg/Makefile head/usr.sbin/mptutil/Makefile Modified: head/libexec/rpc.rstatd/Makefile ============================================================================== --- head/libexec/rpc.rstatd/Makefile Fri Feb 26 09:31:50 2010 (r204351) +++ head/libexec/rpc.rstatd/Makefile Fri Feb 26 09:41:16 2010 (r204352) @@ -4,8 +4,8 @@ PROG = rpc.rstatd SRCS = rstatd.c rstat_proc.c MAN = rpc.rstatd.8 -DPADD= ${LIBRPCSVC} ${LIBUTIL} ${LIBDEVSTAT} -LDADD= -lrpcsvc -lutil -ldevstat +DPADD= ${LIBRPCSVC} ${LIBUTIL} ${LIBDEVSTAT} ${LIBKVM} +LDADD= -lrpcsvc -lutil -ldevstat -lkvm WARNS?= 1 Modified: head/libexec/ulog-helper/Makefile ============================================================================== --- head/libexec/ulog-helper/Makefile Fri Feb 26 09:31:50 2010 (r204351) +++ head/libexec/ulog-helper/Makefile Fri Feb 26 09:41:16 2010 (r204352) @@ -5,7 +5,7 @@ BINOWN= root BINMODE=4555 NO_MAN= -DPADD= ${LIBULOG} -LDADD= -lulog +DPADD= ${LIBULOG} ${LIBMD} +LDADD= -lulog -lmd .include Modified: head/sbin/hastd/Makefile ============================================================================== --- head/sbin/hastd/Makefile Fri Feb 26 09:31:50 2010 (r204351) +++ head/sbin/hastd/Makefile Fri Feb 26 09:41:16 2010 (r204352) @@ -27,8 +27,9 @@ CFLAGS+=-DINET6 # This is needed to have WARNS > 1. CFLAGS+=-DYY_NO_UNPUT -DPADD= ${LIBCRYPTO} ${LIBGEOM} ${LIBL} ${LIBPTHREAD} ${LIBUTIL} -LDADD= -lcrypto -lgeom -ll -lpthread -lutil +DPADD= ${LIBCRYPTO} ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} ${LIBL} \ + ${LIBPTHREAD} ${LIBUTIL} +LDADD= -lcrypto -lgeom -lbsdxml -lsbuf -ll -lpthread -lutil YFLAGS+=-v Modified: head/usr.bin/fetch/Makefile ============================================================================== --- head/usr.bin/fetch/Makefile Fri Feb 26 09:31:50 2010 (r204351) +++ head/usr.bin/fetch/Makefile Fri Feb 26 09:41:16 2010 (r204352) @@ -4,8 +4,8 @@ PROG= fetch CSTD?= c99 -DPADD= ${LIBFETCH} -LDADD= -lfetch +DPADD= ${LIBFETCH} ${LIBMD} +LDADD= -lfetch -lmd .if ${MK_OPENSSL} != "no" DPADD+= ${LIBSSL} ${LIBCRYPTO} LDADD+= -lssl -lcrypto Modified: head/usr.bin/unzip/Makefile ============================================================================== --- head/usr.bin/unzip/Makefile Fri Feb 26 09:31:50 2010 (r204351) +++ head/usr.bin/unzip/Makefile Fri Feb 26 09:41:16 2010 (r204352) @@ -2,7 +2,7 @@ PROG = unzip CSTD = c99 -DPADD = ${LIBARCHIVE} -LDADD = -larchive +DPADD = ${LIBARCHIVE} ${LIBZ} +LDADD = -larchive -lz .include Modified: head/usr.sbin/auditd/Makefile ============================================================================== --- head/usr.sbin/auditd/Makefile Fri Feb 26 09:31:50 2010 (r204351) +++ head/usr.sbin/auditd/Makefile Fri Feb 26 09:41:16 2010 (r204352) @@ -11,8 +11,8 @@ PROG= auditd SRCS= auditd.c audit_warn.c auditd_fbsd.c MAN= auditd.8 -DPADD= ${LIBBSM} ${LIBAUDITD} -LDADD= -lbsm -lauditd +DPADD= ${LIBAUDITD} ${LIBBSM} +LDADD= -lauditd -lbsm WARNS?= 3 Modified: head/usr.sbin/boot0cfg/Makefile ============================================================================== --- head/usr.sbin/boot0cfg/Makefile Fri Feb 26 09:31:50 2010 (r204351) +++ head/usr.sbin/boot0cfg/Makefile Fri Feb 26 09:41:16 2010 (r204352) @@ -3,7 +3,7 @@ PROG= boot0cfg MAN= boot0cfg.8 -DPADD= ${LIBGEOM} -LDADD= -lgeom +DPADD= ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} +LDADD= -lgeom -lbsdxml -lsbuf .include Modified: head/usr.sbin/mptutil/Makefile ============================================================================== --- head/usr.sbin/mptutil/Makefile Fri Feb 26 09:31:50 2010 (r204351) +++ head/usr.sbin/mptutil/Makefile Fri Feb 26 09:41:16 2010 (r204352) @@ -8,8 +8,8 @@ MAN= mptutil.8 WARNS?= 3 -DPADD+= ${LIBCAM} ${LIBUTIL} -LDADD+= -lcam -lutil +DPADD= ${LIBCAM} ${LIBSBUF} ${LIBUTIL} +LDADD= -lcam -lsbuf -lutil # Here be dragons .ifdef DEBUG From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 10:33:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 724C9106566B; Fri, 26 Feb 2010 10:33:48 +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 61A9F8FC17; Fri, 26 Feb 2010 10:33:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1QAXmb8013301; Fri, 26 Feb 2010 10:33:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1QAXmqs013271; Fri, 26 Feb 2010 10:33:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002261033.o1QAXmqs013271@svn.freebsd.org> From: Alexander Motin Date: Fri, 26 Feb 2010 10: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: r204353 - head/sys/cam X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 10:33:49 -0000 Author: mav Date: Fri Feb 26 10:33:48 2010 New Revision: 204353 URL: http://svn.freebsd.org/changeset/base/204353 Log: Fix newlines broken at r204220. Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Fri Feb 26 09:41:16 2010 (r204352) +++ head/sys/cam/cam_xpt.c Fri Feb 26 10:33:48 2010 (r204353) @@ -1096,7 +1096,7 @@ xpt_announce_periph(struct cam_periph *p /* Announce command queueing. */ if (path->device->inq_flags & SID_CmdQue || path->device->flags & CAM_DEV_TAG_AFTER_COUNT) { - printf("\n%s%d: Command Queueing enabled", + printf("%s%d: Command Queueing enabled\n", periph->periph_name, periph->unit_number); } /* Announce caller's details if they've passed in. */ From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 10:42:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFEE0106566B; Fri, 26 Feb 2010 10:42:46 +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 AEDDA8FC1C; Fri, 26 Feb 2010 10:42:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1QAgk9S015260; Fri, 26 Feb 2010 10:42:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1QAgkEx015257; Fri, 26 Feb 2010 10:42:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002261042.o1QAgkEx015257@svn.freebsd.org> From: Alexander Motin Date: Fri, 26 Feb 2010 10:42: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: r204354 - in head/sys: cam/ata sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 10:42:46 -0000 Author: mav Date: Fri Feb 26 10:42:46 2010 New Revision: 204354 URL: http://svn.freebsd.org/changeset/base/204354 Log: Make PUIS detection more strict. Previous implementation caused false positives on VMWare's virtual CD-ROMs. Modified: head/sys/cam/ata/ata_xpt.c head/sys/sys/ata.h Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Fri Feb 26 10:33:48 2010 (r204353) +++ head/sys/cam/ata/ata_xpt.c Fri Feb 26 10:42:46 2010 (r204354) @@ -788,11 +788,10 @@ noerror: ata_btrim(ident_buf->serial, sizeof(ident_buf->serial)); ata_bpack(ident_buf->serial, ident_buf->serial, sizeof(ident_buf->serial)); /* Device may need spin-up before IDENTIFY become valid. */ - if ((ident_buf->config & ATA_RESP_INCOMPLETE) || - ((ident_buf->support.command2 & ATA_SUPPORT_STANDBY) && - (ident_buf->enabled.command2 & ATA_SUPPORT_STANDBY) && - (ident_buf->support.command2 & ATA_SUPPORT_SPINUP) && - softc->spinup == 0)) { + if ((ident_buf->specconf == 0x37c8 || + ident_buf->specconf == 0x738c) && + ((ident_buf->config & ATA_RESP_INCOMPLETE) || + softc->spinup == 0)) { PROBE_SET_ACTION(softc, PROBE_SPINUP); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); Modified: head/sys/sys/ata.h ============================================================================== --- head/sys/sys/ata.h Fri Feb 26 10:33:48 2010 (r204353) +++ head/sys/sys/ata.h Fri Feb 26 10:42:46 2010 (r204354) @@ -51,7 +51,7 @@ struct ata_params { #define ATA_RESP_INCOMPLETE 0x0004 /*001*/ u_int16_t cylinders; /* # of cylinders */ - u_int16_t reserved2; +/*002*/ u_int16_t specconf; /* specific configuration */ /*003*/ u_int16_t heads; /* # heads */ u_int16_t obsolete4; u_int16_t obsolete5; From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 10:49:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08330106564A; Fri, 26 Feb 2010 10:49:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 88A1F8FC14; Fri, 26 Feb 2010 10:49:41 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o1QAnak7062150 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 26 Feb 2010 12:49:36 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o1QAnaWM054936; Fri, 26 Feb 2010 12:49:36 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o1QAnaO6054935; Fri, 26 Feb 2010 12:49:36 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 26 Feb 2010 12:49:36 +0200 From: Kostik Belousov To: "M. Warner Losh" Message-ID: <20100226104936.GD2489@deviant.kiev.zoral.com.ua> References: <3bbf2fe11002251548y773c661gd4946f371bcbbd6f@mail.gmail.com> <3bbf2fe11002251732t35179d9ar3c3f39aafe75d5c2@mail.gmail.com> <20100225.185653.364718154403387259.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="llIrKcgUOe3dCx0c" Content-Disposition: inline In-Reply-To: <20100225.185653.364718154403387259.imp@bsdimp.com> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean Cc: attilio@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, delphij@gmail.com Subject: Re: svn commit: r204309 - in head/sys: amd64/amd64 amd64/isa conf i386/bios i386/cpufreq i386/i386 i386/isa i386/xen isa modules/bios/smbios modules/bios/vpd modules/cpufreq pc98/pc98 x86 x86/bios x86/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 10:49:42 -0000 --llIrKcgUOe3dCx0c Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 25, 2010 at 06:56:53PM -0700, M. Warner Losh wrote: > In message: <3bbf2fe11002251732t35179d9ar3c3f39aafe75d5c2@mail.gmail.com> > Attilio Rao writes: > : 2010/2/26 Xin LI : > : > On Thu, Feb 25, 2010 at 3:48 PM, Attilio Rao wr= ote: > : >> 2010/2/26 M. Warner Losh : > : >>> In message: <201002251413.o1PEDdKV033584@svn.freebsd.org> > : >>> =9A =9A =9A =9A =9A =9AAttilio Rao writes: > : >>> : Author: attilio > : >>> : Date: Thu Feb 25 14:13:39 2010 > : >>> : New Revision: 204309 > : >>> : URL: http://svn.freebsd.org/changeset/base/204309 > : >>> : > : >>> : Log: > : >>> : =9A Introduce the new kernel sub-tree x86 which should contain al= l the code > : >>> : =9A shared and generalized between our current amd64, i386 and pc= 98. > : >>> : > : >>> : =9A This is just an initial step that should lead to a more compl= ete effort. > : >>> : =9A For the moment, a very simple porting of cpufreq modules, BIO= S calls and > : >>> : =9A the whole MD specific ISA bus part is added to the sub-tree b= ut ideally > : >>> : =9A a lot of code might be added and more shared support should g= row. > : >>> > : >>> Cool! > : >>> > : >>> : =9A Sponsored by: =9A =9A =9A Sandvine Incorporated > : >>> : =9A Reviewed by: =9A =9A =9A =9Aemaste, kib, jhb, imp > : >>> : =9A Discussed on: =9A =9A =9A arch > : >>> : =9A MFC: =9A =9A =9A =9A =9A =9A =9A =9A3 weeks > : >>> > : >>> Is this really wise? =9AAre these changes KPI neutral? > : >> > : >> I don't think there are (still) KPI changes. > : >> Which one are you referring to? > : > > : > I think Warner means that there will be some header files to change > : > their location, making certain (I doubt there is any but just in case) > : > kernel modules maintained by third party to break (technically these > : > are not part of KPI but something that _could_ make third party > : > developers unhappy I guess). > :=20 > : Yes but what is already compiled (thirdy-part modules included) will > : keep working without a glance. >=20 > Yes, but modules can't be recompiled. That's why I said KPI rather > than KBI. >=20 > : I think there have been already MFCed patches doing headers movements > : in the past. >=20 > We've tried to keep the KPI upwardly compatible. If files move, then > old code will potentially break. Yes, but there is very non-trivial cost of not merging this. It makes testing in HEAD of other patches less valuable for merges, and merges itself becomes more time-consuming and risking. Fortunately, I do not no dri, but I know that maintaining patches both for 7 and 8/HEAD of dri is a hell. --llIrKcgUOe3dCx0c Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkuHpz8ACgkQC3+MBN1Mb4iMdgCfSe3/wXzvoX9VqxfiXJLun2z0 SJAAni//AXtedV6dY7ZvcvBFIvYDLL4c =cDZb -----END PGP SIGNATURE----- --llIrKcgUOe3dCx0c-- From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 12:12:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58567106566C; Fri, 26 Feb 2010 12:12:54 +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 47E448FC13; Fri, 26 Feb 2010 12:12:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1QCCsu5035191; Fri, 26 Feb 2010 12:12:54 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1QCCs2Z035189; Fri, 26 Feb 2010 12:12:54 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201002261212.o1QCCs2Z035189@svn.freebsd.org> From: Ruslan Ermilov Date: Fri, 26 Feb 2010 12:12: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: r204355 - head/secure/usr.sbin/sshd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 12:12:54 -0000 Author: ru Date: Fri Feb 26 12:12:54 2010 New Revision: 204355 URL: http://svn.freebsd.org/changeset/base/204355 Log: (Almost) fixed static linkage. The remaining problem is with libgssapi.a and libgssapi_krb5.a libraries that define the same symbols. Modified: head/secure/usr.sbin/sshd/Makefile Modified: head/secure/usr.sbin/sshd/Makefile ============================================================================== --- head/secure/usr.sbin/sshd/Makefile Fri Feb 26 10:42:46 2010 (r204354) +++ head/secure/usr.sbin/sshd/Makefile Fri Feb 26 12:12:54 2010 (r204355) @@ -34,8 +34,8 @@ LDADD+= -lbsm .if ${MK_KERBEROS_SUPPORT} != "no" CFLAGS+= -DGSSAPI -DHAVE_GSSAPI_GSSAPI_H=1 -DHAVE_GSSAPI_GSSAPI_KRB5_H=1 -DKRB5 -DHEIMDAL -DPADD+= ${LIBGSSAPI} ${LIBGSSAPI_KRB5} -LDADD+= -lgssapi -lgssapi_krb5 +DPADD+= ${LIBGSSAPI_KRB5} ${LIBGSSAPI} ${LIBKRB5} ${LIBASN1} +LDADD+= -lgssapi_krb5 -lgssapi -lkrb5 -lasn1 .endif .if defined(X11BASE) From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 12:21:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94DED106564A; Fri, 26 Feb 2010 12:21:58 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from mail.vega.ru (mail.vega.ru [90.156.167.5]) by mx1.freebsd.org (Postfix) with ESMTP id 4B0C38FC1C; Fri, 26 Feb 2010 12:21:58 +0000 (UTC) Received: from [10.100.124.99] (helo=edoofus.dev.vega.ru) by mail.vega.ru with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.71 (FreeBSD)) (envelope-from ) id 1NkzCe-000LsT-KB; Fri, 26 Feb 2010 15:21:56 +0300 Date: Fri, 26 Feb 2010 15:21:46 +0300 From: Ruslan Ermilov To: Doug Rabson Message-ID: <20100226122146.GA17782@edoofus.dev.vega.ru> References: <201002261212.o1QCCs2Z035189@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <201002261212.o1QCCs2Z035189@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: libgssapi.a and libgssapi_krb5.a cannot both be used X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 12:21:58 -0000 Doug, The libgssapi.a and libgssapi_krb5.a libraries both define the same symbols that makes static linkage using them impossible in some cases, e.g. when trying to link sshd(8) statically. Details are below. On Fri, Feb 26, 2010 at 12:12:54PM +0000, Ruslan Ermilov wrote: > Author: ru > Date: Fri Feb 26 12:12:54 2010 > New Revision: 204355 > URL: http://svn.freebsd.org/changeset/base/204355 >=20 > Log: > (Almost) fixed static linkage. The remaining problem is with > libgssapi.a and libgssapi_krb5.a libraries that define the > same symbols. After this fix, the static build still fails like this: %%% Script started on Fri Feb 26 15:15:30 2010 # pwd /usr/src/secure/usr.sbin/sshd # make -DNO_SHARED cc -O2 -pipe -I/usr/src/secure/usr.sbin/sshd/../../../crypto/openssh -incl= ude ssh_namespace.h -DUSE_BSM_AUDIT -DHAVE_GETAUDIT_ADDR -DGSSAPI -DHAVE_GS= SAPI_GSSAPI_H=3D1 -DHAVE_GSSAPI_GSSAPI_KRB5_H=3D1 -DKRB5 -DHEIMDAL -DNO_IDE= A -std=3Dgnu99 -fstack-protector -Wno-pointer-sign -static -o sshd sshd.o = auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o sshpty.o sshlogin.o se= rvconf.o serverloop.o auth.o auth1.o auth2.o auth-options.o session.o auth-= chall.o auth2-chall.o groupaccess.o auth-skey.o auth-bsdauth.o auth2-hostba= sed.o auth2-kbdint.o auth2-none.o auth2-passwd.o auth2-pubkey.o auth2-jpake= =2Eo monitor_mm.o monitor.o monitor_wrap.o kexdhs.o kexgexs.o auth-krb5.o a= uth2-gss.o gss-serv.o gss-serv-krb5.o loginrec.o auth-pam.o auth-shadow.o a= uth-sia.o md5crypt.o audit.o audit-bsm.o platform.o sftp-server.o sftp-comm= on.o roaming_common.o gss-genr.o -lssh -lutil -lz -lwrap -lpam -lkrb5 -lhx5= 09 -lasn1 -lcrypto -lcrypt -lroken -lcom_err -lradius -ltacplus -lcrypt -l= util -lopie -lmd -lssh -lcrypto -lcrypt -lypclnt -lbsm -lgssapi_krb5 -lgssa= pi -lkrb5 -lasn1 -lcrypto -lcrypt /usr/lib/libgssapi.a(gss_names.o)(.data+0x0): multiple definition of `GSS_C= _NT_USER_NAME' /usr/lib/libgssapi_krb5.a(external.o)(.data+0x0): first defined here /usr/lib/libgssapi.a(gss_names.o)(.data+0x4): multiple definition of `GSS_C= _NT_MACHINE_UID_NAME' /usr/lib/libgssapi_krb5.a(external.o)(.data+0x4): first defined here /usr/lib/libgssapi.a(gss_names.o)(.data+0x8): multiple definition of `GSS_C= _NT_STRING_UID_NAME' /usr/lib/libgssapi_krb5.a(external.o)(.data+0x8): first defined here /usr/lib/libgssapi.a(gss_names.o)(.data+0xc): multiple definition of `GSS_C= _NT_HOSTBASED_SERVICE_X' /usr/lib/libgssapi_krb5.a(external.o)(.data+0xc): first defined here /usr/lib/libgssapi.a(gss_names.o)(.data+0x10): multiple definition of `GSS_= C_NT_HOSTBASED_SERVICE' /usr/lib/libgssapi_krb5.a(external.o)(.data+0x10): first defined here /usr/lib/libgssapi.a(gss_names.o)(.data+0x14): multiple definition of `GSS_= C_NT_ANONYMOUS' /usr/lib/libgssapi_krb5.a(external.o)(.data+0x14): first defined here /usr/lib/libgssapi.a(gss_names.o)(.data+0x18): multiple definition of `GSS_= C_NT_EXPORT_NAME' /usr/lib/libgssapi_krb5.a(external.o)(.data+0x18): first defined here /usr/lib/libgssapi.a(gss_names.o)(.data+0x1c): multiple definition of `GSS_= KRB5_NT_PRINCIPAL_NAME' /usr/lib/libgssapi_krb5.a(external.o)(.data+0x1c): first defined here /usr/lib/libgssapi.a(gss_names.o)(.data+0x20): multiple definition of `GSS_= KRB5_NT_USER_NAME' /usr/lib/libgssapi_krb5.a(external.o)(.data+0x20): first defined here /usr/lib/libgssapi.a(gss_names.o)(.data+0x24): multiple definition of `GSS_= KRB5_NT_MACHINE_UID_NAME' /usr/lib/libgssapi_krb5.a(external.o)(.data+0x24): first defined here /usr/lib/libgssapi.a(gss_names.o)(.data+0x28): multiple definition of `GSS_= KRB5_NT_STRING_UID_NAME' /usr/lib/libgssapi_krb5.a(external.o)(.data+0x28): first defined here *** Error code 1 Stop in /usr/src/secure/usr.sbin/sshd. #=20 %%% Can you please fix this problem within libgss* libraries? Thanks, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 12:31:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FEC4106564A; Fri, 26 Feb 2010 12:31:16 +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 8F5868FC19; Fri, 26 Feb 2010 12:31:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1QCVGLd039246; Fri, 26 Feb 2010 12:31:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1QCVGEa039244; Fri, 26 Feb 2010 12:31:16 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002261231.o1QCVGEa039244@svn.freebsd.org> From: Alexander Motin Date: Fri, 26 Feb 2010 12:31: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: r204356 - head/sys/dev/mpt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 12:31:16 -0000 Author: mav Date: Fri Feb 26 12:31:16 2010 New Revision: 204356 URL: http://svn.freebsd.org/changeset/base/204356 Log: Store path for rescan to the right place. This should fix panic on boot, introduced by r203108. Modified: head/sys/dev/mpt/mpt_raid.c Modified: head/sys/dev/mpt/mpt_raid.c ============================================================================== --- head/sys/dev/mpt/mpt_raid.c Fri Feb 26 12:12:54 2010 (r204355) +++ head/sys/dev/mpt/mpt_raid.c Fri Feb 26 12:31:16 2010 (r204356) @@ -690,7 +690,6 @@ mpt_raid_thread(void *arg) if (mpt->raid_rescan != 0) { union ccb *ccb; - struct cam_path *path; int error; mpt->raid_rescan = 0; @@ -699,7 +698,7 @@ mpt_raid_thread(void *arg) ccb = xpt_alloc_ccb(); MPT_LOCK(mpt); - error = xpt_create_path(&path, xpt_periph, + error = xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(mpt->phydisk_sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); if (error != CAM_REQ_CMP) { From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 13:40:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E869D1065675; Fri, 26 Feb 2010 13:40:56 +0000 (UTC) (envelope-from emaste@freebsd.org) Received: from mail2.sandvine.com (Mail1.sandvine.com [64.7.137.134]) by mx1.freebsd.org (Postfix) with ESMTP id AA91B8FC1B; Fri, 26 Feb 2010 13:40:56 +0000 (UTC) Received: from labgw2.phaedrus.sandvine.com ([192.168.3.11]) by mail2.sandvine.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 26 Feb 2010 08:28:49 -0500 Received: by labgw2.phaedrus.sandvine.com (Postfix, from userid 10332) id B56EC1170A; Fri, 26 Feb 2010 08:28:54 -0500 (EST) Date: Fri, 26 Feb 2010 08:28:54 -0500 From: Ed Maste To: Kostik Belousov Message-ID: <20100226132854.GA25722@sandvine.com> References: <3bbf2fe11002251548y773c661gd4946f371bcbbd6f@mail.gmail.com> <3bbf2fe11002251732t35179d9ar3c3f39aafe75d5c2@mail.gmail.com> <20100225.185653.364718154403387259.imp@bsdimp.com> <20100226104936.GD2489@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100226104936.GD2489@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.4.2.1i X-OriginalArrivalTime: 26 Feb 2010 13:28:49.0836 (UTC) FILETIME=[A1994EC0:01CAB6E7] Cc: src-committers@freebsd.org, delphij@gmail.com, svn-src-all@freebsd.org, attilio@freebsd.org, svn-src-head@freebsd.org, "M. Warner Losh" Subject: Re: svn commit: r204309 - in head/sys: amd64/amd64 amd64/isa conf i386/bios i386/cpufreq i386/i386 i386/isa i386/xen isa modules/bios/smbios modules/bios/vpd modules/cpufreq pc98/pc98 x86 x86/bios x86/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 13:40:57 -0000 [ About the i386/amd64/pc98 -> x86 merge ] > > : I think there have been already MFCed patches doing headers movements > > : in the past. > > > > We've tried to keep the KPI upwardly compatible. If files move, then > > old code will potentially break. > > Yes, but there is very non-trivial cost of not merging this. > It makes testing in HEAD of other patches less valuable for merges, > and merges itself becomes more time-consuming and risking. > > Fortunately, I do not no dri, but I know that maintaining patches > both for 7 and 8/HEAD of dri is a hell. For headers on older branches we can just leave backwards compatibility stubs in the i386, amd64 and pc98 directories that include the header from the new x86 directory. -Ed From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 13:47:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82DC6106566B; Fri, 26 Feb 2010 13:47:51 +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 727B58FC17; Fri, 26 Feb 2010 13:47:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1QDlpXu056132; Fri, 26 Feb 2010 13:47:51 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1QDlpNT056130; Fri, 26 Feb 2010 13:47:51 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201002261347.o1QDlpNT056130@svn.freebsd.org> From: Ed Schouten Date: Fri, 26 Feb 2010 13:47: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: r204358 - head/usr.bin/pr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 13:47:51 -0000 Author: ed Date: Fri Feb 26 13:47:51 2010 New Revision: 204358 URL: http://svn.freebsd.org/changeset/base/204358 Log: Use time(NULL) instead of gettimeofday(), because we only need tv_sec. Modified: head/usr.bin/pr/pr.c Modified: head/usr.bin/pr/pr.c ============================================================================== --- head/usr.bin/pr/pr.c Fri Feb 26 12:40:01 2010 (r204357) +++ head/usr.bin/pr/pr.c Fri Feb 26 13:47:51 2010 (r204358) @@ -1265,9 +1265,7 @@ FILE * nxtfile(int argc, char **argv, const char **fname, char *buf, int dt) { FILE *inf = NULL; - struct timeval tv; time_t tv_sec; - struct timezone tz; struct tm *timeptr = NULL; struct stat statbuf; static int twice = -1; @@ -1287,14 +1285,13 @@ nxtfile(int argc, char **argv, const cha *fname = fnamedefault; if (nohead) return(inf); - if (gettimeofday(&tv, &tz) < 0) { + if ((tv_sec = time(NULL)) == -1) { ++errcnt; (void)fprintf(err, "pr: cannot get time of day, %s\n", strerror(errno)); eoptind = argc - 1; return(NULL); } - tv_sec = tv.tv_sec; timeptr = localtime(&tv_sec); } for (; eoptind < argc; ++eoptind) { @@ -1311,14 +1308,13 @@ nxtfile(int argc, char **argv, const cha ++eoptind; if (nohead || (dt && twice)) return(inf); - if (gettimeofday(&tv, &tz) < 0) { + if ((tv_sec = time(NULL)) == -1) { ++errcnt; (void)fprintf(err, "pr: cannot get time of day, %s\n", strerror(errno)); return(NULL); } - tv_sec = tv.tv_sec; timeptr = localtime(&tv_sec); } else { /* @@ -1343,14 +1339,13 @@ nxtfile(int argc, char **argv, const cha return(inf); if (dt) { - if (gettimeofday(&tv, &tz) < 0) { + if ((tv_sec = time(NULL)) == -1) { ++errcnt; (void)fprintf(err, "pr: cannot get time of day, %s\n", strerror(errno)); return(NULL); } - tv_sec = tv.tv_sec; timeptr = localtime(&tv_sec); } else { if (fstat(fileno(inf), &statbuf) < 0) { From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 13:48:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 288C01065742; Fri, 26 Feb 2010 13:48:05 +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 187228FC0A; Fri, 26 Feb 2010 13:48:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1QDm4YI056235; Fri, 26 Feb 2010 13:48:04 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1QDm4xx056232; Fri, 26 Feb 2010 13:48:04 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201002261348.o1QDm4xx056232@svn.freebsd.org> From: Ed Schouten Date: Fri, 26 Feb 2010 13:48: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: r204359 - head/usr.bin/pr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 13:48:05 -0000 Author: ed Date: Fri Feb 26 13:48:04 2010 New Revision: 204359 URL: http://svn.freebsd.org/changeset/base/204359 Log: Make pr build with WARNS=6. Modified: head/usr.bin/pr/Makefile head/usr.bin/pr/egetopt.c Modified: head/usr.bin/pr/Makefile ============================================================================== --- head/usr.bin/pr/Makefile Fri Feb 26 13:47:51 2010 (r204358) +++ head/usr.bin/pr/Makefile Fri Feb 26 13:48:04 2010 (r204359) @@ -4,6 +4,4 @@ PROG= pr SRCS= pr.c egetopt.c -WARNS?= 2 - .include Modified: head/usr.bin/pr/egetopt.c ============================================================================== --- head/usr.bin/pr/egetopt.c Fri Feb 26 13:47:51 2010 (r204358) +++ head/usr.bin/pr/egetopt.c Fri Feb 26 13:48:04 2010 (r204359) @@ -48,6 +48,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "extern.h" + /* * egetopt: get option letter from argument vector (an extended * version of getopt). From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 13:57:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 267DA106564A; Fri, 26 Feb 2010 13:57:44 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-iw0-f198.google.com (mail-iw0-f198.google.com [209.85.223.198]) by mx1.freebsd.org (Postfix) with ESMTP id AC0338FC1B; Fri, 26 Feb 2010 13:57:43 +0000 (UTC) Received: by iwn36 with SMTP id 36so92122iwn.28 for ; Fri, 26 Feb 2010 05:57:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=5/x8T+EZxhckD1pV6HYwm3qysb5BF1AsnfnSMlEioKo=; b=n5/TGDlCHU3pgPljTwymPVfXFRxayIVCLdTwTVr0Io6tEFCCYGh5ZanTGj9RfhgHKy BE2tadw1vIuraqrrLBXSbVkxlJ1otEI4wgcb0tg7nE1AKiyVuAMXFtOTPmEZ65Z5kQDk MvnDAJpGeATcOPL2NkFUyqf83leKAx578RPuE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=W/1j3TxtSzwBD8jx2VgMliOFZ1AAR5BAWZZgQkkfi8ctMIf041Z6rfFgIYDWlgXstW pb5VOPCDDrJ2dz6y20wh4mIFFugj8dBg0Xn4WAhLJr3e4FgyLC0Y3YLBP6y0O4fWrbG0 +PlHxdNSIy2on8IiPyX+8ackQPKNGrrsuqFT4= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.231.148.16 with SMTP id n16mr190212ibv.37.1267192656595; Fri, 26 Feb 2010 05:57:36 -0800 (PST) In-Reply-To: <20100226132854.GA25722@sandvine.com> References: <3bbf2fe11002251548y773c661gd4946f371bcbbd6f@mail.gmail.com> <3bbf2fe11002251732t35179d9ar3c3f39aafe75d5c2@mail.gmail.com> <20100225.185653.364718154403387259.imp@bsdimp.com> <20100226104936.GD2489@deviant.kiev.zoral.com.ua> <20100226132854.GA25722@sandvine.com> Date: Fri, 26 Feb 2010 14:57:36 +0100 X-Google-Sender-Auth: 2093c49e966be496 Message-ID: <3bbf2fe11002260557y484cf13bq76f7507c07ed3ebc@mail.gmail.com> From: Attilio Rao To: Ed Maste Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, delphij@gmail.com, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Kostik Belousov , "M. Warner Losh" Subject: Re: svn commit: r204309 - in head/sys: amd64/amd64 amd64/isa conf i386/bios i386/cpufreq i386/i386 i386/isa i386/xen isa modules/bios/smbios modules/bios/vpd modules/cpufreq pc98/pc98 x86 x86/bios x86/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 13:57:44 -0000 2010/2/26 Ed Maste : > [ About the i386/amd64/pc98 -> x86 merge ] > >> > : I think there have been already MFCed patches doing headers movement= s >> > : in the past. >> > >> > We've tried to keep the KPI upwardly compatible. =C2=A0If files move, = then >> > old code will potentially break. >> >> Yes, but there is very non-trivial cost of not merging this. >> It makes testing in HEAD of other patches less valuable for merges, >> and merges itself becomes more time-consuming and risking. >> >> Fortunately, I do not no dri, but I know that maintaining patches >> both for 7 and 8/HEAD of dri is a hell. > > For headers on older branches we can just leave backwards compatibility > stubs in the i386, amd64 and pc98 directories that include the header > from the new x86 directory. Yes, I thought something along those lines, if we think it is worthy (I'm not very concerned about it right now). For the future, however, probabilly we would need to do something like pc98 already does wrt i386 (i386/include/ pc98/include/ amd64/include/ just have files wrappers to the generic one under x86/include/ when necessary). Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 15:17:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D4E7106566B; Fri, 26 Feb 2010 15:17:08 +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 D8F9E8FC2F; Fri, 26 Feb 2010 15:17:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o1QF3sYs098131; Fri, 26 Feb 2010 08:03:54 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 26 Feb 2010 08:04:02 -0700 (MST) Message-Id: <20100226.080402.506212773199817375.imp@bsdimp.com> To: attilio@freebsd.org From: "M. Warner Losh" In-Reply-To: <3bbf2fe11002260557y484cf13bq76f7507c07ed3ebc@mail.gmail.com> References: <20100226104936.GD2489@deviant.kiev.zoral.com.ua> <20100226132854.GA25722@sandvine.com> <3bbf2fe11002260557y484cf13bq76f7507c07ed3ebc@mail.gmail.com> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, delphij@gmail.com, svn-src-all@freebsd.org, svn-src-head@freebsd.org, kostikbel@gmail.com, emaste@freebsd.org Subject: Re: svn commit: r204309 - in head/sys: amd64/amd64 amd64/isa conf i386/bios i386/cpufreq i386/i386 i386/isa i386/xen isa modules/bios/smbios modules/bios/vpd modules/cpufreq pc98/pc98 x86 x86/bios x86/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 15:17:08 -0000 In message: <3bbf2fe11002260557y484cf13bq76f7507c07ed3ebc@mail.gmail.co= m> Attilio Rao writes: : 2010/2/26 Ed Maste : : > [ About the i386/amd64/pc98 -> x86 merge ] : > : >> > : I think there have been already MFCed patches doing headers mo= vements : >> > : in the past. : >> > : >> > We've tried to keep the KPI upwardly compatible. =A0If files mov= e, then : >> > old code will potentially break. : >> : >> Yes, but there is very non-trivial cost of not merging this. : >> It makes testing in HEAD of other patches less valuable for merges= , : >> and merges itself becomes more time-consuming and risking. : >> : >> Fortunately, I do not no dri, but I know that maintaining patches : >> both for 7 and 8/HEAD of dri is a hell. : > : > For headers on older branches we can just leave backwards compatibi= lity : > stubs in the i386, amd64 and pc98 directories that include the head= er : > from the new x86 directory. : = : Yes, I thought something along those lines, if we think it is worthy : (I'm not very concerned about it right now). : For the future, however, probabilly we would need to do something lik= e : pc98 already does wrt i386 (i386/include/ pc98/include/ amd64/include= / : just have files wrappers to the generic one under x86/include/ when : necessary). Yes. If you're going to merge this to old branches, it is critical that you do this so you don't break the compilation of modules on those branches. Warner From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 16:27:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D4141065690; Fri, 26 Feb 2010 16:27:13 +0000 (UTC) (envelope-from wilko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CBCD8FC19; Fri, 26 Feb 2010 16:27:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1QGRDO3091245; Fri, 26 Feb 2010 16:27:13 GMT (envelope-from wilko@svn.freebsd.org) Received: (from wilko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1QGRB2T091242; Fri, 26 Feb 2010 16:27:11 GMT (envelope-from wilko@svn.freebsd.org) Message-Id: <201002261627.o1QGRB2T091242@svn.freebsd.org> From: Wilko Bulte Date: Fri, 26 Feb 2010 16:27: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: r204360 - head/games/fortune/datfiles X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 16:27:13 -0000 Author: wilko Date: Fri Feb 26 16:27:11 2010 New Revision: 204360 URL: http://svn.freebsd.org/changeset/base/204360 Log: s/all ready/already/ Submitted by: ru@, gj@ Modified: head/games/fortune/datfiles/fortunes Modified: head/games/fortune/datfiles/fortunes ============================================================================== --- head/games/fortune/datfiles/fortunes Fri Feb 26 13:48:04 2010 (r204359) +++ head/games/fortune/datfiles/fortunes Fri Feb 26 16:27:11 2010 (r204360) @@ -59627,7 +59627,7 @@ transmission, please delete it immediate Obviously, I am the idiot who sent it to you by mistake. Furthermore, there is no way I can force you to delete it. Worse, by the time you -have reached this disclaimer you have all ready read the document. +have reached this disclaimer you have already read the document. Telling you to forget it would seem absurd. In any event, I have no legal right to force you to take any action upon this email anyway. From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 17:27:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03C46106566B; Fri, 26 Feb 2010 17:27:17 +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 E76978FC16; Fri, 26 Feb 2010 17:27:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1QHRGPG004691; Fri, 26 Feb 2010 17:27:16 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1QHRG04004689; Fri, 26 Feb 2010 17:27:16 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002261727.o1QHRG04004689@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 26 Feb 2010 17:27: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: r204361 - head/sys/dev/msk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 17:27:17 -0000 Author: yongari Date: Fri Feb 26 17:27:16 2010 New Revision: 204361 URL: http://svn.freebsd.org/changeset/base/204361 Log: Reuse the configured LE for VLAN if new LE was created for TSO. Only old controllers need to create new LE for TSO. This change makes TSO work over VLANs. Modified: head/sys/dev/msk/if_msk.c Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Fri Feb 26 16:27:11 2010 (r204360) +++ head/sys/dev/msk/if_msk.c Fri Feb 26 17:27:16 2010 (r204361) @@ -2686,7 +2686,7 @@ msk_encap(struct msk_if_softc *sc_if, st } /* Check if we have a VLAN tag to insert. */ if ((m->m_flags & M_VLANTAG) != 0) { - if (tso == 0) { + if (tx_le == NULL) { tx_le = &sc_if->msk_rdata.msk_tx_ring[prod]; tx_le->msk_addr = htole32(0); tx_le->msk_control = htole32(OP_VLAN | HW_OWNER | From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 17:33:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00B76106566B; Fri, 26 Feb 2010 17:33:44 +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 CA4208FC16; Fri, 26 Feb 2010 17:33:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1QHXhu1006157; Fri, 26 Feb 2010 17:33:43 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1QHXhFx006155; Fri, 26 Feb 2010 17:33:43 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002261733.o1QHXhFx006155@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 26 Feb 2010 17:33: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: r204362 - head/sys/dev/msk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 17:33:44 -0000 Author: yongari Date: Fri Feb 26 17:33:43 2010 New Revision: 204362 URL: http://svn.freebsd.org/changeset/base/204362 Log: Add TSO support on VLANs. Controller requires VLAN hardware tagging to make TSO work over VLANs. Modified: head/sys/dev/msk/if_msk.c Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Fri Feb 26 17:27:16 2010 (r204361) +++ head/sys/dev/msk/if_msk.c Fri Feb 26 17:33:43 2010 (r204362) @@ -1006,11 +1006,6 @@ msk_ioctl(struct ifnet *ifp, u_long comm if ((mask & IFCAP_RXCSUM) != 0 && (IFCAP_RXCSUM & ifp->if_capabilities) != 0) ifp->if_capenable ^= IFCAP_RXCSUM; - if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && - (IFCAP_VLAN_HWTAGGING & ifp->if_capabilities) != 0) { - ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; - msk_setvlan(sc_if, ifp); - } if ((mask & IFCAP_VLAN_HWCSUM) != 0 && (IFCAP_VLAN_HWCSUM & ifp->if_capabilities) != 0) ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; @@ -1022,6 +1017,16 @@ msk_ioctl(struct ifnet *ifp, u_long comm else ifp->if_hwassist &= ~CSUM_TSO; } + if ((mask & IFCAP_VLAN_HWTSO) != 0 && + (IFCAP_VLAN_HWTSO & ifp->if_capabilities) != 0) + ifp->if_capenable ^= IFCAP_VLAN_HWTSO; + if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && + (IFCAP_VLAN_HWTAGGING & ifp->if_capabilities) != 0) { + ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + if ((IFCAP_VLAN_HWTAGGING & ifp->if_capenable) == 0) + ifp->if_capenable &= ~IFCAP_VLAN_HWTSO; + msk_setvlan(sc_if, ifp); + } if (ifp->if_mtu > ETHERMTU && (sc_if->msk_flags & MSK_FLAG_JUMBO_NOCSUM) != 0) { ifp->if_hwassist &= ~(MSK_CSUM_FEATURES | CSUM_TSO); @@ -1559,7 +1564,7 @@ msk_attach(device_t dev) * this workaround does not work so disable checksum offload * for VLAN interface. */ - ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING; + ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWTSO; /* * Enable Rx checksum offloading for VLAN taggedd frames * if controller support new descriptor format. From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 18:18:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFDCD106566C; Fri, 26 Feb 2010 18:18:02 +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 947C18FC12; Fri, 26 Feb 2010 18:18:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1QII2dX016015; Fri, 26 Feb 2010 18:18:02 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1QII2mU016012; Fri, 26 Feb 2010 18:18:02 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002261818.o1QII2mU016012@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 26 Feb 2010 18:18: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: r204363 - head/sys/dev/msk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 18:18:02 -0000 Author: yongari Date: Fri Feb 26 18:18:02 2010 New Revision: 204363 URL: http://svn.freebsd.org/changeset/base/204363 Log: Optimize inserting LE for TX checksum computation. Controller does not require checksum LE configuration if checksum start and write position is the same as before. So keep track last checksum start and write position and insert new LE whenever the position is changed. This reduces number of LEs used in TX path as well as slightly enhance TX performance. Modified: head/sys/dev/msk/if_msk.c head/sys/dev/msk/if_mskreg.h Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Fri Feb 26 17:33:43 2010 (r204362) +++ head/sys/dev/msk/if_msk.c Fri Feb 26 18:18:02 2010 (r204363) @@ -738,6 +738,7 @@ msk_init_tx_ring(struct msk_if_softc *sc int i; sc_if->msk_cdata.msk_tso_mtu = 0; + sc_if->msk_cdata.msk_last_csum = 0; sc_if->msk_cdata.msk_tx_prod = 0; sc_if->msk_cdata.msk_tx_cons = 0; sc_if->msk_cdata.msk_tx_cnt = 0; @@ -2530,7 +2531,7 @@ msk_encap(struct msk_if_softc *sc_if, st struct mbuf *m; bus_dmamap_t map; bus_dma_segment_t txsegs[MSK_MAXTXSEGS]; - uint32_t control, prod, si; + uint32_t control, csum, prod, si; uint16_t offset, tcp_offset, tso_mtu; int error, i, nseg, tso; @@ -2709,17 +2710,22 @@ msk_encap(struct msk_if_softc *sc_if, st if ((sc_if->msk_flags & MSK_FLAG_AUTOTX_CSUM) != 0) control |= CALSUM; else { - tx_le = &sc_if->msk_rdata.msk_tx_ring[prod]; - tx_le->msk_addr = htole32(((tcp_offset + - m->m_pkthdr.csum_data) & 0xffff) | - ((uint32_t)tcp_offset << 16)); - tx_le->msk_control = htole32(1 << 16 | - (OP_TCPLISW | HW_OWNER)); - control = CALSUM | WR_SUM | INIT_SUM | LOCK_SUM; + control |= CALSUM | WR_SUM | INIT_SUM | LOCK_SUM; if ((m->m_pkthdr.csum_flags & CSUM_UDP) != 0) control |= UDPTCP; - sc_if->msk_cdata.msk_tx_cnt++; - MSK_INC(prod, MSK_TX_RING_CNT); + /* Checksum write position. */ + csum = (tcp_offset + m->m_pkthdr.csum_data) & 0xffff; + /* Checksum start position. */ + csum |= (uint32_t)tcp_offset << 16; + if (csum != sc_if->msk_cdata.msk_last_csum) { + tx_le = &sc_if->msk_rdata.msk_tx_ring[prod]; + tx_le->msk_addr = htole32(csum); + tx_le->msk_control = htole32(1 << 16 | + (OP_TCPLISW | HW_OWNER)); + sc_if->msk_cdata.msk_tx_cnt++; + MSK_INC(prod, MSK_TX_RING_CNT); + sc_if->msk_cdata.msk_last_csum = csum; + } } } Modified: head/sys/dev/msk/if_mskreg.h ============================================================================== --- head/sys/dev/msk/if_mskreg.h Fri Feb 26 17:33:43 2010 (r204362) +++ head/sys/dev/msk/if_mskreg.h Fri Feb 26 18:18:02 2010 (r204363) @@ -2361,6 +2361,7 @@ struct msk_chain_data { bus_dmamap_t msk_jumbo_rx_ring_map; bus_dmamap_t msk_jumbo_rx_sparemap; uint16_t msk_tso_mtu; + uint32_t msk_last_csum; int msk_tx_prod; int msk_tx_cons; int msk_tx_cnt; From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 19:18:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A46C106564A; Fri, 26 Feb 2010 19:18: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 692CD8FC17; Fri, 26 Feb 2010 19:18:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1QJITb8029474; Fri, 26 Feb 2010 19:18:29 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1QJITe2029471; Fri, 26 Feb 2010 19:18:29 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002261918.o1QJITe2029471@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 26 Feb 2010 19:18: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: r204365 - head/sys/dev/msk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 19:18:29 -0000 Author: yongari Date: Fri Feb 26 19:18:29 2010 New Revision: 204365 URL: http://svn.freebsd.org/changeset/base/204365 Log: Don't hardcod register offset to set PCIe max read request size. The register offset is not valid on 88E8072 controller. Also don't blindly increase max read request size to 4096, instead, use 2048 which seems to be more sane value and only change the value if the hardware default size(512) was used on that register. For PCIX controllers, use system defined constant rather than using magic value. While I'm here stop showing negotiated link width. Modified: head/sys/dev/msk/if_msk.c head/sys/dev/msk/if_mskreg.h Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Fri Feb 26 18:46:16 2010 (r204364) +++ head/sys/dev/msk/if_msk.c Fri Feb 26 19:18:29 2010 (r204365) @@ -1356,35 +1356,22 @@ mskc_reset(struct msk_softc *sc) * On dual port PCI-X card, there is an problem where status * can be received out of order due to split transactions. */ - if (sc->msk_bustype == MSK_PCIX_BUS && sc->msk_num_port > 1) { - int pcix; + if (sc->msk_pcixcap != 0 && sc->msk_num_port > 1) { uint16_t pcix_cmd; - if (pci_find_extcap(sc->msk_dev, PCIY_PCIX, &pcix) == 0) { - pcix_cmd = pci_read_config(sc->msk_dev, pcix + 2, 2); - /* Clear Max Outstanding Split Transactions. */ - pcix_cmd &= ~0x70; - CSR_WRITE_1(sc, B2_TST_CTRL1, TST_CFG_WRITE_ON); - pci_write_config(sc->msk_dev, pcix + 2, pcix_cmd, 2); - CSR_WRITE_1(sc, B2_TST_CTRL1, TST_CFG_WRITE_OFF); - } + pcix_cmd = pci_read_config(sc->msk_dev, + sc->msk_pcixcap + PCIXR_COMMAND, 2); + /* Clear Max Outstanding Split Transactions. */ + pcix_cmd &= ~PCIXM_COMMAND_MAX_SPLITS; + CSR_WRITE_1(sc, B2_TST_CTRL1, TST_CFG_WRITE_ON); + pci_write_config(sc->msk_dev, + sc->msk_pcixcap + PCIXR_COMMAND, pcix_cmd, 2); + CSR_WRITE_1(sc, B2_TST_CTRL1, TST_CFG_WRITE_OFF); } - if (sc->msk_bustype == MSK_PEX_BUS) { - uint16_t v, width; - - v = pci_read_config(sc->msk_dev, PEX_DEV_CTRL, 2); - /* Change Max. Read Request Size to 4096 bytes. */ - v &= ~PEX_DC_MAX_RRS_MSK; - v |= PEX_DC_MAX_RD_RQ_SIZE(5); - pci_write_config(sc->msk_dev, PEX_DEV_CTRL, v, 2); - width = pci_read_config(sc->msk_dev, PEX_LNK_STAT, 2); - width = (width & PEX_LS_LINK_WI_MSK) >> 4; - v = pci_read_config(sc->msk_dev, PEX_LNK_CAP, 2); - v = (v & PEX_LS_LINK_WI_MSK) >> 4; - if (v != width) - device_printf(sc->msk_dev, - "negotiated width of link(x%d) != " - "max. width of link(x%d)\n", width, v); + if (sc->msk_expcap != 0) { + /* Change Max. Read Request Size to 2048 bytes. */ + if (pci_get_max_read_req(sc->msk_dev) == 512) + pci_set_max_read_req(sc->msk_dev, 2048); } /* Clear status list. */ @@ -1694,11 +1681,13 @@ mskc_attach(device_t dev) } /* Check bus type. */ - if (pci_find_extcap(sc->msk_dev, PCIY_EXPRESS, ®) == 0) + if (pci_find_extcap(sc->msk_dev, PCIY_EXPRESS, ®) == 0) { sc->msk_bustype = MSK_PEX_BUS; - else if (pci_find_extcap(sc->msk_dev, PCIY_PCIX, ®) == 0) + sc->msk_expcap = reg; + } else if (pci_find_extcap(sc->msk_dev, PCIY_PCIX, ®) == 0) { sc->msk_bustype = MSK_PCIX_BUS; - else + sc->msk_pcixcap = reg; + } else sc->msk_bustype = MSK_PCI_BUS; switch (sc->msk_hw_id) { Modified: head/sys/dev/msk/if_mskreg.h ============================================================================== --- head/sys/dev/msk/if_mskreg.h Fri Feb 26 18:46:16 2010 (r204364) +++ head/sys/dev/msk/if_mskreg.h Fri Feb 26 19:18:29 2010 (r204365) @@ -2476,6 +2476,8 @@ struct msk_softc { uint8_t msk_hw_rev; uint8_t msk_bustype; uint8_t msk_num_port; + int msk_expcap; + int msk_pcixcap; int msk_ramsize; /* amount of SRAM on NIC */ uint32_t msk_pmd; /* physical media type */ uint32_t msk_intrmask; From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 19:37:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3E5A106564A; Fri, 26 Feb 2010 19:37:03 +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 929398FC08; Fri, 26 Feb 2010 19:37:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1QJb3PK033579; Fri, 26 Feb 2010 19:37:03 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1QJb37g033576; Fri, 26 Feb 2010 19:37:03 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002261937.o1QJb37g033576@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 26 Feb 2010 19:37: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: r204366 - head/sys/dev/msk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 19:37:03 -0000 Author: yongari Date: Fri Feb 26 19:37:03 2010 New Revision: 204366 URL: http://svn.freebsd.org/changeset/base/204366 Log: Allocate single MSI message. msk(4) used to allocate 2 MSI messages for controllers like 88E8053 which reports two MSI messages. Because we don't get anything useful things with 2 MSI messages, allocating 1 MSI message would be more sane approach. While I'm here, enable MSI for dual-port controllers too. Because status block is shared for dual-port controllers, I don't think msk(4) will encounter problem for using MSI on dual-port controllers. Modified: head/sys/dev/msk/if_msk.c head/sys/dev/msk/if_mskreg.h Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Fri Feb 26 19:18:29 2010 (r204365) +++ head/sys/dev/msk/if_msk.c Fri Feb 26 19:37:03 2010 (r204366) @@ -393,12 +393,6 @@ static struct resource_spec msk_irq_spec { -1, 0, 0 } }; -static struct resource_spec msk_irq_spec_msi2[] = { - { SYS_RES_IRQ, 1, RF_ACTIVE }, - { SYS_RES_IRQ, 2, RF_ACTIVE }, - { -1, 0, 0 } -}; - static int msk_miibus_readreg(device_t dev, int phy, int reg) { @@ -1757,37 +1751,16 @@ mskc_attach(device_t dev) msic = pci_msi_count(dev); if (bootverbose) device_printf(dev, "MSI count : %d\n", msic); - /* - * The Yukon II reports it can handle two messages, one for each - * possible port. We go ahead and allocate two messages and only - * setup a handler for both if we have a dual port card. - * - * XXX: I haven't untangled the interrupt handler to handle dual - * port cards with separate MSI messages, so for now I disable MSI - * on dual port cards. - */ if (legacy_intr != 0) msi_disable = 1; - if (msi_disable == 0) { - switch (msic) { - case 2: - case 1: /* 88E8058 reports 1 MSI message */ - msir = msic; - if (sc->msk_num_port == 1 && - pci_alloc_msi(dev, &msir) == 0) { - if (msic == msir) { - sc->msk_pflags |= MSK_FLAG_MSI; - sc->msk_irq_spec = msic == 2 ? - msk_irq_spec_msi2 : - msk_irq_spec_msi; - } else - pci_release_msi(dev); - } - break; - default: - device_printf(dev, - "Unexpected number of MSI messages : %d\n", msic); - break; + if (msi_disable == 0 && msic > 0) { + msir = 1; + if (pci_alloc_msi(dev, &msir) == 0) { + if (msir == 1) { + sc->msk_pflags |= MSK_FLAG_MSI; + sc->msk_irq_spec = msk_irq_spec_msi; + } else + pci_release_msi(dev); } } @@ -1861,7 +1834,7 @@ mskc_attach(device_t dev) if (legacy_intr) error = bus_setup_intr(dev, sc->msk_irq[0], INTR_TYPE_NET | INTR_MPSAFE, NULL, msk_legacy_intr, sc, - &sc->msk_intrhand[0]); + &sc->msk_intrhand); else { TASK_INIT(&sc->msk_int_task, 0, msk_int_task, sc); sc->msk_tq = taskqueue_create_fast("msk_taskq", M_WAITOK, @@ -1869,7 +1842,7 @@ mskc_attach(device_t dev) taskqueue_start_threads(&sc->msk_tq, 1, PI_NET, "%s taskq", device_get_nameunit(sc->msk_dev)); error = bus_setup_intr(dev, sc->msk_irq[0], INTR_TYPE_NET | - INTR_MPSAFE, msk_intr, NULL, sc, &sc->msk_intrhand[0]); + INTR_MPSAFE, msk_intr, NULL, sc, &sc->msk_intrhand); } if (error != 0) { @@ -1983,13 +1956,9 @@ mskc_detach(device_t dev) taskqueue_free(sc->msk_tq); sc->msk_tq = NULL; } - if (sc->msk_intrhand[0]) { - bus_teardown_intr(dev, sc->msk_irq[0], sc->msk_intrhand[0]); - sc->msk_intrhand[0] = NULL; - } - if (sc->msk_intrhand[1]) { - bus_teardown_intr(dev, sc->msk_irq[0], sc->msk_intrhand[0]); - sc->msk_intrhand[1] = NULL; + if (sc->msk_intrhand) { + bus_teardown_intr(dev, sc->msk_irq[0], sc->msk_intrhand); + sc->msk_intrhand = NULL; } bus_release_resources(dev, sc->msk_irq_spec, sc->msk_irq); if ((sc->msk_pflags & MSK_FLAG_MSI) != 0) Modified: head/sys/dev/msk/if_mskreg.h ============================================================================== --- head/sys/dev/msk/if_mskreg.h Fri Feb 26 19:18:29 2010 (r204365) +++ head/sys/dev/msk/if_mskreg.h Fri Feb 26 19:37:03 2010 (r204366) @@ -2468,9 +2468,9 @@ struct msk_hw_stats { struct msk_softc { struct resource *msk_res[1]; /* I/O resource */ struct resource_spec *msk_res_spec; - struct resource *msk_irq[2]; /* IRQ resources */ + struct resource *msk_irq[1]; /* IRQ resources */ struct resource_spec *msk_irq_spec; - void *msk_intrhand[2]; /* irq handler handle */ + void *msk_intrhand; /* irq handler handle */ device_t msk_dev; uint8_t msk_hw_id; uint8_t msk_hw_rev; From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 19:38:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DE2C106564A; Fri, 26 Feb 2010 19:38:12 +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 6D6268FC08; Fri, 26 Feb 2010 19:38:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1QJcCbA033876; Fri, 26 Feb 2010 19:38:12 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1QJcCTc033874; Fri, 26 Feb 2010 19:38:12 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002261938.o1QJcCTc033874@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 26 Feb 2010 19:38: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: r204367 - head/sys/dev/msk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 19:38:12 -0000 Author: yongari Date: Fri Feb 26 19:38:12 2010 New Revision: 204367 URL: http://svn.freebsd.org/changeset/base/204367 Log: Remove trailing white spaces. Modified: head/sys/dev/msk/if_msk.c Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Fri Feb 26 19:37:03 2010 (r204366) +++ head/sys/dev/msk/if_msk.c Fri Feb 26 19:38:12 2010 (r204367) @@ -1503,7 +1503,7 @@ msk_attach(device_t dev) * Enable Rx checksum offloading if controller support new * descriptor format. */ - if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0 && + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0 && (sc_if->msk_flags & MSK_FLAG_NORX_CSUM) == 0) ifp->if_capabilities |= IFCAP_RXCSUM; ifp->if_hwassist = MSK_CSUM_FEATURES | CSUM_TSO; @@ -1551,7 +1551,7 @@ msk_attach(device_t dev) * Enable Rx checksum offloading for VLAN taggedd frames * if controller support new descriptor format. */ - if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0 && + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0 && (sc_if->msk_flags & MSK_FLAG_NORX_CSUM) == 0) ifp->if_capabilities |= IFCAP_VLAN_HWCSUM; } @@ -3719,7 +3719,7 @@ msk_init_locked(struct msk_if_softc *sc_ CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_BYP_MACSECRX_ON | GMC_BYP_MACSECTX_ON | GMC_BYP_RETR_ON); - + /* * Initialize GMAC first such that speed/duplex/flow-control * parameters are renegotiated when interface is brought up. @@ -3767,7 +3767,7 @@ msk_init_locked(struct msk_if_softc *sc_ eaddr[2] | (eaddr[3] << 8)); GMAC_WRITE_2(sc, sc_if->msk_port, GM_SRC_ADDR_2H, eaddr[4] | (eaddr[5] << 8)); - + /* Disable interrupts for counter overflows. */ GMAC_WRITE_2(sc, sc_if->msk_port, GM_TX_IRQ_MSK, 0); GMAC_WRITE_2(sc, sc_if->msk_port, GM_RX_IRQ_MSK, 0); From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 20:17:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66BAA106564A; Fri, 26 Feb 2010 20:17:17 +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 555648FC15; Fri, 26 Feb 2010 20:17:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1QKHHRk042586; Fri, 26 Feb 2010 20:17:17 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1QKHHKC042584; Fri, 26 Feb 2010 20:17:17 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002262017.o1QKHHKC042584@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 26 Feb 2010 20:17: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: r204368 - head/sys/dev/bce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 20:17:17 -0000 Author: yongari Date: Fri Feb 26 20:17:17 2010 New Revision: 204368 URL: http://svn.freebsd.org/changeset/base/204368 Log: Allow disabling VLAN hardware tag stripping with software work around. Management firmware(ASF/IPMI/UMP) requires the VLAN hardware tag stripping so don't actually disable VLAN hardware tag stripping. If VLAN hardware tag stripping was disabled, bce(4) manually reconstruct VLAN frame by appending stripped VLAN tag. Also remove unnecessary IFCAP_VLAN_MTU message. Reviewed by: davidch Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Fri Feb 26 19:38:12 2010 (r204367) +++ head/sys/dev/bce/if_bce.c Fri Feb 26 20:17:17 2010 (r204368) @@ -5886,6 +5886,7 @@ bce_rx_intr(struct bce_softc *sc) { struct ifnet *ifp = sc->bce_ifp; struct l2_fhdr *l2fhdr; + struct ether_vlan_header *vh; unsigned int pkt_len; u16 sw_rx_cons, sw_rx_cons_idx, hw_rx_cons; u32 status; @@ -6141,12 +6142,37 @@ bce_rx_intr(struct bce_softc *sc) /* Attach the VLAN tag. */ if (status & L2_FHDR_STATUS_L2_VLAN_TAG) { + if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) { #if __FreeBSD_version < 700000 - VLAN_INPUT_TAG(ifp, m0, l2fhdr->l2_fhdr_vlan_tag, continue); + VLAN_INPUT_TAG(ifp, m0, + l2fhdr->l2_fhdr_vlan_tag, continue); #else - m0->m_pkthdr.ether_vtag = l2fhdr->l2_fhdr_vlan_tag; - m0->m_flags |= M_VLANTAG; + m0->m_pkthdr.ether_vtag = + l2fhdr->l2_fhdr_vlan_tag; + m0->m_flags |= M_VLANTAG; #endif + } else { + /* + * bce(4) controllers can't disable VLAN + * tag stripping if management firmware + * (ASF/IPMI/UMP) is running. So we always + * strip VLAN tag and manually reconstruct + * the VLAN frame by appending stripped + * VLAN tag in driver if VLAN tag stripping + * was disabled. + * + * TODO: LLC SNAP handling. + */ + bcopy(mtod(m0, uint8_t *), + mtod(m0, uint8_t *) - ETHER_VLAN_ENCAP_LEN, + ETHER_ADDR_LEN * 2); + m0->m_data -= ETHER_VLAN_ENCAP_LEN; + vh = mtod(m0, struct ether_vlan_header *); + vh->evl_encap_proto = htons(ETHERTYPE_VLAN); + vh->evl_tag = htons(l2fhdr->l2_fhdr_vlan_tag); + m0->m_pkthdr.len += ETHER_VLAN_ENCAP_LEN; + m0->m_len += ETHER_VLAN_ENCAP_LEN; + } } /* Increment received packet statistics. */ @@ -7096,23 +7122,17 @@ bce_ioctl(struct ifnet *ifp, u_long comm ifp->if_hwassist = 0; } - /* Toggle VLAN_MTU capabilities enable flag. */ - if (mask & IFCAP_VLAN_MTU) { - BCE_PRINTF("%s(%d): Changing VLAN_MTU not supported.\n", - __FILE__, __LINE__); - } - - /* Toggle VLANHWTAG capabilities enabled flag. */ - if (mask & IFCAP_VLAN_HWTAGGING) { - if (sc->bce_flags & BCE_MFW_ENABLE_FLAG) - BCE_PRINTF("%s(%d): Cannot change VLAN_HWTAGGING while " - "management firmware (ASF/IPMI/UMP) is running!\n", - __FILE__, __LINE__); - else - BCE_PRINTF("%s(%d): Changing VLAN_HWTAGGING not supported!\n", - __FILE__, __LINE__); - } - + /* + * Don't actually disable VLAN tag stripping as + * management firmware (ASF/IPMI/UMP) requires the + * feature. If VLAN tag stripping is disabled driver + * will manually reconstruct the VLAN frame by + * appending stripped VLAN tag. + */ + if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING)) + ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + VLAN_CAPABILITIES(ifp); break; default: /* We don't know how to handle the IOCTL, pass it on. */ From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 20:26:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 914CE1065673; Fri, 26 Feb 2010 20:26:17 +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 808B38FC26; Fri, 26 Feb 2010 20:26:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1QKQHor044669; Fri, 26 Feb 2010 20:26:17 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1QKQHR4044667; Fri, 26 Feb 2010 20:26:17 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002262026.o1QKQHR4044667@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 26 Feb 2010 20:26: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: r204370 - head/sys/dev/bce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 20:26:17 -0000 Author: yongari Date: Fri Feb 26 20:26:17 2010 New Revision: 204370 URL: http://svn.freebsd.org/changeset/base/204370 Log: Make sure to stop controller first before changing MTU. And if interface is not running don't initialize controller. While here remove unnecessary update of error variable. Reviewed by: davidch Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Fri Feb 26 20:25:30 2010 (r204369) +++ head/sys/dev/bce/if_bce.c Fri Feb 26 20:26:17 2010 (r204370) @@ -6989,7 +6989,7 @@ bce_ioctl(struct ifnet *ifp, u_long comm struct bce_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *) data; struct mii_data *mii; - int mask, error = 0; + int mask, error = 0, reinit; DBENTER(BCE_VERBOSE_MISC); @@ -7010,7 +7010,16 @@ bce_ioctl(struct ifnet *ifp, u_long comm BCE_LOCK(sc); ifp->if_mtu = ifr->ifr_mtu; - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + reinit = 0; + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + /* + * Because allocation size is used in RX + * buffer allocation, stop controller if + * it is already running. + */ + bce_stop(sc); + reinit = 1; + } #ifdef BCE_JUMBO_HDRSPLIT /* No buffer allocation size changes are necessary. */ #else @@ -7028,7 +7037,8 @@ bce_ioctl(struct ifnet *ifp, u_long comm } #endif - bce_init_locked(sc); + if (reinit != 0) + bce_init_locked(sc); BCE_UNLOCK(sc); break; @@ -7062,7 +7072,6 @@ bce_ioctl(struct ifnet *ifp, u_long comm } BCE_UNLOCK(sc); - error = 0; break; @@ -7072,10 +7081,8 @@ bce_ioctl(struct ifnet *ifp, u_long comm DBPRINT(sc, BCE_VERBOSE_MISC, "Received SIOCADDMULTI/SIOCDELMULTI\n"); BCE_LOCK(sc); - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) bce_set_rx_mode(sc); - error = 0; - } BCE_UNLOCK(sc); break; From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 20:39:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17D0A106566C; Fri, 26 Feb 2010 20:39:08 +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 0708B8FC15; Fri, 26 Feb 2010 20:39:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1QKd70I047579; Fri, 26 Feb 2010 20:39:07 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1QKd7Gw047577; Fri, 26 Feb 2010 20:39:07 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002262039.o1QKd7Gw047577@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 26 Feb 2010 20:39: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: r204371 - head/sys/dev/bce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 20:39:08 -0000 Author: yongari Date: Fri Feb 26 20:39:07 2010 New Revision: 204371 URL: http://svn.freebsd.org/changeset/base/204371 Log: Make toggling TSO, VLAN hardware checksum offloading work. Also fix TX/RX checksum handler to set/clear relavant assist bits which was used to cause unexpected results. With this change, bce(4) can be bridged with other interfaces that lack TSO, VLAN checksum offloading. Reviewed by: davidch Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Fri Feb 26 20:26:17 2010 (r204370) +++ head/sys/dev/bce/if_bce.c Fri Feb 26 20:39:07 2010 (r204371) @@ -7102,33 +7102,35 @@ bce_ioctl(struct ifnet *ifp, u_long comm mask = ifr->ifr_reqcap ^ ifp->if_capenable; DBPRINT(sc, BCE_INFO_MISC, "Received SIOCSIFCAP = 0x%08X\n", (u32) mask); - /* Toggle the TX checksum capabilites enable flag. */ - if (mask & IFCAP_TXCSUM) { + /* Toggle the TX checksum capabilities enable flag. */ + if (mask & IFCAP_TXCSUM && + ifp->if_capabilities & IFCAP_TXCSUM) { ifp->if_capenable ^= IFCAP_TXCSUM; if (IFCAP_TXCSUM & ifp->if_capenable) - ifp->if_hwassist = BCE_IF_HWASSIST; + ifp->if_hwassist |= BCE_IF_HWASSIST; else - ifp->if_hwassist = 0; + ifp->if_hwassist &= ~BCE_IF_HWASSIST; } /* Toggle the RX checksum capabilities enable flag. */ - if (mask & IFCAP_RXCSUM) { + if (mask & IFCAP_RXCSUM && + ifp->if_capabilities & IFCAP_RXCSUM) ifp->if_capenable ^= IFCAP_RXCSUM; - if (IFCAP_RXCSUM & ifp->if_capenable) - ifp->if_hwassist = BCE_IF_HWASSIST; - else - ifp->if_hwassist = 0; - } /* Toggle the TSO capabilities enable flag. */ - if (bce_tso_enable && (mask & IFCAP_TSO4)) { + if (bce_tso_enable && (mask & IFCAP_TSO4) && + ifp->if_capabilities & IFCAP_TSO4) { ifp->if_capenable ^= IFCAP_TSO4; - if (IFCAP_RXCSUM & ifp->if_capenable) - ifp->if_hwassist = BCE_IF_HWASSIST; + if (IFCAP_TSO4 & ifp->if_capenable) + ifp->if_hwassist |= CSUM_TSO; else - ifp->if_hwassist = 0; + ifp->if_hwassist &= ~CSUM_TSO; } + if (mask & IFCAP_VLAN_HWCSUM && + ifp->if_capabilities & IFCAP_VLAN_HWCSUM) + ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; + /* * Don't actually disable VLAN tag stripping as * management firmware (ASF/IPMI/UMP) requires the From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 20:41:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E06621065670; Fri, 26 Feb 2010 20:41:28 +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 CFFDE8FC08; Fri, 26 Feb 2010 20:41:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1QKfSH5048156; Fri, 26 Feb 2010 20:41:28 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1QKfSEq048155; Fri, 26 Feb 2010 20:41:28 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002262041.o1QKfSEq048155@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 26 Feb 2010 20:41: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: r204372 - head/sys/dev/bce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 20:41:29 -0000 Author: yongari Date: Fri Feb 26 20:41:28 2010 New Revision: 204372 URL: http://svn.freebsd.org/changeset/base/204372 Log: Prefer m_collapse(9) over m_defrag(9). Reviewed by: davidch Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Fri Feb 26 20:39:07 2010 (r204371) +++ head/sys/dev/bce/if_bce.c Fri Feb 26 20:41:28 2010 (r204372) @@ -6713,7 +6713,7 @@ bce_tx_encap_skip_tso: sc->fragmented_mbuf_count++; /* Try to defrag the mbuf. */ - m0 = m_defrag(*m_head, M_DONTWAIT); + m0 = m_collapse(*m_head, M_DONTWAIT, BCE_MAX_SEGMENTS); if (m0 == NULL) { /* Defrag was unsuccessful */ m_freem(*m_head); From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 21:19:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33CDE106564A; Fri, 26 Feb 2010 21:19: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 20E268FC25; Fri, 26 Feb 2010 21:19:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1QLJkfQ056578; Fri, 26 Feb 2010 21:19:47 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1QLJkW1056576; Fri, 26 Feb 2010 21:19:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002262119.o1QLJkW1056576@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 26 Feb 2010 21:19: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: r204373 - head/sys/dev/bce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 21:19:47 -0000 Author: yongari Date: Fri Feb 26 21:19:46 2010 New Revision: 204373 URL: http://svn.freebsd.org/changeset/base/204373 Log: Move TSO setup to new function bce_tso_setup(). Also remove VLAN parsing code in TSO path as the controller requires VLAN hardware tagging to make TSO work over VLANs. While parsing the mbuf in TSO patch, always perform check for writable mbuf as bce(4) have to reset IP length and IP checksum field of IP header and make sure to ensure contiguous buffer before accessing IP/TCP headers. While I'm here replace magic number 40 to more readable sizeof(struct ip) + sizeof(struct tcphdr). Reviewed by: davidch Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Fri Feb 26 20:41:28 2010 (r204372) +++ head/sys/dev/bce/if_bce.c Fri Feb 26 21:19:46 2010 (r204373) @@ -403,6 +403,7 @@ static void bce_fill_pg_chain (struct b static void bce_free_pg_chain (struct bce_softc *); #endif +static struct mbuf *bce_tso_setup (struct bce_softc *, struct mbuf **, u16 *); static int bce_tx_encap (struct bce_softc *, struct mbuf **); static void bce_start_locked (struct ifnet *); static void bce_start (struct ifnet *); @@ -6585,6 +6586,110 @@ bce_init(void *xsc) } +static struct mbuf * +bce_tso_setup(struct bce_softc *sc, struct mbuf **m_head, u16 *flags) +{ + struct mbuf *m; + struct ether_header *eh; + struct ip *ip; + struct tcphdr *th; + u16 etype; + int hdr_len, ip_hlen = 0, tcp_hlen = 0, ip_len = 0; + + DBRUN(sc->requested_tso_frames++); + /* Controller requires to monify mbuf chains. */ + if (M_WRITABLE(*m_head) == 0) { + m = m_dup(*m_head, M_DONTWAIT); + m_freem(*m_head); + if (m == NULL) { + sc->mbuf_alloc_failed_count++; + *m_head = NULL; + return (NULL); + } + *m_head = m; + } + /* + * For TSO the controller needs two pieces of info, + * the MSS and the IP+TCP options length. + */ + m = m_pullup(*m_head, sizeof(struct ether_header) + sizeof(struct ip)); + if (m == NULL) { + *m_head = NULL; + return (NULL); + } + eh = mtod(m, struct ether_header *); + etype = ntohs(eh->ether_type); + + /* Check for supported TSO Ethernet types (only IPv4 for now) */ + switch (etype) { + case ETHERTYPE_IP: + ip = (struct ip *)(m->m_data + sizeof(struct ether_header)); + /* TSO only supported for TCP protocol. */ + if (ip->ip_p != IPPROTO_TCP) { + BCE_PRINTF("%s(%d): TSO enabled for non-TCP frame!.\n", + __FILE__, __LINE__); + m_freem(*m_head); + *m_head = NULL; + return (NULL); + } + + /* Get IP header length in bytes (min 20) */ + ip_hlen = ip->ip_hl << 2; + m = m_pullup(*m_head, sizeof(struct ether_header) + ip_hlen + + sizeof(struct tcphdr)); + if (m == NULL) { + *m_head = NULL; + return (NULL); + } + + /* Get the TCP header length in bytes (min 20) */ + th = (struct tcphdr *)((caddr_t)ip + ip_hlen); + tcp_hlen = (th->th_off << 2); + + /* Make sure all IP/TCP options live in the same buffer. */ + m = m_pullup(*m_head, sizeof(struct ether_header)+ ip_hlen + + tcp_hlen); + if (m == NULL) { + *m_head = NULL; + return (NULL); + } + + /* IP header length and checksum will be calc'd by hardware */ + ip_len = ip->ip_len; + ip->ip_len = 0; + ip->ip_sum = 0; + break; + case ETHERTYPE_IPV6: + BCE_PRINTF("%s(%d): TSO over IPv6 not supported!.\n", + __FILE__, __LINE__); + m_freem(*m_head); + *m_head = NULL; + return (NULL); + /* NOT REACHED */ + default: + BCE_PRINTF("%s(%d): TSO enabled for unsupported protocol!.\n", + __FILE__, __LINE__); + m_freem(*m_head); + *m_head = NULL; + return (NULL); + } + + hdr_len = sizeof(struct ether_header) + ip_hlen + tcp_hlen; + + DBPRINT(sc, BCE_EXTREME_SEND, "%s(): hdr_len = %d, e_hlen = %d, " + "ip_hlen = %d, tcp_hlen = %d, ip_len = %d\n", + __FUNCTION__, hdr_len, sizeof(struct ether_header), ip_hlen, + tcp_hlen, ip_len); + + /* Set the LSO flag in the TX BD */ + *flags |= TX_BD_FLAGS_SW_LSO; + /* Set the length of IP + TCP options (in 32 bit words) */ + *flags |= (((ip_hlen + tcp_hlen - sizeof(struct ip) - + sizeof(struct tcphdr)) >> 2) << 8); + return (*m_head); +} + + /****************************************************************************/ /* Encapsultes an mbuf cluster into the tx_bd chain structure and makes the */ /* memory visible to the controller. */ @@ -6601,12 +6706,8 @@ bce_tx_encap(struct bce_softc *sc, struc bus_dmamap_t map; struct tx_bd *txbd = NULL; struct mbuf *m0; - struct ether_vlan_header *eh; - struct ip *ip; - struct tcphdr *th; - u16 prod, chain_prod, etype, mss = 0, vlan_tag = 0, flags = 0; + u16 prod, chain_prod, mss = 0, vlan_tag = 0, flags = 0; u32 prod_bseq; - int hdr_len = 0, e_hlen = 0, ip_hlen = 0, tcp_hlen = 0, ip_len = 0; #ifdef BCE_DEBUG u16 debug_prod; @@ -6623,72 +6724,16 @@ bce_tx_encap(struct bce_softc *sc, struc /* Transfer any checksum offload flags to the bd. */ m0 = *m_head; if (m0->m_pkthdr.csum_flags) { - if (m0->m_pkthdr.csum_flags & CSUM_IP) - flags |= TX_BD_FLAGS_IP_CKSUM; - if (m0->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)) - flags |= TX_BD_FLAGS_TCP_UDP_CKSUM; if (m0->m_pkthdr.csum_flags & CSUM_TSO) { - /* For TSO the controller needs two pieces of info, */ - /* the MSS and the IP+TCP options length. */ + m0 = bce_tso_setup(sc, m_head, &flags); + if (m0 == NULL) + goto bce_tx_encap_exit; mss = htole16(m0->m_pkthdr.tso_segsz); - - /* Map the header and find the Ethernet type & header length */ - eh = mtod(m0, struct ether_vlan_header *); - if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { - etype = ntohs(eh->evl_proto); - e_hlen = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; - } else { - etype = ntohs(eh->evl_encap_proto); - e_hlen = ETHER_HDR_LEN; - } - - /* Check for supported TSO Ethernet types (only IPv4 for now) */ - switch (etype) { - case ETHERTYPE_IP: - ip = (struct ip *)(m0->m_data + e_hlen); - - /* TSO only supported for TCP protocol */ - if (ip->ip_p != IPPROTO_TCP) { - BCE_PRINTF("%s(%d): TSO enabled for non-TCP frame!.\n", - __FILE__, __LINE__); - goto bce_tx_encap_skip_tso; - } - - /* Get IP header length in bytes (min 20) */ - ip_hlen = ip->ip_hl << 2; - - /* Get the TCP header length in bytes (min 20) */ - th = (struct tcphdr *)((caddr_t)ip + ip_hlen); - tcp_hlen = (th->th_off << 2); - - /* IP header length and checksum will be calc'd by hardware */ - ip_len = ip->ip_len; - ip->ip_len = 0; - ip->ip_sum = 0; - break; - case ETHERTYPE_IPV6: - BCE_PRINTF("%s(%d): TSO over IPv6 not supported!.\n", - __FILE__, __LINE__); - goto bce_tx_encap_skip_tso; - default: - BCE_PRINTF("%s(%d): TSO enabled for unsupported protocol!.\n", - __FILE__, __LINE__); - goto bce_tx_encap_skip_tso; - } - - hdr_len = e_hlen + ip_hlen + tcp_hlen; - - DBPRINT(sc, BCE_EXTREME_SEND, - "%s(): hdr_len = %d, e_hlen = %d, ip_hlen = %d, tcp_hlen = %d, ip_len = %d\n", - __FUNCTION__, hdr_len, e_hlen, ip_hlen, tcp_hlen, ip_len); - - /* Set the LSO flag in the TX BD */ - flags |= TX_BD_FLAGS_SW_LSO; - /* Set the length of IP + TCP options (in 32 bit words) */ - flags |= (((ip_hlen + tcp_hlen - 40) >> 2) << 8); - -bce_tx_encap_skip_tso: - DBRUN(sc->requested_tso_frames++); + } else { + if (m0->m_pkthdr.csum_flags & CSUM_IP) + flags |= TX_BD_FLAGS_IP_CKSUM; + if (m0->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)) + flags |= TX_BD_FLAGS_TCP_UDP_CKSUM; } } From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 21:26:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D7801065673; Fri, 26 Feb 2010 21:26:07 +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 4C5958FC17; Fri, 26 Feb 2010 21:26:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1QLQ7rO057987; Fri, 26 Feb 2010 21:26:07 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1QLQ71Z057985; Fri, 26 Feb 2010 21:26:07 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002262126.o1QLQ71Z057985@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 26 Feb 2010 21:26: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: r204374 - head/sys/dev/bce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 21:26:07 -0000 Author: yongari Date: Fri Feb 26 21:26:07 2010 New Revision: 204374 URL: http://svn.freebsd.org/changeset/base/204374 Log: Add TSO support on VLANs. bce(4) controllers require VLAN hardware tagging to make TSO work on VLANs so explicitly disable TSO on VLAN if VLAN hardware tagging is disabled. Reviewed by: davidch Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Fri Feb 26 21:19:46 2010 (r204373) +++ head/sys/dev/bce/if_bce.c Fri Feb 26 21:26:07 2010 (r204374) @@ -1058,7 +1058,8 @@ bce_attach(device_t dev) if (bce_tso_enable) { ifp->if_hwassist = BCE_IF_HWASSIST | CSUM_TSO; - ifp->if_capabilities = BCE_IF_CAPABILITIES | IFCAP_TSO4; + ifp->if_capabilities = BCE_IF_CAPABILITIES | IFCAP_TSO4 | + IFCAP_VLAN_HWTSO; } else { ifp->if_hwassist = BCE_IF_HWASSIST; ifp->if_capabilities = BCE_IF_CAPABILITIES; @@ -7176,6 +7177,9 @@ bce_ioctl(struct ifnet *ifp, u_long comm ifp->if_capabilities & IFCAP_VLAN_HWCSUM) ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; + if ((mask & IFCAP_VLAN_HWTSO) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0) + ifp->if_capenable ^= IFCAP_VLAN_HWTSO; /* * Don't actually disable VLAN tag stripping as * management firmware (ASF/IPMI/UMP) requires the @@ -7184,8 +7188,12 @@ bce_ioctl(struct ifnet *ifp, u_long comm * appending stripped VLAN tag. */ if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && - (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING)) + (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING)) { ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) + == 0) + ifp->if_capenable &= ~IFCAP_VLAN_HWTSO; + } VLAN_CAPABILITIES(ifp); break; default: From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 22:29:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A7BE106566B; Fri, 26 Feb 2010 22:29:42 +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 59B698FC17; Fri, 26 Feb 2010 22:29:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1QMTgAE072153; Fri, 26 Feb 2010 22:29:42 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1QMTgSI072151; Fri, 26 Feb 2010 22:29:42 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002262229.o1QMTgSI072151@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 26 Feb 2010 22:29: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: r204376 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 22:29:42 -0000 Author: yongari Date: Fri Feb 26 22:29:42 2010 New Revision: 204376 URL: http://svn.freebsd.org/changeset/base/204376 Log: Disable TSO on BCM5755M controller until I understand better for the issue. I still have no idea why TSO does not work on this controller. davidch@ also confirmed there is no known TSO related issues for this controller. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Fri Feb 26 21:49:11 2010 (r204375) +++ head/sys/dev/bge/if_bge.c Fri Feb 26 22:29:42 2010 (r204376) @@ -2656,9 +2656,11 @@ bge_attach(device_t dev) /* * BCM5754 and BCM5787 shares the same ASIC id so * explicit device id check is required. + * Due to unknown reason TSO does not work on BCM5755M. */ if (pci_get_device(dev) != BCOM_DEVICEID_BCM5754 && - pci_get_device(dev) != BCOM_DEVICEID_BCM5754M) + pci_get_device(dev) != BCOM_DEVICEID_BCM5754M && + pci_get_device(dev) != BCOM_DEVICEID_BCM5755M) sc->bge_flags |= BGE_FLAG_TSO; } From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 22:43:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50B871065670; Fri, 26 Feb 2010 22:43:24 +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 250AA8FC15; Fri, 26 Feb 2010 22:43:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1QMhO76075273; Fri, 26 Feb 2010 22:43:24 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1QMhOpq075271; Fri, 26 Feb 2010 22:43:24 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002262243.o1QMhOpq075271@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 26 Feb 2010 22:43: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: r204377 - head/sys/dev/age X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 22:43:24 -0000 Author: yongari Date: Fri Feb 26 22:43:23 2010 New Revision: 204377 URL: http://svn.freebsd.org/changeset/base/204377 Log: Add TSO support on VLANs. While I'm here remove unnecessary check of VLAN hardware checksum offloading. vlan(4) already takes care of this. Modified: head/sys/dev/age/if_age.c Modified: head/sys/dev/age/if_age.c ============================================================================== --- head/sys/dev/age/if_age.c Fri Feb 26 22:29:42 2010 (r204376) +++ head/sys/dev/age/if_age.c Fri Feb 26 22:43:23 2010 (r204377) @@ -74,9 +74,6 @@ __FBSDID("$FreeBSD$"); /* "device miibus" required. See GENERIC if you get errors here. */ #include "miibus_if.h" -#ifndef IFCAP_VLAN_HWTSO -#define IFCAP_VLAN_HWTSO 0 -#endif #define AGE_CSUM_FEATURES (CSUM_TCP | CSUM_UDP) MODULE_DEPEND(age, pci, 1, 1, 1); @@ -633,8 +630,8 @@ age_attach(device_t dev) ether_ifattach(ifp, sc->age_eaddr); /* VLAN capability setup. */ - ifp->if_capabilities |= IFCAP_VLAN_MTU; - ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM; + ifp->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | + IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTSO; ifp->if_capenable = ifp->if_capabilities; /* Tell the upper layer(s) we support long frames. */ @@ -1892,29 +1889,19 @@ age_ioctl(struct ifnet *ifp, u_long cmd, if ((mask & IFCAP_WOL_MAGIC) != 0 && (ifp->if_capabilities & IFCAP_WOL_MAGIC) != 0) ifp->if_capenable ^= IFCAP_WOL_MAGIC; - - if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && - (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) { - ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; - age_rxvlan(sc); - } if ((mask & IFCAP_VLAN_HWCSUM) != 0 && (ifp->if_capabilities & IFCAP_VLAN_HWCSUM) != 0) ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; if ((mask & IFCAP_VLAN_HWTSO) != 0 && (ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0) ifp->if_capenable ^= IFCAP_VLAN_HWTSO; - /* - * VLAN hardware tagging is required to do checksum - * offload or TSO on VLAN interface. Checksum offload - * on VLAN interface also requires hardware assistance - * of parent interface. - */ - if ((ifp->if_capenable & IFCAP_TXCSUM) == 0) - ifp->if_capenable &= ~IFCAP_VLAN_HWCSUM; - if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0) - ifp->if_capenable &= - ~(IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM); + if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) { + ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0) + ifp->if_capenable &= ~IFCAP_VLAN_HWTSO; + age_rxvlan(sc); + } AGE_UNLOCK(sc); VLAN_CAPABILITIES(ifp); break; From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 22:46:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 523B11065675; Fri, 26 Feb 2010 22:46:38 +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 26C888FC30; Fri, 26 Feb 2010 22:46:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1QMkaKJ076037; Fri, 26 Feb 2010 22:46:36 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1QMka8G076035; Fri, 26 Feb 2010 22:46:36 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002262246.o1QMka8G076035@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 26 Feb 2010 22:46: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: r204378 - head/sys/dev/ale X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 22:46:38 -0000 Author: yongari Date: Fri Feb 26 22:46:36 2010 New Revision: 204378 URL: http://svn.freebsd.org/changeset/base/204378 Log: Add TSO support on VLANs. While I'm here remove unnecessary check of VLAN hardware checksum offloading. vlan(4) already takes care of this. Modified: head/sys/dev/ale/if_ale.c Modified: head/sys/dev/ale/if_ale.c ============================================================================== --- head/sys/dev/ale/if_ale.c Fri Feb 26 22:43:23 2010 (r204377) +++ head/sys/dev/ale/if_ale.c Fri Feb 26 22:46:36 2010 (r204378) @@ -78,9 +78,6 @@ __FBSDID("$FreeBSD$"); /* For more information about Tx checksum offload issues see ale_encap(). */ #define ALE_CSUM_FEATURES (CSUM_TCP | CSUM_UDP) -#ifndef IFCAP_VLAN_HWTSO -#define IFCAP_VLAN_HWTSO 0 -#endif MODULE_DEPEND(ale, pci, 1, 1, 1); MODULE_DEPEND(ale, ether, 1, 1, 1); @@ -617,8 +614,8 @@ ale_attach(device_t dev) ether_ifattach(ifp, sc->ale_eaddr); /* VLAN capability setup. */ - ifp->if_capabilities |= IFCAP_VLAN_MTU; - ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM; + ifp->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | + IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTSO; ifp->if_capenable = ifp->if_capabilities; /* * Even though controllers supported by ale(3) have Rx checksum @@ -2003,29 +2000,19 @@ ale_ioctl(struct ifnet *ifp, u_long cmd, if ((mask & IFCAP_WOL_MAGIC) != 0 && (ifp->if_capabilities & IFCAP_WOL_MAGIC) != 0) ifp->if_capenable ^= IFCAP_WOL_MAGIC; - - if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && - (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) { - ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; - ale_rxvlan(sc); - } if ((mask & IFCAP_VLAN_HWCSUM) != 0 && (ifp->if_capabilities & IFCAP_VLAN_HWCSUM) != 0) ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; if ((mask & IFCAP_VLAN_HWTSO) != 0 && (ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0) ifp->if_capenable ^= IFCAP_VLAN_HWTSO; - /* - * VLAN hardware tagging is required to do checksum - * offload or TSO on VLAN interface. Checksum offload - * on VLAN interface also requires hardware checksum - * offload of parent interface. - */ - if ((ifp->if_capenable & IFCAP_TXCSUM) == 0) - ifp->if_capenable &= ~IFCAP_VLAN_HWCSUM; - if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0) - ifp->if_capenable &= - ~(IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM); + if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) { + ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0) + ifp->if_capenable &= ~IFCAP_VLAN_HWTSO; + ale_rxvlan(sc); + } ALE_UNLOCK(sc); VLAN_CAPABILITIES(ifp); break; From owner-svn-src-head@FreeBSD.ORG Fri Feb 26 23:26:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD493106564A; Fri, 26 Feb 2010 23:26:15 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C65D8FC0A; Fri, 26 Feb 2010 23:26:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1QNQFr0084795; Fri, 26 Feb 2010 23:26:15 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1QNQFVs084793; Fri, 26 Feb 2010 23:26:15 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201002262326.o1QNQFVs084793@svn.freebsd.org> From: Antoine Brodin Date: Fri, 26 Feb 2010 23:26: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: r204379 - head/tools/build/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 23:26:15 -0000 Author: antoine Date: Fri Feb 26 23:26:15 2010 New Revision: 204379 URL: http://svn.freebsd.org/changeset/base/204379 Log: Do not remove fmt.1 when MK_MAIL=no. X-MFC-With: r203584 Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Feb 26 22:46:36 2010 (r204378) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Feb 26 23:26:15 2010 (r204379) @@ -1547,7 +1547,6 @@ OLD_FILES+=usr/libexec/comsat OLD_FILES+=usr/share/examples/etc/mail.rc OLD_FILES+=usr/share/man/man1/Mail.1.gz OLD_FILES+=usr/share/man/man1/biff.1.gz -OLD_FILES+=usr/share/man/man1/fmt.1.gz OLD_FILES+=usr/share/man/man1/from.1.gz OLD_FILES+=usr/share/man/man1/mail.1.gz OLD_FILES+=usr/share/man/man1/mailx.1.gz From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 01:17:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2813106567A; Sat, 27 Feb 2010 01:17:44 +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 C74028FC15; Sat, 27 Feb 2010 01:17:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1R1Hiej009557; Sat, 27 Feb 2010 01:17:44 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1R1Hiop009551; Sat, 27 Feb 2010 01:17:44 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201002270117.o1R1Hiop009551@svn.freebsd.org> From: Xin LI Date: Sat, 27 Feb 2010 01:17:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204383 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 01:17:45 -0000 Author: delphij Date: Sat Feb 27 01:17:44 2010 New Revision: 204383 URL: http://svn.freebsd.org/changeset/base/204383 Log: Add several necessary .El's. MFC after: 2 weeks Modified: head/share/man/man9/BUF_ISLOCKED.9 head/share/man/man9/BUF_RECURSED.9 head/share/man/man9/DEVICE_PROBE.9 head/share/man/man9/VOP_LOCK.9 head/share/man/man9/devfs_set_cdevpriv.9 Modified: head/share/man/man9/BUF_ISLOCKED.9 ============================================================================== --- head/share/man/man9/BUF_ISLOCKED.9 Sat Feb 27 01:17:24 2010 (r204382) +++ head/share/man/man9/BUF_ISLOCKED.9 Sat Feb 27 01:17:44 2010 (r204383) @@ -57,6 +57,7 @@ An exclusive lock is held by someone oth A shared lock is held. .It Li 0 The lock is not held by anyone. +.El .Sh SEE ALSO .Xr lockstatus 9 , .Xr buf 9 , Modified: head/share/man/man9/BUF_RECURSED.9 ============================================================================== --- head/share/man/man9/BUF_RECURSED.9 Sat Feb 27 01:17:24 2010 (r204382) +++ head/share/man/man9/BUF_RECURSED.9 Sat Feb 27 01:17:44 2010 (r204383) @@ -54,6 +54,7 @@ The buffer linked to the lock. See .Xr lockmgr_recursed 9 for details. +.El .Sh SEE ALSO .Xr buf 9 , .Xr BUF_LOCK 9 , Modified: head/share/man/man9/DEVICE_PROBE.9 ============================================================================== --- head/share/man/man9/DEVICE_PROBE.9 Sat Feb 27 01:17:24 2010 (r204382) +++ head/share/man/man9/DEVICE_PROBE.9 Sat Feb 27 01:17:44 2010 (r204383) @@ -127,6 +127,7 @@ The driver expects its parent to tell it and no probing is really done. The device only matches if its parent bus specifically said to use this driver. +.El .Sh SEE ALSO .Xr device 9 , .Xr DEVICE_ATTACH 9 , Modified: head/share/man/man9/VOP_LOCK.9 ============================================================================== --- head/share/man/man9/VOP_LOCK.9 Sat Feb 27 01:17:24 2010 (r204382) +++ head/share/man/man9/VOP_LOCK.9 Sat Feb 27 01:17:44 2010 (r204383) @@ -114,6 +114,7 @@ directly. .Fn vn_lock also does not want a thread specified as argument but it assumes curthread to be used. +.El .Sh RETURN VALUES Zero is returned on success, otherwise an error is returned. .Sh SEE ALSO Modified: head/share/man/man9/devfs_set_cdevpriv.9 ============================================================================== --- head/share/man/man9/devfs_set_cdevpriv.9 Sat Feb 27 01:17:24 2010 (r204382) +++ head/share/man/man9/devfs_set_cdevpriv.9 Sat Feb 27 01:17:44 2010 (r204383) @@ -108,7 +108,7 @@ The private driver data was not associat filedescriptor, or .Fn devfs_clear_cdevpriv was called. -.Pp +.El .Sh SEE ALSO .Xr open 2 , .Xr close 2 , From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 01:58:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45CBE106566C; Sat, 27 Feb 2010 01:58:42 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 352C58FC17; Sat, 27 Feb 2010 01:58:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1R1wggQ018485; Sat, 27 Feb 2010 01:58:42 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1R1wgJm018483; Sat, 27 Feb 2010 01:58:42 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201002270158.o1R1wgJm018483@svn.freebsd.org> From: Matt Jacob Date: Sat, 27 Feb 2010 01:58: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: r204384 - head/sys/dev/isp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 01:58:42 -0000 Author: mjacob Date: Sat Feb 27 01:58:41 2010 New Revision: 204384 URL: http://svn.freebsd.org/changeset/base/204384 Log: Fix misallocation error in target mode. MFC after: 1 day Modified: head/sys/dev/isp/isp_pci.c Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Sat Feb 27 01:17:44 2010 (r204383) +++ head/sys/dev/isp/isp_pci.c Sat Feb 27 01:58:41 2010 (r204384) @@ -1529,7 +1529,7 @@ isp_pci_mbxdma(ispsoftc_t *isp) } isp->isp_xffree = isp->isp_xflist; #ifdef ISP_TARGET_MODE - len = sizeof (isp_hdl_t *) * isp->isp_maxcmds; + len = sizeof (isp_hdl_t) * isp->isp_maxcmds; isp->isp_tgtlist = (isp_hdl_t *) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); if (isp->isp_tgtlist == NULL) { free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 02:20:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B04FF1065670; Sat, 27 Feb 2010 02:20:38 +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 9FA168FC15; Sat, 27 Feb 2010 02:20:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1R2Kcrn023455; Sat, 27 Feb 2010 02:20:38 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1R2KcQ9023453; Sat, 27 Feb 2010 02:20:38 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201002270220.o1R2KcQ9023453@svn.freebsd.org> From: Weongyo Jeong Date: Sat, 27 Feb 2010 02:20: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: r204385 - head/sys/dev/bwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 02:20:38 -0000 Author: weongyo Date: Sat Feb 27 02:20:38 2010 New Revision: 204385 URL: http://svn.freebsd.org/changeset/base/204385 Log: don't need to check BWN_RX_PHYST0_SHORTPRMBL flag because it's already handled in later. Reported from: imp, nwhitehorn Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Sat Feb 27 01:58:41 2010 (r204384) +++ head/sys/dev/bwn/if_bwn.c Sat Feb 27 02:20:38 2010 (r204385) @@ -9395,8 +9395,6 @@ bwn_rxeof(struct bwn_mac *mac, struct mb device_printf(sc->sc_dev, "TODO RX: RX_FLAG_FAILED_FCS_CRC\n"); if (phystat0 & (BWN_RX_PHYST0_PLCPHCF | BWN_RX_PHYST0_PLCPFV)) device_printf(sc->sc_dev, "TODO RX: RX_FLAG_FAILED_PLCP_CRC\n"); - if (phystat0 & BWN_RX_PHYST0_SHORTPRMBL) - device_printf(sc->sc_dev, "TODO RX: RX_FLAG_SHORTPRE\n"); if (macstat & BWN_RX_MAC_DECERR) goto drop; From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 05:41:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80EB8106566C; Sat, 27 Feb 2010 05:41:24 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F0EF8FC13; Sat, 27 Feb 2010 05:41:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1R5fO4w067991; Sat, 27 Feb 2010 05:41:24 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1R5fOp5067982; Sat, 27 Feb 2010 05:41:24 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201002270541.o1R5fOp5067982@svn.freebsd.org> From: Matt Jacob Date: Sat, 27 Feb 2010 05:41: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: r204397 - head/sys/dev/isp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 05:41:24 -0000 Author: mjacob Date: Sat Feb 27 05:41:23 2010 New Revision: 204397 URL: http://svn.freebsd.org/changeset/base/204397 Log: Revamp the pieces of some of the stuff I forgot to do when shifting to 32 bit handles. The RIO (reduced interrupt operation) and fast posting for the parallel SCSI cards were all 16 bit handles. Furthermore, target mode parallel SCSI only can have 16 bit handles. Use part of a supplied patch to switch over to using 32 bit handles. Be a bit more conservative here and only do this for parallel SCSI for the 12160 (Ultra3) cards. There were a lot of marginal Ultra2 cards, and, frankly, few are findable now for testing. Fix the target handle routine to only do 16 bit handles for parallel SCSI cards. This is okay because the upper sixteen bits of the new 32 bit handles is a sequence number to help protect against duplicate completions. This would be very unlikely to happen with parallel SCSI target mode, and wasn't present before, so we're no worse off than we used to be. While we're at it, finally split the async mailbox completion handlers into FC and parallel SCSI functions. This makes it much cleaner and easier to figure out what is or isn't a legal async mailbox completion code for different card classes. PR: kern/144250 Submitted partially by: Charles D MFC after: 1 week Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/isp_library.c head/sys/dev/isp/isp_library.h head/sys/dev/isp/isp_pci.c head/sys/dev/isp/isp_target.c head/sys/dev/isp/ispmbox.h head/sys/dev/isp/ispreg.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Sat Feb 27 04:33:24 2010 (r204396) +++ head/sys/dev/isp/isp.c Sat Feb 27 05:41:23 2010 (r204397) @@ -108,10 +108,11 @@ static const uint8_t alpa_map[] = { * Local function prototypes. */ static int isp_parse_async(ispsoftc_t *, uint16_t); +static int isp_parse_async_fc(ispsoftc_t *, uint16_t); static int isp_handle_other_response(ispsoftc_t *, int, isphdr_t *, uint32_t *); static void isp_parse_status(ispsoftc_t *, ispstatusreq_t *, XS_T *, long *); static void isp_parse_status_24xx(ispsoftc_t *, isp24xx_statusreq_t *, XS_T *, long *); -static void isp_fastpost_complete(ispsoftc_t *, uint16_t); +static void isp_fastpost_complete(ispsoftc_t *, uint32_t); static int isp_mbox_continue(ispsoftc_t *); static void isp_scsi_init(ispsoftc_t *); static void isp_scsi_channel_init(ispsoftc_t *, int); @@ -1334,23 +1335,24 @@ isp_scsi_init(ispsoftc_t *isp) } /* - * Turn on Fast Posting, LVD transitions + * Turn on LVD transitions for ULTRA2 or better and other features * - * Ultra2 F/W always has had fast posting (and LVD transitions) - * - * Ultra and older (i.e., SBus) cards may not. It's just safer - * to assume not for them. + * Now that we have 32 bit handles, don't do any fast posting + * any more. For Ultra2/Ultra3 cards, we can turn on 32 bit RIO + * operation or use fast posting. To be conservative, we'll only + * do this for Ultra3 cards now because the other cards are so + * rare for this author to find and test with. */ MBSINIT(&mbs, MBOX_SET_FW_FEATURES, MBLOGALL, 0); if (IS_ULTRA2(isp)) mbs.param[1] |= FW_FEATURE_LVD_NOTIFY; -#ifndef ISP_NO_RIO - if (IS_ULTRA2(isp) || IS_1240(isp)) - mbs.param[1] |= FW_FEATURE_RIO_16BIT; -#else - if (IS_ULTRA2(isp) || IS_1240(isp)) +#ifdef ISP_NO_RIO + if (IS_ULTRA3(isp)) mbs.param[1] |= FW_FEATURE_FAST_POST; +#else + if (IS_ULTRA3(isp)) + mbs.param[1] |= FW_FEATURE_RIO_32BIT; #endif if (mbs.param[1] != 0) { uint16_t sfeat = mbs.param[1]; @@ -1604,25 +1606,15 @@ isp_fibre_init(ispsoftc_t *isp) } if (IS_2200(isp)) { /* - * There seems to just be too much breakage here - * with RIO and Fast Posting- it probably actually - * works okay but this driver is messing it up. - * This card is really ancient by now, so let's - * just opt for safety and not use the feature. + * We can't have Fast Posting any more- we now + * have 32 bit handles. + * + * RIO seemed to have to much breakage. + * + * Just opt for safety. */ -#if 0 - if (ISP_FW_NEWER_THAN(isp, 1, 17, 0)) { - icbp->icb_xfwoptions |= ICBXOPT_RIO_16BIT; - icbp->icb_fwoptions &= ~ICBOPT_FAST_POST; - icbp->icb_racctimer = 4; - icbp->icb_idelaytimer = 8; - } else { - icbp->icb_fwoptions |= ICBOPT_FAST_POST; - } -#else icbp->icb_xfwoptions &= ~ICBXOPT_RIO_16BIT; icbp->icb_fwoptions &= ~ICBOPT_FAST_POST; -#endif } else { /* * QLogic recommends that FAST Posting be turned @@ -4863,7 +4855,7 @@ again: */ if (sema) { fmbox: - if (mbox & 0x4000) { + if (mbox & MBOX_COMMAND_COMPLETE) { isp->isp_intmboxc++; if (isp->isp_mboxbsy) { int obits = isp->isp_obits; @@ -4883,10 +4875,13 @@ again: } else { isp_prt(isp, ISP_LOGWARN, "mailbox cmd (0x%x) with no waiters", mbox); } - } else if (isp_parse_async(isp, mbox) < 0) { - return; + } else { + i = IS_FC(isp)? isp_parse_async_fc(isp, mbox) : isp_parse_async(isp, mbox); + if (i < 0) { + return; + } } - if ((IS_FC(isp) && mbox != ASYNC_RIO_RESP) || isp->isp_state != ISP_RUNSTATE) { + if ((IS_FC(isp) && mbox != ASYNC_RIOZIO_STALL) || isp->isp_state != ISP_RUNSTATE) { goto out; } } @@ -5068,9 +5063,9 @@ again: req_status_flags = sp->req_status_flags; req_state_flags = sp->req_state_flags; resid = sp->req_resid; - } else if (etype == RQSTYPE_RIO2) { - isp_rio2_t *rio = (isp_rio2_t *)qe; - isp_get_rio2(isp, (isp_rio2_t *) hp, rio); + } else if (etype == RQSTYPE_RIO1) { + isp_rio1_t *rio = (isp_rio1_t *) qe; + isp_get_rio1(isp, (isp_rio1_t *) hp, rio); if (isp->isp_dblev & ISP_LOGDEBUG1) { isp_print_bytes(isp, "Response Queue Entry", QENTRY_LEN, rio); } @@ -5082,6 +5077,10 @@ again: } ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ continue; + } else if (etype == RQSTYPE_RIO2) { + isp_prt(isp, ISP_LOGERR, "dropping RIO2 response\n"); + ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ + continue; } else { /* * Somebody reachable via isp_handle_other_response @@ -5394,40 +5393,35 @@ out: * Support routines. */ -#define GET_24XX_BUS(isp, chan, msg) \ - if (IS_24XX(isp)) { \ - chan = ISP_READ(isp, OUTMAILBOX3) & 0xff; \ - if (chan >= isp->isp_nchan) { \ - isp_prt(isp, ISP_LOGERR, "bogus channel %u for %s at line %d", chan, msg, __LINE__); \ - break; \ - } \ - } - +/* + * Parse an ASYNC mailbox complete + * + * Return non-zero if the event has been acknowledged. + */ static int isp_parse_async(ispsoftc_t *isp, uint16_t mbox) { - int rval = 0; - int pattern = 0; - uint16_t chan; + int acked = 0; + uint32_t h1 = 0, h2 = 0; + uint16_t chan = 0; - if (IS_DUALBUS(isp)) { - chan = ISP_READ(isp, OUTMAILBOX6); - } else { - chan = 0; + /* + * Pick up the channel, but not if this is a ASYNC_RIO32_2, + * where Mailboxes 6/7 have the second handle. + */ + if (mbox != ASYNC_RIO32_2) { + if (IS_DUALBUS(isp)) { + chan = ISP_READ(isp, OUTMAILBOX6); + } } isp_prt(isp, ISP_LOGDEBUG2, "Async Mbox 0x%x", mbox); switch (mbox) { case ASYNC_BUS_RESET: - if (IS_FC(isp)) { - isp_prt(isp, ISP_LOGWARN, - "ILLEGAL ASYNC_BUS_RESET for FC card"); - break; - } ISP_SET_SENDMARKER(isp, chan, 1); #ifdef ISP_TARGET_MODE if (isp_target_async(isp, chan, mbox)) { - rval = -1; + acked = 1; } #endif isp_async(isp, ISPASYNC_BUS_RESET, chan); @@ -5435,10 +5429,6 @@ isp_parse_async(ispsoftc_t *isp, uint16_ case ASYNC_SYSTEM_ERROR: isp->isp_dead = 1; isp->isp_state = ISP_CRASHED; - if (IS_FC(isp)) { - FCPARAM(isp, chan)->isp_loopstate = LOOP_NIL; - FCPARAM(isp, chan)->isp_fwstate = FW_CONFIG_WAIT; - } /* * Were we waiting for a mailbox command to complete? * If so, it's dead, so wake up the waiter. @@ -5453,7 +5443,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_ * restart the firmware */ isp_async(isp, ISPASYNC_FW_CRASH); - rval = -1; + acked = 1; break; case ASYNC_RQS_XFER_ERR: @@ -5465,17 +5455,6 @@ isp_parse_async(ispsoftc_t *isp, uint16_ break; case ASYNC_QWAKEUP: -#ifdef ISP_TARGET_MODE - if (IS_24XX(isp)) { - isp_prt(isp, ISP_LOGERR, "ATIO Queue Transfer Error"); - break; - } -#endif - if (IS_FC(isp)) { - isp_prt(isp, ISP_LOGWARN, - "ILLEGAL ASYNC_QWAKEUP for FC card"); - break; - } /* * We've just been notified that the Queue has woken up. * We don't need to be chatty about this- just unlatch things @@ -5485,82 +5464,45 @@ isp_parse_async(ispsoftc_t *isp, uint16_ break; case ASYNC_TIMEOUT_RESET: - if (IS_FC(isp)) { - isp_prt(isp, ISP_LOGWARN, - "ILLEGAL ASYNC_TIMEOUT_RESET for FC card"); - break; - } - isp_prt(isp, ISP_LOGWARN, - "timeout initiated SCSI bus reset of chan %d", chan); + isp_prt(isp, ISP_LOGWARN, "timeout initiated SCSI bus reset of chan %d", chan); ISP_SET_SENDMARKER(isp, chan, 1); #ifdef ISP_TARGET_MODE if (isp_target_async(isp, chan, mbox)) { - rval = -1; + acked = 1; } #endif break; case ASYNC_DEVICE_RESET: - if (IS_FC(isp)) { - isp_prt(isp, ISP_LOGWARN, - "ILLEGAL DEVICE_RESET for FC card"); - break; - } isp_prt(isp, ISP_LOGINFO, "device reset on chan %d", chan); ISP_SET_SENDMARKER(isp, chan, 1); #ifdef ISP_TARGET_MODE if (isp_target_async(isp, chan, mbox)) { - rval = -1; + acked = 1; } #endif break; case ASYNC_EXTMSG_UNDERRUN: - if (IS_FC(isp)) { - isp_prt(isp, ISP_LOGWARN, - "ILLEGAL ASYNC_EXTMSG_UNDERRUN for FC card"); - break; - } isp_prt(isp, ISP_LOGWARN, "extended message underrun"); break; case ASYNC_SCAM_INT: - if (IS_FC(isp)) { - isp_prt(isp, ISP_LOGWARN, - "ILLEGAL ASYNC_SCAM_INT for FC card"); - break; - } isp_prt(isp, ISP_LOGINFO, "SCAM interrupt"); break; case ASYNC_HUNG_SCSI: - if (IS_FC(isp)) { - isp_prt(isp, ISP_LOGWARN, - "ILLEGAL ASYNC_HUNG_SCSI for FC card"); - break; - } - isp_prt(isp, ISP_LOGERR, - "stalled SCSI Bus after DATA Overrun"); + isp_prt(isp, ISP_LOGERR, "stalled SCSI Bus after DATA Overrun"); /* XXX: Need to issue SCSI reset at this point */ break; case ASYNC_KILLED_BUS: - if (IS_FC(isp)) { - isp_prt(isp, ISP_LOGWARN, - "ILLEGAL ASYNC_KILLED_BUS for FC card"); - break; - } isp_prt(isp, ISP_LOGERR, "SCSI Bus reset after DATA Overrun"); break; case ASYNC_BUS_TRANSIT: - if (IS_FC(isp)) { - isp_prt(isp, ISP_LOGWARN, - "ILLEGAL ASYNC_BUS_TRANSIT for FC card"); - break; - } mbox = ISP_READ(isp, OUTMAILBOX2); - switch (mbox & 0x1c00) { + switch (mbox & SXP_PINS_MODE_MASK) { case SXP_PINS_LVD_MODE: isp_prt(isp, ISP_LOGINFO, "Transition to LVD mode"); SDPARAM(isp, chan)->isp_diffmode = 0; @@ -5593,70 +5535,142 @@ isp_parse_async(ispsoftc_t *isp, uint16_ ISP_SET_SENDMARKER(isp, chan, 1); break; - case ASYNC_RIO5: - pattern = 0xce; /* outgoing mailbox regs 1-3, 6-7 */ + case ASYNC_CMD_CMPLT: + case ASYNC_RIO32_1: + if (!IS_ULTRA3(isp)) { + isp_prt(isp, ISP_LOGERR, "unexpected fast posting completion"); + break; + } + /* FALLTHROUGH */ + h1 = (ISP_READ(isp, OUTMAILBOX2) << 16) | ISP_READ(isp, OUTMAILBOX1); + break; + + case ASYNC_RIO32_2: + h1 = (ISP_READ(isp, OUTMAILBOX2) << 16) | ISP_READ(isp, OUTMAILBOX1); + h2 = (ISP_READ(isp, OUTMAILBOX7) << 16) | ISP_READ(isp, OUTMAILBOX6); + break; + + case ASYNC_RIO16_5: + case ASYNC_RIO16_4: + case ASYNC_RIO16_3: + case ASYNC_RIO16_2: + case ASYNC_RIO16_1: + isp_prt(isp, ISP_LOGERR, "unexpected 16 bit RIO handle"); + break; + default: + isp_prt(isp, ISP_LOGWARN, "%s: unhandled async code 0x%x", __func__, mbox); + break; + } + + if (h1 || h2) { + isp_prt(isp, ISP_LOGDEBUG3, "fast post/rio completion of 0x%08x", h1); + isp_fastpost_complete(isp, h1); + if (h2) { + isp_prt(isp, ISP_LOGDEBUG3, "fast post/rio completion of 0x%08x", h2); + isp_fastpost_complete(isp, h2); + if (isp->isp_fpcchiwater < 2) { + isp->isp_fpcchiwater = 2; + } + } else { + if (isp->isp_fpcchiwater < 1) { + isp->isp_fpcchiwater = 1; + } + } + } else { + isp->isp_intoasync++; + } + return (acked); +} + +#define GET_24XX_BUS(isp, chan, msg) \ + if (IS_24XX(isp)) { \ + chan = ISP_READ(isp, OUTMAILBOX3) & 0xff; \ + if (chan >= isp->isp_nchan) { \ + isp_prt(isp, ISP_LOGERR, "bogus channel %u for %s at line %d", chan, msg, __LINE__); \ + break; \ + } \ + } + + +static int +isp_parse_async_fc(ispsoftc_t *isp, uint16_t mbox) +{ + int acked = 0; + uint16_t chan; + + if (IS_DUALBUS(isp)) { + chan = ISP_READ(isp, OUTMAILBOX6); + } else { + chan = 0; + } + isp_prt(isp, ISP_LOGDEBUG2, "Async Mbox 0x%x", mbox); + + switch (mbox) { + case ASYNC_SYSTEM_ERROR: + isp->isp_dead = 1; + isp->isp_state = ISP_CRASHED; + FCPARAM(isp, chan)->isp_loopstate = LOOP_NIL; + FCPARAM(isp, chan)->isp_fwstate = FW_CONFIG_WAIT; + /* + * Were we waiting for a mailbox command to complete? + * If so, it's dead, so wake up the waiter. + */ + if (isp->isp_mboxbsy) { + isp->isp_obits = 1; + isp->isp_mboxtmp[0] = MBOX_HOST_INTERFACE_ERROR; + MBOX_NOTIFY_COMPLETE(isp); + } + /* + * It's up to the handler for isp_async to reinit stuff and + * restart the firmware + */ + isp_async(isp, ISPASYNC_FW_CRASH); + acked = 1; break; - case ASYNC_RIO4: - pattern = 0x4e; /* outgoing mailbox regs 1-3, 6 */ + case ASYNC_RQS_XFER_ERR: + isp_prt(isp, ISP_LOGERR, "Request Queue Transfer Error"); break; - case ASYNC_RIO3: - pattern = 0x0e; /* outgoing mailbox regs 1-3 */ + case ASYNC_RSP_XFER_ERR: + isp_prt(isp, ISP_LOGERR, "Response Queue Transfer Error"); break; - case ASYNC_RIO2: - pattern = 0x06; /* outgoing mailbox regs 1-2 */ + case ASYNC_QWAKEUP: +#ifdef ISP_TARGET_MODE + if (IS_24XX(isp)) { + isp_prt(isp, ISP_LOGERR, "ATIO Queue Transfer Error"); + break; + } +#endif + isp_prt(isp, ISP_LOGERR, "%s: unexpected ASYNC_QWAKEUP code", __func__); break; - case ASYNC_RIO1: case ASYNC_CMD_CMPLT: - pattern = 0x02; /* outgoing mailbox regs 1 */ + isp_fastpost_complete(isp, (ISP_READ(isp, OUTMAILBOX2) << 16) | ISP_READ(isp, OUTMAILBOX1)); + if (isp->isp_fpcchiwater < 1) { + isp->isp_fpcchiwater = 1; + } break; - case ASYNC_RIO_RESP: - return (rval); + case ASYNC_RIOZIO_STALL: + break; case ASYNC_CTIO_DONE: - { #ifdef ISP_TARGET_MODE - int handle; - if (IS_SCSI(isp) || IS_24XX(isp)) { - isp_prt(isp, ISP_LOGWARN, - "bad ASYNC_CTIO_DONE for %s cards", - IS_SCSI(isp)? "SCSI" : "24XX"); - break; - } - handle = - (ISP_READ(isp, OUTMAILBOX2) << 16) | - (ISP_READ(isp, OUTMAILBOX1)); - if (isp_target_async(isp, handle, mbox)) { - rval = -1; + if (isp_target_async(isp, (ISP_READ(isp, OUTMAILBOX2) << 16) | ISP_READ(isp, OUTMAILBOX1), mbox)) { + acked = 1; } else { - /* count it as a fast posting intr */ isp->isp_fphccmplt++; } #else - if (IS_SCSI(isp) || IS_24XX(isp)) { - isp_prt(isp, ISP_LOGWARN, - "bad ASYNC_CTIO_DONE for %s cards", - IS_SCSI(isp)? "SCSI" : "24XX"); - break; - } - isp_prt(isp, ISP_LOGINFO, "Fast Posting CTIO done"); - isp->isp_fphccmplt++; /* count it as a fast posting intr */ + isp_prt(isp, ISP_LOGWARN, "unexpected ASYNC CTIO done"); #endif break; - } case ASYNC_LIP_ERROR: case ASYNC_LIP_F8: case ASYNC_LIP_OCCURRED: case ASYNC_PTPMODE: - if (IS_SCSI(isp)) { - isp_prt(isp, ISP_LOGWARN, - "bad LIP event for SCSI cards"); - break; - } /* * These are broadcast events that have to be sent across * all active channels. @@ -5676,7 +5690,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_ isp_async(isp, ISPASYNC_LIP, chan); #ifdef ISP_TARGET_MODE if (isp_target_async(isp, chan, mbox)) { - rval = -1; + acked = 1; } #endif /* @@ -5711,11 +5725,6 @@ isp_parse_async(ispsoftc_t *isp, uint16_ break; case ASYNC_LOOP_UP: - if (IS_SCSI(isp)) { - isp_prt(isp, ISP_LOGWARN, - "bad LOOP UP event for SCSI cards"); - break; - } /* * This is a broadcast event that has to be sent across * all active channels. @@ -5735,18 +5744,13 @@ isp_parse_async(ispsoftc_t *isp, uint16_ isp_async(isp, ISPASYNC_LOOP_UP, chan); #ifdef ISP_TARGET_MODE if (isp_target_async(isp, chan, mbox)) { - rval = -1; + acked = 1; } #endif } break; case ASYNC_LOOP_DOWN: - if (IS_SCSI(isp)) { - isp_prt(isp, ISP_LOGWARN, - "bad LOOP DOWN event for SCSI cards"); - break; - } /* * This is a broadcast event that has to be sent across * all active channels. @@ -5765,18 +5769,13 @@ isp_parse_async(ispsoftc_t *isp, uint16_ isp_async(isp, ISPASYNC_LOOP_DOWN, chan); #ifdef ISP_TARGET_MODE if (isp_target_async(isp, chan, mbox)) { - rval = -1; + acked = 1; } #endif } break; case ASYNC_LOOP_RESET: - if (IS_SCSI(isp)) { - isp_prt(isp, ISP_LOGWARN, - "bad LIP RESET event for SCSI cards"); - break; - } /* * This is a broadcast event that has to be sent across * all active channels. @@ -5795,7 +5794,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_ isp_async(isp, ISPASYNC_LOOP_RESET, chan); #ifdef ISP_TARGET_MODE if (isp_target_async(isp, chan, mbox)) { - rval = -1; + acked = 1; } #endif } @@ -5804,11 +5803,6 @@ isp_parse_async(ispsoftc_t *isp, uint16_ case ASYNC_PDB_CHANGED: { int nphdl, nlstate, reason; - if (IS_SCSI(isp)) { - isp_prt(isp, ISP_LOGWARN, - "bad PDB CHANGED event for SCSI cards"); - break; - } /* * We *should* get a channel out of the 24XX, but we don't seem * to get more than a PDB CHANGED on channel 0, so turn it into @@ -5831,8 +5825,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_ ISP_SET_SENDMARKER(isp, chan, 1); fcp->isp_loopstate = LOOP_PDB_RCVD; ISP_MARK_PORTDB(isp, chan, 1); - isp_async(isp, ISPASYNC_CHANGE_NOTIFY, chan, - ISPASYNC_CHANGE_PDB, nphdl, nlstate, reason); + isp_async(isp, ISPASYNC_CHANGE_NOTIFY, chan, ISPASYNC_CHANGE_PDB, nphdl, nlstate, reason); } break; } @@ -5840,11 +5833,6 @@ isp_parse_async(ispsoftc_t *isp, uint16_ { int lochan, hichan; - if (IS_SCSI(isp)) { - isp_prt(isp, ISP_LOGWARN, - "bad CHANGE NOTIFY event for SCSI cards"); - break; - } if (ISP_FW_NEWER_THAN(isp, 4, 0, 25) && ISP_CAP_MULTI_ID(isp)) { GET_24XX_BUS(isp, chan, "ASYNC_CHANGE_NOTIFY"); lochan = chan; @@ -5866,8 +5854,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_ fcp->isp_loopstate = LOOP_PDB_RCVD; } ISP_MARK_PORTDB(isp, chan, 1); - isp_async(isp, ISPASYNC_CHANGE_NOTIFY, chan, - ISPASYNC_CHANGE_SNS); + isp_async(isp, ISPASYNC_CHANGE_NOTIFY, chan, ISPASYNC_CHANGE_SNS); } break; } @@ -5877,8 +5864,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_ * This only applies to 2100 amd 2200 cards */ if (!IS_2200(isp) && !IS_2100(isp)) { - isp_prt(isp, ISP_LOGWARN, - "bad card for ASYNC_CONNMODE event"); + isp_prt(isp, ISP_LOGWARN, "bad card for ASYNC_CONNMODE event"); break; } chan = 0; @@ -5912,8 +5898,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_ "Unknown connection mode (0x%x)", mbox); break; } - isp_async(isp, ISPASYNC_CHANGE_NOTIFY, chan, - ISPASYNC_CHANGE_OTHER); + isp_async(isp, ISPASYNC_CHANGE_NOTIFY, chan, ISPASYNC_CHANGE_OTHER); FCPARAM(isp, chan)->sendmarker = 1; FCPARAM(isp, chan)->isp_fwstate = FW_CONFIG_WAIT; FCPARAM(isp, chan)->isp_loopstate = LOOP_LIP_RCVD; @@ -5923,8 +5908,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_ if (IS_24XX(isp)) { isp_prt(isp, ISP_LOGWARN, "Receive Error"); } else { - isp_prt(isp, ISP_LOGWARN, - "Unknown Async Code 0x%x", mbox); + isp_prt(isp, ISP_LOGWARN, "unexpected ASYNC_RCV_ERR"); } break; case ASYNC_RJT_SENT: /* same as ASYNC_QFULL_SENT */ @@ -5940,29 +5924,10 @@ isp_parse_async(ispsoftc_t *isp, uint16_ isp_prt(isp, ISP_LOGWARN, "Unknown Async Code 0x%x", mbox); break; } - - if (pattern) { - int i, nh; - uint16_t handles[16]; - - for (nh = 0, i = 1; i < MAX_MAILBOX(isp); i++) { - if ((pattern & (1 << i)) == 0) { - continue; - } - handles[nh++] = ISP_READ(isp, MBOX_OFF(i)); - } - for (i = 0; i < nh; i++) { - isp_fastpost_complete(isp, handles[i]); - isp_prt(isp, ISP_LOGDEBUG3, - "fast post completion of %u", handles[i]); - } - if (isp->isp_fpcchiwater < nh) { - isp->isp_fpcchiwater = nh; - } - } else { + if (mbox != ASYNC_CTIO_DONE && mbox != ASYNC_CMD_CMPLT) { isp->isp_intoasync++; } - return (rval); + return (acked); } /* @@ -6594,7 +6559,7 @@ isp_parse_status_24xx(ispsoftc_t *isp, i } static void -isp_fastpost_complete(ispsoftc_t *isp, uint16_t fph) +isp_fastpost_complete(ispsoftc_t *isp, uint32_t fph) { XS_T *xs; @@ -7682,7 +7647,6 @@ isp_setdfltfcparm(ispsoftc_t *isp, int c fcp->isp_fwoptions |= ICBOPT_FAIRNESS; fcp->isp_fwoptions |= ICBOPT_PDBCHANGE_AE; fcp->isp_fwoptions |= ICBOPT_HARD_ADDRESS; - fcp->isp_fwoptions |= ICBOPT_FAST_POST; if (isp->isp_confopts & ISP_CFG_FULL_DUPLEX) { fcp->isp_fwoptions |= ICBOPT_FULL_DUPLEX; } Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Sat Feb 27 04:33:24 2010 (r204396) +++ head/sys/dev/isp/isp_freebsd.c Sat Feb 27 05:41:23 2010 (r204397) @@ -2304,7 +2304,8 @@ isp_handle_platform_ctio(ispsoftc_t *isp uint32_t tval, handle; /* - * CTIO, CTIO2 and CTIO7 are close enough.... + * CTIO handles are 16 bits. + * CTIO2 and CTIO7 are 32 bits. */ if (IS_SCSI(isp)) { Modified: head/sys/dev/isp/isp_library.c ============================================================================== --- head/sys/dev/isp/isp_library.c Sat Feb 27 04:33:24 2010 (r204396) +++ head/sys/dev/isp/isp_library.c Sat Feb 27 05:41:23 2010 (r204397) @@ -668,7 +668,7 @@ isp_clear_commands(ispsoftc_t *isp) ctio->ct_header.rqs_entry_type = RQSTYPE_CTIO2; } else { ct_entry_t *ctio = (ct_entry_t *) local; - ctio->ct_syshandle = hdp->handle & 0xffff; + ctio->ct_syshandle = hdp->handle; ctio->ct_status = CT_HBA_RESET & 0xff; ctio->ct_header.rqs_entry_type = RQSTYPE_CTIO; } @@ -1132,17 +1132,36 @@ isp_get_24xx_abrt(ispsoftc_t *isp, isp24 void +isp_get_rio1(ispsoftc_t *isp, isp_rio1_t *r1src, isp_rio1_t *r1dst) +{ + const int lim = sizeof (r1dst->req_handles) / sizeof (r1dst->req_handles[0]); + int i; + isp_get_hdr(isp, &r1src->req_header, &r1dst->req_header); + if (r1dst->req_header.rqs_seqno > lim) { + r1dst->req_header.rqs_seqno = lim; + } + for (i = 0; i < r1dst->req_header.rqs_seqno; i++) { + ISP_IOXGET_32(isp, &r1src->req_handles[i], r1dst->req_handles[i]); + } + while (i < lim) { + r1dst->req_handles[i++] = 0; + } +} + +void isp_get_rio2(ispsoftc_t *isp, isp_rio2_t *r2src, isp_rio2_t *r2dst) { + const int lim = sizeof (r2dst->req_handles) / sizeof (r2dst->req_handles[0]); int i; + isp_get_hdr(isp, &r2src->req_header, &r2dst->req_header); - if (r2dst->req_header.rqs_seqno > 30) { - r2dst->req_header.rqs_seqno = 30; + if (r2dst->req_header.rqs_seqno > lim) { + r2dst->req_header.rqs_seqno = lim; } for (i = 0; i < r2dst->req_header.rqs_seqno; i++) { ISP_IOXGET_16(isp, &r2src->req_handles[i], r2dst->req_handles[i]); } - while (i < 30) { + while (i < lim) { r2dst->req_handles[i++] = 0; } } @@ -2240,7 +2259,13 @@ isp_allocate_xs_tgt(ispsoftc_t *isp, voi hdp->cmd = xs; hdp->handle = (hdp - isp->isp_tgtlist); hdp->handle |= (ISP_HANDLE_TARGET << ISP_HANDLE_USAGE_SHIFT); - hdp->handle |= (isp->isp_seqno++ << ISP_HANDLE_SEQ_SHIFT); + /* + * Target handles for SCSI cards are only 16 bits, so + * sequence number protection will be ommitted. + */ + if (IS_FC(isp)) { + hdp->handle |= (isp->isp_seqno++ << ISP_HANDLE_SEQ_SHIFT); + } *handlep = hdp->handle; return (0); } Modified: head/sys/dev/isp/isp_library.h ============================================================================== --- head/sys/dev/isp/isp_library.h Sat Feb 27 04:33:24 2010 (r204396) +++ head/sys/dev/isp/isp_library.h Sat Feb 27 05:41:23 2010 (r204397) @@ -108,6 +108,7 @@ void isp_put_cont64_req(ispsoftc_t *, is void isp_get_response(ispsoftc_t *, ispstatusreq_t *, ispstatusreq_t *); void isp_get_24xx_response(ispsoftc_t *, isp24xx_statusreq_t *, isp24xx_statusreq_t *); void isp_get_24xx_abrt(ispsoftc_t *, isp24xx_abrt_t *, isp24xx_abrt_t *); +void isp_get_rio1(ispsoftc_t *, isp_rio1_t *, isp_rio1_t *); void isp_get_rio2(ispsoftc_t *, isp_rio2_t *, isp_rio2_t *); void isp_put_icb(ispsoftc_t *, isp_icb_t *, isp_icb_t *); void isp_put_icb_2400(ispsoftc_t *, isp_icb_2400_t *, isp_icb_2400_t *); Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Sat Feb 27 04:33:24 2010 (r204396) +++ head/sys/dev/isp/isp_pci.c Sat Feb 27 05:41:23 2010 (r204397) @@ -1068,8 +1068,7 @@ isp_pci_rd_isr(ispsoftc_t *isp, uint32_t } static int -isp_pci_rd_isr_2300(ispsoftc_t *isp, uint32_t *isrp, - uint16_t *semap, uint16_t *mbox0p) +isp_pci_rd_isr_2300(ispsoftc_t *isp, uint32_t *isrp, uint16_t *semap, uint16_t *mbox0p) { uint32_t hccr; uint32_t r2hisr; @@ -1096,7 +1095,7 @@ isp_pci_rd_isr_2300(ispsoftc_t *isp, uin return (1); case ISPR2HST_RIO_16: *isrp = r2hisr & 0xffff; - *mbox0p = ASYNC_RIO1; + *mbox0p = ASYNC_RIO16_1; *semap = 1; return (1); case ISPR2HST_FPOST: @@ -1118,21 +1117,17 @@ isp_pci_rd_isr_2300(ispsoftc_t *isp, uin hccr = ISP_READ(isp, HCCR); if (hccr & HCCR_PAUSE) { ISP_WRITE(isp, HCCR, HCCR_RESET); - isp_prt(isp, ISP_LOGERR, - "RISC paused at interrupt (%x->%x)", hccr, - ISP_READ(isp, HCCR)); + isp_prt(isp, ISP_LOGERR, "RISC paused at interrupt (%x->%x)", hccr, ISP_READ(isp, HCCR)); ISP_WRITE(isp, BIU_ICR, 0); } else { - isp_prt(isp, ISP_LOGERR, "unknown interrupt 0x%x\n", - r2hisr); + isp_prt(isp, ISP_LOGERR, "unknown interrupt 0x%x\n", r2hisr); } return (0); } } static int -isp_pci_rd_isr_2400(ispsoftc_t *isp, uint32_t *isrp, - uint16_t *semap, uint16_t *mbox0p) +isp_pci_rd_isr_2400(ispsoftc_t *isp, uint32_t *isrp, uint16_t *semap, uint16_t *mbox0p) { uint32_t r2hisr; @@ -1177,8 +1172,7 @@ isp_pci_rd_reg(ispsoftc_t *isp, int rego * We will assume that someone has paused the RISC processor. */ oldconf = BXR2(isp, IspVirt2Off(isp, BIU_CONF1)); - BXW2(isp, IspVirt2Off(isp, BIU_CONF1), - oldconf | BIU_PCI_CONF1_SXP); + BXW2(isp, IspVirt2Off(isp, BIU_CONF1), oldconf | BIU_PCI_CONF1_SXP); MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2); } rv = BXR2(isp, IspVirt2Off(isp, regoff)); Modified: head/sys/dev/isp/isp_target.c ============================================================================== --- head/sys/dev/isp/isp_target.c Sat Feb 27 04:33:24 2010 (r204396) +++ head/sys/dev/isp/isp_target.c Sat Feb 27 05:41:23 2010 (r204397) @@ -826,7 +826,9 @@ isp_target_async(ispsoftc_t *isp, int bu ct_entry_t *ct = (ct_entry_t *) storage; ct->ct_header.rqs_entry_type = RQSTYPE_CTIO; ct->ct_status = CT_OK; - ct->ct_fwhandle = bus; + ct->ct_syshandle = bus; + /* we skip fwhandle here */ + ct->ct_fwhandle = 0; ct->ct_flags = CT_SENDSTATUS; } isp_async(isp, ISPASYNC_TARGET_ACTION, storage); Modified: head/sys/dev/isp/ispmbox.h ============================================================================== --- head/sys/dev/isp/ispmbox.h Sat Feb 27 04:33:24 2010 (r204396) +++ head/sys/dev/isp/ispmbox.h Sat Feb 27 05:41:23 2010 (r204397) @@ -223,6 +223,8 @@ #define ASYNC_SECURITY_UPDATE 0x801B #define ASYNC_CMD_CMPLT 0x8020 #define ASYNC_CTIO_DONE 0x8021 +#define ASYNC_RIO32_1 0x8021 +#define ASYNC_RIO32_2 0x8022 #define ASYNC_IP_XMIT_DONE 0x8022 #define ASYNC_IP_RECV_DONE 0x8023 #define ASYNC_IP_BROADCAST 0x8024 @@ -230,19 +232,19 @@ #define ASYNC_IP_RCVQ_EMPTY 0x8026 #define ASYNC_IP_RECV_DONE_ALIGNED 0x8027 #define ASYNC_PTPMODE 0x8030 -#define ASYNC_RIO1 0x8031 -#define ASYNC_RIO2 0x8032 -#define ASYNC_RIO3 0x8033 -#define ASYNC_RIO4 0x8034 -#define ASYNC_RIO5 0x8035 +#define ASYNC_RIO16_1 0x8031 +#define ASYNC_RIO16_2 0x8032 +#define ASYNC_RIO16_3 0x8033 +#define ASYNC_RIO16_4 0x8034 +#define ASYNC_RIO16_5 0x8035 #define ASYNC_CONNMODE 0x8036 #define ISP_CONN_LOOP 1 #define ISP_CONN_PTP 2 #define ISP_CONN_BADLIP 3 #define ISP_CONN_FATAL 4 #define ISP_CONN_LOOPBACK 5 -#define ASYNC_RIO_RESP 0x8040 -#define ASYNC_RIO_COMP 0x8042 +#define ASYNC_RIOZIO_STALL 0x8040 /* there's a RIO/ZIO entry that hasn't been serviced */ +#define ASYNC_RIO32_2_2200 0x8042 /* same as ASYNC_RIO32_2, but for 2100/2200 */ #define ASYNC_RCV_ERR 0x8048 /* @@ -860,7 +862,7 @@ typedef struct { (ISP_CAP_MULTI_ID(isp) ? tag : 0) /* - * Reduced Interrupt Operation Response Queue Entreis + * Reduced Interrupt Operation Response Queue Entries */ typedef struct { Modified: head/sys/dev/isp/ispreg.h ============================================================================== --- head/sys/dev/isp/ispreg.h Sat Feb 27 04:33:24 2010 (r204396) +++ head/sys/dev/isp/ispreg.h Sat Feb 27 05:41:23 2010 (r204397) @@ -677,13 +677,13 @@ typedef struct { #define SXP_PINS_LVD_MODE 0x1000 #define SXP_PINS_HVD_MODE 0x0800 #define SXP_PINS_SE_MODE 0x0400 +#define SXP_PINS_MODE_MASK (SXP_PINS_LVD_MODE|SXP_PINS_HVD_MODE|SXP_PINS_SE_MODE) /* The above have to be put together with the DIFFM pin to make sense */ #define ISP1080_LVD_MODE (SXP_PINS_LVD_MODE) #define ISP1080_HVD_MODE (SXP_PINS_HVD_MODE|SXP_PINS_DIFF_MODE) #define ISP1080_SE_MODE (SXP_PINS_SE_MODE) -#define ISP1080_MODE_MASK \ - (SXP_PINS_LVD_MODE|SXP_PINS_HVD_MODE|SXP_PINS_SE_MODE|SXP_PINS_DIFF_MODE) +#define ISP1080_MODE_MASK (SXP_PINS_MODE_MASK|SXP_PINS_DIFF_MODE) /* * RISC and Host Command and Control Block Register Offsets From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 07:12:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 310571065675; Sat, 27 Feb 2010 07:12:26 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1FBB38FC1F; Sat, 27 Feb 2010 07:12:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1R7CQ4k088055; Sat, 27 Feb 2010 07:12:26 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1R7CQEn088053; Sat, 27 Feb 2010 07:12:26 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201002270712.o1R7CQEn088053@svn.freebsd.org> From: Qing Li Date: Sat, 27 Feb 2010 07:12: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: r204402 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 07:12:26 -0000 Author: qingli Date: Sat Feb 27 07:12:25 2010 New Revision: 204402 URL: http://svn.freebsd.org/changeset/base/204402 Log: Use reference counting instead of locking to secure an address while that address is being used to generate temporary IPv6 address. This approach is sufficient and avoids recursive locking. MFC after: 3 days Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Sat Feb 27 06:28:22 2010 (r204401) +++ head/sys/netinet6/nd6.c Sat Feb 27 07:12:25 2010 (r204402) @@ -764,22 +764,25 @@ regen_tmpaddr(struct in6_ifaddr *ia6) */ if (!IFA6_IS_DEPRECATED(it6)) public_ifa6 = it6; + + if (public_ifa6 != NULL) + ifa_ref(&public_ifa6->ia_ifa); } + IF_ADDR_UNLOCK(ifp); if (public_ifa6 != NULL) { int e; if ((e = in6_tmpifadd(public_ifa6, 0, 0)) != 0) { - IF_ADDR_UNLOCK(ifp); + ifa_free(&public_ifa6->ia_ifa); log(LOG_NOTICE, "regen_tmpaddr: failed to create a new" " tmp addr,errno=%d\n", e); return (-1); } - IF_ADDR_UNLOCK(ifp); + ifa_free(&public_ifa6->ia_ifa); return (0); } - IF_ADDR_UNLOCK(ifp); return (-1); } From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 09:19:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D27D4106564A; Sat, 27 Feb 2010 09:19:23 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from mail.vega.ru (mail.vega.ru [90.156.167.5]) by mx1.freebsd.org (Postfix) with ESMTP id 893868FC14; Sat, 27 Feb 2010 09:19:23 +0000 (UTC) Received: from [10.100.124.99] (helo=edoofus.dev.vega.ru) by mail.vega.ru with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.71 (FreeBSD)) (envelope-from ) id 1NlIpW-000NnF-Lq; Sat, 27 Feb 2010 12:19:22 +0300 Date: Sat, 27 Feb 2010 12:19:11 +0300 From: Ruslan Ermilov To: Antoine Brodin Message-ID: <20100227091911.GB47001@edoofus.dev.vega.ru> References: <201002262326.o1QNQFVs084793@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201002262326.o1QNQFVs084793@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r204379 - head/tools/build/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 09:19:23 -0000 On Fri, Feb 26, 2010 at 11:26:15PM +0000, Antoine Brodin wrote: > Author: antoine > Date: Fri Feb 26 23:26:15 2010 > New Revision: 204379 > URL: http://svn.freebsd.org/changeset/base/204379 > > Log: > Do not remove fmt.1 when MK_MAIL=no. > > X-MFC-With: r203584 > > Modified: > head/tools/build/mk/OptionalObsoleteFiles.inc > > Modified: head/tools/build/mk/OptionalObsoleteFiles.inc > ============================================================================== > --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Feb 26 22:46:36 2010 (r204378) > +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Feb 26 23:26:15 2010 (r204379) > @@ -1547,7 +1547,6 @@ OLD_FILES+=usr/libexec/comsat > OLD_FILES+=usr/share/examples/etc/mail.rc > OLD_FILES+=usr/share/man/man1/Mail.1.gz > OLD_FILES+=usr/share/man/man1/biff.1.gz > -OLD_FILES+=usr/share/man/man1/fmt.1.gz > OLD_FILES+=usr/share/man/man1/from.1.gz > OLD_FILES+=usr/share/man/man1/mail.1.gz > OLD_FILES+=usr/share/man/man1/mailx.1.gz Picking up a random context... This doesn't handle the NO_MANCOMPRESS case where manpages are installed uncompressed. Cheers, -- Ruslan Ermilov ru@FreeBSD.org FreeBSD committer From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 09:21:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6F6D106567C; Sat, 27 Feb 2010 09:21:03 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from mail.vega.ru (mail.vega.ru [90.156.167.5]) by mx1.freebsd.org (Postfix) with ESMTP id 9074A8FC22; Sat, 27 Feb 2010 09:21:03 +0000 (UTC) Received: from [10.100.124.99] (helo=edoofus.dev.vega.ru) by mail.vega.ru with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.71 (FreeBSD)) (envelope-from ) id 1NlIr8-000NpR-Mo; Sat, 27 Feb 2010 12:21:02 +0300 Date: Sat, 27 Feb 2010 12:20:52 +0300 From: Ruslan Ermilov To: Xin LI Message-ID: <20100227092051.GC47001@edoofus.dev.vega.ru> References: <201002270117.o1R1Hiop009551@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201002270117.o1R1Hiop009551@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r204383 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 09:21:03 -0000 On Sat, Feb 27, 2010 at 01:17:44AM +0000, Xin LI wrote: > Author: delphij > Date: Sat Feb 27 01:17:44 2010 > New Revision: 204383 > URL: http://svn.freebsd.org/changeset/base/204383 > > Log: > Add several necessary .El's. > > MFC after: 2 weeks > > Modified: > head/share/man/man9/BUF_ISLOCKED.9 > head/share/man/man9/BUF_RECURSED.9 > head/share/man/man9/DEVICE_PROBE.9 > head/share/man/man9/VOP_LOCK.9 > head/share/man/man9/devfs_set_cdevpriv.9 "make manlint" is your friend. Cheers, -- Ruslan Ermilov ru@FreeBSD.org FreeBSD committer From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 10:14:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AF841065674; Sat, 27 Feb 2010 10:14:59 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A20E8FC1B; Sat, 27 Feb 2010 10:14:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1RAExfr029450; Sat, 27 Feb 2010 10:14:59 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1RAExV3029447; Sat, 27 Feb 2010 10:14:59 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201002271014.o1RAExV3029447@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 27 Feb 2010 10:14: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: r204403 - head/sbin/mount_hpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 10:14:59 -0000 Author: uqs Date: Sat Feb 27 10:14:59 2010 New Revision: 204403 URL: http://svn.freebsd.org/changeset/base/204403 Log: mount_hpfs(8): make WARNS=6 clean PR: bin/139995 Approved by: ed (co-mentor) Modified: head/sbin/mount_hpfs/Makefile head/sbin/mount_hpfs/mount_hpfs.c Modified: head/sbin/mount_hpfs/Makefile ============================================================================== --- head/sbin/mount_hpfs/Makefile Sat Feb 27 07:12:25 2010 (r204402) +++ head/sbin/mount_hpfs/Makefile Sat Feb 27 10:14:59 2010 (r204403) @@ -7,8 +7,7 @@ SRCS= mount_hpfs.c getmntopts.c MAN= mount_hpfs.8 MOUNT= ${.CURDIR}/../mount -CFLAGS+=-I${MOUNT} -DHPFS -WARNS?= 0 +CFLAGS+= -I${MOUNT} -DHPFS .PATH: ${MOUNT} Modified: head/sbin/mount_hpfs/mount_hpfs.c ============================================================================== --- head/sbin/mount_hpfs/mount_hpfs.c Sat Feb 27 07:12:25 2010 (r204402) +++ head/sbin/mount_hpfs/mount_hpfs.c Sat Feb 27 10:14:59 2010 (r204403) @@ -60,9 +60,7 @@ static void usage(void) __dead2; static void load_u2wtable(struct hpfs_args *, char *); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char *argv[]) { struct hpfs_args args; struct stat sb; @@ -150,8 +148,7 @@ main(argc, argv) } gid_t -a_gid(s) - char *s; +a_gid(char *s) { struct group *gr; char *gname; @@ -170,8 +167,7 @@ a_gid(s) } uid_t -a_uid(s) - char *s; +a_uid(char *s) { struct passwd *pw; char *uname; @@ -190,8 +186,7 @@ a_uid(s) } mode_t -a_mask(s) - char *s; +a_mask(char *s) { int done, rv=0; char *ep; @@ -207,16 +202,14 @@ a_mask(s) } void -usage() +usage(void) { fprintf(stderr, "usage: mount_hpfs [-u user] [-g group] [-m mask] bdev dir\n"); exit(EX_USAGE); } void -load_u2wtable (pargs, name) - struct hpfs_args *pargs; - char *name; +load_u2wtable (struct hpfs_args *pargs, char *name) { FILE *f; int i, code; From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 10:16:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35502106566C; Sat, 27 Feb 2010 10:16:15 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24B498FC27; Sat, 27 Feb 2010 10:16:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1RAGFBq029789; Sat, 27 Feb 2010 10:16:15 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1RAGFmc029786; Sat, 27 Feb 2010 10:16:15 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201002271016.o1RAGFmc029786@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 27 Feb 2010 10:16: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: r204404 - head/sbin/mount_ntfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 10:16:15 -0000 Author: uqs Date: Sat Feb 27 10:16:14 2010 New Revision: 204404 URL: http://svn.freebsd.org/changeset/base/204404 Log: mount_ntfs(8): make WARNS=6 clean PR: bin/140000 Approved by: ed (co-mentor) Modified: head/sbin/mount_ntfs/Makefile head/sbin/mount_ntfs/mount_ntfs.c Modified: head/sbin/mount_ntfs/Makefile ============================================================================== --- head/sbin/mount_ntfs/Makefile Sat Feb 27 10:14:59 2010 (r204403) +++ head/sbin/mount_ntfs/Makefile Sat Feb 27 10:16:14 2010 (r204404) @@ -9,8 +9,7 @@ DPADD= ${LIBKICONV} LDADD= -lkiconv MOUNT= ${.CURDIR}/../mount -CFLAGS+=-I${MOUNT} -WARNS?= 0 +CFLAGS+= -I${MOUNT} # Needs to be dynamically linked for optional dlopen() access to # userland libiconv Modified: head/sbin/mount_ntfs/mount_ntfs.c ============================================================================== --- head/sbin/mount_ntfs/mount_ntfs.c Sat Feb 27 10:14:59 2010 (r204403) +++ head/sbin/mount_ntfs/mount_ntfs.c Sat Feb 27 10:16:14 2010 (r204404) @@ -69,9 +69,7 @@ static void usage(void) __dead2; static int set_charset(struct ntfs_args *); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char *argv[]) { struct ntfs_args args; struct stat sb; @@ -193,8 +191,7 @@ main(argc, argv) } gid_t -a_gid(s) - char *s; +a_gid(char *s) { struct group *gr; char *gname; @@ -213,8 +210,7 @@ a_gid(s) } uid_t -a_uid(s) - char *s; +a_uid(char *s) { struct passwd *pw; char *uname; @@ -233,8 +229,7 @@ a_uid(s) } mode_t -a_mask(s) - char *s; +a_mask(char *s) { int done, rv=0; char *ep; @@ -250,7 +245,7 @@ a_mask(s) } void -usage() +usage(void) { #ifdef TRANSITION_PERIOD_HACK fprintf(stderr, "%s\n%s\n", From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 10:17:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41408106566B; Sat, 27 Feb 2010 10:17:28 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 167998FC2C; Sat, 27 Feb 2010 10:17:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1RAHR0p030093; Sat, 27 Feb 2010 10:17:27 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1RAHRPl030089; Sat, 27 Feb 2010 10:17:27 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201002271017.o1RAHRPl030089@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 27 Feb 2010 10:17: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: r204405 - in head/sbin/routed: . rtquery X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 10:17:29 -0000 Author: uqs Date: Sat Feb 27 10:17:27 2010 New Revision: 204405 URL: http://svn.freebsd.org/changeset/base/204405 Log: routed(8)/rtquery(8) bump/demote to WARNS=3 for all archs - The MACHINE_ARCH check is not exhaustive (missing at least powerpc), and generally not worth maintaining. - While here, fix whitespace and ordering of the Makefile PR: bin/140081 Approved by: ed (co-mentor) Modified: head/sbin/routed/Makefile head/sbin/routed/if.c head/sbin/routed/rtquery/Makefile Modified: head/sbin/routed/Makefile ============================================================================== --- head/sbin/routed/Makefile Sat Feb 27 10:16:14 2010 (r204404) +++ head/sbin/routed/Makefile Sat Feb 27 10:17:27 2010 (r204405) @@ -1,14 +1,13 @@ # Make `routed` for FreeBSD # $FreeBSD$ -PROG= routed -SRCS= if.c input.c main.c output.c parms.c radix.c rdisc.c table.c trace.c -MAN= routed.8 -SUBDIR= rtquery -LDADD= -lmd +PROG= routed +MAN= routed.8 +SRCS= if.c input.c main.c output.c parms.c radix.c rdisc.c table.c trace.c +WARNS?= 3 DPADD= ${LIBMD} -.if ${MACHINE_ARCH} != "i386" && ${MACHINE_ARCH} != "amd64" -WARNS?= 0 -.endif +LDADD= -lmd + +SUBDIR= rtquery .include Modified: head/sbin/routed/if.c ============================================================================== --- head/sbin/routed/if.c Sat Feb 27 10:16:14 2010 (r204404) +++ head/sbin/routed/if.c Sat Feb 27 10:17:27 2010 (r204405) @@ -29,6 +29,8 @@ * $FreeBSD$ */ +#include + #include "defs.h" #include "pathnames.h" @@ -948,9 +950,9 @@ ifinit(void) } else if (now.tv_sec>(ifp->int_data.ts + CHECK_BAD_INTERVAL)) { trace_act("interface %s has been off" - " %ld seconds; forget it", + " %jd seconds; forget it", ifp->int_name, - (long)now.tv_sec- + (intmax_t)now.tv_sec - ifp->int_data.ts); ifdel(ifp); } Modified: head/sbin/routed/rtquery/Makefile ============================================================================== --- head/sbin/routed/rtquery/Makefile Sat Feb 27 10:16:14 2010 (r204404) +++ head/sbin/routed/rtquery/Makefile Sat Feb 27 10:17:27 2010 (r204405) @@ -6,6 +6,6 @@ PROG= rtquery MAN= rtquery.8 LDADD= -lmd DPADD= ${LIBMD} -WARNS?= 0 +WARNS?= 3 .include From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 10:18:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3315106566B; Sat, 27 Feb 2010 10:18:33 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D16628FC1E; Sat, 27 Feb 2010 10:18:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1RAIXYs030357; Sat, 27 Feb 2010 10:18:33 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1RAIXtK030354; Sat, 27 Feb 2010 10:18:33 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201002271018.o1RAIXtK030354@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 27 Feb 2010 10:18: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: r204406 - head/sbin/route X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 10:18:34 -0000 Author: uqs Date: Sat Feb 27 10:18:33 2010 New Revision: 204406 URL: http://svn.freebsd.org/changeset/base/204406 Log: route(8): make WARNS=3 clean - add static and const where appropriate - check pointers against NULL - minor styling nits - it is actually WARNS=6 clean for non-strict alignment platforms This is shamelessly stolen from DragonflyBSD and reduces our diff. PR: bin/140078 Approved by: ed (co-mentor) Modified: head/sbin/route/Makefile head/sbin/route/route.c Modified: head/sbin/route/Makefile ============================================================================== --- head/sbin/route/Makefile Sat Feb 27 10:17:27 2010 (r204405) +++ head/sbin/route/Makefile Sat Feb 27 10:18:33 2010 (r204406) @@ -6,7 +6,7 @@ PROG= route MAN= route.8 SRCS= route.c keywords.h -WARNS?= 0 +WARNS?= 3 CLEANFILES+=keywords.h _keywords.tmp CFLAGS+= -DNS Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Sat Feb 27 10:17:27 2010 (r204405) +++ head/sbin/route/route.c Sat Feb 27 10:18:33 2010 (r204406) @@ -70,7 +70,7 @@ __FBSDID("$FreeBSD$"); #include struct keytab { - char *kt_cp; + const char *kt_cp; int kt_i; } keywords[] = { #include "keywords.h" @@ -100,39 +100,39 @@ struct rt_metrics rt_metrics; u_long rtm_inits; uid_t uid; -int atalk_aton(const char *, struct at_addr *); -char *atalk_ntoa(struct at_addr); -void bprintf(FILE *, int, u_char *); -void flushroutes(int argc, char *argv[]); -int getaddr(int, char *, struct hostent **); -int keyword(char *); -void inet_makenetandmask(u_long, struct sockaddr_in *, u_long); +static int atalk_aton(const char *, struct at_addr *); +static char *atalk_ntoa(struct at_addr); +static void bprintf(FILE *, int, u_char *); +static void flushroutes(int argc, char *argv[]); +static int getaddr(int, char *, struct hostent **); +static int keyword(const char *); +static void inet_makenetandmask(u_long, struct sockaddr_in *, u_long); #ifdef INET6 -static int inet6_makenetandmask(struct sockaddr_in6 *, char *); +static int inet6_makenetandmask(struct sockaddr_in6 *, const char *); #endif -void interfaces(void); -void mask_addr(void); -void monitor(void); -const char *netname(struct sockaddr *); -void newroute(int, char **); -void pmsg_addrs(char *, int); -void pmsg_common(struct rt_msghdr *); -int prefixlen(char *); -void print_getmsg(struct rt_msghdr *, int); -void print_rtmsg(struct rt_msghdr *, int); -const char *routename(struct sockaddr *); -int rtmsg(int, int); -void set_metric(char *, int); -void sockaddr(char *, struct sockaddr *); -void sodump(sup, char *); -extern char *iso_ntoa(); +static void interfaces(void); +static void mask_addr(void); +static void monitor(void); +static const char *netname(struct sockaddr *); +static void newroute(int, char **); +static void pmsg_addrs(char *, int); +static void pmsg_common(struct rt_msghdr *); +static int prefixlen(const char *); +static void print_getmsg(struct rt_msghdr *, int); +static void print_rtmsg(struct rt_msghdr *, int); +static const char *routename(struct sockaddr *); +static int rtmsg(int, int); +static void set_metric(char *, int); +static void sockaddr(char *, struct sockaddr *); +static void sodump(sup, const char *); +extern char *iso_ntoa(void); -void usage(const char *) __dead2; +static void usage(const char *) __dead2; void usage(const char *cp) { - if (cp) + if (cp != NULL) warnx("bad keyword: %s", cp); (void) fprintf(stderr, "usage: route [-dnqtv] command [[modifiers] args]\n"); @@ -146,7 +146,7 @@ main(int argc, char **argv) int ch; if (argc < 2) - usage((char *)NULL); + usage(NULL); while ((ch = getopt(argc, argv, "nqdtv")) != -1) switch(ch) { @@ -167,7 +167,7 @@ main(int argc, char **argv) break; case '?': default: - usage((char *)NULL); + usage(NULL); } argc -= optind; argv += optind; @@ -180,7 +180,7 @@ main(int argc, char **argv) s = socket(PF_ROUTE, SOCK_RAW, 0); if (s < 0) err(EX_OSERR, "socket"); - if (*argv) + if (*argv != NULL) switch (keyword(*argv)) { case K_GET: case K_SHOW: @@ -211,7 +211,7 @@ main(int argc, char **argv) * Purge all entries in the routing tables not * associated with network interfaces. */ -void +static void flushroutes(int argc, char *argv[]) { size_t needed; @@ -219,7 +219,7 @@ flushroutes(int argc, char *argv[]) char *buf, *next, *lim; struct rt_msghdr *rtm; - if (uid && !debugonly) { + if (uid != 0 && !debugonly) { errx(EX_NOPERM, "must be root to alter routing table"); } shutdown(s, SHUT_RD); /* Don't want to read back our messages */ @@ -259,7 +259,7 @@ retry: errx(EX_OSERR, "malloc failed"); if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) { if (errno == ENOMEM && count++ < 10) { - warnx("Routing table grew, retrying"); + warnx("Routing table grew, retrying"); sleep(1); free(buf); goto retry; @@ -276,7 +276,7 @@ retry: print_rtmsg(rtm, rtm->rtm_msglen); if ((rtm->rtm_flags & RTF_GATEWAY) == 0) continue; - if (af) { + if (af != 0) { struct sockaddr *sa = (struct sockaddr *)(rtm + 1); if (sa->sa_family != af) @@ -315,7 +315,7 @@ retry: const char * routename(struct sockaddr *sa) { - char *cp; + const char *cp; static char line[MAXHOSTNAMELEN + 1]; struct hostent *hp; static char domain[MAXHOSTNAMELEN + 1]; @@ -339,20 +339,22 @@ routename(struct sockaddr *sa) { struct in_addr in; in = ((struct sockaddr_in *)sa)->sin_addr; - cp = 0; + cp = NULL; if (in.s_addr == INADDR_ANY || sa->sa_len < 4) cp = "default"; - if (cp == 0 && !nflag) { + if (cp == NULL && !nflag) { hp = gethostbyaddr((char *)&in, sizeof (struct in_addr), AF_INET); - if (hp) { - if ((cp = strchr(hp->h_name, '.')) && - !strcmp(cp + 1, domain)) - *cp = 0; + if (hp != NULL) { + char *cptr; + cptr = strchr(hp->h_name, '.'); + if (cptr != NULL && + strcmp(cptr + 1, domain) == 0) + *cptr = '\0'; cp = hp->h_name; } } - if (cp) { + if (cp != NULL) { strncpy(line, cp, sizeof(line) - 1); line[sizeof(line) - 1] = '\0'; } else @@ -400,16 +402,17 @@ routename(struct sockaddr *sa) return (link_ntoa((struct sockaddr_dl *)sa)); default: - { u_short *s = (u_short *)sa; - u_short *slim = s + ((sa->sa_len + 1) >> 1); - char *cp = line + sprintf(line, "(%d)", sa->sa_family); + { + u_short *sp = (u_short *)sa; + u_short *splim = sp + ((sa->sa_len + 1) >> 1); + char *cps = line + sprintf(line, "(%d)", sa->sa_family); char *cpe = line + sizeof(line); - while (++s < slim && cp < cpe) /* start with sa->sa_data */ - if ((n = snprintf(cp, cpe - cp, " %x", *s)) > 0) - cp += n; + while (++sp < splim && cps < cpe) /* start with sa->sa_data */ + if ((n = snprintf(cps, cpe - cps, " %x", *sp)) > 0) + cps += n; else - *cp = '\0'; + *cps = '\0'; break; } } @@ -423,9 +426,9 @@ routename(struct sockaddr *sa) const char * netname(struct sockaddr *sa) { - char *cp = 0; + const char *cp = NULL; static char line[MAXHOSTNAMELEN + 1]; - struct netent *np = 0; + struct netent *np = NULL; u_long net, mask; u_long i; int n, subnetshift; @@ -462,11 +465,11 @@ netname(struct sockaddr *sa) while ((mask & 1) == 0) mask >>= 1, net >>= 1; np = getnetbyaddr(net, AF_INET); - if (np) + if (np != NULL) cp = np->n_name; } #define C(x) (unsigned)((x) & 0xff) - if (cp) + if (cp != NULL) strncpy(line, cp, sizeof(line)); else if ((in.s_addr & 0xffffff) == 0) (void) sprintf(line, "%u", C(in.s_addr >> 24)); @@ -525,23 +528,24 @@ netname(struct sockaddr *sa) default: - { u_short *s = (u_short *)sa->sa_data; - u_short *slim = s + ((sa->sa_len + 1)>>1); - char *cp = line + sprintf(line, "af %d:", sa->sa_family); + { + u_short *sp = (u_short *)sa->sa_data; + u_short *splim = sp + ((sa->sa_len + 1)>>1); + char *cps = line + sprintf(line, "af %d:", sa->sa_family); char *cpe = line + sizeof(line); - while (s < slim && cp < cpe) - if ((n = snprintf(cp, cpe - cp, " %x", *s++)) > 0) - cp += n; + while (sp < splim && cps < cpe) + if ((n = snprintf(cps, cpe - cps, " %x", *sp++)) > 0) + cps += n; else - *cp = '\0'; + *cps = '\0'; break; } } return (line); } -void +static void set_metric(char *value, int key) { int flag = 0; @@ -567,15 +571,16 @@ set_metric(char *value, int key) *valp = atoi(value); } -void +static void newroute(int argc, char **argv) { - char *cmd, *dest = "", *gateway = "", *errmsg; + char *cmd; + const char *dest = "", *gateway = "", *errmsg; int ishost = 0, proxy = 0, ret, attempts, oerrno, flags = RTF_STATIC; int key; struct hostent *hp = 0; - if (uid) { + if (uid != 0) { errx(EX_NOPERM, "must be root to alter routing table"); } cmd = argv[0]; @@ -652,33 +657,33 @@ newroute(int argc, char **argv) break; case K_IFA: if (!--argc) - usage((char *)NULL); + usage(NULL); (void) getaddr(RTA_IFA, *++argv, 0); break; case K_IFP: if (!--argc) - usage((char *)NULL); + usage(NULL); (void) getaddr(RTA_IFP, *++argv, 0); break; case K_GENMASK: if (!--argc) - usage((char *)NULL); + usage(NULL); (void) getaddr(RTA_GENMASK, *++argv, 0); break; case K_GATEWAY: if (!--argc) - usage((char *)NULL); + usage(NULL); (void) getaddr(RTA_GATEWAY, *++argv, 0); break; case K_DST: if (!--argc) - usage((char *)NULL); + usage(NULL); ishost = getaddr(RTA_DST, *++argv, &hp); dest = *argv; break; case K_NETMASK: if (!--argc) - usage((char *)NULL); + usage(NULL); (void) getaddr(RTA_NETMASK, *++argv, 0); /* FALLTHROUGH */ case K_NET: @@ -686,7 +691,7 @@ newroute(int argc, char **argv) break; case K_PREFIXLEN: if (!--argc) - usage((char *)NULL); + usage(NULL); if (prefixlen(*++argv) == -1) { forcenet = 0; ishost = 1; @@ -705,7 +710,7 @@ newroute(int argc, char **argv) case K_RTTVAR: case K_WEIGHT: if (!--argc) - usage((char *)NULL); + usage(NULL); set_metric(*++argv, key); break; default: @@ -729,9 +734,9 @@ newroute(int argc, char **argv) #ifdef INET6 if (af == AF_INET6) { rtm_addrs &= ~RTA_NETMASK; - memset((void *)&so_mask, 0, sizeof(so_mask)); + memset((void *)&so_mask, 0, sizeof(so_mask)); } -#endif +#endif } if (forcenet) ishost = 0; @@ -750,10 +755,12 @@ newroute(int argc, char **argv) break; if (errno != ENETUNREACH && errno != ESRCH) break; - if (af == AF_INET && *gateway && hp && hp->h_addr_list[1]) { + if (af == AF_INET && *gateway != '\0' && + hp != NULL && hp->h_addr_list[1] != NULL) { hp->h_addr_list++; memmove(&so_gate.sin.sin_addr, hp->h_addr_list[0], - MIN(hp->h_length, sizeof(so_gate.sin.sin_addr))); + MIN((size_t)hp->h_length, + sizeof(so_gate.sin.sin_addr))); } else break; } @@ -798,14 +805,14 @@ newroute(int argc, char **argv) exit(ret != 0); } -void +static void inet_makenetandmask(u_long net, struct sockaddr_in *sin, u_long bits) { u_long addr, mask = 0; char *cp; rtm_addrs |= RTA_NETMASK; - /* + /* * XXX: This approach unable to handle 0.0.0.1/32 correctly * as inet_network() converts 0.0.0.1 and 1 equally. */ @@ -818,7 +825,7 @@ inet_makenetandmask(u_long net, struct s else addr = net; /* - * If no /xx was specified we must cacluate the + * If no /xx was specified we must calculate the * CIDR address. */ if ((bits == 0) && (addr != 0)) { @@ -851,11 +858,11 @@ inet_makenetandmask(u_long net, struct s * XXX the function may need more improvement... */ static int -inet6_makenetandmask(struct sockaddr_in6 *sin6, char *plen) +inet6_makenetandmask(struct sockaddr_in6 *sin6, const char *plen) { struct in6_addr in6; - if (!plen) { + if (plen == NULL) { if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) && sin6->sin6_scope_id == 0) { plen = "0"; @@ -868,11 +875,11 @@ inet6_makenetandmask(struct sockaddr_in6 } } - if (!plen || strcmp(plen, "128") == 0) - return 1; + if (plen == NULL || strcmp(plen, "128") == 0) + return (1); rtm_addrs |= RTA_NETMASK; - (void)prefixlen(plen); - return 0; + prefixlen(plen); + return (0); } #endif @@ -880,8 +887,8 @@ inet6_makenetandmask(struct sockaddr_in6 * Interpret an argument as a network address of some kind, * returning 1 if a host address, 0 if a network address. */ -int -getaddr(int which, char *s, struct hostent **hpp) +static int +getaddr(int which, char *str, struct hostent **hpp) { sup su; struct hostent *hp; @@ -909,17 +916,17 @@ getaddr(int which, char *s, struct hoste if (getifaddrs(&ifap)) err(1, "getifaddrs"); - for (ifa = ifap; ifa; ifa = ifa->ifa_next) { + for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) { if (ifa->ifa_addr->sa_family != AF_LINK) continue; - if (strcmp(s, ifa->ifa_name)) + if (strcmp(str, ifa->ifa_name) != 0) continue; sdl = (struct sockaddr_dl *)ifa->ifa_addr; } /* If we found it, then use it */ - if (sdl) { + if (sdl != NULL) { /* * Copy is safe since we have a * sockaddr_storage member in sockunion{}. @@ -929,7 +936,7 @@ getaddr(int which, char *s, struct hoste memcpy(&su->sdl, sdl, sdl->sdl_len); } freeifaddrs(ifap); - if (sdl) + if (sdl != NULL) return(1); } break; @@ -952,9 +959,9 @@ getaddr(int which, char *s, struct hoste } su->sa.sa_len = aflen; su->sa.sa_family = afamily; /* cases that don't want it have left already */ - if (strcmp(s, "default") == 0) { + if (strcmp(str, "default") == 0) { /* - * Default is net 0.0.0.0/0 + * Default is net 0.0.0.0/0 */ switch (which) { case RTA_DST: @@ -962,7 +969,7 @@ getaddr(int which, char *s, struct hoste #if 0 bzero(su, sizeof(*su)); /* for readability */ #endif - (void) getaddr(RTA_NETMASK, s, 0); + getaddr(RTA_NETMASK, str, 0); break; #if 0 case RTA_NETMASK: @@ -980,15 +987,15 @@ getaddr(int which, char *s, struct hoste int ecode; q = NULL; - if (which == RTA_DST && (q = strchr(s, '/')) != NULL) + if (which == RTA_DST && (q = strchr(str, '/')) != NULL) *q = '\0'; memset(&hints, 0, sizeof(hints)); hints.ai_family = afamily; /*AF_INET6*/ hints.ai_socktype = SOCK_DGRAM; /*dummy*/ - ecode = getaddrinfo(s, NULL, &hints, &res); + ecode = getaddrinfo(str, NULL, &hints, &res); if (ecode != 0 || res->ai_family != AF_INET6 || res->ai_addrlen != sizeof(su->sin6)) { - (void) fprintf(stderr, "%s: %s\n", s, + (void) fprintf(stderr, "%s: %s\n", str, gai_strerror(ecode)); exit(1); } @@ -1012,19 +1019,19 @@ getaddr(int which, char *s, struct hoste #endif /* INET6 */ case AF_APPLETALK: - if (!atalk_aton(s, &su->sat.sat_addr)) - errx(EX_NOHOST, "bad address: %s", s); + if (!atalk_aton(str, &su->sat.sat_addr)) + errx(EX_NOHOST, "bad address: %s", str); rtm_addrs |= RTA_NETMASK; return(forcehost || su->sat.sat_addr.s_node != 0); case AF_LINK: - link_addr(s, &su->sdl); + link_addr(str, &su->sdl); return (1); case PF_ROUTE: su->sa.sa_len = sizeof(*su); - sockaddr(s, &su->sa); + sockaddr(str, &su->sa); return (1); case AF_INET: @@ -1036,10 +1043,10 @@ getaddr(int which, char *s, struct hoste hpp = &hp; *hpp = NULL; - q = strchr(s,'/'); - if (q && which == RTA_DST) { + q = strchr(str,'/'); + if (q != NULL && which == RTA_DST) { *q = '\0'; - if ((val = inet_network(s)) != INADDR_NONE) { + if ((val = inet_network(str)) != INADDR_NONE) { inet_makenetandmask( val, &su->sin, strtoul(q+1, 0, 0)); return (0); @@ -1047,7 +1054,7 @@ getaddr(int which, char *s, struct hoste *q = '/'; } if ((which != RTA_DST || forcenet == 0) && - inet_aton(s, &su->sin.sin_addr)) { + inet_aton(str, &su->sin.sin_addr)) { val = su->sin.sin_addr.s_addr; if (which != RTA_DST || forcehost || inet_lnaof(su->sin.sin_addr) != INADDR_ANY) @@ -1058,27 +1065,27 @@ getaddr(int which, char *s, struct hoste } } if (which == RTA_DST && forcehost == 0 && - ((val = inet_network(s)) != INADDR_NONE || - ((np = getnetbyname(s)) != NULL && (val = np->n_net) != 0))) { + ((val = inet_network(str)) != INADDR_NONE || + ((np = getnetbyname(str)) != NULL && (val = np->n_net) != 0))) { netdone: inet_makenetandmask(val, &su->sin, 0); return (0); } - hp = gethostbyname(s); - if (hp) { + hp = gethostbyname(str); + if (hp != NULL) { *hpp = hp; su->sin.sin_family = hp->h_addrtype; memmove((char *)&su->sin.sin_addr, hp->h_addr, - MIN(hp->h_length, sizeof(su->sin.sin_addr))); + MIN((size_t)hp->h_length, sizeof(su->sin.sin_addr))); return (1); } - errx(EX_NOHOST, "bad address: %s", s); + errx(EX_NOHOST, "bad address: %s", str); } -int -prefixlen(char *s) +static int +prefixlen(const char *str) { - int len = atoi(s), q, r; + int len = atoi(str), q, r; int max; char *p; @@ -1095,13 +1102,12 @@ prefixlen(char *s) p = (char *)&so_mask.sin.sin_addr; break; default: - (void) fprintf(stderr, "prefixlen not supported in this af\n"); + fprintf(stderr, "prefixlen not supported in this af\n"); exit(1); - /*NOTREACHED*/ } if (len < 0 || max < len) { - (void) fprintf(stderr, "%s: bad value\n", s); + fprintf(stderr, "%s: bad value\n", str); exit(1); } @@ -1115,12 +1121,12 @@ prefixlen(char *s) if (r > 0) *((u_char *)p + q) = (0xff00 >> r) & 0xff; if (len == max) - return -1; + return (-1); else - return len; + return (len); } -void +static void interfaces(void) { size_t needed; @@ -1155,7 +1161,7 @@ retry2: } } -void +static void monitor(void) { int n; @@ -1166,7 +1172,7 @@ monitor(void) interfaces(); exit(0); } - for(;;) { + for (;;) { time_t now; n = read(s, msg, 2048); now = time(NULL); @@ -1180,7 +1186,7 @@ struct { char m_space[512]; } m_rtmsg; -int +static int rtmsg(int cmd, int flags) { static int seq; @@ -1250,7 +1256,7 @@ rtmsg(int cmd, int flags) return (0); } -void +static void mask_addr(void) { int olen = so_mask.sa.sa_len; @@ -1281,7 +1287,7 @@ mask_addr(void) *--cp1 &= *--cp2; } -char *msgtypes[] = { +const char *msgtypes[] = { "", "RTM_ADD: Add Route", "RTM_DELETE: Delete Route", @@ -1318,8 +1324,8 @@ char ifnetflags[] = char addrnames[] = "\1DST\2GATEWAY\3NETMASK\4GENMASK\5IFP\6IFA\7AUTHOR\010BRD"; -void -print_rtmsg(struct rt_msghdr *rtm, int msglen) +static void +print_rtmsg(struct rt_msghdr *rtm, int msglen __unused) { struct if_msghdr *ifm; struct ifa_msghdr *ifam; @@ -1327,7 +1333,7 @@ print_rtmsg(struct rt_msghdr *rtm, int m struct ifma_msghdr *ifmam; #endif struct if_announcemsghdr *ifan; - char *state; + const char *state; if (verbose == 0) return; @@ -1399,7 +1405,7 @@ print_rtmsg(struct rt_msghdr *rtm, int m } } -void +static void print_getmsg(struct rt_msghdr *rtm, int msglen) { struct sockaddr *dst = NULL, *gate = NULL, *mask = NULL; @@ -1493,7 +1499,7 @@ print_getmsg(struct rt_msghdr *rtm, int #undef RTA_IGN } -void +static void pmsg_common(struct rt_msghdr *rtm) { (void) printf("\nlocks: "); @@ -1503,7 +1509,7 @@ pmsg_common(struct rt_msghdr *rtm) pmsg_addrs(((char *)(rtm + 1)), rtm->rtm_addrs); } -void +static void pmsg_addrs(char *cp, int addrs) { struct sockaddr *sa; @@ -1516,7 +1522,7 @@ pmsg_addrs(char *cp, int addrs) (void) printf("\nsockaddrs: "); bprintf(stdout, addrs, addrnames); (void) putchar('\n'); - for (i = 1; i; i <<= 1) + for (i = 1; i != 0; i <<= 1) if (i & addrs) { sa = (struct sockaddr *)cp; (void) printf(" %s", routename(sa)); @@ -1526,15 +1532,15 @@ pmsg_addrs(char *cp, int addrs) (void) fflush(stdout); } -void -bprintf(FILE *fp, int b, u_char *s) +static void +bprintf(FILE *fp, int b, u_char *str) { int i; int gotsome = 0; if (b == 0) return; - while ((i = *s++) != 0) { + while ((i = *str++) != 0) { if (b & (1 << (i-1))) { if (gotsome == 0) i = '<'; @@ -1542,28 +1548,28 @@ bprintf(FILE *fp, int b, u_char *s) i = ','; (void) putc(i, fp); gotsome = 1; - for (; (i = *s) > 32; s++) + for (; (i = *str) > 32; str++) (void) putc(i, fp); } else - while (*s > 32) - s++; + while (*str > 32) + str++; } if (gotsome) (void) putc('>', fp); } int -keyword(char *cp) +keyword(const char *cp) { struct keytab *kt = keywords; - while (kt->kt_cp && strcmp(kt->kt_cp, cp)) + while (kt->kt_cp != NULL && strcmp(kt->kt_cp, cp) != 0) kt++; - return kt->kt_i; + return (kt->kt_i); } -void -sodump(sup su, char *which) +static void +sodump(sup su, const char *which) { switch (su->sa.sa_family) { case AF_LINK: @@ -1591,7 +1597,7 @@ sodump(sup su, char *which) #define END (4*1) #define DELIM (4*2) -void +static void sockaddr(char *addr, struct sockaddr *sa) { char *cp = (char *)sa; @@ -1608,7 +1614,7 @@ sockaddr(char *addr, struct sockaddr *sa new = *addr - 'a' + 10; } else if ((*addr >= 'A') && (*addr <= 'F')) { new = *addr - 'A' + 10; - } else if (*addr == 0) + } else if (*addr == '\0') state |= END; else state |= DELIM; @@ -1633,7 +1639,7 @@ sockaddr(char *addr, struct sockaddr *sa sa->sa_len = cp - (char *)sa; } -int +static int atalk_aton(const char *text, struct at_addr *addr) { u_int net, node; @@ -1646,7 +1652,7 @@ atalk_aton(const char *text, struct at_a return(1); } -char * +static char * atalk_ntoa(struct at_addr at) { static char buf[20]; From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 10:19:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1497A1065675; Sat, 27 Feb 2010 10:19:40 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02E998FC17; Sat, 27 Feb 2010 10:19:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1RAJdgY030629; Sat, 27 Feb 2010 10:19:39 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1RAJdPC030620; Sat, 27 Feb 2010 10:19:39 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201002271019.o1RAJdPC030620@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 27 Feb 2010 10:19: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: r204407 - in head: sbin/rtsol usr.sbin/rtsold X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 10:19:40 -0000 Author: uqs Date: Sat Feb 27 10:19:39 2010 New Revision: 204407 URL: http://svn.freebsd.org/changeset/base/204407 Log: rtsol(8)/rtsold(8): make WARNS=3 clean It is actually WARNS=6 clean for non-strict alignment archs. Approved by: ed (co-mentor) Modified: head/sbin/rtsol/Makefile head/usr.sbin/rtsold/Makefile head/usr.sbin/rtsold/dump.c head/usr.sbin/rtsold/if.c head/usr.sbin/rtsold/rtsock.c head/usr.sbin/rtsold/rtsol.c head/usr.sbin/rtsold/rtsold.c head/usr.sbin/rtsold/rtsold.h Modified: head/sbin/rtsol/Makefile ============================================================================== --- head/sbin/rtsol/Makefile Sat Feb 27 10:18:33 2010 (r204406) +++ head/sbin/rtsol/Makefile Sat Feb 27 10:19:39 2010 (r204407) @@ -21,8 +21,8 @@ SRCDIR= ${.CURDIR}/../../usr.sbin/rtsold PROG= rtsol SRCS= rtsold.c rtsol.c if.c probe.c rtsock.c NO_MAN= -WARNS?= 0 +WARNS?= 3 CFLAGS+= -DHAVE_ARC4RANDOM -DHAVE_POLL_H -DSMALL .include Modified: head/usr.sbin/rtsold/Makefile ============================================================================== --- head/usr.sbin/rtsold/Makefile Sat Feb 27 10:18:33 2010 (r204406) +++ head/usr.sbin/rtsold/Makefile Sat Feb 27 10:19:39 2010 (r204407) @@ -19,10 +19,8 @@ MAN= rtsold.8 MLINKS= rtsold.8 rtsol.8 SRCS= rtsold.c rtsol.c if.c probe.c dump.c rtsock.c +WARNS?= 3 CFLAGS+= -DHAVE_ARC4RANDOM -DHAVE_POLL_H - -WARNS?= 1 - DPADD= ${LIBKVM} LDADD= -lkvm Modified: head/usr.sbin/rtsold/dump.c ============================================================================== --- head/usr.sbin/rtsold/dump.c Sat Feb 27 10:18:33 2010 (r204406) +++ head/usr.sbin/rtsold/dump.c Sat Feb 27 10:19:39 2010 (r204407) @@ -52,8 +52,8 @@ static FILE *fp; extern struct ifinfo *iflist; static void dump_interface_status(void); -static char *sec2str(time_t); -char *ifstatstr[] = {"IDLE", "DELAY", "PROBE", "DOWN", "TENTATIVE"}; +static const char *sec2str(time_t); +static const char * const ifstatstr[] = {"IDLE", "DELAY", "PROBE", "DOWN", "TENTATIVE"}; static void dump_interface_status(void) @@ -97,7 +97,7 @@ dump_interface_status(void) } void -rtsold_dump_file(char *dumpfile) +rtsold_dump_file(const char *dumpfile) { if ((fp = fopen(dumpfile, "w")) == NULL) { warnmsg(LOG_WARNING, __func__, "open a dump file(%s): %s", @@ -108,7 +108,7 @@ rtsold_dump_file(char *dumpfile) fclose(fp); } -static char * +static const char * sec2str(time_t total) { static char result[256]; Modified: head/usr.sbin/rtsold/if.c ============================================================================== --- head/usr.sbin/rtsold/if.c Sat Feb 27 10:18:33 2010 (r204406) +++ head/usr.sbin/rtsold/if.c Sat Feb 27 10:19:39 2010 (r204407) @@ -82,7 +82,6 @@ interface_up(char *name) struct in6_ndireq nd; int llflag; int s; - int error; memset(&ifr, 0, sizeof(ifr)); strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); Modified: head/usr.sbin/rtsold/rtsock.c ============================================================================== --- head/usr.sbin/rtsold/rtsock.c Sat Feb 27 10:18:33 2010 (r204406) +++ head/usr.sbin/rtsold/rtsock.c Sat Feb 27 10:19:39 2010 (r204407) @@ -94,9 +94,9 @@ rtsock_input(int s) char *lim, *next; struct rt_msghdr *rtm; int idx; - size_t len; + ssize_t len; int ret = 0; - const size_t lenlim = + const ssize_t lenlim = offsetof(struct rt_msghdr, rtm_msglen) + sizeof(rtm->rtm_msglen); n = read(s, msg, sizeof(msg)); @@ -135,7 +135,7 @@ rtsock_input(int s) #ifdef RTM_IFANNOUNCE /*NetBSD 1.5 or later*/ static int -rtsock_input_ifannounce(int s, struct rt_msghdr *rtm, char *lim) +rtsock_input_ifannounce(int s __unused, struct rt_msghdr *rtm, char *lim) { struct if_announcemsghdr *ifan; struct ifinfo *ifinfo; Modified: head/usr.sbin/rtsold/rtsol.c ============================================================================== --- head/usr.sbin/rtsold/rtsol.c Sat Feb 27 10:18:33 2010 (r204406) +++ head/usr.sbin/rtsold/rtsol.c Sat Feb 27 10:19:39 2010 (r204407) @@ -72,8 +72,10 @@ static int rcvcmsglen; int rssock; -static struct sockaddr_in6 sin6_allrouters = -{sizeof(sin6_allrouters), AF_INET6}; +static struct sockaddr_in6 sin6_allrouters = { + .sin6_len = sizeof(sin6_allrouters), + .sin6_family = AF_INET6, +}; static void call_script(char *, char *); static int safefile(const char *); @@ -183,7 +185,7 @@ sendpacket(struct ifinfo *ifinfo) struct in6_pktinfo *pi; struct cmsghdr *cm; int hoplimit = 255; - int i; + ssize_t i; struct sockaddr_in6 dst; dst = sin6_allrouters; @@ -213,7 +215,7 @@ sendpacket(struct ifinfo *ifinfo) "send RS on %s, whose state is %d", ifinfo->ifname, ifinfo->state); i = sendmsg(rssock, &sndmhdr, 0); - if (i < 0 || i != ifinfo->rs_datalen) { + if (i < 0 || (size_t)i != ifinfo->rs_datalen) { /* * ENETDOWN is not so serious, especially when using several * network cards on a mobile node. We ignore it. @@ -231,7 +233,8 @@ void rtsol_input(int s) { u_char ntopbuf[INET6_ADDRSTRLEN], ifnamebuf[IFNAMSIZ]; - int ifindex = 0, i, *hlimp = NULL; + int ifindex = 0, *hlimp = NULL; + ssize_t i; struct in6_pktinfo *pi = NULL; struct ifinfo *ifi = NULL; struct icmp6_hdr *icp; @@ -272,9 +275,9 @@ rtsol_input(int s) return; } - if (i < sizeof(struct nd_router_advert)) { + if ((size_t)i < sizeof(struct nd_router_advert)) { warnmsg(LOG_INFO, __func__, - "packet size(%d) is too short", i); + "packet size(%zd) is too short", i); return; } Modified: head/usr.sbin/rtsold/rtsold.c ============================================================================== --- head/usr.sbin/rtsold/rtsold.c Sat Feb 27 10:18:33 2010 (r204406) +++ head/usr.sbin/rtsold/rtsold.c Sat Feb 27 10:19:39 2010 (r204407) @@ -91,10 +91,10 @@ int main(int, char **); static int mobile_node = 0; #ifndef SMALL static int do_dump; -static char *dumpfilename = "/var/run/rtsold.dump"; /* XXX: should be configurable */ +static const char *dumpfilename = "/var/run/rtsold.dump"; /* XXX: should be configurable */ #endif #if 1 -static char *pidfilename = "/var/run/rtsold.pid"; /* should be configurable */ +static const char *pidfilename = "/var/run/rtsold.pid"; /* should be configurable */ #endif #if 0 @@ -113,7 +113,8 @@ main(int argc, char **argv) { int s, ch, once = 0; struct timeval *timeout; - char *argv0, *opts; + char *argv0; + const char *opts; #ifdef HAVE_POLL_H struct pollfd set[2]; #else @@ -734,7 +735,7 @@ rtsol_timer_update(struct ifinfo *ifinfo #ifndef SMALL static void -rtsold_set_dump_file(int sig) +rtsold_set_dump_file(int sig __unused) { do_dump = 1; } @@ -790,7 +791,7 @@ autoifprobe(void) static char **argv = NULL; static int n = 0; char **a; - int s, i, found; + int s = 0, i, found; struct ifaddrs *ifap, *ifa, *target; struct in6_ndireq nd; Modified: head/usr.sbin/rtsold/rtsold.h ============================================================================== --- head/usr.sbin/rtsold/rtsold.h Sat Feb 27 10:18:33 2010 (r204406) +++ head/usr.sbin/rtsold/rtsold.h Sat Feb 27 10:19:39 2010 (r204407) @@ -97,7 +97,7 @@ extern int probe_init(void); extern void defrouter_probe(struct ifinfo *); /* dump.c */ -extern void rtsold_dump_file(char *); +extern void rtsold_dump_file(const char *); /* rtsock.c */ extern int rtsock_open(void); From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 10:37:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD63A106566C; Sat, 27 Feb 2010 10:37:14 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by mx1.freebsd.org (Postfix) with ESMTP id B73CF8FC16; Sat, 27 Feb 2010 10:37:10 +0000 (UTC) Received: by ewy26 with SMTP id 26so490895ewy.3 for ; Sat, 27 Feb 2010 02:37:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:message-id:in-reply-to:references:x-mailer:mime-version :content-type; bh=rsng2wmvLsRHAQlG3au94U9500bwTcgpNAMwoPlSafU=; b=K1jaDPygsYr9eJISI53kE/3KiuRsIII7KpNS1sUeJNuz/aw6/4GGwc7zfm3umcqjdi 8e6pGrpZshLvym7Khp7MC4/uCB5km7vwSC6up5gxsLQXb5qHGmxzvnIN5kB9DAEhrgA9 wDRI4UhmsfwtD5WcHk2G26RJ1ck1IGUjL0ZaA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:in-reply-to:references :x-mailer:mime-version:content-type; b=D/Zp0CB1fP/Wgd7zEQBUthT3zN9p/OXxgDpt9mWmjrw13lJbfDqWz08s1ccXYCuC39 rnorx59RLyn235CqANEvIJ8j1O4sG8e6KaFda6sKZ/uLLvVHK5zwNATGd7GaeUmxE74j 7JmNN889IR68qXYMtwg01GomFf9U1gsDxDOYA= Received: by 10.213.109.91 with SMTP id i27mr1115278ebp.3.1267267020455; Sat, 27 Feb 2010 02:37:00 -0800 (PST) Received: from peanut.dreadbsd.org (mna75-2-82-67-196-50.fbx.proxad.net [82.67.196.50]) by mx.google.com with ESMTPS id 5sm921150eyh.9.2010.02.27.02.36.59 (version=SSLv3 cipher=RC4-MD5); Sat, 27 Feb 2010 02:36:59 -0800 (PST) Sender: Antoine Brodin Date: Sat, 27 Feb 2010 11:36:56 +0100 From: Antoine Brodin To: Ruslan Ermilov Message-Id: <20100227113656.a3ea6ad5.antoine@FreeBSD.org> In-Reply-To: <20100227091911.GB47001@edoofus.dev.vega.ru> References: <201002262326.o1QNQFVs084793@svn.freebsd.org> <20100227091911.GB47001@edoofus.dev.vega.ru> X-Mailer: Sylpheed 2.7.1 (GTK+ 2.18.6; i386-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Sat__27_Feb_2010_11_36_56_+0100_Y8X=WAEW2li2xQXT" Cc: svn-src-head@freebsd.org, Antoine Brodin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r204379 - head/tools/build/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 10:37:15 -0000 This is a multi-part message in MIME format. --Multipart=_Sat__27_Feb_2010_11_36_56_+0100_Y8X=WAEW2li2xQXT Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Ruslan Ermilov wrote: > Picking up a random context... This doesn't handle the NO_MANCOMPRESS > case where manpages are installed uncompressed. What about the following patch. Index: Makefile.inc1 =================================================================== RCS file: /home/ncvs/src/Makefile.inc1,v retrieving revision 1.640 diff -u -r1.640 Makefile.inc1 --- Makefile.inc1 26 Jan 2010 10:00:26 -0000 1.640 +++ Makefile.inc1 27 Feb 2010 10:27:35 -0000 @@ -1259,7 +1259,7 @@ @echo ">>> Removing old files (only deletes safe to delete libs)" # Ask for every old file if the user really wants to remove it. # It's annoying, but better safe than sorry. - @for file in ${OLD_FILES}; do \ + @for file in ${OLD_FILES} ${OLD_FILES:Musr/share/*man/*.gz:R}; do \ if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \ rm ${RM_I} "${DESTDIR}/$${file}"; \ @@ -1279,7 +1279,7 @@ check-old-files: @echo ">>> Checking for old files" - @for file in ${OLD_FILES}; do \ + @for file in ${OLD_FILES} ${OLD_FILES:Musr/share/*man/*.gz:R}; do \ if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ echo "${DESTDIR}/$${file}"; \ fi; \ Cheers, Antoine --Multipart=_Sat__27_Feb_2010_11_36_56_+0100_Y8X=WAEW2li2xQXT Content-Type: text/x-diff; name="M.diff" Content-Disposition: attachment; filename="M.diff" Content-Transfer-Encoding: 7bit Index: Makefile.inc1 =================================================================== RCS file: /home/ncvs/src/Makefile.inc1,v retrieving revision 1.640 diff -u -r1.640 Makefile.inc1 --- Makefile.inc1 26 Jan 2010 10:00:26 -0000 1.640 +++ Makefile.inc1 27 Feb 2010 10:27:35 -0000 @@ -1259,7 +1259,7 @@ @echo ">>> Removing old files (only deletes safe to delete libs)" # Ask for every old file if the user really wants to remove it. # It's annoying, but better safe than sorry. - @for file in ${OLD_FILES}; do \ + @for file in ${OLD_FILES} ${OLD_FILES:Musr/share/*man/*.gz:R}; do \ if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \ rm ${RM_I} "${DESTDIR}/$${file}"; \ @@ -1279,7 +1279,7 @@ check-old-files: @echo ">>> Checking for old files" - @for file in ${OLD_FILES}; do \ + @for file in ${OLD_FILES} ${OLD_FILES:Musr/share/*man/*.gz:R}; do \ if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ echo "${DESTDIR}/$${file}"; \ fi; \ --Multipart=_Sat__27_Feb_2010_11_36_56_+0100_Y8X=WAEW2li2xQXT-- From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 10:41:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F35B2106566B; Sat, 27 Feb 2010 10:41:30 +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 E23848FC13; Sat, 27 Feb 2010 10:41:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1RAfU69035459; Sat, 27 Feb 2010 10:41:30 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1RAfUjV035457; Sat, 27 Feb 2010 10:41:30 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201002271041.o1RAfUjV035457@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 27 Feb 2010 10:41: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: r204408 - head/sys/dev/md X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 10:41:31 -0000 Author: trasz Date: Sat Feb 27 10:41:30 2010 New Revision: 204408 URL: http://svn.freebsd.org/changeset/base/204408 Log: Fix panic on invalid 'mdconfig -at preload' usage. PR: kern/80136 Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Sat Feb 27 10:19:39 2010 (r204407) +++ head/sys/dev/md/md.c Sat Feb 27 10:41:30 2010 (r204408) @@ -814,6 +814,8 @@ mdcreate_preload(struct md_s *sc, struct if (mdio->md_options & ~(MD_AUTOUNIT | MD_FORCE)) return (EINVAL); + if (mdio->md_base == 0) + return (EINVAL); sc->flags = mdio->md_options & MD_FORCE; /* Cast to pointer size, then to pointer to avoid warning */ sc->pl_ptr = (u_char *)(uintptr_t)mdio->md_base; From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 12:16:00 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19BB0106566B; Sat, 27 Feb 2010 12:16:00 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 088D98FC1E; Sat, 27 Feb 2010 12:16:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1RCFx9B056230; Sat, 27 Feb 2010 12:15:59 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1RCFxGg056229; Sat, 27 Feb 2010 12:15:59 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201002271215.o1RCFxGg056229@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 27 Feb 2010 12:15: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: r204410 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 12:16:00 -0000 Author: jilles Date: Sat Feb 27 12:15:59 2010 New Revision: 204410 URL: http://svn.freebsd.org/changeset/base/204410 Log: Include terminated threads in ps's process cpu time field. MFC after: 2 weeks Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sat Feb 27 10:55:43 2010 (r204409) +++ head/sys/kern/kern_proc.c Sat Feb 27 12:15:59 2010 (r204410) @@ -676,11 +676,9 @@ fill_kinfo_aggregate(struct proc *p, str kp->ki_estcpu = 0; kp->ki_pctcpu = 0; - kp->ki_runtime = 0; FOREACH_THREAD_IN_PROC(p, td) { thread_lock(td); kp->ki_pctcpu += sched_pctcpu(td); - kp->ki_runtime += cputick2usec(td->td_runtime); kp->ki_estcpu += td->td_estcpu; thread_unlock(td); } From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 13:43:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B93E106564A; Sat, 27 Feb 2010 13:43:36 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-exrelay3.uni-muenster.de (ZIVM-EXRELAY3.UNI-MUENSTER.DE [128.176.192.20]) by mx1.freebsd.org (Postfix) with ESMTP id 80EC28FC14; Sat, 27 Feb 2010 13:43:35 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.49,550,1262559600"; d="scan'208";a="27087420" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER04.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay3.uni-muenster.de with ESMTP; 27 Feb 2010 14:13:36 +0100 Received: by ZIVMAILUSER04.UNI-MUENSTER.DE (Postfix, from userid 149459) id 82E4C1B07C1; Sat, 27 Feb 2010 14:13:36 +0100 (CET) Date: Sat, 27 Feb 2010 14:13:36 +0100 (CET) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= Message-ID: 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 Subject: Re: svn commit: r204408 - head/sys/dev/md X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 13:43:36 -0000 thanks. :) could you also mfc this after a while to stable[6-8]? alex From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 13:54:03 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46BE0106566C; Sat, 27 Feb 2010 13:54:03 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from mail.vega.ru (mail.vega.ru [90.156.167.5]) by mx1.freebsd.org (Postfix) with ESMTP id EF4028FC0A; Sat, 27 Feb 2010 13:54:02 +0000 (UTC) Received: from [10.100.124.99] (helo=edoofus.dev.vega.ru) by mail.vega.ru with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.71 (FreeBSD)) (envelope-from ) id 1NlN7J-0007V9-31; Sat, 27 Feb 2010 16:54:01 +0300 Date: Sat, 27 Feb 2010 16:53:50 +0300 From: Ruslan Ermilov To: Antoine Brodin Message-ID: <20100227135350.GA51861@edoofus.dev.vega.ru> References: <201002262326.o1QNQFVs084793@svn.freebsd.org> <20100227091911.GB47001@edoofus.dev.vega.ru> <20100227113656.a3ea6ad5.antoine@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100227113656.a3ea6ad5.antoine@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r204379 - head/tools/build/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 13:54:03 -0000 On Sat, Feb 27, 2010 at 11:36:56AM +0100, Antoine Brodin wrote: > Ruslan Ermilov wrote: > > Picking up a random context... This doesn't handle the NO_MANCOMPRESS > > case where manpages are installed uncompressed. > > What about the following patch. Still doesn't catch some cases, grep /man ObsoleteFiles.inc | grep -v usr/share/man shows which (and some bugs). -- Ruslan Ermilov ru@FreeBSD.org FreeBSD committer From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 15:26:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCBD11065674; Sat, 27 Feb 2010 15:26:36 +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 AB51B8FC15; Sat, 27 Feb 2010 15:26:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1RFQaD3098079; Sat, 27 Feb 2010 15:26:36 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1RFQaWP098077; Sat, 27 Feb 2010 15:26:36 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002271526.o1RFQaWP098077@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 27 Feb 2010 15:26: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: r204412 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 15:26:36 -0000 Author: kib Date: Sat Feb 27 15:26:36 2010 New Revision: 204412 URL: http://svn.freebsd.org/changeset/base/204412 Log: Fix several style issues. Define make_dev_credv() as static to match declaration. MFC after: 3 days Modified: head/sys/kern/kern_conf.c Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Sat Feb 27 12:27:49 2010 (r204411) +++ head/sys/kern/kern_conf.c Sat Feb 27 15:26:36 2010 (r204412) @@ -649,7 +649,7 @@ prep_cdevsw(struct cdevsw *devsw) cdevsw_free_devlocked(dsw2); } -struct cdev * +static struct cdev * make_dev_credv(int flags, struct cdevsw *devsw, int unit, struct ucred *cr, uid_t uid, gid_t gid, int mode, const char *fmt, va_list ap) @@ -947,7 +947,8 @@ clone_setup(struct clonedevs **cdp) } int -clone_create(struct clonedevs **cdp, struct cdevsw *csw, int *up, struct cdev **dp, int extra) +clone_create(struct clonedevs **cdp, struct cdevsw *csw, int *up, + struct cdev **dp, int extra) { struct clonedevs *cd; struct cdev *dev, *ndev, *dl, *de; @@ -1118,6 +1119,7 @@ destroy_dev_sched_cbl(struct cdev *dev, int destroy_dev_sched_cb(struct cdev *dev, void (*cb)(void *), void *arg) { + dev_lock(); return (destroy_dev_sched_cbl(dev, cb, arg)); } @@ -1125,6 +1127,7 @@ destroy_dev_sched_cb(struct cdev *dev, v int destroy_dev_sched(struct cdev *dev) { + return (destroy_dev_sched_cb(dev, NULL, NULL)); } From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 15:32:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BCF0106564A; Sat, 27 Feb 2010 15:32:49 +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 6A0198FC08; Sat, 27 Feb 2010 15:32:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1RFWnVr099464; Sat, 27 Feb 2010 15:32:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1RFWnCp099462; Sat, 27 Feb 2010 15:32:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002271532.o1RFWnCp099462@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 27 Feb 2010 15:32: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: r204413 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 15:32:49 -0000 Author: kib Date: Sat Feb 27 15:32:49 2010 New Revision: 204413 URL: http://svn.freebsd.org/changeset/base/204413 Log: For kinfo_proc in kp->ki_siglist, return the set of the signals pending in the process queue when gathering information for the process, and set of signals pending for the thread, when gathering information for the thread. Previously, the sysctl returned a union of the process and some arbitrary thread pending set for the process, and union of the process and the thread pending set for the thread. MFC after: 1 week Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sat Feb 27 15:26:36 2010 (r204412) +++ head/sys/kern/kern_proc.c Sat Feb 27 15:32:49 2010 (r204413) @@ -828,9 +828,10 @@ fill_kinfo_proc_only(struct proc *p, str } /* - * Fill in information that is thread specific. Must be called with p_slock - * locked. If 'preferthread' is set, overwrite certain process-related - * fields that are maintained for both threads and processes. + * Fill in information that is thread specific. Must be called with + * target process locked. If 'preferthread' is set, overwrite certain + * process-related fields that are maintained for both threads and + * processes. */ static void fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp, int preferthread) @@ -899,7 +900,8 @@ fill_kinfo_thread(struct thread *td, str /* We can't get this anymore but ps etc never used it anyway. */ kp->ki_rqindex = 0; - SIGSETOR(kp->ki_siglist, td->td_siglist); + if (preferthread) + kp->ki_siglist = td->td_siglist; kp->ki_sigmask = td->td_sigmask; thread_unlock(td); } From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 17:09:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C4E91065670; Sat, 27 Feb 2010 17:09: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 3B7278FC12; Sat, 27 Feb 2010 17:09:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1RH9THQ020856; Sat, 27 Feb 2010 17:09:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1RH9Td3020854; Sat, 27 Feb 2010 17:09:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002271709.o1RH9Td3020854@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 27 Feb 2010 17:09: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: r204415 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 17:09:29 -0000 Author: kib Date: Sat Feb 27 17:09:28 2010 New Revision: 204415 URL: http://svn.freebsd.org/changeset/base/204415 Log: Update comment for vm_page_alloc(9), listing all acceptable flags [1]. Note that the function does not sleep, it can block. Submitted by: Giovanni Trematerra [1] MFC after: 3 days Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sat Feb 27 16:51:23 2010 (r204414) +++ head/sys/vm/vm_page.c Sat Feb 27 17:09:28 2010 (r204415) @@ -1020,8 +1020,13 @@ vm_page_cache_transfer(vm_object_t orig_ * VM_ALLOC_SYSTEM system *really* needs a page * VM_ALLOC_INTERRUPT interrupt time request * VM_ALLOC_ZERO zero page + * VM_ALLOC_WIRED wire the allocated page + * VM_ALLOC_NOOBJ page is not associated with a vm object + * VM_ALLOC_NOBUSY do not set the page busy + * VM_ALLOC_IFNOTCACHED return NULL, do not reactivate if the page + * is cached * - * This routine may not block. + * This routine may not sleep. */ vm_page_t vm_page_alloc(vm_object_t object, vm_pindex_t pindex, int req) From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 17:11:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FC741065670; Sat, 27 Feb 2010 17:11:15 +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 8EFD48FC2C; Sat, 27 Feb 2010 17:11:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1RHBFSV021269; Sat, 27 Feb 2010 17:11:15 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1RHBFTU021267; Sat, 27 Feb 2010 17:11:15 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002271711.o1RHBFTU021267@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 27 Feb 2010 17:11: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: r204416 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 17:11:15 -0000 Author: kib Date: Sat Feb 27 17:11:15 2010 New Revision: 204416 URL: http://svn.freebsd.org/changeset/base/204416 Log: Update man page for vm_page_alloc(9). Based on the submission by: Giovanni Trematerra MFC after: 3 days Modified: head/share/man/man9/vm_page_alloc.9 Modified: head/share/man/man9/vm_page_alloc.9 ============================================================================== --- head/share/man/man9/vm_page_alloc.9 Sat Feb 27 17:09:28 2010 (r204415) +++ head/share/man/man9/vm_page_alloc.9 Sat Feb 27 17:11:15 2010 (r204416) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 13, 2001 +.Dd February 27, 2010 .Dt VM_PAGE_ALLOC 9 .Os .Sh NAME @@ -48,16 +48,26 @@ within .Fa object . It is assumed that a page has not already been allocated at .Fa pindex . -The page returned is inserted into the object, but is not inserted -into the pmap. +The page returned is inserted into the object, unless +.Dv VM_ALLOC_NOOBJ +is specified in the +.Fa page_req , +but is not inserted into a pmap. +The page may exists in the vm object cache, in which case it will +be reactivated instead, moving from the cache into the object page list. .Pp .Fn vm_page_alloc -will not block. +will not sleep. .Pp Its arguments are: .Bl -tag -width ".Fa page_req" .It Fa object The VM object to allocate the page for. +The +.Fa object +must be locked if +.Dv VM_ALLOC_NOOBJ +is not specified. .It Fa pindex The index into the object at which the page should be inserted. .It Fa page_req @@ -82,12 +92,24 @@ than zero. .It Dv VM_ALLOC_ZERO Indicate a preference for a pre-zeroed page. There is no guarantee that the page thus returned will be zeroed, but -it will be marked as such. +it will be marked by +.Dv PG_ZERO +flag if it is zeroed. .It Dv VM_ALLOC_NOOBJ -The page is associated with an unmanaged memory region, that is, there -is no backing VM object. -This is typically used to allocate pages within the kernel virtual -address space. +Do not associate the allocated page with a vm object. +The +.Fa object +argument is ignored. +.It Dv VM_ALLOC_NOBUSY +The page returned will not be busied. +.It Dv VM_ALLOC_WIRED +The returned page is wired. +.It Dv VM_ALLOC_IFNOTCACHED +Only allocate the page if it is not cached in the +.Fa object . +If the page at the specified +.Fa pindex +is cached, NULL is returned instead. .El .El .Sh RETURN VALUES From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 17:31:00 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC5E1106566B; Sat, 27 Feb 2010 17:31:00 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81B2D8FC0A; Sat, 27 Feb 2010 17:31:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1RHV02o025674; Sat, 27 Feb 2010 17:31:00 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1RHV0Rx025672; Sat, 27 Feb 2010 17:31:00 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201002271731.o1RHV0Rx025672@svn.freebsd.org> From: Antoine Brodin Date: Sat, 27 Feb 2010 17:31: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: r204417 - head/etc/mtree X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 17:31:00 -0000 Author: antoine Date: Sat Feb 27 17:31:00 2010 New Revision: 204417 URL: http://svn.freebsd.org/changeset/base/204417 Log: usr/share/examples/bc no longer exists. Modified: head/etc/mtree/BSD.usr.dist Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Sat Feb 27 17:11:15 2010 (r204416) +++ head/etc/mtree/BSD.usr.dist Sat Feb 27 17:31:00 2010 (r204417) @@ -193,8 +193,6 @@ .. IPv6 .. - bc - .. bootforth .. cvs From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 17:36:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29926106564A; Sat, 27 Feb 2010 17:36:14 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1974C8FC08; Sat, 27 Feb 2010 17:36:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1RHaDVj026862; Sat, 27 Feb 2010 17:36:13 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1RHaDup026861; Sat, 27 Feb 2010 17:36:13 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201002271736.o1RHaDup026861@svn.freebsd.org> From: Antoine Brodin Date: Sat, 27 Feb 2010 17:36: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: r204418 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 17:36:14 -0000 Author: antoine Date: Sat Feb 27 17:36:13 2010 New Revision: 204418 URL: http://svn.freebsd.org/changeset/base/204418 Log: Add more obsolete files. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Feb 27 17:31:00 2010 (r204417) +++ head/ObsoleteFiles.inc Sat Feb 27 17:36:13 2010 (r204418) @@ -14,6 +14,16 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20100208: man pages moved +.if ${TARGET_ARCH} == "i386" +OLD_FILES+=usr/share/man/man4/i386/alpm.4.gz +OLD_FILES+=usr/share/man/man4/i386/amdpm.4.gz +OLD_FILES+=usr/share/man/man4/i386/mcd.4.gz +OLD_FILES+=usr/share/man/man4/i386/padlock.4.gz +OLD_FILES+=usr/share/man/man4/i386/pcf.4.gz +OLD_FILES+=usr/share/man/man4/i386/scd.4.gz +OLD_FILES+=usr/share/man/man4/i386/viapm.4.gz +.endif # 20100122: move BSDL bc/dc USD documents to /usr/share/doc/usd OLD_FILES+=usr/share/doc/papers/bc.ascii.gz OLD_FILES+=usr/share/doc/papers/dc.ascii.gz From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 18:00:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF8BD106564A; Sat, 27 Feb 2010 18:00:57 +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 AECEF8FC15; Sat, 27 Feb 2010 18:00:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1RI0v8x032346; Sat, 27 Feb 2010 18:00:57 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1RI0vKW032341; Sat, 27 Feb 2010 18:00:57 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201002271800.o1RI0vKW032341@svn.freebsd.org> From: Alan Cox Date: Sat, 27 Feb 2010 18:00: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: r204420 - in head/sys: amd64/amd64 i386/i386 kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 18:00:57 -0000 Author: alc Date: Sat Feb 27 18:00:57 2010 New Revision: 204420 URL: http://svn.freebsd.org/changeset/base/204420 Log: When running as a guest operating system, the FreeBSD kernel must assume that the virtual machine monitor has enabled machine check exceptions. Unfortunately, on AMD Family 10h processors the machine check hardware has a bug (Erratum 383) that can result in a false machine check exception when a superpage promotion occurs. Thus, I am disabling superpage promotion when the FreeBSD kernel is running as a guest operating system on an AMD Family 10h processor. Reviewed by: jhb, kib MFC after: 3 days Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c head/sys/kern/subr_param.c head/sys/sys/systm.h Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Feb 27 17:55:29 2010 (r204419) +++ head/sys/amd64/amd64/pmap.c Sat Feb 27 18:00:57 2010 (r204420) @@ -686,6 +686,15 @@ pmap_init(void) pv_entry_high_water = 9 * (pv_entry_max / 10); /* + * Disable large page mappings by default if the kernel is running in + * a virtual machine on an AMD Family 10h processor. This is a work- + * around for Erratum 383. + */ + if (vm_guest == VM_GUEST_VM && cpu_vendor_id == CPU_VENDOR_AMD && + CPUID_TO_FAMILY(cpu_id) == 0x10) + pg_ps_enabled = 0; + + /* * Are large page mappings enabled? */ TUNABLE_INT_FETCH("vm.pmap.pg_ps_enabled", &pg_ps_enabled); Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sat Feb 27 17:55:29 2010 (r204419) +++ head/sys/i386/i386/pmap.c Sat Feb 27 18:00:57 2010 (r204420) @@ -692,6 +692,15 @@ pmap_init(void) pv_entry_high_water = 9 * (pv_entry_max / 10); /* + * Disable large page mappings by default if the kernel is running in + * a virtual machine on an AMD Family 10h processor. This is a work- + * around for Erratum 383. + */ + if (vm_guest == VM_GUEST_VM && cpu_vendor_id == CPU_VENDOR_AMD && + CPUID_TO_FAMILY(cpu_id) == 0x10) + pg_ps_enabled = 0; + + /* * Are large page mappings enabled? */ TUNABLE_INT_FETCH("vm.pmap.pg_ps_enabled", &pg_ps_enabled); Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Sat Feb 27 17:55:29 2010 (r204419) +++ head/sys/kern/subr_param.c Sat Feb 27 18:00:57 2010 (r204420) @@ -74,10 +74,6 @@ __FBSDID("$FreeBSD$"); #define MAXFILES (maxproc * 2) #endif -/* Values of enum VM_GUEST members are used as indices in - * vm_guest_sysctl_names */ -enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN }; - static int sysctl_kern_vm_guest(SYSCTL_HANDLER_ARGS); int hz; @@ -137,6 +133,10 @@ SYSCTL_PROC(_kern, OID_AUTO, vm_guest, C */ struct buf *swbuf; +/* + * The elements of this array are ordered based upon the values of the + * corresponding enum VM_GUEST members. + */ static const char *const vm_guest_sysctl_names[] = { "none", "generic", Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Sat Feb 27 17:55:29 2010 (r204419) +++ head/sys/sys/systm.h Sat Feb 27 18:00:57 2010 (r204420) @@ -63,6 +63,9 @@ extern int bootverbose; /* nonzero to p extern int maxusers; /* system tune hint */ extern int ngroups_max; /* max # of supplemental groups */ +extern int vm_guest; /* Running as virtual machine guest? */ + +enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN }; #ifdef INVARIANTS /* The option is always available */ #define KASSERT(exp,msg) do { \ From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 18:55:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 689FE106564A; Sat, 27 Feb 2010 18:55: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 56EEF8FC12; Sat, 27 Feb 2010 18:55:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1RIthMZ044631; Sat, 27 Feb 2010 18:55:43 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1RIthVg044626; Sat, 27 Feb 2010 18:55:43 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201002271855.o1RIthVg044626@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 27 Feb 2010 18:55: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: r204425 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 18:55:43 -0000 Author: marcel Date: Sat Feb 27 18:55:43 2010 New Revision: 204425 URL: http://svn.freebsd.org/changeset/base/204425 Log: Interrupt related cleanups: o Assign vectors based on priority, because vectors have implied priority in hardware. o Use unordered memory accesses to the I/O sapic and use the acceptance form of the mf instruction. o Remove the sapicreg.h and sapicvar.h headers. All definitions in sapicreg.h are private to sapic.c and all definitions in sapicvar.h are either private or interface functions. Move the interface functions to intr.h. o Hide the definition of struct sapic. Deleted: head/sys/ia64/include/sapicreg.h head/sys/ia64/include/sapicvar.h Modified: head/sys/ia64/ia64/interrupt.c head/sys/ia64/ia64/nexus.c head/sys/ia64/ia64/sapic.c head/sys/ia64/include/intr.h Modified: head/sys/ia64/ia64/interrupt.c ============================================================================== --- head/sys/ia64/ia64/interrupt.c Sat Feb 27 18:45:32 2010 (r204424) +++ head/sys/ia64/ia64/interrupt.c Sat Feb 27 18:55:43 2010 (r204425) @@ -60,7 +60,6 @@ #include #include #include -#include #include #ifdef EVCNT_COUNTERS @@ -74,16 +73,6 @@ struct evcnt clock_intr_evcnt; /* event #include #endif -static void ia64_dispatch_intr(void *, u_int); - -static void -dummy_perf(unsigned long vector, struct trapframe *tf) -{ - printf("performance interrupt!\n"); -} - -void (*perf_irq)(unsigned long, struct trapframe *) = dummy_perf; - SYSCTL_NODE(_debug, OID_AUTO, clock, CTLFLAG_RW, 0, "clock statistics"); static int adjust_edges = 0; @@ -102,6 +91,19 @@ static int adjust_ticks = 0; SYSCTL_INT(_debug_clock, OID_AUTO, adjust_ticks, CTLFLAG_RD, &adjust_ticks, 0, "Total number of ITC interrupts with adjustment"); + +struct ia64_intr { + struct intr_event *event; /* interrupt event */ + volatile long *cntp; /* interrupt counter */ + struct sapic *sapic; + u_int irq; +}; + +static struct ia64_intr *ia64_intrs[256]; + + +static void ia64_dispatch_intr(void *, u_int); + void interrupt(struct trapframe *tf) { @@ -247,19 +249,6 @@ stray: } } -/* - * Hardware irqs have vectors starting at this offset. - */ -#define IA64_HARDWARE_IRQ_BASE 0x20 - -struct ia64_intr { - struct intr_event *event; /* interrupt event */ - volatile long *cntp; /* interrupt counter */ - struct sapic *sapic; - u_int irq; -}; - -static struct ia64_intr *ia64_intrs[256]; static void ia64_intr_eoi(void *arg) @@ -303,57 +292,75 @@ ia64_setup_intr(const char *name, int ir struct ia64_intr *i; struct sapic *sa; char *intrname; - u_int vector; + u_int prio, vector; int error; - /* Get the I/O SAPIC that corresponds to the IRQ. */ - sa = sapic_lookup(irq); - if (sa == NULL) + prio = intr_priority(flags); + if (prio > PRI_MAX_ITHD) return (EINVAL); + /* XXX lock */ + + /* Get the I/O SAPIC and vector that corresponds to the IRQ. */ + sa = sapic_lookup(irq, &vector); + if (sa == NULL) { + /* XXX unlock */ + return (EINVAL); + } + + if (vector == 0) { + /* XXX unlock */ + i = malloc(sizeof(struct ia64_intr), M_DEVBUF, + M_ZERO | M_WAITOK); + /* XXX lock */ + sa = sapic_lookup(irq, &vector); + KASSERT(sa != NULL, ("sapic_lookup")); + if (vector != 0) + free(i, M_DEVBUF); + } + /* - * XXX - There's a priority implied by the choice of vector. - * We should therefore relate the vector to the interrupt type. + * If the IRQ has no vector assigned to it yet, assign one based + * on the priority. */ - vector = irq + IA64_HARDWARE_IRQ_BASE; - - i = ia64_intrs[vector]; - if (i == NULL) { - i = malloc(sizeof(struct ia64_intr), M_DEVBUF, M_NOWAIT); - if (i == NULL) - return (ENOMEM); + if (vector == 0) { + vector = (256 - 64) - (prio << 1); + while (vector < 256 && ia64_intrs[vector] != NULL) + vector++; error = intr_event_create(&i->event, (void *)(uintptr_t)vector, 0, irq, ia64_intr_mask, ia64_intr_unmask, ia64_intr_eoi, NULL, "irq%u:", irq); if (error) { + /* XXX unlock */ free(i, M_DEVBUF); return (error); } - if (!atomic_cmpset_ptr(&ia64_intrs[vector], NULL, i)) { - intr_event_destroy(i->event); - free(i, M_DEVBUF); - i = ia64_intrs[vector]; - } else { - i->sapic = sa; - i->irq = irq; - - i->cntp = intrcnt + irq + INTRCNT_ISA_IRQ; - if (name != NULL && *name != '\0') { - /* XXX needs abstraction. Too error prone. */ - intrname = intrnames + - (irq + INTRCNT_ISA_IRQ) * INTRNAME_LEN; - memset(intrname, ' ', INTRNAME_LEN - 1); - bcopy(name, intrname, strlen(name)); - } - - sapic_enable(i->sapic, irq, vector); + i->sapic = sa; + i->irq = irq; + i->cntp = intrcnt + irq + INTRCNT_ISA_IRQ; + ia64_intrs[vector] = i; + sapic_enable(sa, irq, vector); + + /* XXX unlock */ + + if (name != NULL && *name != '\0') { + /* XXX needs abstraction. Too error prone. */ + intrname = intrnames + + (irq + INTRCNT_ISA_IRQ) * INTRNAME_LEN; + memset(intrname, ' ', INTRNAME_LEN - 1); + bcopy(name, intrname, strlen(name)); } + } else { + i = ia64_intrs[vector]; + /* XXX unlock */ } + KASSERT(i != NULL, ("vector mapping bug")); + error = intr_event_add_handler(i->event, name, filter, handler, arg, - intr_priority(flags), flags, cookiep); + prio, flags, cookiep); return (error); } Modified: head/sys/ia64/ia64/nexus.c ============================================================================== --- head/sys/ia64/ia64/nexus.c Sat Feb 27 18:45:32 2010 (r204424) +++ head/sys/ia64/ia64/nexus.c Sat Feb 27 18:55:43 2010 (r204425) @@ -59,7 +59,6 @@ #include #include #include -#include #include #include Modified: head/sys/ia64/ia64/sapic.c ============================================================================== --- head/sys/ia64/ia64/sapic.c Sat Feb 27 18:45:32 2010 (r204424) +++ head/sys/ia64/ia64/sapic.c Sat Feb 27 18:55:43 2010 (r204425) @@ -39,77 +39,100 @@ #include #include -#include -#include #include #include -static MALLOC_DEFINE(M_SAPIC, "sapic", "I/O SAPIC devices"); - -static int sysctl_machdep_apic(SYSCTL_HANDLER_ARGS); - -SYSCTL_OID(_machdep, OID_AUTO, apic, CTLTYPE_STRING|CTLFLAG_RD, - NULL, 0, sysctl_machdep_apic, "A", "(x)APIC redirection table entries"); - -struct sapic *ia64_sapics[16]; /* XXX make this resizable */ -int ia64_sapic_count; +/* + * Offsets from the SAPIC base in memory. Most registers are accessed + * by indexing using the SAPIC_IO_SELECT register. + */ +#define SAPIC_IO_SELECT 0x00 +#define SAPIC_IO_WINDOW 0x10 +#define SAPIC_APIC_EOI 0x40 + +/* + * Indexed registers. + */ +#define SAPIC_ID 0x00 +#define SAPIC_VERSION 0x01 +#define SAPIC_ARBITRATION_ID 0x02 +#define SAPIC_RTE_BASE 0x10 + +/* Interrupt polarity. */ +#define SAPIC_POLARITY_HIGH 0 +#define SAPIC_POLARITY_LOW 1 + +/* Interrupt trigger. */ +#define SAPIC_TRIGGER_EDGE 0 +#define SAPIC_TRIGGER_LEVEL 1 + +/* Interrupt delivery mode. */ +#define SAPIC_DELMODE_FIXED 0 +#define SAPIC_DELMODE_LOWPRI 1 +#define SAPIC_DELMODE_PMI 2 +#define SAPIC_DELMODE_NMI 4 +#define SAPIC_DELMODE_INIT 5 +#define SAPIC_DELMODE_EXTINT 7 + +struct sapic { + struct mtx sa_mtx; + uint64_t sa_registers; /* virtual address of sapic */ + u_int sa_id; /* I/O SAPIC Id */ + u_int sa_base; /* ACPI vector base */ + u_int sa_limit; /* last ACPI vector handled here */ +}; struct sapic_rte { - u_int64_t rte_vector :8; - u_int64_t rte_delivery_mode :3; - u_int64_t rte_destination_mode :1; - u_int64_t rte_delivery_status :1; - u_int64_t rte_polarity :1; - u_int64_t rte_rirr :1; - u_int64_t rte_trigger_mode :1; - u_int64_t rte_mask :1; - u_int64_t rte_flushen :1; - u_int64_t rte_reserved :30; - u_int64_t rte_destination_eid :8; - u_int64_t rte_destination_id :8; + uint64_t rte_vector :8; + uint64_t rte_delivery_mode :3; + uint64_t rte_destination_mode :1; + uint64_t rte_delivery_status :1; + uint64_t rte_polarity :1; + uint64_t rte_rirr :1; + uint64_t rte_trigger_mode :1; + uint64_t rte_mask :1; + uint64_t rte_flushen :1; + uint64_t rte_reserved :30; + uint64_t rte_destination_eid :8; + uint64_t rte_destination_id :8; }; -struct sapic * -sapic_lookup(u_int irq) -{ - struct sapic *sa; - int i; +MALLOC_DEFINE(M_SAPIC, "sapic", "I/O SAPIC devices"); - for (i = 0; i < ia64_sapic_count; i++) { - sa = ia64_sapics[i]; - if (irq >= sa->sa_base && irq <= sa->sa_limit) - return (sa); - } +struct sapic *ia64_sapics[16]; /* XXX make this resizable */ +int ia64_sapic_count; - return (NULL); -} +static int sysctl_machdep_apic(SYSCTL_HANDLER_ARGS); -static __inline u_int32_t +SYSCTL_OID(_machdep, OID_AUTO, apic, CTLTYPE_STRING|CTLFLAG_RD, + NULL, 0, sysctl_machdep_apic, "A", "(x)APIC redirection table entries"); + +static __inline uint32_t sapic_read(struct sapic *sa, int which) { - vm_offset_t reg = sa->sa_registers; + uint32_t value; - *(volatile u_int32_t *) (reg + SAPIC_IO_SELECT) = which; - ia64_mf(); - return *(volatile u_int32_t *) (reg + SAPIC_IO_WINDOW); + ia64_st4((void *)(sa->sa_registers + SAPIC_IO_SELECT), which); + ia64_mf_a(); + value = ia64_ld4((void *)(sa->sa_registers + SAPIC_IO_WINDOW)); + return (value); } static __inline void -sapic_write(struct sapic *sa, int which, u_int32_t value) +sapic_write(struct sapic *sa, int which, uint32_t value) { - vm_offset_t reg = sa->sa_registers; - *(volatile u_int32_t *) (reg + SAPIC_IO_SELECT) = which; - ia64_mf(); - *(volatile u_int32_t *) (reg + SAPIC_IO_WINDOW) = value; - ia64_mf(); + ia64_st4((void *)(sa->sa_registers + SAPIC_IO_SELECT), which); + ia64_mf_a(); + ia64_st4((void *)(sa->sa_registers + SAPIC_IO_WINDOW), value); + ia64_mf_a(); } static __inline void sapic_read_rte(struct sapic *sa, int which, struct sapic_rte *rte) { - u_int32_t *p = (u_int32_t *) rte; + uint32_t *p = (uint32_t *) rte; p[0] = sapic_read(sa, SAPIC_RTE_BASE + 2 * which); p[1] = sapic_read(sa, SAPIC_RTE_BASE + 2 * which + 1); @@ -118,19 +141,43 @@ sapic_read_rte(struct sapic *sa, int whi static __inline void sapic_write_rte(struct sapic *sa, int which, struct sapic_rte *rte) { - u_int32_t *p = (u_int32_t *) rte; + uint32_t *p = (uint32_t *) rte; - sapic_write(sa, SAPIC_RTE_BASE + 2 *which, p[0]); - sapic_write(sa, SAPIC_RTE_BASE + 2 *which + 1, p[1]); + sapic_write(sa, SAPIC_RTE_BASE + 2 * which, p[0]); + sapic_write(sa, SAPIC_RTE_BASE + 2 * which + 1, p[1]); } +struct sapic * +sapic_lookup(u_int irq, u_int *vecp) +{ + struct sapic_rte rte; + struct sapic *sa; + int i; + + for (i = 0; i < ia64_sapic_count; i++) { + sa = ia64_sapics[i]; + if (irq >= sa->sa_base && irq <= sa->sa_limit) { + if (vecp != NULL) { + mtx_lock_spin(&sa->sa_mtx); + sapic_read_rte(sa, irq - sa->sa_base, &rte); + mtx_unlock_spin(&sa->sa_mtx); + *vecp = rte.rte_vector; + } + return (sa); + } + } + + return (NULL); +} + + int sapic_config_intr(u_int irq, enum intr_trigger trig, enum intr_polarity pol) { struct sapic_rte rte; struct sapic *sa; - sa = sapic_lookup(irq); + sa = sapic_lookup(irq, NULL); if (sa == NULL) return (EINVAL); @@ -154,7 +201,7 @@ sapic_config_intr(u_int irq, enum intr_t } struct sapic * -sapic_create(u_int id, u_int base, u_int64_t address) +sapic_create(u_int id, u_int base, uint64_t address) { struct sapic_rte rte; struct sapic *sa; @@ -214,10 +261,9 @@ sapic_enable(struct sapic *sa, u_int irq void sapic_eoi(struct sapic *sa, u_int vector) { - vm_offset_t reg = sa->sa_registers; - *(volatile u_int32_t *)(reg + SAPIC_APIC_EOI) = vector; - ia64_mf(); + ia64_st4((void *)(sa->sa_registers + SAPIC_APIC_EOI), vector); + ia64_mf_a(); } /* Expected to be called with interrupts disabled. */ Modified: head/sys/ia64/include/intr.h ============================================================================== --- head/sys/ia64/include/intr.h Sat Feb 27 18:45:32 2010 (r204424) +++ head/sys/ia64/include/intr.h Sat Feb 27 18:55:43 2010 (r204425) @@ -30,6 +30,8 @@ #ifndef _MACHINE_INTR_H_ #define _MACHINE_INTR_H_ +struct sapic; + /* * Layout of the Processor Interrupt Block. */ @@ -46,8 +48,20 @@ struct ia64_pib extern struct ia64_pib *ia64_pib; -int ia64_setup_intr(const char *name, int irq, driver_filter_t filter, - driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep); -int ia64_teardown_intr(void *cookie); +int ia64_setup_intr(const char *, int, driver_filter_t, driver_intr_t, + void *, enum intr_type, void **); +int ia64_teardown_intr(void *); + +int sapic_config_intr(u_int, enum intr_trigger, enum intr_polarity); +struct sapic *sapic_create(u_int, u_int, uint64_t); +int sapic_enable(struct sapic *, u_int, u_int); +void sapic_eoi(struct sapic *, u_int); +struct sapic *sapic_lookup(u_int, u_int *); +void sapic_mask(struct sapic *, u_int); +void sapic_unmask(struct sapic *, u_int); + +#ifdef DDB +void sapic_print(struct sapic *, u_int); +#endif #endif /* !_MACHINE_INTR_H_ */ From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 19:00:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CD6D1065677; Sat, 27 Feb 2010 19:00:13 +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 7C9018FC13; Sat, 27 Feb 2010 19:00:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1RJ0DnC045678; Sat, 27 Feb 2010 19:00:13 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1RJ0Dv4045676; Sat, 27 Feb 2010 19:00:13 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201002271900.o1RJ0Dv4045676@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 27 Feb 2010 19:00: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: r204426 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 19:00:13 -0000 Author: marcel Date: Sat Feb 27 19:00:13 2010 New Revision: 204426 URL: http://svn.freebsd.org/changeset/base/204426 Log: ia64: and removed. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Feb 27 18:55:43 2010 (r204425) +++ head/ObsoleteFiles.inc Sat Feb 27 19:00:13 2010 (r204426) @@ -14,6 +14,11 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20100227: [ia64] removed and +.if ${TARGET_ARCH} == "ia64" +OLD_FILES+=usr/include/machine/sapicreg.h +OLD_FILES+=usr/include/machine/sapicvar.h +.endif # 20100208: man pages moved .if ${TARGET_ARCH} == "i386" OLD_FILES+=usr/share/man/man4/i386/alpm.4.gz From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 19:02:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 587FB1065670; Sat, 27 Feb 2010 19:02:22 +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 2E8368FC18; Sat, 27 Feb 2010 19:02:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1RJ2MZd046171; Sat, 27 Feb 2010 19:02:22 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1RJ2MTN046169; Sat, 27 Feb 2010 19:02:22 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201002271902.o1RJ2MTN046169@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 27 Feb 2010 19:02: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: r204427 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 19:02:22 -0000 Author: ume Date: Sat Feb 27 19:02:21 2010 New Revision: 204427 URL: http://svn.freebsd.org/changeset/base/204427 Log: Add the shutdown KEYWORD. Pointed out by: dougb MFC after: 3 days Modified: head/etc/rc.d/rtsold Modified: head/etc/rc.d/rtsold ============================================================================== --- head/etc/rc.d/rtsold Sat Feb 27 19:00:13 2010 (r204426) +++ head/etc/rc.d/rtsold Sat Feb 27 19:02:21 2010 (r204427) @@ -6,7 +6,7 @@ # PROVIDE: rtsold # REQUIRE: netif # BEFORE: NETWORKING -# KEYWORD: nojail +# KEYWORD: nojail shutdown . /etc/rc.subr From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 19:57:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA41B106566C; Sat, 27 Feb 2010 19:57:40 +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 B9ED58FC28; Sat, 27 Feb 2010 19:57:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1RJvehZ058325; Sat, 27 Feb 2010 19:57:40 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1RJveQD058323; Sat, 27 Feb 2010 19:57:40 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201002271957.o1RJveQD058323@svn.freebsd.org> From: Robert Watson Date: Sat, 27 Feb 2010 19:57: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: r204430 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 19:57:40 -0000 Author: rwatson Date: Sat Feb 27 19:57:40 2010 New Revision: 204430 URL: http://svn.freebsd.org/changeset/base/204430 Log: Remove stale comment about socket buffer accounting from access(2) code. It is the case, however, that the uidinfo of the temporary credential set up for access(2) is not properly updated when its effective uid is changed. MFC after: 3 days Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Sat Feb 27 19:44:44 2010 (r204429) +++ head/sys/kern/vfs_syscalls.c Sat Feb 27 19:57:40 2010 (r204430) @@ -2122,8 +2122,7 @@ kern_accessat(struct thread *td, int fd, /* * Create and modify a temporary credential instead of one that - * is potentially shared. This could also mess up socket - * buffer accounting which can run in an interrupt context. + * is potentially shared. */ if (!(flags & AT_EACCESS)) { cred = td->td_ucred; From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 20:05:07 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 113881065670; Sat, 27 Feb 2010 20:05:07 +0000 (UTC) (envelope-from julian@elischer.org) Received: from out-0.mx.aerioconnect.net (out-0-9.mx.aerioconnect.net [216.240.47.69]) by mx1.freebsd.org (Postfix) with ESMTP id E4F2B8FC1F; Sat, 27 Feb 2010 20:05:06 +0000 (UTC) Received: from idiom.com (postfix@mx0.idiom.com [216.240.32.160]) by out-0.mx.aerioconnect.net (8.13.8/8.13.8) with ESMTP id o1RJsYu7008880; Sat, 27 Feb 2010 11:54:34 -0800 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 (h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137]) by idiom.com (Postfix) with ESMTP id 230552D6011; Sat, 27 Feb 2010 11:54:34 -0800 (PST) Message-ID: <4B897879.9090507@elischer.org> Date: Sat, 27 Feb 2010 11:54:33 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Jilles Tjoelker References: <201002271215.o1RCFxGg056229@svn.freebsd.org> In-Reply-To: <201002271215.o1RCFxGg056229@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 216.240.47.51 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r204410 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 20:05:07 -0000 Jilles Tjoelker wrote: > Author: jilles > Date: Sat Feb 27 12:15:59 2010 > New Revision: 204410 > URL: http://svn.freebsd.org/changeset/base/204410 > > Log: > Include terminated threads in ps's process cpu time field. > > MFC after: 2 weeks > > Modified: > head/sys/kern/kern_proc.c > > Modified: head/sys/kern/kern_proc.c > ============================================================================== > --- head/sys/kern/kern_proc.c Sat Feb 27 10:55:43 2010 (r204409) > +++ head/sys/kern/kern_proc.c Sat Feb 27 12:15:59 2010 (r204410) > @@ -676,11 +676,9 @@ fill_kinfo_aggregate(struct proc *p, str > > kp->ki_estcpu = 0; > kp->ki_pctcpu = 0; > - kp->ki_runtime = 0; > FOREACH_THREAD_IN_PROC(p, td) { > thread_lock(td); > kp->ki_pctcpu += sched_pctcpu(td); > - kp->ki_runtime += cputick2usec(td->td_runtime); > kp->ki_estcpu += td->td_estcpu; > thread_unlock(td); > } this patch seems to do a lot less than the comment suggests. From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 21:00:29 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B677106566C; Sat, 27 Feb 2010 21:00:29 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 3EDB58FC15; Sat, 27 Feb 2010 21:00:29 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 9725635A880; Sat, 27 Feb 2010 22:00:28 +0100 (CET) Received: by turtle.stack.nl (Postfix, from userid 1677) id 7AD5A17B2B; Sat, 27 Feb 2010 22:00:28 +0100 (CET) Date: Sat, 27 Feb 2010 22:00:28 +0100 From: Jilles Tjoelker To: Julian Elischer Message-ID: <20100227210028.GA77656@stack.nl> References: <201002271215.o1RCFxGg056229@svn.freebsd.org> <4B897879.9090507@elischer.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B897879.9090507@elischer.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r204410 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 21:00:29 -0000 On Sat, Feb 27, 2010 at 11:54:33AM -0800, Julian Elischer wrote: > Jilles Tjoelker wrote: > > Log: > > Include terminated threads in ps's process cpu time field. > this patch seems to do a lot less than the comment suggests. I guess the commit message could have been more verbose. When a kinfo_proc is filled, first fill_kinfo_proc_only() fills in ki_runtime using p->p_rux.rux_runtime (all cpu time used by the process including terminated threads). If information for a specific thread is requested, fill_kinfo_thread() then overwrites this with the thread's td->td_runtime (good). If not, fill_kinfo_aggregate() overwrote it with the sum of all threads' td->td_runtime which does not include terminated threads. This affects ps(1)'s TIME field, not its %CPU field nor anything in top(1). See also http://lists.freebsd.org/pipermail/freebsd-hackers/2010-February/030610.html -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 21:58:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FC151065672; Sat, 27 Feb 2010 21:58:55 +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 8E5BA8FC0A; Sat, 27 Feb 2010 21:58:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1RLwtmu085377; Sat, 27 Feb 2010 21:58:55 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1RLwtvb085375; Sat, 27 Feb 2010 21:58:55 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201002272158.o1RLwtvb085375@svn.freebsd.org> From: Robert Watson Date: Sat, 27 Feb 2010 21:58:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204435 - head/lib/libkvm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 21:58:55 -0000 Author: rwatson Date: Sat Feb 27 21:58:55 2010 New Revision: 204435 URL: http://svn.freebsd.org/changeset/base/204435 Log: Fix typo in comment. MFC after: 3 days Modified: head/lib/libkvm/kvm_vnet.c Modified: head/lib/libkvm/kvm_vnet.c ============================================================================== --- head/lib/libkvm/kvm_vnet.c Sat Feb 27 20:41:18 2010 (r204434) +++ head/lib/libkvm/kvm_vnet.c Sat Feb 27 21:58:55 2010 (r204435) @@ -117,8 +117,8 @@ _kvm_vnet_selectpid(kvm_t *kd, pid_t pid } /* - * First, find the process for this pid. If we are workig on a dump, - * either locate the thread dumptid is refering to or proc0. + * First, find the process for this pid. If we are working on a + * dump, either locate the thread dumptid is refering to or proc0. * Based on either, take the address of the ucred. */ credp = 0; From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 22:08:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2CE01065679; Sat, 27 Feb 2010 22:08:55 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id B55688FC13; Sat, 27 Feb 2010 22:08:55 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 1AAA9359962; Sat, 27 Feb 2010 23:08:55 +0100 (CET) Received: by turtle.stack.nl (Postfix, from userid 1677) id 05B9017B2B; Sat, 27 Feb 2010 23:08:55 +0100 (CET) Date: Sat, 27 Feb 2010 23:08:54 +0100 From: Jilles Tjoelker To: Konstantin Belousov Message-ID: <20100227220854.GB77656@stack.nl> References: <201002271532.o1RFWnCp099462@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201002271532.o1RFWnCp099462@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r204413 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 22:08:56 -0000 On Sat, Feb 27, 2010 at 03:32:49PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Sat Feb 27 15:32:49 2010 > New Revision: 204413 > URL: http://svn.freebsd.org/changeset/base/204413 > Log: > For kinfo_proc in kp->ki_siglist, return the set of the signals pending > in the process queue when gathering information for the process, and set > of signals pending for the thread, when gathering information for the > thread. Previously, the sysctl returned a union of the process and some > arbitrary thread pending set for the process, and union of the process > and the thread pending set for the thread. Although the new way provides maximum information and the old way was definitely broken for processes, I think the new way may not be what I expect. In particular, 'ps O pending' and 'ps HO pending' now give (usually) disjunct answers, even for single-threaded processes. I suppose these different answers can be useful for kernel debugging, but it should be documented. Most interesting stuff will be in the process queue so the change will not be very noticeable. Signals directed at threads are usually traps (which do not stay pending very long), pthread_kill() or SIGEV_THREAD_ID. SIGPIPE and SIGSYS (not from kill/sigqueue) may be expected to be thread-directed but they are process-directed. In 7.x, process-directed signals are often delivered directly to a thread queue, but this usually only happens for signals that will be delivered right away. Somewhat related, ki_sigmask could be the logical AND of all threads' td_sigmask when gathering information for the process, instead of the td_sigmask of the most recently created thread; fill_kinfo_aggregate() could handle this. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 23:04:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0391B1065673; Sat, 27 Feb 2010 23:04:30 +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 E62958FC0A; Sat, 27 Feb 2010 23:04:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1RN4TAo099896; Sat, 27 Feb 2010 23:04:29 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1RN4TWY099894; Sat, 27 Feb 2010 23:04:29 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201002272304.o1RN4TWY099894@svn.freebsd.org> From: Weongyo Jeong Date: Sat, 27 Feb 2010 23:04: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: r204436 - head/sys/dev/bwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 23:04:30 -0000 Author: weongyo Date: Sat Feb 27 23:04:29 2010 New Revision: 204436 URL: http://svn.freebsd.org/changeset/base/204436 Log: supports the adhoc demo mode that it's tested on modified aircrack-ng suite and worked. Submitted by: Paul B Mahol Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Sat Feb 27 21:58:55 2010 (r204435) +++ head/sys/dev/bwn/if_bwn.c Sat Feb 27 23:04:29 2010 (r204436) @@ -1076,6 +1076,7 @@ bwn_attach_post(struct bwn_softc *sc) ic->ic_caps = IEEE80211_C_STA /* station mode supported */ | IEEE80211_C_MONITOR /* monitor mode */ + | IEEE80211_C_AHDEMO /* adhoc demo mode */ | IEEE80211_C_SHPREAMBLE /* short preamble supported */ | IEEE80211_C_SHSLOT /* short slot time supported */ | IEEE80211_C_WME /* WME/WMM supported */ @@ -8447,7 +8448,8 @@ bwn_newstate(struct ieee80211vap *vap, e } } - if (vap->iv_opmode == IEEE80211_M_MONITOR) { + if (vap->iv_opmode == IEEE80211_M_MONITOR || + vap->iv_opmode == IEEE80211_M_AHDEMO) { /* XXX nothing to do? */ } else if (nstate == IEEE80211_S_RUN) { memcpy(sc->sc_bssid, vap->iv_bss->ni_bssid, IEEE80211_ADDR_LEN); From owner-svn-src-head@FreeBSD.ORG Sat Feb 27 23:42:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76B881065676; Sat, 27 Feb 2010 23:42:32 +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 654D78FC13; Sat, 27 Feb 2010 23:42:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1RNgW1F008315; Sat, 27 Feb 2010 23:42:32 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1RNgWqi008313; Sat, 27 Feb 2010 23:42:32 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201002272342.o1RNgWqi008313@svn.freebsd.org> From: Weongyo Jeong Date: Sat, 27 Feb 2010 23:42: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: r204437 - head/sys/dev/bwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 23:42:32 -0000 Author: weongyo Date: Sat Feb 27 23:42:32 2010 New Revision: 204437 URL: http://svn.freebsd.org/changeset/base/204437 Log: fixes a bug to load firmware images for LP PHY. For LP PHY always, `lp_' string is contained in its full image names. Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Sat Feb 27 23:04:29 2010 (r204436) +++ head/sys/dev/bwn/if_bwn.c Sat Feb 27 23:42:32 2010 (r204437) @@ -7789,8 +7789,9 @@ bwn_fw_get(struct bwn_mac *mac, enum bwn bwn_do_release_fw(bfw); } - snprintf(namebuf, sizeof(namebuf), "bwn%s_v4_%s", - (type == BWN_FWTYPE_OPENSOURCE) ? "-open" : "", name); + snprintf(namebuf, sizeof(namebuf), "bwn%s_v4_%s%s", + (type == BWN_FWTYPE_OPENSOURCE) ? "-open" : "", + (mac->mac_phy.type == BWN_PHYTYPE_LP) ? "lp_" : "", name); /* XXX Sleeping on "fwload" with the non-sleepable locks held */ fw = firmware_get(namebuf); if (fw == NULL) {