From owner-p4-projects@FreeBSD.ORG Sat Jul 22 03:56:09 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1A6DB16A4E8; Sat, 22 Jul 2006 03:56:09 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9BEDF16A4DE for ; Sat, 22 Jul 2006 03:56:08 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0946343D49 for ; Sat, 22 Jul 2006 03:56:08 +0000 (GMT) (envelope-from gnn@neville-neil.com) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k6M3u7RZ075989 for ; Sat, 22 Jul 2006 03:56:07 GMT (envelope-from gnn@neville-neil.com) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k6M3u5sr075986 for perforce@freebsd.org; Sat, 22 Jul 2006 03:56:05 GMT (envelope-from gnn@neville-neil.com) Date: Sat, 22 Jul 2006 03:56:05 GMT Message-Id: <200607220356.k6M3u5sr075986@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gnn@neville-neil.com using -f From: "George V. Neville-Neil" To: Perforce Change Reviews Cc: Subject: PERFORCE change 102105 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jul 2006 03:56:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=102105 Change 102105 by gnn@gnn_devbox_fast_ipsec on 2006/07/22 03:55:47 Integrate rwatson's socket changes Affected files ... .. //depot/projects/gnn_fast_ipsec/src/sys/amd64/amd64/pmap.c#10 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/arm/arm/in_cksum.c#3 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/arm/arm/pmap.c#8 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/arm/arm/vm_machdep.c#6 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/arm/at91/if_ate.c#6 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/arm/at91/kb920x_machdep.c#4 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/arm/at91/uart_dev_at91usart.c#6 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/arm/conf/KB920X#4 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/compat/linux/linux_misc.c#6 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/compat/linux/linux_socket.c#6 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/compat/svr4/svr4_misc.c#4 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/compat/svr4/svr4_proto.h#3 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/compat/svr4/svr4_socket.c#2 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/compat/svr4/svr4_socket.h#2 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/compat/svr4/svr4_stream.c#4 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/compat/svr4/svr4_syscall.h#3 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/compat/svr4/svr4_syscallnames.c#3 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/compat/svr4/svr4_sysent.c#3 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/compat/svr4/svr4_sysvec.c#2 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/compat/svr4/syscalls.master#3 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/conf/Makefile.arm#7 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/conf/NOTES#9 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/conf/files.ia64#6 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/conf/kern.pre.mk#5 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/conf/options#11 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/contrib/pf/net/pf_ioctl.c#5 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/ddb/db_command.c#6 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/acpica/acpi_perf.c#3 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/amr/amr.c#7 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/ata/ata-queue.c#6 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/bce/if_bce.c#3 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/em/if_em.c#7 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/em/if_em.h#4 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/isp/isp.c#6 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/isp/isp_library.c#3 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/isp/isp_sbus.c#5 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/isp/isp_target.c#5 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/lmc/if_lmc.h#4 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/mpt/mpt.c#6 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/mpt/mpt.h#8 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/mpt/mpt_cam.c#8 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/mpt/mpt_cam.h#3 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/mpt/mpt_debug.c#4 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/mpt/mpt_pci.c#6 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/mpt/mpt_raid.c#6 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/mpt/mpt_raid.h#2 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/mpt/mpt_reg.h#4 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/mxge/if_mxge.c#2 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/sk/if_sk.c#4 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/sk/if_skreg.h#3 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/sound/driver.c#5 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/sound/pci/emu10kx-midi.c#1 branch .. //depot/projects/gnn_fast_ipsec/src/sys/dev/sound/pci/emu10kx-pcm.c#1 branch .. //depot/projects/gnn_fast_ipsec/src/sys/dev/sound/pci/emu10kx.c#1 branch .. //depot/projects/gnn_fast_ipsec/src/sys/dev/sound/pci/emu10kx.h#1 branch .. //depot/projects/gnn_fast_ipsec/src/sys/dev/sound/pcm/buffer.c#2 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/sound/pcm/buffer.h#2 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/sound/pcm/mixer.h#2 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/sound/pcm/sound.c#5 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/sound/pcm/sound.h#4 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/spibus/spi.h#2 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/spibus/spibusvar.h#2 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/dev/streams/streams.c#2 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/fs/devfs/devfs_devs.c#3 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/fs/devfs/devfs_rule.c#3 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/fs/devfs/devfs_vfsops.c#3 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/fs/devfs/devfs_vnops.c#6 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/fs/portalfs/portal_vnops.c#3 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/fs/smbfs/smbfs_vfsops.c#4 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/gnu/dev/sound/pci/emu10k1-ac97.h#2 delete .. //depot/projects/gnn_fast_ipsec/src/sys/gnu/dev/sound/pci/emu10k1-alsa.h#2 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/gnu/dev/sound/pci/emu10k1.h#2 delete .. //depot/projects/gnn_fast_ipsec/src/sys/gnu/dev/sound/pci/p16v-alsa.h#1 branch .. //depot/projects/gnn_fast_ipsec/src/sys/gnu/dev/sound/pci/p17v-alsa.h#1 branch .. //depot/projects/gnn_fast_ipsec/src/sys/i386/i386/pmap.c#11 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/i386/linux/linux_proto.h#6 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/i386/linux/linux_syscall.h#6 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/i386/linux/linux_sysent.c#6 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/i386/linux/syscalls.master#6 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/ia64/conf/DEFAULTS#4 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/kern/kern_descrip.c#6 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/kern/kern_mac.c#3 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/kern/kern_uuid.c#2 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/kern/subr_autoconf.c#2 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/kern/uipc_socket.c#7 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/kern/uipc_usrreq.c#8 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/kern/vfs_bio.c#7 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/kern/vfs_syscalls.c#6 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/modules/sound/driver/Makefile#4 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/modules/sound/driver/emu10kx/Makefile#1 branch .. //depot/projects/gnn_fast_ipsec/src/sys/net/raw_usrreq.c#5 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/net/rtsock.c#5 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/net80211/ieee80211_input.c#6 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/net80211/ieee80211_ioctl.c#6 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netatalk/ddp_usrreq.c#3 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netatm/atm_aal5.c#4 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netatm/atm_usrreq.c#3 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netgraph/bluetooth/include/ng_btsocket_hci_raw.h#3 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netgraph/bluetooth/include/ng_btsocket_l2cap.h#4 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netgraph/bluetooth/include/ng_btsocket_rfcomm.h#4 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netgraph/bluetooth/socket/ng_btsocket.c#3 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c#4 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c#4 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c#3 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c#4 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netgraph/ng_socket.c#7 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netinet/in_pcb.c#7 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netinet/in_pcb.h#5 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netinet/ip_divert.c#6 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netinet/raw_ip.c#6 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netinet/tcp_subr.c#7 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netinet/tcp_usrreq.c#8 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netinet/udp_usrreq.c#9 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netinet6/README#2 delete .. //depot/projects/gnn_fast_ipsec/src/sys/netinet6/in6_pcb.c#6 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netinet6/raw_ip6.c#5 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netinet6/udp6_usrreq.c#7 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netipsec/keysock.c#7 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netipx/ipx_usrreq.c#4 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netipx/spx_usrreq.c#5 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netkey/keysock.c#5 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netnatm/natm.c#5 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/netsmb/smb_conn.c#3 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/security/mac/mac_vfs.c#3 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/sys/libkern.h#2 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/sys/mbuf.h#6 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/sys/param.h#8 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/sys/sysctl.h#5 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/ufs/ffs/ffs_alloc.c#4 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/vm/pmap.h#5 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/vm/uma_core.c#4 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/vm/vm.h#2 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/vm/vm_fault.c#6 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/vm/vm_object.c#5 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/vm/vm_object.h#3 integrate .. //depot/projects/gnn_fast_ipsec/src/sys/vm/vm_page.c#7 integrate Differences ... ==== //depot/projects/gnn_fast_ipsec/src/sys/amd64/amd64/pmap.c#10 (text+ko) ==== @@ -77,7 +77,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.565 2006/07/06 06:17:08 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.567 2006/07/20 17:48:40 alc Exp $"); /* * Manages physical address maps. @@ -207,7 +207,6 @@ static void free_pv_entry(pmap_t pmap, pv_entry_t pv); static pv_entry_t get_pv_entry(pmap_t locked_pmap, int try); -static void pmap_clear_write(vm_page_t m); static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, vm_page_t mpte); @@ -1627,6 +1626,7 @@ int idx, field, bit; mtx_assert(&vm_page_queue_mtx, MA_OWNED); + PMAP_LOCK_ASSERT(pmap, MA_OWNED); PV_STAT(pv_entry_frees++); PV_STAT(pv_entry_spare++); pv_entry_count--; @@ -2015,8 +2015,8 @@ TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); m->md.pv_list_count--; pmap_unuse_pt(pmap, pv->pv_va, ptepde); + free_pv_entry(pmap, pv); PMAP_UNLOCK(pmap); - free_pv_entry(pmap, pv); } vm_page_flag_clear(m, PG_WRITEABLE); } @@ -2971,7 +2971,7 @@ /* * Clear the write and modified bits in each of the given page's mappings. */ -static __inline void +void pmap_clear_write(vm_page_t m) { pv_entry_t pv; ==== //depot/projects/gnn_fast_ipsec/src/sys/arm/arm/in_cksum.c#3 (text+ko) ==== @@ -38,7 +38,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__FBSDID("$FreeBSD: src/sys/arm/arm/in_cksum.c,v 1.6 2006/03/09 23:33:59 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/in_cksum.c,v 1.7 2006/07/18 00:07:05 cognet Exp $"); #include #include @@ -89,6 +89,17 @@ return (sum); } +static +uint64_t _do_cksum(void *addr, int len) +{ + uint64_t sum; + union q_util q_util; + + sum = do_cksum(addr, len); + REDUCE32; + return (sum); +} + u_short in_cksum_skip(struct mbuf *m, int len, int skip) { @@ -120,9 +131,9 @@ mlen = len; if ((clen ^ (int) addr) & 1) - sum += do_cksum(addr, mlen) << 8; + sum += _do_cksum(addr, mlen) << 8; else - sum += do_cksum(addr, mlen); + sum += _do_cksum(addr, mlen); clen += mlen; len -= mlen; ==== //depot/projects/gnn_fast_ipsec/src/sys/arm/arm/pmap.c#8 (text+ko) ==== @@ -147,7 +147,7 @@ #include "opt_vm.h" #include -__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.65 2006/07/11 11:22:06 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.66 2006/07/20 23:26:22 alc Exp $"); #include #include #include @@ -4461,6 +4461,21 @@ /* + * Clear the write and modified bits in each of the given page's mappings. + */ +void +pmap_clear_write(vm_page_t m) +{ + + if (m->md.pvh_attrs & PVF_WRITE) + pmap_clearbit(m, PVF_WRITE); + else + KASSERT((m->flags & PG_WRITEABLE) == 0, + ("pmap_clear_write: page %p has PG_WRITEABLE set", m)); +} + + +/* * perform the pmap work for mincore */ int ==== //depot/projects/gnn_fast_ipsec/src/sys/arm/arm/vm_machdep.c#6 (text+ko) ==== @@ -41,7 +41,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/arm/vm_machdep.c,v 1.24 2006/06/05 23:42:47 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/vm_machdep.c,v 1.26 2006/07/15 23:15:31 cognet Exp $"); #include #include @@ -512,7 +512,7 @@ void *ret; struct arm_small_page *sp, *tmp; TAILQ_HEAD(,arm_small_page) *head; - static int in_alloc; + static struct thread *in_alloc; static int in_sleep; int should_wakeup = 0; @@ -532,12 +532,13 @@ if (!sp) { /* No more free pages, need to alloc more. */ - if (!(wait & M_WAITOK)) { + if (!(wait & M_WAITOK) || + in_alloc == curthread) { mtx_unlock(&smallalloc_mtx); *flags = UMA_SLAB_KMEM; return ((void *)kmem_malloc(kmem_map, bytes, M_NOWAIT)); } - if (in_alloc) { + if (in_alloc != NULL) { /* Somebody else is already doing the allocation. */ in_sleep++; msleep(&in_alloc, &smallalloc_mtx, PWAIT, @@ -545,14 +546,14 @@ in_sleep--; goto retry; } - in_alloc = 1; + in_alloc = curthread; mtx_unlock(&smallalloc_mtx); /* Try to alloc 1MB of contiguous memory. */ ret = arm_uma_do_alloc(&sp, bytes, zone == l2zone ? SECTION_PT : SECTION_CACHE); mtx_lock(&smallalloc_mtx); - in_alloc = 0; - if (in_sleep) + in_alloc = NULL; + if (in_sleep > 0) should_wakeup = 1; if (sp) { for (int i = 0; i < (0x100000 / PAGE_SIZE) - 1; ==== //depot/projects/gnn_fast_ipsec/src/sys/arm/at91/if_ate.c#6 (text) ==== @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/at91/if_ate.c,v 1.8 2006/06/17 23:24:35 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/at91/if_ate.c,v 1.9 2006/07/17 21:36:08 cognet Exp $"); #include #include @@ -764,7 +764,7 @@ } mdefrag = m_defrag(m, M_DONTWAIT); if (mdefrag == NULL) { - m_freem(m); + IFQ_DRV_PREPEND(&ifp->if_snd, m); return; } m = mdefrag; ==== //depot/projects/gnn_fast_ipsec/src/sys/arm/at91/kb920x_machdep.c#4 (text) ==== @@ -48,7 +48,7 @@ #include "opt_at91.h" #include -__FBSDID("$FreeBSD: src/sys/arm/at91/kb920x_machdep.c,v 1.11 2006/07/15 00:09:53 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/at91/kb920x_machdep.c,v 1.12 2006/07/17 21:20:00 cognet Exp $"); #define _ARM32_BUS_DMA_PRIVATE #include @@ -234,7 +234,7 @@ /* PIOA's B periph: Turn USART 3's TX/RX pins */ at91_pio_use_periph_b(AT91RM92_PIOA_BASE, AT91C_PA6_RXD3, 0); at91_pio_use_periph_b(AT91RM92_PIOA_BASE, AT91C_PA5_TXD3, 1); -#if AT91_TSC +#ifdef AT91_TSC /* We're using TC0's A1 and A2 input */ at91_pio_use_periph_b(AT91RM92_PIOA_BASE, AT91C_PA19_TIOA1 | AT91C_PA21_TIOA2, 0); @@ -244,7 +244,7 @@ at91_pio_use_periph_a(AT91RM92_PIOB_BASE, AT91C_PB20_TXD1, 1); /* Pin assignment */ -#if AT91_TSC +#ifdef AT91_TSC /* Assert PA24 low -- talk to rubidium */ at91_pio_use_gpio(AT91RM92_PIOA_BASE, AT91C_PIO_PA24); at91_pio_gpio_output(AT91RM92_PIOA_BASE, AT91C_PIO_PA24, 0); ==== //depot/projects/gnn_fast_ipsec/src/sys/arm/at91/uart_dev_at91usart.c#6 (text) ==== @@ -26,7 +26,9 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/at91/uart_dev_at91usart.c,v 1.8 2006/07/14 21:33:04 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/at91/uart_dev_at91usart.c,v 1.9 2006/07/20 21:03:43 cognet Exp $"); + +#include "opt_comconsole.h" #include #include @@ -492,6 +494,19 @@ return (at91_usart_param(&sc->sc_bas, baudrate, databits, stopbits, parity)); } + +static __inline void +at91_rx_put(struct uart_softc *sc, int key) +{ +#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) + if (sc->sc_sysdev != NULL && sc->sc_sysdev->type == UART_DEV_CONSOLE) { + if (kdb_alt_break(key, &sc->sc_altbrk)) + kdb_enter("Break sequence to console"); + } +#endif + uart_rx_put(sc, key); +} + static int at91_usart_bus_ipend(struct uart_softc *sc) { @@ -534,9 +549,9 @@ bus_dmamap_sync(atsc->dmatag, atsc->pong->map, BUS_DMASYNC_POSTREAD); for (i = 0; i < sc->sc_rxfifosz; i++) - uart_rx_put(sc, atsc->ping->buffer[i]); + at91_rx_put(sc, atsc->ping->buffer[i]); for (i = 0; i < sc->sc_rxfifosz; i++) - uart_rx_put(sc, atsc->pong->buffer[i]); + at91_rx_put(sc, atsc->pong->buffer[i]); uart_rx_put(sc, UART_STAT_OVERRUN); csr &= ~(USART_CSR_ENDRX | USART_CSR_TIMEOUT); WR4(&sc->sc_bas, PDC_RPR, atsc->ping->pa); @@ -554,7 +569,7 @@ bus_dmamap_sync(atsc->dmatag, atsc->ping->map, BUS_DMASYNC_POSTREAD); for (i = 0; i < sc->sc_rxfifosz; i++) - uart_rx_put(sc, atsc->ping->buffer[i]); + at91_rx_put(sc, atsc->ping->buffer[i]); p = atsc->ping; atsc->ping = atsc->pong; atsc->pong = p; @@ -574,7 +589,7 @@ BUS_DMASYNC_POSTREAD); len = sc->sc_rxfifosz - RD4(&sc->sc_bas, PDC_RCR); for (i = 0; i < len; i++) - uart_rx_put(sc, atsc->ping->buffer[i]); + at91_rx_put(sc, atsc->ping->buffer[i]); WR4(&sc->sc_bas, PDC_RPR, atsc->ping->pa); WR4(&sc->sc_bas, PDC_RCR, sc->sc_rxfifosz); WR4(&sc->sc_bas, USART_CR, USART_CR_STTTO); @@ -584,7 +599,7 @@ if (!(atsc->flags & HAS_TIMEOUT) && (csr & USART_CSR_RXRDY)) { // We have another charater in a device that doesn't support // timeouts, so we do it one character at a time. - uart_rx_put(sc, RD4(&sc->sc_bas, USART_RHR) & 0xff); + at91_rx_put(sc, RD4(&sc->sc_bas, USART_RHR) & 0xff); ipend |= SER_INT_RXREADY; } ==== //depot/projects/gnn_fast_ipsec/src/sys/arm/conf/KB920X#4 (text) ==== @@ -16,7 +16,7 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/arm/conf/KB920X,v 1.8 2006/07/14 15:20:31 imp Exp $ +# $FreeBSD: src/sys/arm/conf/KB920X,v 1.9 2006/07/17 21:17:20 cognet Exp $ machine arm ident KB920X @@ -81,3 +81,4 @@ device md # device at91_twi # TWI: Two Wire Interface device at91_spi # SPI: +device spibus ==== //depot/projects/gnn_fast_ipsec/src/sys/compat/linux/linux_misc.c#6 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.179 2006/06/23 18:49:38 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.180 2006/07/21 20:22:13 jhb Exp $"); #include "opt_compat.h" #include "opt_mac.h" @@ -229,7 +229,7 @@ unsigned long bss_size; char *library; int error; - int locked; + int locked, vfslocked; LCONVPATHEXIST(td, args->library, &library); @@ -239,34 +239,26 @@ #endif a_out = NULL; + vfslocked = 0; locked = 0; vp = NULL; - /* - * XXX: This code should make use of vn_open(), rather than doing - * all this stuff itself. - */ - NDINIT(&ni, LOOKUP, ISOPEN|FOLLOW|LOCKLEAF, UIO_SYSSPACE, library, td); + NDINIT(&ni, LOOKUP, ISOPEN | FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1, + UIO_SYSSPACE, library, td); error = namei(&ni); LFREEPATH(library); if (error) goto cleanup; vp = ni.ni_vp; - /* - * XXX - This looks like a bogus check. A LOCKLEAF namei should not - * succeed without returning a vnode. - */ - if (vp == NULL) { - error = ENOEXEC; /* ?? */ - goto cleanup; - } + vfslocked = NDHASGIANT(&ni); NDFREE(&ni, NDF_ONLY_PNBUF); /* * From here on down, we have a locked vnode that must be unlocked. + * XXX: The code below largely duplicates exec_check_permissions(). */ - locked++; + locked = 1; /* Writable? */ if (vp->v_writecount) { @@ -281,6 +273,7 @@ if ((vp->v_mount->mnt_flag & MNT_NOEXEC) || ((attr.va_mode & 0111) == 0) || (attr.va_type != VREG)) { + /* EACCESS is what exec(2) returns. */ error = ENOEXEC; goto cleanup; } @@ -299,6 +292,8 @@ /* * XXX: This should use vn_open() so that it is properly authorized, * and to reduce code redundancy all over the place here. + * XXX: Not really, it duplicates far more of exec_check_permissions() + * than vn_open(). */ #ifdef MAC error = mac_check_vnode_open(td->td_ucred, vp, FREAD); @@ -312,12 +307,6 @@ /* Pull in executable header into kernel_map */ error = vm_mmap(kernel_map, (vm_offset_t *)&a_out, PAGE_SIZE, VM_PROT_READ, VM_PROT_READ, 0, OBJT_VNODE, vp, 0); - /* - * Lock no longer needed - */ - locked = 0; - VOP_UNLOCK(vp, 0, td); - if (error) goto cleanup; @@ -372,11 +361,21 @@ } PROC_UNLOCK(td->td_proc); - mp_fixme("Unlocked vflags access."); - /* prevent more writers */ + /* + * Prevent more writers. + * XXX: Note that if any of the VM operations fail below we don't + * clear this flag. + */ vp->v_vflag |= VV_TEXT; /* + * Lock no longer needed + */ + locked = 0; + VOP_UNLOCK(vp, 0, td); + VFS_UNLOCK_GIANT(vfslocked); + + /* * Check if file_offset page aligned. Currently we cannot handle * misalinged file offsets, and so we read in the entire image * (what a waste). @@ -453,8 +452,10 @@ cleanup: /* Unlock vnode if needed */ - if (locked) + if (locked) { VOP_UNLOCK(vp, 0, td); + VFS_UNLOCK_GIANT(vfslocked); + } /* Release the kernel mapping. */ if (a_out) ==== //depot/projects/gnn_fast_ipsec/src/sys/compat/linux/linux_socket.c#6 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_socket.c,v 1.69 2006/07/08 20:03:38 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_socket.c,v 1.70 2006/07/19 18:28:52 jhb Exp $"); /* XXX we use functions that might not exist. */ #include "opt_compat.h" @@ -609,7 +609,9 @@ if (error) return (error); - return (kern_bind(td, linux_args.s, sa)); + error = kern_bind(td, linux_args.s, sa); + free(sa, M_SONAME); + return (error); } struct linux_connect_args { @@ -638,6 +640,7 @@ return (error); error = kern_connect(td, linux_args.s, sa); + free(sa, M_SONAME); if (error != EISCONN) return (error); ==== //depot/projects/gnn_fast_ipsec/src/sys/compat/svr4/svr4_misc.c#4 (text+ko) ==== @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/svr4/svr4_misc.c,v 1.86 2006/07/11 20:52:07 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/svr4/svr4_misc.c,v 1.89 2006/07/21 20:28:56 jhb Exp $"); #include "opt_mac.h" @@ -104,7 +104,7 @@ svr4_mode_t, svr4_dev_t); static __inline clock_t timeval_to_clock_t(struct timeval *); -static int svr4_setinfo (struct proc *, int, svr4_siginfo_t *); +static int svr4_setinfo (pid_t , struct rusage *, int, svr4_siginfo_t *); struct svr4_hrtcntl_args; static int svr4_hrtcntl (struct thread *, struct svr4_hrtcntl_args *, @@ -606,34 +606,36 @@ struct svr4_sys_fchroot_args *uap; { struct filedesc *fdp = td->td_proc->p_fd; - struct vnode *vp, *vpold; + struct vnode *vp; struct file *fp; - int error; + int error, vfslocked; if ((error = suser(td)) != 0) return error; if ((error = getvnode(fdp, uap->fd, &fp)) != 0) return error; vp = fp->f_vnode; + VREF(vp); + fdrop(fp, td); + vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); - if (vp->v_type != VDIR) - error = ENOTDIR; - else - error = VOP_ACCESS(vp, VEXEC, td->td_ucred, td); + error = change_dir(vp, td); + if (error) + goto fail; +#ifdef MAC + error = mac_check_vnode_chroot(td->td_ucred, vp); + if (error) + goto fail; +#endif VOP_UNLOCK(vp, 0, td); - if (error) { - fdrop(fp, td); - return error; - } - VREF(vp); - FILEDESC_LOCK_FAST(fdp); - vpold = fdp->fd_rdir; - fdp->fd_rdir = vp; - FILEDESC_UNLOCK_FAST(fdp); - if (vpold != NULL) - vrele(vpold); - fdrop(fp, td); - return 0; + error = change_root(vp, td); + vrele(vp); + VFS_UNLOCK_GIANT(vfslocked); + return (error); +fail: + vput(vp); + VFS_UNLOCK_GIANT(vfslocked); + return (error); } @@ -1083,12 +1085,12 @@ static int -svr4_setinfo(p, st, s) - struct proc *p; +svr4_setinfo(pid, ru, st, s) + pid_t pid; + struct rusage *ru; int st; svr4_siginfo_t *s; { - struct timeval utime, stime; svr4_siginfo_t i; int sig; @@ -1097,13 +1099,10 @@ i.svr4_si_signo = SVR4_SIGCHLD; i.svr4_si_errno = 0; /* XXX? */ - if (p) { - i.svr4_si_pid = p->p_pid; - PROC_LOCK(p); - calcru(p, &utime, &stime); - PROC_UNLOCK(p); - i.svr4_si_stime = stime.tv_sec; - i.svr4_si_utime = utime.tv_sec; + i.svr4_si_pid = pid; + if (ru) { + i.svr4_si_stime = ru->ru_stime.tv_sec; + i.svr4_si_utime = ru->ru_utime.tv_sec; } if (WIFEXITED(st)) { @@ -1142,188 +1141,185 @@ struct thread *td; struct svr4_sys_waitsys_args *uap; { - int nfound; + struct rusage ru; + pid_t pid; + int nfound, status; int error, *retval = td->td_retval; - struct proc *p, *q, *t; + struct proc *p, *q; + + DPRINTF(("waitsys(%d, %d, %p, %x)\n", + uap->grp, uap->id, + uap->info, uap->options)); - p = td->td_proc; + q = td->td_proc; switch (uap->grp) { - case SVR4_P_PID: + case SVR4_P_PID: + pid = uap->id; break; case SVR4_P_PGID: - PROC_LOCK(p); - uap->id = -p->p_pgid; - PROC_UNLOCK(p); + PROC_LOCK(q); + pid = -q->p_pgid; + PROC_UNLOCK(q); break; case SVR4_P_ALL: - uap->id = WAIT_ANY; + pid = WAIT_ANY; break; default: return EINVAL; } - DPRINTF(("waitsys(%d, %d, %p, %x)\n", - uap->grp, uap->id, - uap->info, uap->options)); + /* Hand off the easy cases to kern_wait(). */ + if (!(uap->options & (SVR4_WNOWAIT)) && + (uap->options & (SVR4_WEXITED | SVR4_WTRAPPED))) { + int options; + + options = 0; + if (uap->options & SVR4_WSTOPPED) + options |= WUNTRACED; + if (uap->options & SVR4_WCONTINUED) + options |= WCONTINUED; + if (uap->options & SVR4_WNOHANG) + options |= WNOHANG; + + error = kern_wait(td, pid, &status, options, &ru); + if (error) + return (error); + if (uap->options & SVR4_WNOHANG && *retval == 0) + error = svr4_setinfo(*retval, NULL, 0, uap->info); + else + error = svr4_setinfo(*retval, &ru, status, uap->info); + *retval = 0; + return (error); + } + /* + * Ok, handle the weird cases. Either WNOWAIT is set (meaning we + * just want to see if there is a process to harvest, we dont' + * want to actually harvest it), or WEXIT and WTRAPPED are clear + * meaning we want to ignore zombies. Either way, we don't have + * to handle harvesting zombies here. We do have to duplicate the + * other portions of kern_wait() though, especially for the + * WCONTINUED and WSTOPPED. + */ loop: nfound = 0; sx_slock(&proctree_lock); - LIST_FOREACH(q, &p->p_children, p_sibling) { - PROC_LOCK(q); - if (uap->id != WAIT_ANY && - q->p_pid != uap->id && - q->p_pgid != -uap->id) { - PROC_UNLOCK(q); - DPRINTF(("pid %d pgid %d != %d\n", q->p_pid, - q->p_pgid, uap->id)); + LIST_FOREACH(p, &q->p_children, p_sibling) { + PROC_LOCK(p); + if (pid != WAIT_ANY && + p->p_pid != pid && p->p_pgid != -pid) { + PROC_UNLOCK(p); + DPRINTF(("pid %d pgid %d != %d\n", p->p_pid, + p->p_pgid, pid)); + continue; + } + if (p_canwait(td, p)) { + PROC_UNLOCK(p); continue; } + nfound++; - if ((q->p_state == PRS_ZOMBIE) && + + /* + * See if we have a zombie. If so, WNOWAIT should be set, + * as otherwise we should have called kern_wait() up above. + */ + if ((p->p_state == PRS_ZOMBIE) && ((uap->options & (SVR4_WEXITED|SVR4_WTRAPPED)))) { - PROC_UNLOCK(q); + KASSERT(uap->options & SVR4_WNOWAIT, + ("WNOWAIT is clear")); + + /* Found a zombie, so cache info in local variables. */ + pid = p->p_pid; + status = p->p_xstat; + ru = *p->p_ru; + calcru(p, &ru.ru_utime, &ru.ru_stime); + PROC_UNLOCK(p); sx_sunlock(&proctree_lock); + + /* Copy the info out to userland. */ *retval = 0; - DPRINTF(("found %d\n", q->p_pid)); - error = svr4_setinfo(q, q->p_xstat, uap->info); - if (error != 0) - return error; + DPRINTF(("found %d\n", pid)); + return (svr4_setinfo(pid, &ru, status, uap->info)); + } + /* + * See if we have a stopped or continued process. + * XXX: This duplicates the same code in kern_wait(). + */ + mtx_lock_spin(&sched_lock); + if ((p->p_flag & P_STOPPED_SIG) && + (p->p_suspcount == p->p_numthreads) && + (p->p_flag & P_WAITED) == 0 && + (p->p_flag & P_TRACED || uap->options & SVR4_WSTOPPED)) { + mtx_unlock_spin(&sched_lock); + if (((uap->options & SVR4_WNOWAIT)) == 0) + p->p_flag |= P_WAITED; + sx_sunlock(&proctree_lock); + pid = p->p_pid; + status = W_STOPCODE(p->p_xstat); + ru = *p->p_ru; + calcru(p, &ru.ru_utime, &ru.ru_stime); + PROC_UNLOCK(p); - if ((uap->options & SVR4_WNOWAIT)) { - DPRINTF(("Don't wait\n")); - return 0; + if (((uap->options & SVR4_WNOWAIT)) == 0) { + PROC_LOCK(q); + sigqueue_take(p->p_ksi); + PROC_UNLOCK(q); } - /* - * If we got the child via ptrace(2) or procfs, and - * the parent is different (meaning the process was - * attached, rather than run as a child), then we need - * to give it back to the old parent, and send the - * parent a SIGCHLD. The rest of the cleanup will be - * done when the old parent waits on the child. - */ - sx_xlock(&proctree_lock); - PROC_LOCK(q); - if (q->p_flag & P_TRACED) { - if (q->p_oppid != q->p_pptr->p_pid) { - PROC_UNLOCK(q); - t = pfind(q->p_oppid); - if (t == NULL) { - t = initproc; - PROC_LOCK(initproc); - } - PROC_LOCK(q); - proc_reparent(q, t); - q->p_oppid = 0; - q->p_flag &= ~(P_TRACED | P_WAITED); - PROC_UNLOCK(q); - psignal(t, SIGCHLD); - wakeup(t); - PROC_UNLOCK(t); - sx_xunlock(&proctree_lock); - return 0; - } + *retval = 0; + DPRINTF(("jobcontrol %d\n", pid)); + return (svr4_setinfo(pid, &ru, status, uap->info)); + } + mtx_unlock_spin(&sched_lock); + if (uap->options & SVR4_WCONTINUED && + (p->p_flag & P_CONTINUED)) { + sx_sunlock(&proctree_lock); + if (((uap->options & SVR4_WNOWAIT)) == 0) + p->p_flag &= ~P_CONTINUED; + pid = p->p_pid; + ru = *p->p_ru; + status = SIGCONT; + calcru(p, &ru.ru_utime, &ru.ru_stime); + PROC_UNLOCK(p); + + if (((uap->options & SVR4_WNOWAIT)) == 0) { + PROC_LOCK(q); + sigqueue_take(p->p_ksi); + PROC_UNLOCK(q); } - PROC_UNLOCK(q); - sx_xunlock(&proctree_lock); - q->p_xstat = 0; - ruadd(&p->p_stats->p_cru, &p->p_crux, q->p_ru, - &q->p_rux); - FREE(q->p_ru, M_ZOMBIE); - q->p_ru = NULL; - - /* - * Decrement the count of procs running with this uid. - */ - (void)chgproccnt(q->p_ucred->cr_ruidinfo, -1, 0); - /* - * Release reference to text vnode. - */ - if (q->p_textvp) - vrele(q->p_textvp); - - /* - * Free up credentials. - */ - crfree(q->p_ucred); - q->p_ucred = NULL; - - /* - * Remove unused arguments - */ - pargs_drop(q->p_args); - PROC_UNLOCK(q); - - /* - * Finally finished with old proc entry. - * Unlink it from its process group and free it. - */ - sx_xlock(&proctree_lock); - leavepgrp(q); - - sx_xlock(&allproc_lock); - LIST_REMOVE(q, p_list); /* off zombproc */ - sx_xunlock(&allproc_lock); - - LIST_REMOVE(q, p_sibling); - sx_xunlock(&proctree_lock); - - PROC_LOCK(q); - sigacts_free(q->p_sigacts); - q->p_sigacts = NULL; - PROC_UNLOCK(q); - - /* - * Give machine-dependent layer a chance - * to free anything that cpu_exit couldn't - * release while still running in process context. - */ >>> TRUNCATED FOR MAIL (1000 lines) <<<