svn commit: r192035 - in head/sys: amd64/amd64 i386/i386
Author: alc Date: Wed May 13 07:42:53 2009 New Revision: 192035 URL: http://svn.freebsd.org/changeset/base/192035 Log: Correct a rare use-after-free error in pmap_copy(). This error was introduced in amd64 revision 1.540 and i386 revision 1.547. However, it had no harmful effects until after a recent change, r189698, on amd64. (In other words, the error is harmless in RELENG_7.) The error is triggered by the failure to allocate a pv entry for the one and only mapping in a page table page. I am addressing the error by changing pmap_copy() to abort if either pv entry allocation or page table page allocation fails. This is appropriate because the creation of mappings by pmap_copy() is optional. They are a (possible) optimization, and not a requirement. Correct a nearby whitespace error in the i386 pmap_copy(). Crash reported by: jeff@ MFC after:6 weeks Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c == --- head/sys/amd64/amd64/pmap.c Wed May 13 05:39:39 2009(r192034) +++ head/sys/amd64/amd64/pmap.c Wed May 13 07:42:53 2009(r192035) @@ -3556,7 +3556,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm dstmpte->wire_count++; else if ((dstmpte = pmap_allocpte(dst_pmap, addr, M_NOWAIT)) == NULL) - break; + goto out; dst_pte = (pt_entry_t *) PHYS_TO_DMAP(VM_PAGE_TO_PHYS(dstmpte)); dst_pte = &dst_pte[pmap_pte_index(addr)]; @@ -3579,6 +3579,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm addr); pmap_free_zero_pages(free); } + goto out; } if (dstmpte->wire_count >= srcmpte->wire_count) break; @@ -3587,6 +3588,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm src_pte++; } } +out: vm_page_unlock_queues(); PMAP_UNLOCK(src_pmap); PMAP_UNLOCK(dst_pmap); Modified: head/sys/i386/i386/pmap.c == --- head/sys/i386/i386/pmap.c Wed May 13 05:39:39 2009(r192034) +++ head/sys/i386/i386/pmap.c Wed May 13 07:42:53 2009(r192035) @@ -3638,7 +3638,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm dstmpte = pmap_allocpte(dst_pmap, addr, M_NOWAIT); if (dstmpte == NULL) - break; + goto out; dst_pte = pmap_pte_quick(dst_pmap, addr); if (*dst_pte == 0 && pmap_try_insert_pv_entry(dst_pmap, addr, @@ -3653,12 +3653,13 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm dst_pmap->pm_stats.resident_count++; } else { free = NULL; - if (pmap_unwire_pte_hold( dst_pmap, + if (pmap_unwire_pte_hold(dst_pmap, dstmpte, &free)) { pmap_invalidate_page(dst_pmap, addr); pmap_free_zero_pages(free); } + goto out; } if (dstmpte->wire_count >= srcmpte->wire_count) break; @@ -3667,6 +3668,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm src_pte++; } } +out: sched_unpin(); vm_page_unlock_queues(); PMAP_UNLOCK(src_pmap); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192036 - head/sys/compat/ndis
Author: brueffer Date: Wed May 13 08:50:13 2009 New Revision: 192036 URL: http://svn.freebsd.org/changeset/base/192036 Log: Fix memory leak in an error case. Found with: Coverity Prevent(tm) CID: 371 MFC after:2 weeks Modified: head/sys/compat/ndis/kern_windrv.c Modified: head/sys/compat/ndis/kern_windrv.c == --- head/sys/compat/ndis/kern_windrv.c Wed May 13 07:42:53 2009 (r192035) +++ head/sys/compat/ndis/kern_windrv.c Wed May 13 08:50:13 2009 (r192036) @@ -531,7 +531,10 @@ windrv_bus_attach(drv, name) RtlInitAnsiString(&as, name); if (RtlAnsiStringToUnicodeString(&drv->dro_drivername, &as, TRUE)) + { + free(new, M_DEVBUF); return(ENOMEM); + } /* * Set up a fake image pointer to avoid false matches ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192040 - head/usr.bin/truss
Author: dds Date: Wed May 13 12:43:37 2009 New Revision: 192040 URL: http://svn.freebsd.org/changeset/base/192040 Log: Fix compilation error introduced in r192025. Modified: head/usr.bin/truss/mips-fbsd.c Modified: head/usr.bin/truss/mips-fbsd.c == --- head/usr.bin/truss/mips-fbsd.c Wed May 13 12:19:54 2009 (r192039) +++ head/usr.bin/truss/mips-fbsd.c Wed May 13 12:43:37 2009 (r192040) @@ -338,7 +338,8 @@ mips_syscall_exit(struct trussinfo *trus * but that complicates things considerably. */ - print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp, retval); + print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp, + fsc.sc, retval); clear_fsc(); return (retval); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192041 - head/usr.bin/truss
Author: dds Date: Wed May 13 13:00:52 2009 New Revision: 192041 URL: http://svn.freebsd.org/changeset/base/192041 Log: Fix print_syscall_ret parameter order. Modified: head/usr.bin/truss/mips-fbsd.c Modified: head/usr.bin/truss/mips-fbsd.c == --- head/usr.bin/truss/mips-fbsd.c Wed May 13 12:43:37 2009 (r192040) +++ head/usr.bin/truss/mips-fbsd.c Wed May 13 13:00:52 2009 (r192041) @@ -339,7 +339,7 @@ mips_syscall_exit(struct trussinfo *trus */ print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp, - fsc.sc, retval); + retval, fsc.sc); clear_fsc(); return (retval); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192042 - head/sys/dev/bwi
Author: nwhitehorn Date: Wed May 13 14:25:55 2009 New Revision: 192042 URL: http://svn.freebsd.org/changeset/base/192042 Log: Add a short delay after programming PHY registers to give some time for the engine to catch up. This prevents a machine check exception from illegal memory requests with a BCM4318. Modified: head/sys/dev/bwi/bwiphy.c Modified: head/sys/dev/bwi/bwiphy.c == --- head/sys/dev/bwi/bwiphy.c Wed May 13 13:00:52 2009(r192041) +++ head/sys/dev/bwi/bwiphy.c Wed May 13 14:25:55 2009(r192042) @@ -664,6 +664,7 @@ bwi_phy_init_11b_rev6(struct bwi_mac *ma for (ofs = 0xa8; ofs < 0xc8; ++ofs) { PHY_WRITE(mac, ofs, (val & 0x3f3f)); val += 0x202; + DELAY(10); } if (phy->phy_mode == IEEE80211_MODE_11G) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r192026 - head/share/man/man9
On Tuesday 12 May 2009 5:28:13 pm Marius Strobl wrote: > On Tue, May 12, 2009 at 04:13:06PM -0500, Robert Noland wrote: > > On Tue, 2009-05-12 at 20:56 +, Marius Strobl wrote: > > > Author: marius > > > Date: Tue May 12 20:56:34 2009 > > > New Revision: 192026 > > > URL: http://svn.freebsd.org/changeset/base/192026 > > > > > > Log: > > > Correct r190283 (partially reverting it) as on sparc64 BUS_DMA_NOCACHE > > > actually is only valid for bus_dmamap_load(). > > > > Ok, this is getting very confusing... This means that code has to set > > this flag on both alloc and load to allow for somethine resembling > > consistent behavior. > > > > Personally I don't understand why amd64 and i386 where decided to > implement BUS_DMA_NOCACHE for bus_dmamem_alloc(9) only as this > is less flexible than using it with bus_dmamap_load(9) (which also > is the older existing implementation). Anyway, > documents BUS_DMA_NOCACHE and BUS_DMA_NOWRITE as "non-standard or > specific to only certain architectures" so I think it's okay for > the usage of these flags to differ across them. Hmm, it might be possible to move it to bus_dmamap_load() instead. -- John Baldwin ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192043 - head/sys/dev/ed
Author: imp Date: Wed May 13 14:43:26 2009 New Revision: 192043 URL: http://svn.freebsd.org/changeset/base/192043 Log: ifp->if_softc is managed entirely by the driver. We never set it to NULL or change it. We initialize it before we set if_ioctl. It can therefore never be NULL, and most other drivers don't bother with this sanity check. Modified: head/sys/dev/ed/if_ed.c Modified: head/sys/dev/ed/if_ed.c == --- head/sys/dev/ed/if_ed.c Wed May 13 14:25:55 2009(r192042) +++ head/sys/dev/ed/if_ed.c Wed May 13 14:43:26 2009(r192043) @@ -1164,14 +1164,6 @@ ed_ioctl(struct ifnet *ifp, u_long comma struct ifreq *ifr = (struct ifreq *)data; int error = 0; - /* -* XXX really needed? -*/ - if (sc == NULL) { - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - return (ENXIO); - } - switch (command) { case SIOCSIFFLAGS: /* ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192046 - head/sys/dev/bwi
Author: nwhitehorn Date: Wed May 13 16:19:05 2009 New Revision: 192046 URL: http://svn.freebsd.org/changeset/base/192046 Log: Add a comment to motivate my last change. Suggested by: sam, imp Modified: head/sys/dev/bwi/bwiphy.c Modified: head/sys/dev/bwi/bwiphy.c == --- head/sys/dev/bwi/bwiphy.c Wed May 13 15:09:01 2009(r192045) +++ head/sys/dev/bwi/bwiphy.c Wed May 13 16:19:05 2009(r192046) @@ -664,6 +664,8 @@ bwi_phy_init_11b_rev6(struct bwi_mac *ma for (ofs = 0xa8; ofs < 0xc8; ++ofs) { PHY_WRITE(mac, ofs, (val & 0x3f3f)); val += 0x202; + + /* XXX: delay 10 us to avoid PCI parity errors with BCM4318 */ DELAY(10); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r191983 - in head/sys: dev/usb/wlan modules/usb/upgt
On Mon, 11 May 2009, Weongyo Jeong wrote: Author: weongyo Date: Mon May 11 02:39:49 2009 New Revision: 191983 URL: http://svn.freebsd.org/changeset/base/191983 Log: ports upgt(4) driver for USB2. Ah, great! Do you have any similar plans regarding urtw? Robert N M Watson Computer Laboratory University of Cambridge Added: head/sys/dev/usb/wlan/if_upgt.c (contents, props changed) head/sys/dev/usb/wlan/if_upgtvar.h (contents, props changed) head/sys/modules/usb/upgt/ head/sys/modules/usb/upgt/Makefile (contents, props changed) Added: head/sys/dev/usb/wlan/if_upgt.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/wlan/if_upgt.c Mon May 11 02:39:49 2009 (r191983) @@ -0,0 +1,2404 @@ +/* $OpenBSD: if_upgt.c,v 1.35 2008/04/16 18:32:15 damien Exp $ */ +/* $FreeBSD$ */ + +/* + * Copyright (c) 2007 Marcus Glocker + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include "usbdevs.h" + +#include + +/* + * Driver for the USB PrismGT devices. + * + * For now just USB 2.0 devices with the GW3887 chipset are supported. + * The driver has been written based on the firmware version 2.13.1.0_LM87. + * + * TODO's: + * - MONITOR mode test. + * - Add HOSTAP mode. + * - Add IBSS mode. + * - Support the USB 1.0 devices (NET2280, ISL3880, ISL3886 chipsets). + * + * Parts of this driver has been influenced by reading the p54u driver + * written by Jean-Baptiste Note and + * Sebastien Bourdeauducq . + */ + +SYSCTL_NODE(_hw, OID_AUTO, upgt, CTLFLAG_RD, 0, +"USB PrismGT GW3887 driver parameters"); + +#ifdef UPGT_DEBUG +int upgt_debug = 0; +SYSCTL_INT(_hw_upgt, OID_AUTO, debug, CTLFLAG_RW, &upgt_debug, + 0, "control debugging printfs"); +TUNABLE_INT("hw.upgt.debug", &upgt_debug); +enum { + UPGT_DEBUG_XMIT = 0x0001, /* basic xmit operation */ + UPGT_DEBUG_RECV = 0x0002, /* basic recv operation */ + UPGT_DEBUG_RESET= 0x0004, /* reset processing */ + UPGT_DEBUG_INTR = 0x0008, /* INTR */ + UPGT_DEBUG_TX_PROC = 0x0010, /* tx ISR proc */ + UPGT_DEBUG_RX_PROC = 0x0020, /* rx ISR proc */ + UPGT_DEBUG_STATE= 0x0040, /* 802.11 state transitions */ + UPGT_DEBUG_STAT = 0x0080, /* statistic */ + UPGT_DEBUG_FW = 0x0100, /* firmware */ + UPGT_DEBUG_ANY = 0x +}; +#defineDPRINTF(sc, m, fmt, ...) do { \ + if (sc->sc_debug & (m)) \ + printf(fmt, __VA_ARGS__); \ +} while (0) +#else +#defineDPRINTF(sc, m, fmt, ...) do { \ + (void) sc; \ +} while (0) +#endif + +/* + * Prototypes. + */ +static device_probe_t upgt_match; +static device_attach_t upgt_attach; +static device_detach_t upgt_detach; +static int upgt_alloc_tx(struct upgt_softc *); +static int upgt_alloc_rx(struct upgt_softc *); +static int upgt_device_reset(struct upgt_softc *); +static voidupgt_bulk_tx(struct upgt_softc *, struct upgt_data *); +static int upgt_fw_verify(struct upgt_softc *); +static int upgt_mem_init(struct upgt_softc *); +static int upgt_fw_load(struct upgt_softc *); +static int upgt_fw_copy(const uint8_t *, char *, int); +static uint32_tupgt_crc32_le(const void *, size_t); +static struct mbuf * + upgt_rxeof(struct usb2_xfer *, struct upgt_data *, int *); +static struct mbuf * + upgt_rx(struct upgt_softc *, uint8_t *, int, int *); +static voidupgt_txeof(struct usb2_xfer *, struct upgt_data *); +static int upgt_eeprom_read(struct upgt_softc *); +static int upgt_eeprom_parse(struct upgt_softc *); +st
svn commit: r192047 - head/sys/legacy/dev/usb
Author: rwatson Date: Wed May 13 17:11:25 2009 New Revision: 192047 URL: http://svn.freebsd.org/changeset/base/192047 Log: Garbage collect legacy upgt driver now that it is available in the new USB implementation. Garbage collect legacy USB ethernet framework now that it is unused. Deleted: head/sys/legacy/dev/usb/if_upgt.c head/sys/legacy/dev/usb/if_upgtvar.h head/sys/legacy/dev/usb/usb_ethersubr.c head/sys/legacy/dev/usb/usb_ethersubr.h ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192048 - head/sys/net
Author: rwatson Date: Wed May 13 17:17:05 2009 New Revision: 192048 URL: http://svn.freebsd.org/changeset/base/192048 Log: Remove now-unused NETISR_USB. Modified: head/sys/net/netisr.h Modified: head/sys/net/netisr.h == --- head/sys/net/netisr.h Wed May 13 17:11:25 2009(r192047) +++ head/sys/net/netisr.h Wed May 13 17:17:05 2009(r192048) @@ -53,7 +53,6 @@ #defineNETISR_ATALK1 17 /* Appletalk phase 1 */ #defineNETISR_ARP 18 /* same as AF_LINK */ #defineNETISR_IPX 23 /* same as AF_IPX */ -#defineNETISR_USB 25 /* USB soft interrupt */ #defineNETISR_PPP 26 /* PPP soft interrupt */ #defineNETISR_IPV6 27 #defineNETISR_NATM 28 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192049 - head/sys/net
Author: rwatson Date: Wed May 13 17:22:33 2009 New Revision: 192049 URL: http://svn.freebsd.org/changeset/base/192049 Log: Garbage collect now-unused NETISR_FORCEQUEUE, which overrode the global direct dispatch policy for specific protocols (NETISR_USB). We leave the additional 'flags' argument to netisr_register() for the time being, even though it is no longer required. Modified: head/sys/net/netisr.c head/sys/net/netisr.h Modified: head/sys/net/netisr.c == --- head/sys/net/netisr.c Wed May 13 17:17:05 2009(r192048) +++ head/sys/net/netisr.c Wed May 13 17:22:33 2009(r192049) @@ -78,8 +78,7 @@ netisr_register(int num, netisr_t *handl KASSERT(!(num < 0 || num >= (sizeof(netisrs)/sizeof(*netisrs))), ("bad isr %d", num)); - KASSERT(flags == 0 || flags == NETISR_FORCEQUEUE, - ("netisr_register: bad flags 0x%x\n", flags)); + KASSERT(flags == 0, ("netisr_register: bad flags 0x%x\n", flags)); netisrs[num].ni_handler = handler; netisrs[num].ni_queue = inq; netisrs[num].ni_flags = flags; @@ -169,15 +168,11 @@ netisr_dispatch(int num, struct mbuf *m) } /* -* Unless NETISR_FORCEQUEUE is set on the netisr (generally -* indicating that the handler still requires Giant, which cannot be -* acquired in arbitrary order with respect to a caller), directly -* dispatch handling of this packet. Source ordering is maintained -* by virtue of callers consistently calling one of queued or direct -* dispatch, and the forcequeue flag being immutable after -* registration. +* Directly dispatch handling of this packet, if permitted by global +* policy. Source ordering is maintained by virtue of callers +* consistently calling one of queued or direct dispatch. */ - if (netisr_direct && !(ni->ni_flags & NETISR_FORCEQUEUE)) { + if (netisr_direct) { isrstat.isrs_directed++; ni->ni_handler(m); } else { Modified: head/sys/net/netisr.h == --- head/sys/net/netisr.h Wed May 13 17:17:05 2009(r192048) +++ head/sys/net/netisr.h Wed May 13 17:22:33 2009(r192049) @@ -83,7 +83,6 @@ typedef void netisr_t (struct mbuf *); void netisr_dispatch(int, struct mbuf *); intnetisr_queue(int, struct mbuf *); -#defineNETISR_FORCEQUEUE 0x0002 /* Force queued dispatch. */ void netisr_register(int, netisr_t *, struct ifqueue *, int); void netisr_unregister(int); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r192011 - head/sys/netinet
On Tue, May 12, 2009 at 07:44:28PM +0200, Dimitry Andric wrote: > On 2009-05-12 09:41, Qing Li wrote: > > Author: qingli > > Date: Tue May 12 07:41:20 2009 > > New Revision: 192011 > > URL: http://svn.freebsd.org/changeset/base/192011 > > > > Log: > > This patch adds a host route to an interface address (that is assigned > > to a non loopback/ppp link types) through the loopback interface. Prior > > to the new L2/L3 rewrite, this host route is implicitly added by the L2 > > code during RTM_RESOLVE of that interface address. This host route is > > deleted when that interface is removed. > > This commit breaks dhclient startup, I now get: > > [...] > in_ifinit: insertion failed > ifconfig: ioctl (SIOCAIFADDR): File exists > em0: not found > exiting. > > So it seems to hit this part: > > + } else if (error != 0) > + log(LOG_INFO, "in_ifinit: insertion failed\n"); > > Reverting the commit makes dhclient work again. It also breaks PXE booting, can it be fixed or reverted? bootpc_init: wired to interface 'npe0' in_ifinit: insertion failed panic: bootpc_fakeup_interface: set if addr, error=17 Andrew ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192050 - in head/sys: amd64/amd64 amd64/include conf i386/i386 i386/include
Author: jhb Date: Wed May 13 17:53:04 2009 New Revision: 192050 URL: http://svn.freebsd.org/changeset/base/192050 Log: Implement simple machine check support for amd64 and i386. - For CPUs that only support MCE (the machine check exception) but not MCA (i.e. Pentium), all this does is print out the value of the machine check registers and then panic when a machine check exception occurs. - For CPUs that support MCA (the machine check architecture), the support is a bit more involved. - First, there is limited support for decoding the CPU-independent MCA error codes in the kernel, and the kernel uses this to output a short description of any machine check events that occur. - When a machine check exception occurs, all of the MCx banks on the current CPU are scanned and any events are reported to the console before panic'ing. - To catch events for correctable errors, a periodic timer kicks off a task which scans the MCx banks on all CPUs. The frequency of these checks is controlled via the "hw.mca.interval" sysctl. - Userland can request an immediate scan of the MCx banks by writing a non-zero value to "hw.mca.force_scan". - If any correctable events are encountered, the appropriate details are stored in a 'struct mca_record' (defined in ). The "hw.mca.count" is a count of such records and each record may be queried via the "hw.mca.records" tree by specifying the record index (0 .. count - 1) as the next name in the MIB similar to using PIDs with the kern.proc.* sysctls. The idea is to export machine check events to userland for more detailed processing. - The periodic timer and hw.mca sysctls are only present if the CPU supports MCA. Discussed with: emaste (briefly) MFC after:1 month Added: head/sys/amd64/amd64/mca.c (contents, props changed) head/sys/amd64/include/mca.h (contents, props changed) head/sys/i386/i386/mca.c (contents, props changed) head/sys/i386/include/mca.h (contents, props changed) Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/amd64/trap.c head/sys/amd64/include/specialreg.h head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/i386/i386/machdep.c head/sys/i386/i386/mp_machdep.c head/sys/i386/i386/trap.c head/sys/i386/include/specialreg.h Modified: head/sys/amd64/amd64/machdep.c == --- head/sys/amd64/amd64/machdep.c Wed May 13 17:22:33 2009 (r192049) +++ head/sys/amd64/amd64/machdep.c Wed May 13 17:53:04 2009 (r192050) @@ -109,6 +109,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -274,6 +275,7 @@ cpu_startup(dummy) vm_pager_bufferinit(); cpu_setregs(); + mca_init(); } /* Added: head/sys/amd64/amd64/mca.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/amd64/mca.c Wed May 13 17:53:04 2009(r192050) @@ -0,0 +1,530 @@ +/*- + * Copyright (c) 2009 Advanced Computing Technologies LLC + * Written by: John H. 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. + * + * 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. + */ + +/* + * Support for x86 machine check architecture. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct mca_internal { + struct mca_record rec; + int
svn commit: r192051 - head/sys/dev/usb
Author: thompsa Date: Wed May 13 17:58:37 2009 New Revision: 192051 URL: http://svn.freebsd.org/changeset/base/192051 Log: The transfer must return USB_ERR_CANCELLED when the device is gone due to the way usb drivers work. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_transfer.c Modified: head/sys/dev/usb/usb_transfer.c == --- head/sys/dev/usb/usb_transfer.c Wed May 13 17:53:04 2009 (r192050) +++ head/sys/dev/usb/usb_transfer.c Wed May 13 17:58:37 2009 (r192051) @@ -1439,7 +1439,11 @@ usb2_start_hardware(struct usb2_xfer *xf /* Check if the device is still alive */ if (info->udev->state < USB_STATE_POWERED) { USB_BUS_LOCK(bus); - usb2_transfer_done(xfer, USB_ERR_NOT_CONFIGURED); + /* +* Must return cancelled error code else +* device drivers can hang. +*/ + usb2_transfer_done(xfer, USB_ERR_CANCELLED); USB_BUS_UNLOCK(bus); return; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192052 - in head/sys/dev/usb: . storage
Author: thompsa Date: Wed May 13 18:03:23 2009 New Revision: 192052 URL: http://svn.freebsd.org/changeset/base/192052 Log: Sync to P4 Add umass quirks for Alcor AU6390, Cypress PATA 6830XX and MPMan MPF400. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/storage/umass.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/storage/umass.c == --- head/sys/dev/usb/storage/umass.cWed May 13 17:58:37 2009 (r192051) +++ head/sys/dev/usb/storage/umass.cWed May 13 18:03:23 2009 (r192052) @@ -309,6 +309,7 @@ struct umass_devdescr { /* wire and command protocol */ uint16_t proto; +#defineUMASS_PROTO_DEFAULT 0x /* use protocol indicated by USB descriptors */ #defineUMASS_PROTO_BBB 0x0001 /* USB wire protocol */ #defineUMASS_PROTO_CBI 0x0002 #defineUMASS_PROTO_CBI_I 0x0004 @@ -372,7 +373,7 @@ struct umass_devdescr { static const struct umass_devdescr umass_devdescr[] = { {USB_VENDOR_ASAHIOPTICAL, PID_WILDCARD, RID_WILDCARD, - UMASS_PROTO_ATAPI | UMASS_PROTO_CBI_I, + UMASS_PROTO_DEFAULT, RS_NO_CLEAR_UA }, {USB_VENDOR_ADDON, USB_PRODUCT_ADDON_ATTACHE, RID_WILDCARD, @@ -395,6 +396,10 @@ static const struct umass_devdescr umass UMASS_PROTO_SCSI | UMASS_PROTO_BBB, NO_QUIRKS }, + {USB_VENDOR_ALCOR, USB_PRODUCT_ALCOR_AU6390, RID_WILDCARD, + UMASS_PROTO_DEFAULT, + NO_SYNCHRONIZE_CACHE + }, {USB_VENDOR_ALCOR, USB_PRODUCT_ALCOR_UMCR_9361, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, NO_GETMAXLUN @@ -427,6 +432,10 @@ static const struct umass_devdescr umass UMASS_PROTO_SCSI | UMASS_PROTO_BBB, FORCE_SHORT_INQUIRY | NO_START_STOP | IGNORE_RESIDUE }, + {USB_VENDOR_CYPRESS, USB_PRODUCT_CYPRESS_XX6830XX, RID_WILDCARD, + UMASS_PROTO_DEFAULT, + NO_GETMAXLUN | NO_SYNCHRONIZE_CACHE + }, {USB_VENDOR_DESKNOTE, USB_PRODUCT_DESKNOTE_UCR_61S2B, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, NO_QUIRKS @@ -600,6 +609,10 @@ static const struct umass_devdescr umass UMASS_PROTO_SCSI | UMASS_PROTO_BBB, FORCE_SHORT_INQUIRY | NO_INQUIRY_EVPD | NO_GETMAXLUN }, + {USB_VENDOR_MPMAN, PID_WILDCARD, RID_WILDCARD, + UMASS_PROTO_DEFAULT, + NO_SYNCHRONIZE_CACHE + }, {USB_VENDOR_MSYSTEMS, USB_PRODUCT_MSYSTEMS_DISKONKEY, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, IGNORE_RESIDUE | NO_GETMAXLUN | RS_NO_CLEAR_UA @@ -609,11 +622,11 @@ static const struct umass_devdescr umass NO_QUIRKS }, {USB_VENDOR_MYSON, USB_PRODUCT_MYSON_HEDEN, RID_WILDCARD, - UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + UMASS_PROTO_DEFAULT, IGNORE_RESIDUE | NO_SYNCHRONIZE_CACHE }, {USB_VENDOR_MYSON, USB_PRODUCT_MYSON_STARREADER, RID_WILDCARD, - UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + UMASS_PROTO_DEFAULT, NO_SYNCHRONIZE_CACHE }, {USB_VENDOR_NEODIO, USB_PRODUCT_NEODIO_ND3260, RID_WILDCARD, @@ -849,7 +862,7 @@ static const struct umass_devdescr umass NO_QUIRKS }, {USB_VENDOR_SUPERTOP, USB_PRODUCT_SUPERTOP_IDE, RID_WILDCARD, - UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + UMASS_PROTO_DEFAULT, IGNORE_RESIDUE | NO_SYNCHRONIZE_CACHE }, {USB_VENDOR_TAUGA, USB_PRODUCT_TAUGA_CAMERAMATE, RID_WILDCARD, @@ -1281,6 +1294,58 @@ MODULE_DEPEND(umass, cam, 1, 1, 1); * USB device probe/attach/detach */ +static uint16_t +umass_get_proto(struct usb2_interface *iface) +{ + struct usb2_interface_descriptor *id; + uint16_t retval; + + retval = 0; + + /* Check for a standards compliant device */ + id = usb2_get_interface_descriptor(iface); + if ((id == NULL) || + (id->bInterfaceClass != UICLASS_MASS)) { + goto done; + } + switch (id->bInterfaceSubClass) { + case UISUBCLASS_SCSI: + retval |= UMASS_PROTO_SCSI; + break; + case UISUBCLASS_UFI: + retval |= UMASS_PROTO_UFI; + break; + case UISUBCLASS_RBC: + retval |= UMASS_PROTO_RBC; + break; + case UISUBCLASS_SFF8020I: + case UISUBCLASS_SFF8070I: + retval |= UMASS_PROTO_ATAPI; + break; + default: + retval = 0; + goto done; + } + + switch (id->bInterfaceProtocol) { + case UIPROTO_MASS_CBI: + retval |= UMASS_PROTO_CBI; +
svn commit: r192053 - head/sys/dev/usb/controller
Author: thompsa Date: Wed May 13 18:04:51 2009 New Revision: 192053 URL: http://svn.freebsd.org/changeset/base/192053 Log: Add debug lines for fullspeed and highspeed xfer completion. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/controller/ehci.c Modified: head/sys/dev/usb/controller/ehci.c == --- head/sys/dev/usb/controller/ehci.c Wed May 13 18:03:23 2009 (r192052) +++ head/sys/dev/usb/controller/ehci.c Wed May 13 18:04:51 2009 (r192053) @@ -2028,6 +2028,8 @@ ehci_isoc_fs_done(ehci_softc_t *sc, stru len = EHCI_SITD_GET_LEN(status); + DPRINTFN(2, "status=0x%08x, rem=%u\n", status, len); + if (*plen >= len) { len = *plen - len; } else { @@ -2081,6 +2083,8 @@ ehci_isoc_hs_done(ehci_softc_t *sc, stru len = EHCI_ITD_GET_LEN(status); + DPRINTFN(2, "status=0x%08x, len=%u\n", status, len); + if (*plen >= len) { /* * The length is valid. NOTE: The complete ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192054 - head/sys/dev/usb
Author: thompsa Date: Wed May 13 18:05:40 2009 New Revision: 192054 URL: http://svn.freebsd.org/changeset/base/192054 Log: Check the correct variable for IO_NDELAY. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_dev.c Modified: head/sys/dev/usb/usb_dev.c == --- head/sys/dev/usb/usb_dev.c Wed May 13 18:04:51 2009(r192053) +++ head/sys/dev/usb/usb_dev.c Wed May 13 18:05:40 2009(r192054) @@ -1203,7 +1203,7 @@ usb2_read(struct cdev *dev, struct uio * (f->methods->f_start_read) (f); - if (fflags & IO_NDELAY) { + if (ioflag & IO_NDELAY) { if (tr_data) { /* return length before error */ break; @@ -1326,7 +1326,7 @@ usb2_write(struct cdev *dev, struct uio if (m == NULL) { - if (fflags & IO_NDELAY) { + if (ioflag & IO_NDELAY) { if (tr_data) { /* return length before error */ break; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192055 - head/sys/dev/usb
Author: thompsa Date: Wed May 13 18:06:52 2009 New Revision: 192055 URL: http://svn.freebsd.org/changeset/base/192055 Log: Make sure collections have the usage field set. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_hid.c Modified: head/sys/dev/usb/usb_hid.c == --- head/sys/dev/usb/usb_hid.c Wed May 13 18:05:40 2009(r192054) +++ head/sys/dev/usb/usb_hid.c Wed May 13 18:06:52 2009(r192055) @@ -309,6 +309,7 @@ hid_get_item(struct hid_data *s, struct c->kind = hid_collection; c->collection = dval; c->collevel++; + c->usage = s->usage_last; *h = *c; return (1); case 11:/* Feature */ @@ -408,6 +409,9 @@ hid_get_item(struct hid_data *s, struct if (bSize != 4) dval = (dval & mask) | c->_usage_page; + /* set last usage, in case of a collection */ + s->usage_last = dval; + if (s->nusage < MAXUSAGE) { s->usages_min[s->nusage] = dval; s->usages_max[s->nusage] = dval; @@ -630,9 +634,11 @@ hid_is_collection(const void *desc, usb2 if (hd == NULL) return (0); - err = hid_get_item(hd, &hi) && - hi.kind == hid_collection && - hi.usage == usage; + while ((err = hid_get_item(hd, &hi))) { +if (hi.kind == hid_collection && +hi.usage == usage) + break; + } hid_end_parse(hd); return (err); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192056 - head/sys/dev/usb
Author: thompsa Date: Wed May 13 18:25:14 2009 New Revision: 192056 URL: http://svn.freebsd.org/changeset/base/192056 Log: Add parenthesis around the xfer macro argument. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_core.h Modified: head/sys/dev/usb/usb_core.h == --- head/sys/dev/usb/usb_core.h Wed May 13 18:06:52 2009(r192055) +++ head/sys/dev/usb/usb_core.h Wed May 13 18:25:14 2009(r192056) @@ -233,9 +233,9 @@ * The following macro will tell if an USB transfer is currently * receiving or transferring data. */ -#defineUSB_GET_DATA_ISREAD(xfer) (((xfer)->flags_int.usb2_mode == \ - USB_MODE_DEVICE) ? ((xfer->endpoint & UE_DIR_IN) ? 0 : 1) : \ - ((xfer->endpoint & UE_DIR_IN) ? 1 : 0)) +#defineUSB_GET_DATA_ISREAD(xfer) ((xfer)->flags_int.usb2_mode == \ + USB_MODE_DEVICE ? (((xfer)->endpoint & UE_DIR_IN) ? 0 : 1) : \ + (((xfer)->endpoint & UE_DIR_IN) ? 1 : 0)) /* * The following macros are used used to convert milliseconds into ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192057 - head/sys/dev/usb/storage
Author: thompsa Date: Wed May 13 18:26:55 2009 New Revision: 192057 URL: http://svn.freebsd.org/changeset/base/192057 Log: Ensure the bmRequestType is the right type for the incoming control request. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/storage/ustorage_fs.c Modified: head/sys/dev/usb/storage/ustorage_fs.c == --- head/sys/dev/usb/storage/ustorage_fs.c Wed May 13 18:25:14 2009 (r192056) +++ head/sys/dev/usb/storage/ustorage_fs.c Wed May 13 18:26:55 2009 (r192057) @@ -466,7 +466,8 @@ ustorage_fs_handle_request(device_t dev, const struct usb2_device_request *req = preq; if (!is_complete) { - if (req->bRequest == UR_BBB_RESET) { + if ((req->bmRequestType == UT_WRITE_CLASS_INTERFACE) && + (req->bRequest == UR_BBB_RESET)) { *plen = 0; mtx_lock(&sc->sc_mtx); ustorage_fs_transfer_stop(sc); @@ -475,7 +476,8 @@ ustorage_fs_handle_request(device_t dev, USTORAGE_FS_T_BBB_COMMAND); mtx_unlock(&sc->sc_mtx); return (0); - } else if (req->bRequest == UR_BBB_GET_MAX_LUN) { + } else if ((req->bmRequestType == UT_READ_CLASS_INTERFACE) && + (req->bRequest == UR_BBB_GET_MAX_LUN)) { if (offset == 0) { *plen = 1; *pptr = &sc->sc_last_lun; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192058 - head/sys/dev/flash
Author: gonzo Date: Wed May 13 18:31:28 2009 New Revision: 192058 URL: http://svn.freebsd.org/changeset/base/192058 Log: - Remove nonexistent header file from includes list Modified: head/sys/dev/flash/at45d.c Modified: head/sys/dev/flash/at45d.c == --- head/sys/dev/flash/at45d.c Wed May 13 18:26:55 2009(r192057) +++ head/sys/dev/flash/at45d.c Wed May 13 18:31:28 2009(r192058) @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192059 - in head/sys: arm/at91 dev/spibus
Author: gonzo Date: Wed May 13 18:42:49 2009 New Revision: 192059 URL: http://svn.freebsd.org/changeset/base/192059 Log: - Make SPI bus bridge be non-arch dependent by using more generic name Reviewed by: imp Modified: head/sys/arm/at91/at91_spi.c head/sys/dev/spibus/spibus.c Modified: head/sys/arm/at91/at91_spi.c == --- head/sys/arm/at91/at91_spi.cWed May 13 18:31:28 2009 (r192058) +++ head/sys/arm/at91/at91_spi.cWed May 13 18:42:49 2009 (r192059) @@ -297,7 +297,7 @@ static device_method_t at91_spi_methods[ }; static driver_t at91_spi_driver = { - "at91_spi", + "spi", at91_spi_methods, sizeof(struct at91_spi_softc), }; Modified: head/sys/dev/spibus/spibus.c == --- head/sys/dev/spibus/spibus.cWed May 13 18:31:28 2009 (r192058) +++ head/sys/dev/spibus/spibus.cWed May 13 18:42:49 2009 (r192059) @@ -194,5 +194,5 @@ static driver_t spibus_driver = { devclass_t spibus_devclass; -DRIVER_MODULE(spibus, at91_spi, spibus_driver, spibus_devclass, 0, 0); +DRIVER_MODULE(spibus, spi, spibus_driver, spibus_devclass, 0, 0); MODULE_VERSION(spibus, 1); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192060 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/isp
Author: marius Date: Wed May 13 19:26:04 2009 New Revision: 192060 URL: http://svn.freebsd.org/changeset/base/192060 Log: MFC: r191979 Change uses of the struct ccb_hdr timeout_ch missed when isp(4) was adapted to MPSAFE cam(4) to a isp(4) specific callout structure. Thanks to Florian Smeets for providing access to a machine exhibiting this problem for debugging. Approved by: mjacob Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/isp/isp_freebsd.c Modified: stable/7/sys/dev/isp/isp_freebsd.c == --- stable/7/sys/dev/isp/isp_freebsd.c Wed May 13 18:42:49 2009 (r192059) +++ stable/7/sys/dev/isp/isp_freebsd.c Wed May 13 19:26:04 2009 (r192060) @@ -1988,7 +1988,8 @@ isp_watchdog_work(ispsoftc_t *isp, XS_T isp_done(xs); } else { XS_CMD_C_WDOG(xs); - xs->ccb_h.timeout_ch = timeout(isp_watchdog, xs, hz); + callout_reset(&PISP_PCMD((union ccb *)xs)->wdog, hz, + isp_watchdog, xs); XS_CMD_S_GRACE(xs); isp->isp_sendmarker |= 1 << XS_CHANNEL(xs); } @@ -3004,7 +3005,7 @@ isp_done(struct ccb_scsiio *sccb) XS_CMD_S_DONE(sccb); if (XS_CMD_WDOG_P(sccb) == 0) { - untimeout(isp_watchdog, sccb, sccb->ccb_h.timeout_ch); + callout_stop(&PISP_PCMD(sccb)->wdog); if (XS_CMD_GRACE_P(sccb)) { isp_prt(isp, ISP_LOGDEBUG2, "finished command on borrowed time"); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192061 - in stable/6/sys: . contrib/pf dev/cxgb dev/isp
Author: marius Date: Wed May 13 19:26:19 2009 New Revision: 192061 URL: http://svn.freebsd.org/changeset/base/192061 Log: MFC: r191979 Change uses of the struct ccb_hdr timeout_ch missed when isp(4) was adapted to MPSAFE cam(4) to a isp(4) specific callout structure. Thanks to Florian Smeets for providing access to a machine exhibiting this problem for debugging. Approved by: mjacob Modified: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) stable/6/sys/dev/isp/isp_freebsd.c Modified: stable/6/sys/dev/isp/isp_freebsd.c == --- stable/6/sys/dev/isp/isp_freebsd.c Wed May 13 19:26:04 2009 (r192060) +++ stable/6/sys/dev/isp/isp_freebsd.c Wed May 13 19:26:19 2009 (r192061) @@ -2075,7 +2075,8 @@ isp_watchdog_work(ispsoftc_t *isp, XS_T isp_done(xs); } else { XS_CMD_C_WDOG(xs); - xs->ccb_h.timeout_ch = timeout(isp_watchdog, xs, hz); + callout_reset(&PISP_PCMD((union ccb *)xs)->wdog, hz, + isp_watchdog, xs); XS_CMD_S_GRACE(xs); isp->isp_sendmarker |= 1 << XS_CHANNEL(xs); } @@ -3091,7 +3092,7 @@ isp_done(struct ccb_scsiio *sccb) XS_CMD_S_DONE(sccb); if (XS_CMD_WDOG_P(sccb) == 0) { - untimeout(isp_watchdog, sccb, sccb->ccb_h.timeout_ch); + callout_stop(&PISP_PCMD(sccb)->wdog); if (XS_CMD_GRACE_P(sccb)) { isp_prt(isp, ISP_LOGDEBUG2, "finished command on borrowed time"); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192062 - head/sys/dev/snp
Author: ed Date: Wed May 13 19:29:50 2009 New Revision: 192062 URL: http://svn.freebsd.org/changeset/base/192062 Log: Keep this line shorter than 80 columns. Modified: head/sys/dev/snp/snp.c Modified: head/sys/dev/snp/snp.c == --- head/sys/dev/snp/snp.c Wed May 13 19:26:19 2009(r192061) +++ head/sys/dev/snp/snp.c Wed May 13 19:29:50 2009(r192062) @@ -257,8 +257,8 @@ snp_ioctl(struct cdev *dev, u_long cmd, SNP_UNLOCK(); return (EBUSY); } - error = ttyhook_register(&ss->snp_tty, td->td_proc, *(int *)data, - &snp_hook, ss); + error = ttyhook_register(&ss->snp_tty, td->td_proc, + *(int *)data, &snp_hook, ss); SNP_UNLOCK(); if (error != 0) return (error); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r192059 - in head/sys: arm/at91 dev/spibus
On Wed, 13 May 2009 18:42:49 + (UTC) Oleksandr Tymoshenko mentioned: > Author: gonzo > Date: Wed May 13 18:42:49 2009 > New Revision: 192059 > URL: http://svn.freebsd.org/changeset/base/192059 > > Log: > - Make SPI bus bridge be non-arch dependent by using more generic > name > > Reviewed by:imp > > Modified: > head/sys/arm/at91/at91_spi.c > head/sys/dev/spibus/spibus.c > > Modified: head/sys/arm/at91/at91_spi.c > == > --- head/sys/arm/at91/at91_spi.c Wed May 13 18:31:28 2009 > (r192058) > +++ head/sys/arm/at91/at91_spi.c Wed May 13 18:42:49 2009 > (r192059) > @@ -297,7 +297,7 @@ static device_method_t at91_spi_methods[ > }; > > static driver_t at91_spi_driver = { > - "at91_spi", > + "spi", > at91_spi_methods, > sizeof(struct at91_spi_softc), > }; > > Modified: head/sys/dev/spibus/spibus.c > == > --- head/sys/dev/spibus/spibus.c Wed May 13 18:31:28 2009 > (r192058) > +++ head/sys/dev/spibus/spibus.c Wed May 13 18:42:49 2009 > (r192059) > @@ -194,5 +194,5 @@ static driver_t spibus_driver = { > > devclass_t spibus_devclass; > > -DRIVER_MODULE(spibus, at91_spi, spibus_driver, spibus_devclass, 0, 0); > +DRIVER_MODULE(spibus, spi, spibus_driver, spibus_devclass, 0, 0); > MODULE_VERSION(spibus, 1); > On the other hand this driver appears to be machine-specific. What if one would like to have a kernel with several SPI bus drivers included for devices that doesn't support enumeration? In this case it will be impossible to diffirentiate these drivers in the hints file. -- Stanislav Sedov ST4096-RIPE !DSPAM:4a0b2cba994296549215293! ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192063 - head/sys/arm/at91
Author: stas Date: Wed May 13 20:29:53 2009 New Revision: 192063 URL: http://svn.freebsd.org/changeset/base/192063 Log: - Style(9) and consistency nitpicking. Reviewed by: imp Modified: head/sys/arm/at91/if_ate.c Modified: head/sys/arm/at91/if_ate.c == --- head/sys/arm/at91/if_ate.c Wed May 13 19:29:50 2009(r192062) +++ head/sys/arm/at91/if_ate.c Wed May 13 20:29:53 2009(r192063) @@ -69,8 +69,8 @@ __FBSDID("$FreeBSD$"); #include "miibus_if.h" -#define ATE_MAX_TX_BUFFERS 2 /* We have ping-pong tx buffers */ -#define ATE_MAX_RX_BUFFERS 64 +#defineATE_MAX_TX_BUFFERS 2 /* We have ping-pong tx buffers */ +#defineATE_MAX_RX_BUFFERS 64 /* * Driver-specific flags. @@ -80,41 +80,43 @@ __FBSDID("$FreeBSD$"); struct ate_softc { - struct ifnet *ifp; /* ifnet pointer */ - struct mtx sc_mtx; /* basically a perimeter lock */ - device_t dev; /* Myself */ - device_t miibus;/* My child miibus */ - void *intrhand; /* Interrupt handle */ - struct resource *irq_res; /* IRQ resource */ + struct ifnet*ifp; /* ifnet pointer */ + struct mtx sc_mtx; /* Basically a perimeter lock */ + device_tdev;/* Myself */ + device_tmiibus; /* My child miibus */ + struct resource *irq_res; /* IRQ resource */ struct resource *mem_res; /* Memory resource */ - struct callout tick_ch; /* Tick callout */ - bus_dma_tag_t mtag; /* bus dma tag for mbufs */ - bus_dmamap_t tx_map[ATE_MAX_TX_BUFFERS]; - struct mbuf *sent_mbuf[ATE_MAX_TX_BUFFERS]; /* Sent mbufs */ - bus_dma_tag_t rxtag; - bus_dmamap_t rx_map[ATE_MAX_RX_BUFFERS]; - void *rx_buf[ATE_MAX_RX_BUFFERS]; /* RX buffer space */ - int rx_buf_ptr; - bus_dma_tag_t rx_desc_tag; - bus_dmamap_t rx_desc_map; - int txcur; /* current tx map pointer */ - bus_addr_t rx_desc_phys; - eth_rx_desc_t *rx_descs; - int use_rmii; - struct ifmib_iso_8802_3 mibdata; /* stuff for network mgmt */ - int flags; - int if_flags; + struct callout tick_ch;/* Tick callout */ + struct ifmib_iso_8802_3 mibdata; /* Stuff for network mgmt */ + struct mbuf *sent_mbuf[ATE_MAX_TX_BUFFERS]; /* Sent mbufs */ + bus_dma_tag_t mtag; /* bus dma tag for mbufs */ + bus_dma_tag_t rxtag; + bus_dma_tag_t rx_desc_tag; + bus_dmamap_trx_desc_map; + bus_dmamap_trx_map[ATE_MAX_RX_BUFFERS]; + bus_dmamap_ttx_map[ATE_MAX_TX_BUFFERS]; + bus_addr_t rx_desc_phys; + eth_rx_desc_t *rx_descs; + void*rx_buf[ATE_MAX_RX_BUFFERS]; /* RX buffer space */ + void*intrhand; /* Interrupt handle */ + int flags; + int if_flags; + int rx_buf_ptr; + int txcur; /* Current TX map pointer */ + int use_rmii; }; static inline uint32_t RD4(struct ate_softc *sc, bus_size_t off) { - return bus_read_4(sc->mem_res, off); + + return (bus_read_4(sc->mem_res, off)); } static inline void WR4(struct ate_softc *sc, bus_size_t off, uint32_t val) { + bus_write_4(sc->mem_res, off, val); } @@ -125,41 +127,45 @@ BARRIER(struct ate_softc *sc, bus_size_t bus_barrier(sc->mem_res, off, len, flags); } -#define ATE_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#defineATE_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #defineATE_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) -#define ATE_LOCK_INIT(_sc) \ - mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->dev), \ +#defineATE_LOCK_INIT(_sc) \ + mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->dev), \ MTX_NETWORK_LOCK, MTX_DEF) -#define ATE_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); -#define ATE_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); -#define ATE_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); +#defineATE_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); +#defineATE_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); +#defineATE_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); static devclass_t ate_devclass; -/* ifnet entry points */ +/* + * ifnet entry points. + */ +static voidateinit_locked(void *); +static voidatestart_locked(struct ifnet *); + +static voidateinit(void *); +static voidatestart(struct ifnet *); +static voidatestop(struct ate_softc *); +static int ateioctl(struct ifnet * ifp, u_long, caddr_t); -static void ateinit_locked(void *);
svn commit: r192064 - head/sys/arm/at91
Author: stas Date: Wed May 13 21:01:10 2009 New Revision: 192064 URL: http://svn.freebsd.org/changeset/base/192064 Log: - Set MAC address in ateinit, so it can be changed later. Modified: head/sys/arm/at91/if_ate.c Modified: head/sys/arm/at91/if_ate.c == --- head/sys/arm/at91/if_ate.c Wed May 13 20:29:53 2009(r192063) +++ head/sys/arm/at91/if_ate.c Wed May 13 21:01:10 2009(r192064) @@ -256,7 +256,6 @@ ate_attach(device_t dev) eaddr[4] = (rnd >> 8) & 0xff; eaddr[5] = rnd & 0xff; } - ate_set_mac(sc, eaddr); sc->ifp = ifp = if_alloc(IFT_ETHER); if (mii_phy_probe(dev, &sc->miibus, ate_ifmedia_upd, ate_ifmedia_sts)) { @@ -841,6 +840,7 @@ ateinit_locked(void *xsc) struct ate_softc *sc = xsc; struct ifnet *ifp = sc->ifp; struct mii_data *mii; + uint8_t eaddr[ETHER_ADDR_LEN]; uint32_t reg; ATE_ASSERT_LOCKED(sc); @@ -870,17 +870,16 @@ ateinit_locked(void *xsc) ate_rxfilter(sc); /* -* Turn on MACs and interrupt processing. +* Set the chip MAC address. */ - WR4(sc, ETH_CTL, RD4(sc, ETH_CTL) | ETH_CTL_TE | ETH_CTL_RE); - WR4(sc, ETH_IER, ETH_ISR_RCOM | ETH_ISR_TCOM | ETH_ISR_RBNA); + bcopy(IF_LLADDR(ifp), eaddr, ETHER_ADDR_LEN); + ate_set_mac(sc, eaddr); /* -* Boot loader fills in MAC address. If that's not the case, then -* we should set SA1L and SA1H here to the appropriate value. Note: -* the byte order is big endian, not little endian, so we have some -* swapping to do. Again, if we need it (which I don't think we do). +* Turn on MACs and interrupt processing. */ + WR4(sc, ETH_CTL, RD4(sc, ETH_CTL) | ETH_CTL_TE | ETH_CTL_RE); + WR4(sc, ETH_IER, ETH_ISR_RCOM | ETH_ISR_TCOM | ETH_ISR_RBNA); /* Enable big packets. */ WR4(sc, ETH_CFG, RD4(sc, ETH_CFG) | ETH_CFG_BIG); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192065 - head/sys/fs/nfsclient
Author: rmacklem Date: Wed May 13 21:18:34 2009 New Revision: 192065 URL: http://svn.freebsd.org/changeset/base/192065 Log: Apply a one line change to nfs_clbio.c (which is largely a copy of sys/nfsclient/nfs_bio.c) to track the change recently committed by acl for nfs_bio.c. Approved by: kib (mentor) Modified: head/sys/fs/nfsclient/nfs_clbio.c Modified: head/sys/fs/nfsclient/nfs_clbio.c == --- head/sys/fs/nfsclient/nfs_clbio.c Wed May 13 21:01:10 2009 (r192064) +++ head/sys/fs/nfsclient/nfs_clbio.c Wed May 13 21:18:34 2009 (r192065) @@ -306,7 +306,8 @@ ncl_getpages(struct vop_getpages_args *a * Read operation filled an entire page */ m->valid = VM_PAGE_BITS_ALL; - vm_page_undirty(m); + KASSERT(m->dirty == 0, + ("nfs_getpages: page %p is dirty", m)); } else if (size > toff) { /* * Read operation filled a partial page. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192066 - head/sys/dev/aic
Author: des Date: Wed May 13 22:31:25 2009 New Revision: 192066 URL: http://svn.freebsd.org/changeset/base/192066 Log: Snip redundant assignment. Approved by: scottl MFC after:2 weeks Coverity ID: 3863 Modified: head/sys/dev/aic/aic.c Modified: head/sys/dev/aic/aic.c == --- head/sys/dev/aic/aic.c Wed May 13 21:18:34 2009(r192065) +++ head/sys/dev/aic/aic.c Wed May 13 22:31:25 2009(r192066) @@ -168,7 +168,7 @@ aic_action(struct cam_sim *sim, union cc } case XPT_SET_TRAN_SETTINGS: { - struct ccb_trans_settings *cts = cts = &ccb->cts; + struct ccb_trans_settings *cts = &ccb->cts; struct aic_tinfo *ti = &aic->tinfo[ccb->ccb_h.target_id]; struct ccb_trans_settings_scsi *scsi = &cts->proto_specific.scsi; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192067 - in head/sys: conf powerpc/aim powerpc/booke powerpc/include powerpc/powerpc
Author: nwhitehorn Date: Thu May 14 00:34:26 2009 New Revision: 192067 URL: http://svn.freebsd.org/changeset/base/192067 Log: Factor out platform dependent things unrelated to device drivers into a new platform module. These are probed in early boot, and have the responsibility of determining the layout of physical memory, determining the CPU timebase frequency, and handling the zoo of SMP mechanisms found on PowerPC. Reviewed by: marcel, raj Book-E parts by: raj Added: head/sys/powerpc/aim/platform_chrp.c (contents, props changed) head/sys/powerpc/booke/platform_bare.c (contents, props changed) head/sys/powerpc/include/platform.h - copied, changed from r192066, head/sys/powerpc/include/powerpc.h head/sys/powerpc/include/platformvar.h (contents, props changed) head/sys/powerpc/powerpc/platform.c (contents, props changed) head/sys/powerpc/powerpc/platform_if.m (contents, props changed) Deleted: head/sys/powerpc/include/powerpc.h Modified: head/sys/conf/files.powerpc head/sys/powerpc/aim/clock.c head/sys/powerpc/aim/machdep.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/aim/mp_cpudep.c head/sys/powerpc/aim/ofw_machdep.c head/sys/powerpc/aim/vm_machdep.c head/sys/powerpc/booke/clock.c head/sys/powerpc/booke/machdep.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/booke/vm_machdep.c head/sys/powerpc/include/md_var.h head/sys/powerpc/include/ofw_machdep.h head/sys/powerpc/include/pmap.h head/sys/powerpc/include/smp.h head/sys/powerpc/include/spr.h head/sys/powerpc/powerpc/mp_machdep.c head/sys/powerpc/powerpc/pmap_dispatch.c Modified: head/sys/conf/files.powerpc == --- head/sys/conf/files.powerpc Wed May 13 22:31:25 2009(r192066) +++ head/sys/conf/files.powerpc Thu May 14 00:34:26 2009(r192067) @@ -81,6 +81,7 @@ powerpc/aim/mp_cpudep.c optionalaim sm powerpc/aim/nexus.coptionalaim powerpc/aim/ofw_machdep.c optionalaim powerpc/aim/ofwmagic.S optionalaim +powerpc/aim/platform_chrp.coptionalaim powerpc/aim/swtch.Soptionalaim powerpc/aim/trap.c optionalaim powerpc/aim/uma_machdep.c optionalaim @@ -90,6 +91,7 @@ powerpc/booke/copyinout.c optionale500 powerpc/booke/interrupt.c optionale500 powerpc/booke/locore.S optionale500 no-obj powerpc/booke/machdep.coptionale500 +powerpc/booke/platform_bare.c optionalmpc85xx powerpc/booke/pmap.c optionale500 powerpc/booke/swtch.S optionale500 powerpc/booke/trap.c optionale500 @@ -155,6 +157,8 @@ powerpc/powerpc/mp_machdep.coptionalsm powerpc/powerpc/openpic.c standard powerpc/powerpc/pic_if.m standard powerpc/powerpc/pmap_dispatch.cstandard +powerpc/powerpc/platform.c standard +powerpc/powerpc/platform_if.m standard powerpc/powerpc/sc_machdep.c optionalsc powerpc/powerpc/setjmp.S standard powerpc/powerpc/sigcode.S standard Modified: head/sys/powerpc/aim/clock.c == --- head/sys/powerpc/aim/clock.cWed May 13 22:31:25 2009 (r192066) +++ head/sys/powerpc/aim/clock.cThu May 14 00:34:26 2009 (r192067) @@ -125,44 +125,27 @@ decr_intr(struct trapframe *frame) void decr_init(void) { - int qhandle, phandle; - char name[32]; - unsigned int msr; - - phandle = 0; + struct cpuref cpu; + register_t msr; /* -* Get this info during autoconf? XXX +* Check the BSP's timebase frequency. Sometimes we can't find the BSP, so fall +* back to the first CPU in this case. */ - for (qhandle = OF_peer(0); qhandle; qhandle = phandle) { - if (OF_getprop(qhandle, "device_type", name, sizeof name) >= 0 - && !strcmp(name, "cpu") - && OF_getprop(qhandle, "timebase-frequency", - &ticks_per_sec, sizeof ticks_per_sec) >= 0) { - /* -* Should check for correct CPU here? XXX -*/ - msr = mfmsr(); - mtmsr(msr & ~PSL_EE); - - ns_per_tick = 10 / ticks_per_sec; - ticks_per_intr = ticks_per_sec / hz; - mtdec(ticks_per_intr); - - mtmsr(msr); - - break; - } - if ((phandle = OF_child(qhandle))) - continue; - while (qhandle) { - if ((phandle = OF_peer(qhan
svn commit: r192068 - in stable/7: etc etc/mtree etc/rc.d gnu/usr.bin/man gnu/usr.bin/man/man
Author: des Date: Thu May 14 01:35:43 2009 New Revision: 192068 URL: http://svn.freebsd.org/changeset/base/192068 Log: MFC r183696, r183698: enable UTF-8 for man pages. Modified: stable/7/etc/ (props changed) stable/7/etc/Makefile stable/7/etc/mtree/BSD.usr.dist stable/7/etc/rc.d/ (props changed) stable/7/gnu/usr.bin/man/ (props changed) stable/7/gnu/usr.bin/man/man/man.c Modified: stable/7/etc/Makefile == --- stable/7/etc/Makefile Thu May 14 00:34:26 2009(r192067) +++ stable/7/etc/Makefile Thu May 14 01:35:43 2009(r192068) @@ -261,6 +261,7 @@ distrib-dirs: .endif cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* . + cd ${DESTDIR}/usr/share/man/en.UTF-8; ln -sf ../man* . cd ${DESTDIR}/usr/share/man; \ set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \ while [ $$# -gt 0 ] ; \ Modified: stable/7/etc/mtree/BSD.usr.dist == --- stable/7/etc/mtree/BSD.usr.dist Thu May 14 00:34:26 2009 (r192067) +++ stable/7/etc/mtree/BSD.usr.dist Thu May 14 01:35:43 2009 (r192068) @@ -752,6 +752,46 @@ cat9 .. .. +en.UTF-8uname=root +cat1 +.. +cat1aout +.. +cat2 +.. +cat3 +.. +cat4 +amd64 +.. +arm +.. +i386 +.. +powerpc +.. +sparc64 +.. +.. +cat5 +.. +cat6 +.. +cat7 +.. +cat8 +amd64 +.. +i386 +.. +powerpc +.. +sparc64 +.. +.. +cat9 +.. +.. ja uname=root cat1 .. Modified: stable/7/gnu/usr.bin/man/man/man.c == --- stable/7/gnu/usr.bin/man/man/man.c Thu May 14 00:34:26 2009 (r192067) +++ stable/7/gnu/usr.bin/man/man/man.c Thu May 14 01:35:43 2009 (r192068) @@ -105,6 +105,7 @@ static struct ltable ltable[] = { {"KOI8-R", "koi8-r"}, {"ISO8859-1", "latin1"}, {"ISO8859-15", "latin1"}, + {"UTF-8", "utf8"}, {NULL} }; #endif ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192069 - stable/7/lib/libutil
Author: des Date: Thu May 14 01:38:06 2009 New Revision: 192069 URL: http://svn.freebsd.org/changeset/base/192069 Log: MFC r184633, r184635, r184683: WARNS cleanup Modified: stable/7/lib/libutil/ (props changed) stable/7/lib/libutil/Makefile stable/7/lib/libutil/login_cap.c stable/7/lib/libutil/login_class.c stable/7/lib/libutil/realhostname.c Modified: stable/7/lib/libutil/Makefile == --- stable/7/lib/libutil/Makefile Thu May 14 01:35:43 2009 (r192068) +++ stable/7/lib/libutil/Makefile Thu May 14 01:38:06 2009 (r192069) @@ -16,6 +16,8 @@ SRCS= _secure_path.c auth.c gr_util.c ex stub.c trimdomain.c uucplock.c INCS= libutil.h login_cap.h +WARNS?=6 + CFLAGS+= -DLIBC_SCCS .if ${MK_INET6_SUPPORT} != "no" Modified: stable/7/lib/libutil/login_cap.c == --- stable/7/lib/libutil/login_cap.cThu May 14 01:35:43 2009 (r192068) +++ stable/7/lib/libutil/login_cap.cThu May 14 01:38:06 2009 (r192069) @@ -61,6 +61,8 @@ static char * internal_string = NULL; static size_t internal_arraysz = 0; static const char ** internal_array = NULL; +static char path_login_conf[] = _PATH_LOGIN_CONF; + static char * allocstr(const char *str) { @@ -215,15 +217,14 @@ login_getclassbyname(char const *name, c if (dir && snprintf(userpath, MAXPATHLEN, "%s/%s", dir, _FILE_LOGIN_CONF) < MAXPATHLEN) { - login_dbarray[i] = userpath; if (_secure_path(userpath, pwd->pw_uid, pwd->pw_gid) != -1) - i++;/* only use 'secure' data */ + login_dbarray[i++] = userpath; } /* * XXX: Why to add the system database if the class is `me'? */ - if (_secure_path(_PATH_LOGIN_CONF, 0, 0) != -1) - login_dbarray[i++] = _PATH_LOGIN_CONF; + if (_secure_path(path_login_conf, 0, 0) != -1) + login_dbarray[i++] = path_login_conf; login_dbarray[i] = NULL; memset(lc, 0, sizeof(login_cap_t)); Modified: stable/7/lib/libutil/login_class.c == --- stable/7/lib/libutil/login_class.c Thu May 14 01:35:43 2009 (r192068) +++ stable/7/lib/libutil/login_class.c Thu May 14 01:38:06 2009 (r192069) @@ -137,14 +137,13 @@ substvar(const char * var, const struct int tildes = 0; int dollas = 0; char*p; + const char *q; if (pwd != NULL) { - /* Count the number of ~'s in var to substitute */ - for (p = (char *)var; (p = strchr(p, '~')) != NULL; p++) - ++tildes; - /* Count the number of $'s in var to substitute */ - for (p = (char *)var; (p = strchr(p, '$')) != NULL; p++) - ++dollas; + for (q = var; *q != '\0'; ++q) { + tildes += (*q == '~'); + dollas += (*q == '$'); + } } np = malloc(strlen(var) + (dollas * nlen) Modified: stable/7/lib/libutil/realhostname.c == --- stable/7/lib/libutil/realhostname.c Thu May 14 01:35:43 2009 (r192068) +++ stable/7/lib/libutil/realhostname.c Thu May 14 01:38:06 2009 (r192069) @@ -84,6 +84,18 @@ realhostname(char *host, size_t hsize, c return result; } +/* + * struct sockaddr has very lax alignment requirements, since all its + * members are char or equivalent. This is a problem when trying to + * dereference a struct sockaddr_in6 * that was passed in as a struct + * sockaddr *. Although we know (or trust) that the passed-in struct was + * properly aligned, the compiler doesn't, and (rightly) complains. These + * macros perform the cast in a way that the compiler will accept. + */ +#define SOCKADDR_IN6(p) ((struct sockaddr_in6 *)(void *)(p)) +#define SOCKADDR_IN(p) ((struct sockaddr_in *)(void *)(p)) +#define SOCKINET(p) ((struct sockinet *)(void *)(p)) + int realhostname_sa(char *host, size_t hsize, struct sockaddr *addr, int addrlen) { @@ -97,10 +109,10 @@ realhostname_sa(char *host, size_t hsize /* IPv4 mapped IPv6 addr consideraton, specified in rfc2373. */ if (addr->sa_family == AF_INET6 && addrlen == sizeof(struct sockaddr_in6) && - IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)addr)->sin6_addr)) { + IN6_IS_ADDR_V4MAPPED(&SOCKADDR_IN6(addr)->sin6_addr)) { struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)addr; + sin6 = SOCKADDR_IN6(addr); memset(&lsin, 0, sizeof(lsin)); lsin.sin_len = sizeof(struct sockaddr_in); @@ -143,15 +155,16 @@ realhostname_sa(char *host, size_t hsize }
svn commit: r192070 - stable/7/libexec/rpc.rquotad
Author: des Date: Thu May 14 01:40:36 2009 New Revision: 192070 URL: http://svn.freebsd.org/changeset/base/192070 Log: MFC r184638: style and WARNS cleanup Modified: stable/7/libexec/rpc.rquotad/ (props changed) stable/7/libexec/rpc.rquotad/Makefile stable/7/libexec/rpc.rquotad/rquotad.c Modified: stable/7/libexec/rpc.rquotad/Makefile == --- stable/7/libexec/rpc.rquotad/Makefile Thu May 14 01:38:06 2009 (r192069) +++ stable/7/libexec/rpc.rquotad/Makefile Thu May 14 01:40:36 2009 (r192070) @@ -4,6 +4,8 @@ PROG = rpc.rquotad SRCS = rquotad.c MAN = rpc.rquotad.8 +WARNS ?= 6 + DPADD= ${LIBRPCSVC} LDADD= -lrpcsvc Modified: stable/7/libexec/rpc.rquotad/rquotad.c == --- stable/7/libexec/rpc.rquotad/rquotad.c Thu May 14 01:38:06 2009 (r192069) +++ stable/7/libexec/rpc.rquotad/rquotad.c Thu May 14 01:40:36 2009 (r192070) @@ -1,39 +1,35 @@ /* * by Manuel Bouyer (bou...@ensta.fr) - * + * * There is no copyright, you can use it as you want. */ -#ifndef lint -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ +#include +__FBSDID("$FreeBSD$"); #include -#include #include #include #include #include -#include + +#include +#include +#include +#include +#include #include #include #include #include #include +#include #include #include #include -#include - #include - -#include -#include -#include -#include -#include +#include void rquota_service(struct svc_req *request, SVCXPRT *transp); void sendquota(struct svc_req *request, SVCXPRT *transp); @@ -56,15 +52,17 @@ struct fs_stat *fs_begin = NULL; int from_inetd = 1; -void +static void cleanup(int sig) { + + (void) sig; (void) rpcb_unset(RQUOTAPROG, RQUOTAVERS, NULL); exit(0); } int -main(int argc, char *argv[]) +main(void) { SVCXPRT *transp; int ok; @@ -101,19 +99,22 @@ main(int argc, char *argv[]) ok = svc_create(rquota_service, RQUOTAPROG, RQUOTAVERS, "udp"); if (!ok) { - syslog(LOG_ERR, "unable to register (RQUOTAPROG, RQUOTAVERS, %s)", (!from_inetd)?"udp":"(inetd)"); + syslog(LOG_ERR, + "unable to register (RQUOTAPROG, RQUOTAVERS, %s)", + from_inetd ? "(inetd)" : "udp"); exit(1); } - initfs(); /* init the fs_stat list */ + initfs(); svc_run(); syslog(LOG_ERR, "svc_run returned"); exit(1); } -void +void rquota_service(struct svc_req *request, SVCXPRT *transp) { + switch (request->rq_proc) { case NULLPROC: (void)svc_sendreply(transp, (xdrproc_t)xdr_void, (char *)NULL); @@ -133,7 +134,7 @@ rquota_service(struct svc_req *request, } /* read quota for the specified id, and send it */ -void +void sendquota(struct svc_req *request, SVCXPRT *transp) { struct getquota_args getq_args; @@ -183,7 +184,7 @@ sendquota(struct svc_req *request, SVCXP } } -void +void printerr_reply(SVCXPRT *transp)/* when a reply to a request failed */ { char name[INET6_ADDRSTRLEN]; @@ -203,7 +204,7 @@ printerr_reply(SVCXPRT *transp) /* when } /* initialise the fs_tab list from entries in /etc/fstab */ -void +void initfs(void) { struct fs_stat *fs_current = NULL; @@ -222,10 +223,12 @@ initfs(void) fs_current = (struct fs_stat *) malloc(sizeof(struct fs_stat)); fs_current->fs_next = fs_next; /* next element */ - fs_current->fs_file = malloc(sizeof(char) * (strlen(fs->fs_file) + 1)); + fs_current->fs_file = + malloc(sizeof(char) * (strlen(fs->fs_file) + 1)); strcpy(fs_current->fs_file, fs->fs_file); - fs_current->qfpathname = malloc(sizeof(char) * (strlen(qfpathname) + 1)); + fs_current->qfpathname = + malloc(sizeof(char) * (strlen(qfpathname) + 1)); strcpy(fs_current->qfpathname, qfpathname); stat(fs_current->fs_file, &st); @@ -242,7 +245,7 @@ initfs(void) * Return 0 if fail, 1 otherwise */ int -getfsquota(long id, char *path, struct dqblk *dqblk) +getfsquota(long id, char *path, struct dqblk *dqblk) { struct stat st_path; struct fs_stat *fs; @@ -301,8 +304,8 @@ hasquota(struct fstab *fs, char **qfnam { static char initname, usrname[100]; static char buf[BUFSIZ]; - char*opt, *cp; - char*qfextension[] = INITQFNAMES; + char *opt, *cp; + const char *qfextension[] = INITQFNAMES; if (!initname) { sprintf(usrname, "%s%s", qfextension[USRQUOTA], QUOTAFILENAME); @@ -321,7 +324,8 @@ hasquota(s
svn commit: r192071 - stable/7/share/man/man9
Author: des Date: Thu May 14 01:41:54 2009 New Revision: 192071 URL: http://svn.freebsd.org/changeset/base/192071 Log: MFC r184690: missing email address Modified: stable/7/share/man/man9/ (props changed) stable/7/share/man/man9/pseudofs.9 Modified: stable/7/share/man/man9/pseudofs.9 == --- stable/7/share/man/man9/pseudofs.9 Thu May 14 01:40:36 2009 (r192070) +++ stable/7/share/man/man9/pseudofs.9 Thu May 14 01:41:54 2009 (r192071) @@ -67,4 +67,4 @@ module appeared in The .Nm module and this manual page were written by -.An Dag-Erling Sm\(/orgrav . +.An Dag-Erling Sm\(/orgrav Aq d...@freebsd.org . ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192072 - in stable/7/sys: . compat/linprocfs contrib/pf dev/ath/ath_hal dev/cxgb
Author: des Date: Thu May 14 02:00:50 2009 New Revision: 192072 URL: http://svn.freebsd.org/changeset/base/192072 Log: MFC r184691: convert to UTF-8. Modified: stable/7/sys/ (props changed) stable/7/sys/compat/linprocfs/linprocfs.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/compat/linprocfs/linprocfs.c == --- stable/7/sys/compat/linprocfs/linprocfs.c Thu May 14 01:41:54 2009 (r192071) +++ stable/7/sys/compat/linprocfs/linprocfs.c Thu May 14 02:00:50 2009 (r192072) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000 Dag-Erling Co�dan Sm�rgrav + * Copyright (c) 2000 Dag-Erling Coïdan Smørgrav * Copyright (c) 1999 Pierre Beyssac * Copyright (c) 1993 Jan-Simon Pendry * Copyright (c) 1993 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192073 - stable/7/usr.bin/fetch
Author: des Date: Thu May 14 02:07:41 2009 New Revision: 192073 URL: http://svn.freebsd.org/changeset/base/192073 Log: MFC 185912: Apply the same defaults to HTTPS as to HTTP. MFC 187361: Fix FTP / HTTP timeouts Modified: stable/7/usr.bin/fetch/ (props changed) stable/7/usr.bin/fetch/fetch.c Modified: stable/7/usr.bin/fetch/fetch.c == --- stable/7/usr.bin/fetch/fetch.c Thu May 14 02:00:50 2009 (r192072) +++ stable/7/usr.bin/fetch/fetch.c Thu May 14 02:07:41 2009 (r192073) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000-2004 Dag-Erling Co�dan Sm�rgrav + * Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #define MINBUFSIZE 4096 +#define TIMEOUT120 /* Option flags */ int A_flag;/*-A: do not follow 302 redirects */ @@ -75,7 +76,7 @@ intR_flag;/*-R: don't delete part int r_flag;/*-r: restart previously interrupted transfer */ off_t S_size;/*-S: require size to match */ int s_flag;/*-s: show size, don't fetch */ -longT_secs = 120; /*-T: transfer timeout in seconds */ +longT_secs;/*-T: transfer timeout in seconds */ int t_flag;/*! -t: workaround TCP bug */ int U_flag;/*-U: do not use high ports */ int v_level = 1; /*-v: verbosity level */ @@ -88,8 +89,8 @@ intsigalrm; /* SIGALRM received */ int siginfo; /* SIGINFO received */ int sigint;/* SIGINT received */ -longftp_timeout; /* default timeout for FTP transfers */ -longhttp_timeout; /* default timeout for HTTP transfers */ +longftp_timeout = TIMEOUT; /* default timeout for FTP transfers */ +longhttp_timeout = TIMEOUT;/* default timeout for HTTP transfers */ char *buf; /* transfer buffer */ @@ -376,7 +377,8 @@ fetch(char *URL, const char *path) } /* HTTP specific flags */ - if (strcmp(url->scheme, SCHEME_HTTP) == 0) { + if (strcmp(url->scheme, SCHEME_HTTP) == 0 || + strcmp(url->scheme, SCHEME_HTTPS) == 0) { if (d_flag) strcat(flags, "d"); if (A_flag) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192074 - stable/7/share/man/man9
Author: des Date: Thu May 14 02:09:09 2009 New Revision: 192074 URL: http://svn.freebsd.org/changeset/base/192074 Log: MFC r186224: exeunt Modified: stable/7/share/man/man9/ (props changed) stable/7/share/man/man9/style.9 Modified: stable/7/share/man/man9/style.9 == --- stable/7/share/man/man9/style.9 Thu May 14 02:07:41 2009 (r192073) +++ stable/7/share/man/man9/style.9 Thu May 14 02:09:09 2009 (r192074) @@ -26,7 +26,7 @@ .\"From: @(#)style 1.14 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd February 10, 2005 +.Dd December 17, 2008 .Dt STYLE 9 .Os .Sh NAME @@ -602,11 +602,9 @@ Do YOU understand the following? k = !(l & FLAGS); .Ed .Pp -Exits should be 0 on success, or according to the predefined -values in -.Xr sysexits 3 . +Exits should be 0 on success, or 1 on failure. .Bd -literal - exit(EX_OK);/* + exit(0);/* * Avoid obvious comments such as * "Exit 0 on success." */ @@ -806,7 +804,7 @@ placed in a single set of brackets. .Ed .Bd -literal (void)fprintf(stderr, "usage: f [-ab]\en"); - exit(EX_USAGE); + exit(1); } .Ed .Pp @@ -840,7 +838,6 @@ and produce minimal warnings. .Xr indent 1 , .Xr lint 1 , .Xr err 3 , -.Xr sysexits 3 , .Xr warn 3 , .Xr style.Makefile 5 .Sh HISTORY ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192075 - stable/7/usr.bin/sockstat
Author: des Date: Thu May 14 02:10:31 2009 New Revision: 192075 URL: http://svn.freebsd.org/changeset/base/192075 Log: MFC r187915: make sure columns don't run into each other. PR: bin/129318 Modified: stable/7/usr.bin/sockstat/ (props changed) stable/7/usr.bin/sockstat/sockstat.c Modified: stable/7/usr.bin/sockstat/sockstat.c == --- stable/7/usr.bin/sockstat/sockstat.cThu May 14 02:09:09 2009 (r192074) +++ stable/7/usr.bin/sockstat/sockstat.cThu May 14 02:10:31 2009 (r192075) @@ -584,25 +584,25 @@ display(void) continue; pos = 0; if ((pwd = getpwuid(xf->xf_uid)) == NULL) - pos += xprintf("%lu", (u_long)xf->xf_uid); + pos += xprintf("%lu ", (u_long)xf->xf_uid); else - pos += xprintf("%s", pwd->pw_name); + pos += xprintf("%s ", pwd->pw_name); while (pos < 9) pos += xprintf(" "); pos += xprintf("%.10s", getprocname(xf->xf_pid)); while (pos < 20) pos += xprintf(" "); - pos += xprintf("%lu", (u_long)xf->xf_pid); + pos += xprintf("%lu ", (u_long)xf->xf_pid); while (pos < 26) pos += xprintf(" "); - pos += xprintf("%d", xf->xf_fd); + pos += xprintf("%d ", xf->xf_fd); while (pos < 29) pos += xprintf(" "); pos += xprintf("%s", s->protoname); if (s->vflag & INP_IPV4) - pos += xprintf("4"); + pos += xprintf("4 "); if (s->vflag & INP_IPV6) - pos += xprintf("6"); + pos += xprintf("6 "); while (pos < 36) pos += xprintf(" "); switch (s->family) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192076 - in stable/7/etc: . rc.d
Author: des Date: Thu May 14 02:14:46 2009 New Revision: 192076 URL: http://svn.freebsd.org/changeset/base/192076 Log: MFC r190032: add hostid Modified: stable/7/etc/ (props changed) stable/7/etc/netstart stable/7/etc/rc.d/ (props changed) Modified: stable/7/etc/netstart == --- stable/7/etc/netstart Thu May 14 02:10:31 2009(r192075) +++ stable/7/etc/netstart Thu May 14 02:14:46 2009(r192076) @@ -38,6 +38,7 @@ load_rc_config 'XXX' /etc/rc.d/devd start +/etc/rc.d/hostid start /etc/rc.d/hostname start /etc/rc.d/ipmon start /etc/rc.d/ipfilter start ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192077 - stable/7/share/timedef
Author: des Date: Thu May 14 02:20:37 2009 New Revision: 192077 URL: http://svn.freebsd.org/changeset/base/192077 Log: MFC r190774: fix ISO8859-15 links for nb_NO / no_NO. Modified: stable/7/share/timedef/ (props changed) stable/7/share/timedef/Makefile Modified: stable/7/share/timedef/Makefile == --- stable/7/share/timedef/Makefile Thu May 14 02:14:46 2009 (r192076) +++ stable/7/share/timedef/Makefile Thu May 14 02:20:37 2009 (r192077) @@ -126,10 +126,9 @@ GB2312_GBK=zh_CN ISO8859-1_ISO8859-1= ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} ${IT_LINKS} \ ${NL_LINKS} ${NO_LINKS} en_US:af_ZA ISO8859-1_ISO8859-15= ca_ES da_DK de_AT de_DE en_GB en_US es_ES eu_ES \ - fi_FI fr_FR is_IS it_IT la_LN nl_NL nn_NO no_NO pt_PT \ + fi_FI fr_FR is_IS it_IT la_LN nb_NO nl_NL nn_NO no_NO pt_PT \ sv_SE \ - ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} ${IT_LINKS} ${NL_LINKS} \ - ${NO_LINKS} + ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} ${IT_LINKS} ${NL_LINKS} ISO8859-1_US-ASCII= ${GB_LINKS} en_GB en_US la_LN ISO8859-1_ISO8859-2= la_LN ISO8859-1_ISO8859-4= la_LN ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192078 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/ichwd
Author: des Date: Thu May 14 02:27:38 2009 New Revision: 192078 URL: http://svn.freebsd.org/changeset/base/192078 Log: MFC r190030: rename a couple of functions, add comments Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/ichwd/ichwd.c Modified: stable/7/sys/dev/ichwd/ichwd.c == --- stable/7/sys/dev/ichwd/ichwd.c Thu May 14 02:20:37 2009 (r192077) +++ stable/7/sys/dev/ichwd/ichwd.c Thu May 14 02:27:38 2009 (r192078) @@ -141,26 +141,55 @@ static devclass_t ichwd_devclass; device_printf(dev, __VA_ARGS__);\ } while (0) +/* + * Disable the watchdog timeout SMI handler. + * + * Apparently, some BIOSes install handlers that reset or disable the + * watchdog timer instead of resetting the system, so we disable the SMI + * (by clearing the SMI_TCO_EN bit of the SMI_EN register) to prevent this + * from happening. + */ static __inline void -ichwd_intr_enable(struct ichwd_softc *sc) +ichwd_smi_disable(struct ichwd_softc *sc) { ichwd_write_smi_4(sc, SMI_EN, ichwd_read_smi_4(sc, SMI_EN) & ~SMI_TCO_EN); } +/* + * Enable the watchdog timeout SMI handler. See above for details. + */ static __inline void -ichwd_intr_disable(struct ichwd_softc *sc) +ichwd_smi_enable(struct ichwd_softc *sc) { ichwd_write_smi_4(sc, SMI_EN, ichwd_read_smi_4(sc, SMI_EN) | SMI_TCO_EN); } +/* + * Reset the watchdog status bits. + */ static __inline void ichwd_sts_reset(struct ichwd_softc *sc) { + /* +* The watchdog status bits are set to 1 by the hardware to +* indicate various conditions. They can be cleared by software +* by writing a 1, not a 0. +*/ ichwd_write_tco_2(sc, TCO1_STS, TCO_TIMEOUT); + /* +* XXX The datasheet says that TCO_SECOND_TO_STS must be cleared +* before TCO_BOOT_STS, not the other way around. +*/ ichwd_write_tco_2(sc, TCO2_STS, TCO_BOOT_STS); ichwd_write_tco_2(sc, TCO2_STS, TCO_SECOND_TO_STS); } +/* + * Enable the watchdog timer by clearing the TCO_TMR_HALT bit in the + * TCO1_CNT register. This is complicated by the need to preserve bit 9 + * of that same register, and the requirement that all other bits must be + * written back as zero. + */ static __inline void ichwd_tmr_enable(struct ichwd_softc *sc) { @@ -172,6 +201,9 @@ ichwd_tmr_enable(struct ichwd_softc *sc) ichwd_verbose_printf(sc->device, "timer enabled\n"); } +/* + * Disable the watchdog timer. See above for details. + */ static __inline void ichwd_tmr_disable(struct ichwd_softc *sc) { @@ -183,6 +215,11 @@ ichwd_tmr_disable(struct ichwd_softc *sc ichwd_verbose_printf(sc->device, "timer disabled\n"); } +/* + * Reload the watchdog timer: writing anything to any of the lower five + * bits of the TCO_RLD register reloads the timer from the last value + * written to TCO_TMR. + */ static __inline void ichwd_tmr_reload(struct ichwd_softc *sc) { @@ -194,6 +231,10 @@ ichwd_tmr_reload(struct ichwd_softc *sc) ichwd_verbose_printf(sc->device, "timer reloaded\n"); } +/* + * Set the initial timeout value. Note that this must always be followed + * by a reload. + */ static __inline void ichwd_tmr_set(struct ichwd_softc *sc, unsigned int timeout) { @@ -262,7 +303,8 @@ ichwd_clear_noreboot(struct ichwd_softc } /* - * Watchdog event handler. + * Watchdog event handler - called by the framework to enable or disable + * the watchdog or change the initial timeout value. */ static void ichwd_event(void *arg, unsigned int cmd, int *error) @@ -426,6 +468,13 @@ ichwd_attach(device_t dev) device_printf(dev, "%s (ICH%d or equivalent)\n", device_get_desc(dev), sc->ich_version); + /* +* XXX we should check the status registers (specifically, the +* TCO_SECOND_TO_STS bit in the TCO2_STS register) to see if we +* just came back from a watchdog-induced reset, and let the user +* know. +*/ + /* reset the watchdog status registers */ ichwd_sts_reset(sc); @@ -435,8 +484,8 @@ ichwd_attach(device_t dev) /* register the watchdog event handler */ sc->ev_tag = EVENTHANDLER_REGISTER(watchdog_list, ichwd_event, sc, 0); - /* enable watchdog timeout interrupts */ - ichwd_intr_enable(sc); + /* disable the SMI handler */ + ichwd_smi_disable(sc); return (0); fail: @@ -466,8 +515,8 @@ ichwd_detach(device_t dev) if (sc->active) ichwd_tmr_disable(sc); - /* disable watchdog timeout interrupts */ - ichwd_intr_disable(sc); + /* enable the SMI handler */ + ichwd_smi_enable(sc); /* deregister event handler */ if (sc->ev_tag != NULL)
Re: svn commit: r191983 - in head/sys: dev/usb/wlan modules/usb/upgt
On Wed, May 13, 2009 at 06:09:42PM +0100, Robert Watson wrote: > > On Mon, 11 May 2009, Weongyo Jeong wrote: > > >Author: weongyo > >Date: Mon May 11 02:39:49 2009 > >New Revision: 191983 > >URL: http://svn.freebsd.org/changeset/base/191983 > > > >Log: > > ports upgt(4) driver for USB2. > > Ah, great! Do you have any similar plans regarding urtw? Yes it'll happen before the code slush. :-) regards, Weongyo Jeong ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192079 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb fs/procfs fs/pseudofs
Author: des Date: Thu May 14 02:42:29 2009 New Revision: 192079 URL: http://svn.freebsd.org/changeset/base/192079 Log: MFC r188677: always call pfs_attr if defined MFC r190806: fix incorrect KASSERT, add more MFC r188677: remove incorrect locking Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/fs/procfs/procfs.c stable/7/sys/fs/pseudofs/pseudofs_vnops.c Modified: stable/7/sys/fs/procfs/procfs.c == --- stable/7/sys/fs/procfs/procfs.c Thu May 14 02:27:38 2009 (r192078) +++ stable/7/sys/fs/procfs/procfs.c Thu May 14 02:42:29 2009 (r192079) @@ -99,7 +99,6 @@ procfs_docurproc(PFS_FILL_ARGS) int procfs_attr(PFS_ATTR_ARGS) { - PROC_LOCK_ASSERT(p, MA_OWNED); /* XXX inefficient, split into separate functions */ if (strcmp(pn->pn_name, "ctl") == 0 || @@ -112,11 +111,12 @@ procfs_attr(PFS_ATTR_ARGS) strcmp(pn->pn_name, "fpregs") == 0) vap->va_mode = 0600; - if ((p->p_flag & P_SUGID) && pn->pn_type != pfstype_procdir) - vap->va_mode = 0; + if (p != NULL) { + PROC_LOCK_ASSERT(p, MA_OWNED); - vap->va_uid = p->p_ucred->cr_uid; - vap->va_gid = p->p_ucred->cr_gid; + if ((p->p_flag & P_SUGID) && pn->pn_type != pfstype_procdir) + vap->va_mode = 0; + } return (0); } Modified: stable/7/sys/fs/pseudofs/pseudofs_vnops.c == --- stable/7/sys/fs/pseudofs/pseudofs_vnops.c Thu May 14 02:27:38 2009 (r192078) +++ stable/7/sys/fs/pseudofs/pseudofs_vnops.c Thu May 14 02:42:29 2009 (r192079) @@ -52,6 +52,20 @@ __FBSDID("$FreeBSD$"); #include #include +#define KASSERT_PN_IS_DIR(pn) \ + KASSERT((pn)->pn_type == pfstype_root ||\ + (pn)->pn_type == pfstype_dir || \ + (pn)->pn_type == pfstype_procdir, \ + ("%s(): VDIR vnode refers to non-directory pfs_node", __func__)) + +#define KASSERT_PN_IS_FILE(pn) \ + KASSERT((pn)->pn_type == pfstype_file, \ + ("%s(): VREG vnode refers to non-file pfs_node", __func__)) + +#define KASSERT_PN_IS_LINK(pn) \ + KASSERT((pn)->pn_type == pfstype_symlink, \ + ("%s(): VLNK vnode refers to non-link pfs_node", __func__)) + /* * Returns the fileno, adjusted for target pid */ @@ -226,14 +240,17 @@ pfs_getattr(struct vop_getattr_args *va) if (proc != NULL) { vap->va_uid = proc->p_ucred->cr_ruid; vap->va_gid = proc->p_ucred->cr_rgid; - if (pn->pn_attr != NULL) - error = pn_attr(va->a_td, proc, pn, vap); - PROC_UNLOCK(proc); } else { vap->va_uid = 0; vap->va_gid = 0; } + if (pn->pn_attr != NULL) + error = pn_attr(va->a_td, proc, pn, vap); + + if(proc != NULL) + PROC_UNLOCK(proc); + PFS_RETURN (error); } @@ -254,6 +271,7 @@ pfs_ioctl(struct vop_ioctl_args *va) if (vn->v_type != VREG) PFS_RETURN (EINVAL); + KASSERT_PN_IS_FILE(pn); if (pn->pn_ioctl == NULL) PFS_RETURN (ENOTTY); @@ -330,6 +348,7 @@ pfs_lookup(struct vop_cachedlookup_args if (vn->v_type != VDIR) PFS_RETURN (ENOTDIR); + KASSERT_PN_IS_DIR(pd); error = VOP_ACCESS(vn, VEXEC, cnp->cn_cred, cnp->cn_thread); if (error) @@ -484,6 +503,7 @@ pfs_read(struct vop_read_args *va) if (vn->v_type != VREG) PFS_RETURN (EINVAL); + KASSERT_PN_IS_FILE(pn); if (!(pn->pn_flags & PFS_RD)) PFS_RETURN (EBADF); @@ -626,6 +646,7 @@ pfs_readdir(struct vop_readdir_args *va) if (vn->v_type != VDIR) PFS_RETURN (ENOTDIR); + KASSERT_PN_IS_DIR(pd); uio = va->a_uio; /* only allow reading entire entries */ @@ -734,6 +755,7 @@ pfs_readlink(struct vop_readlink_args *v if (vn->v_type != VLNK) PFS_RETURN (EINVAL); + KASSERT_PN_IS_LINK(pn); if (pn->pn_fill == NULL) PFS_RETURN (EIO); @@ -819,8 +841,7 @@ pfs_write(struct vop_write_args *va) if (vn->v_type != VREG) PFS_RETURN (EINVAL); - KASSERT(pn->pn_type != pfstype_file, - ("%s(): VREG vnode refers to non-file pfs_node", __func__)); + KASSERT_PN_IS_FILE(pn); if (!(pn->pn_flags & PFS_WR)) PFS
svn commit: r192080 - in head/sys: kern sys
Author: jeff Date: Thu May 14 03:24:22 2009 New Revision: 192080 URL: http://svn.freebsd.org/changeset/base/192080 Log: - Implement a lockless file descriptor lookup algorithm in fget_unlocked(). - Save old file descriptor tables created on expansion until the entire descriptor table is freed so that pointers may be followed without regard for expanders. - Mark the file zone as NOFREE so we may attempt to reference potentially freed files. - Convert several fget_locked() users to fget_unlocked(). This requires us to manage reference counts explicitly but reduces locking overhead in the common case. Modified: head/sys/kern/kern_descrip.c head/sys/kern/sys_generic.c head/sys/kern/tty.c head/sys/kern/uipc_syscalls.c head/sys/kern/vfs_syscalls.c head/sys/sys/filedesc.h Modified: head/sys/kern/kern_descrip.c == --- head/sys/kern/kern_descrip.cThu May 14 02:42:29 2009 (r192079) +++ head/sys/kern/kern_descrip.cThu May 14 03:24:22 2009 (r192080) @@ -125,12 +125,24 @@ static void fdused(struct filedesc *fdp, #define OFILESIZE (sizeof(struct file *) + sizeof(char)) /* + * Storage to hold unused ofiles that need to be reclaimed. + */ +struct freetable { + struct file **ft_table; + SLIST_ENTRY(freetable) ft_next; +}; + +/* * Basic allocation of descriptors: * one of the above, plus arrays for NDFILE descriptors. */ struct filedesc0 { struct filedesc fd_fd; /* +* ofiles which need to be reclaimed on free. +*/ + SLIST_HEAD(,freetable) fd_free; + /* * These arrays are used when the number of open files is * <= NDFILE, and are then pointed to by the pointers above. */ @@ -1268,7 +1280,10 @@ out: static void fdgrowtable(struct filedesc *fdp, int nfd) { + struct filedesc0 *fdp0; + struct freetable *fo; struct file **ntable; + struct file **otable; char *nfileflags; int nnfiles, onfiles; NDSLOTTYPE *nmap; @@ -1287,7 +1302,7 @@ fdgrowtable(struct filedesc *fdp, int nf /* allocate a new table and (if required) new bitmaps */ FILEDESC_XUNLOCK(fdp); - ntable = malloc(nnfiles * OFILESIZE, + ntable = malloc((nnfiles * OFILESIZE) + sizeof(struct freetable), M_FILEDESC, M_ZERO | M_WAITOK); nfileflags = (char *)&ntable[nnfiles]; if (NDSLOTS(nnfiles) > NDSLOTS(onfiles)) @@ -1311,10 +1326,20 @@ fdgrowtable(struct filedesc *fdp, int nf } bcopy(fdp->fd_ofiles, ntable, onfiles * sizeof(*ntable)); bcopy(fdp->fd_ofileflags, nfileflags, onfiles); - if (onfiles > NDFILE) - free(fdp->fd_ofiles, M_FILEDESC); - fdp->fd_ofiles = ntable; + otable = fdp->fd_ofiles; fdp->fd_ofileflags = nfileflags; + fdp->fd_ofiles = ntable; + /* +* We must preserve ofiles until the process exits because we can't +* be certain that no threads have references to the old table via +* _fget(). +*/ + if (onfiles > NDFILE) { + fo = (struct freetable *)&otable[onfiles]; + fdp0 = (struct filedesc0 *)fdp; + fo->ft_table = otable; + SLIST_INSERT_HEAD(&fdp0->fd_free, fo, ft_next); + } if (NDSLOTS(nnfiles) > NDSLOTS(onfiles)) { bcopy(fdp->fd_map, nmap, NDSLOTS(onfiles) * sizeof(*nmap)); if (NDSLOTS(onfiles) > NDSLOTS(NDFILE)) @@ -1512,6 +1537,8 @@ fdhold(struct proc *p) static void fddrop(struct filedesc *fdp) { + struct filedesc0 *fdp0; + struct freetable *ft; int i; mtx_lock(&fdesc_mtx); @@ -1521,6 +1548,11 @@ fddrop(struct filedesc *fdp) return; FILEDESC_LOCK_DESTROY(fdp); + fdp0 = (struct filedesc0 *)fdp; + while ((ft = SLIST_FIRST(&fdp0->fd_free)) != NULL) { + SLIST_REMOVE_HEAD(&fdp0->fd_free, ft_next); + free(ft->ft_table, M_FILEDESC); + } free(fdp, M_FILEDESC); } @@ -2022,6 +2054,38 @@ finit(struct file *fp, u_int flag, short atomic_store_rel_ptr((volatile uintptr_t *)&fp->f_ops, (uintptr_t)ops); } +struct file * +fget_unlocked(struct filedesc *fdp, int fd) +{ + struct file *fp; + u_int count; + + if (fd < 0 || fd >= fdp->fd_nfiles) + return (NULL); + /* +* Fetch the descriptor locklessly. We avoid fdrop() races by +* never raising a refcount above 0. To accomplish this we have +* to use a cmpset loop rather than an atomic_add. The descriptor +* must be re-verified once we acquire a reference to be certain +* that the identity is still correct and we did not lose a race +* due to preemption. +*/ + for (;;) { + fp = fdp->fd_ofiles[fd]; +
svn commit: r192081 - head/sys/dev/e1000
Author: kmacy Date: Thu May 14 03:33:04 2009 New Revision: 192081 URL: http://svn.freebsd.org/changeset/base/192081 Log: Call drbr_stats_update to update ifp stats directly when we bypass the buf_ring on transmit Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c == --- head/sys/dev/e1000/if_em.c Thu May 14 03:24:22 2009(r192080) +++ head/sys/dev/e1000/if_em.c Thu May 14 03:33:04 2009(r192081) @@ -1006,15 +1006,18 @@ em_transmit_locked(struct ifnet *ifp, st || (!adapter->link_active)) { error = drbr_enqueue(ifp, adapter->br, m); return (error); - } - - if (ADAPTER_RING_EMPTY(adapter) && + } else if (ADAPTER_RING_EMPTY(adapter) && (adapter->num_tx_desc_avail > EM_TX_OP_THRESHOLD)) { if (em_xmit(adapter, &m)) { if (m && (error = drbr_enqueue(ifp, adapter->br, m)) != 0) return (error); } else { /* +* We've bypassed the buf ring so we need to update +* ifp directly +*/ + drbr_stats_update(ifp, m->m_pkthdr.len, m->m_flags); + /* ** Send a copy of the frame to the BPF ** listener and set the watchdog on. */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r192085 - head/sys/netinet
Author: qingli Date: Thu May 14 05:27:09 2009 New Revision: 192085 URL: http://svn.freebsd.org/changeset/base/192085 Log: Ignore the INADDR_ANY address inserted/deleted by DHCP when installing a loopback route to the interface address. Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c == --- head/sys/netinet/in.c Thu May 14 03:54:03 2009(r192084) +++ head/sys/netinet/in.c Thu May 14 05:27:09 2009(r192085) @@ -906,6 +906,9 @@ in_ifinit(struct ifnet *ifp, struct in_i if ((error = in_addprefix(ia, flags)) != 0) return (error); + if (ia->ia_addr.sin_addr.s_addr == INADDR_ANY) + return (0); + /* * add a loopback route to self */ @@ -1014,7 +1017,8 @@ in_scrubprefix(struct in_ifaddr *target) if ((target->ia_flags & IFA_ROUTE) == 0) return (0); - if (!(target->ia_ifp->if_flags & (IFF_LOOPBACK | IFF_POINTOPOINT))) { + if ((target->ia_addr.sin_addr.s_addr != INADDR_ANY) && + !(target->ia_ifp->if_flags & (IFF_LOOPBACK | IFF_POINTOPOINT))) { bzero(&null_sdl, sizeof(null_sdl)); null_sdl.sdl_len = sizeof(null_sdl); null_sdl.sdl_family = AF_LINK; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"