Date: Fri, 24 Feb 2006 22:47:55 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 92361 for review Message-ID: <200602242247.k1OMltXS036013@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=92361 Change 92361 by jhb@jhb_slimer on 2006/02/24 22:47:50 IFC @92359. Affected files ... .. //depot/projects/smpng/sys/conf/kmod.mk#56 integrate .. //depot/projects/smpng/sys/dev/amr/amr_linux.c#2 integrate .. //depot/projects/smpng/sys/dev/ata/ata-all.h#44 integrate .. //depot/projects/smpng/sys/dev/ata/ata-chipset.c#64 integrate .. //depot/projects/smpng/sys/dev/ata/ata-queue.c#31 integrate .. //depot/projects/smpng/sys/dev/fdc/fdc.c#22 integrate .. //depot/projects/smpng/sys/dev/ic/z8530.h#3 integrate .. //depot/projects/smpng/sys/dev/ppc/ppc.c#10 integrate .. //depot/projects/smpng/sys/dev/puc/puc_ebus.c#7 integrate .. //depot/projects/smpng/sys/dev/puc/puc_sbus.c#9 integrate .. //depot/projects/smpng/sys/dev/sound/pci/atiixp.c#5 integrate .. //depot/projects/smpng/sys/dev/sound/pcm/feeder.c#15 integrate .. //depot/projects/smpng/sys/dev/uart/uart_bus.h#8 integrate .. //depot/projects/smpng/sys/dev/uart/uart_bus_ebus.c#10 integrate .. //depot/projects/smpng/sys/dev/uart/uart_core.c#11 integrate .. //depot/projects/smpng/sys/dev/uart/uart_dev_ns8250.c#10 integrate .. //depot/projects/smpng/sys/dev/uart/uart_dev_sab82532.c#8 integrate .. //depot/projects/smpng/sys/dev/uart/uart_dev_z8530.c#9 integrate .. //depot/projects/smpng/sys/dev/uart/uart_kbd_sun.c#7 integrate .. //depot/projects/smpng/sys/dev/uart/uart_tty.c#17 integrate .. //depot/projects/smpng/sys/i386/include/mptable.h#4 integrate .. //depot/projects/smpng/sys/kern/kern_condvar.c#42 integrate .. //depot/projects/smpng/sys/kern/kern_sig.c#118 integrate .. //depot/projects/smpng/sys/kern/kern_synch.c#98 integrate .. //depot/projects/smpng/sys/kern/kern_timeout.c#30 integrate .. //depot/projects/smpng/sys/kern/subr_sleepqueue.c#24 integrate .. //depot/projects/smpng/sys/kern/vfs_subr.c#122 integrate .. //depot/projects/smpng/sys/kern/vfs_syscalls.c#99 integrate .. //depot/projects/smpng/sys/modules/Makefile#117 integrate .. //depot/projects/smpng/sys/modules/if_ef/Makefile#5 integrate .. //depot/projects/smpng/sys/modules/uart/Makefile#8 integrate .. //depot/projects/smpng/sys/net/if_vlan.c#46 integrate .. //depot/projects/smpng/sys/netinet/tcp_input.c#81 integrate .. //depot/projects/smpng/sys/netinet/tcp_output.c#39 integrate .. //depot/projects/smpng/sys/sys/serial.h#2 integrate Differences ... ==== //depot/projects/smpng/sys/conf/kmod.mk#56 (text+ko) ==== @@ -1,5 +1,5 @@ # From: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 -# $FreeBSD: src/sys/conf/kmod.mk,v 1.205 2006/02/20 01:08:33 mlaier Exp $ +# $FreeBSD: src/sys/conf/kmod.mk,v 1.206 2006/02/24 01:49:36 marcel Exp $ # # The include file <bsd.kmod.mk> handles building and installing loadable # kernel modules. @@ -320,7 +320,7 @@ dev/pccard/card_if.m dev/pccard/power_if.m dev/pci/pci_if.m \ dev/pci/pcib_if.m dev/ppbus/ppbus_if.m dev/smbus/smbus_if.m \ dev/sound/pcm/ac97_if.m dev/sound/pcm/channel_if.m \ - dev/sound/pcm/feeder_if.m dev/sound/pcm/mixer_if.m dev/uart/uart_if.m \ + dev/sound/pcm/feeder_if.m dev/sound/pcm/mixer_if.m \ dev/usb/usb_if.m isa/isa_if.m \ kern/bus_if.m kern/cpufreq_if.m kern/device_if.m \ libkern/iconv_converter_if.m opencrypto/crypto_if.m \ ==== //depot/projects/smpng/sys/dev/amr/amr_linux.c#2 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/amr/amr_linux.c,v 1.1 2006/01/24 21:13:49 ambrisko Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/amr/amr_linux.c,v 1.2 2006/02/23 18:05:38 jhb Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -170,13 +170,15 @@ devclass_t devclass; struct amr_softc *sc; struct amr_linux_ioctl ali; - int adapter; + int adapter, error; devclass = devclass_find("amr"); if (devclass == NULL) return (ENOENT); - copyin((caddr_t)args->arg, &ali, sizeof(ali)); + error = copyin((caddr_t)args->arg, &ali, sizeof(ali)); + if (error) + return (error); if (ali.ui.fcs.opcode == 0x82) adapter = 0; else ==== //depot/projects/smpng/sys/dev/ata/ata-all.h#44 (text+ko) ==== @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ata/ata-all.h,v 1.113 2006/02/09 20:54:42 sos Exp $ + * $FreeBSD: src/sys/dev/ata/ata-all.h,v 1.114 2006/02/23 20:15:22 sos Exp $ */ /* ATA register defines */ @@ -338,6 +338,7 @@ /* structure used to queue an ATA/ATAPI request */ struct ata_request { device_t dev; /* device handle */ + device_t parent; /* channel handle */ union { struct { u_int8_t command; /* command reg */ ==== //depot/projects/smpng/sys/dev/ata/ata-chipset.c#64 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.159 2006/02/16 17:09:24 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.160 2006/02/23 18:52:15 sos Exp $"); #include "opt_ata.h" #include <sys/param.h> @@ -4075,7 +4075,6 @@ /* setup the usual register normal pci style */ if (ata_pci_allocate(dev)) return ENXIO; - ata_pci_allocate(dev); if (ctlr->chip->cfg2 & SIIINTR) ch->hw.status = ata_cmd_status; ==== //depot/projects/smpng/sys/dev/ata/ata-queue.c#31 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-queue.c,v 1.55 2006/01/18 13:10:17 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-queue.c,v 1.56 2006/02/23 20:15:22 sos Exp $"); #include "opt_ata.h" #include <sys/param.h> @@ -55,6 +55,7 @@ /* mark request as virgin (this might be a ATA_R_REQUEUE) */ request->result = request->status = request->error = 0; + request->parent = device_get_parent(request->dev); callout_init_mtx(&request->callout, &ch->state_mtx, CALLOUT_RETURNUNLOCKED); if (!request->callback && !(request->flags & ATA_R_REQUEUE)) @@ -218,7 +219,7 @@ void ata_finish(struct ata_request *request) { - struct ata_channel *ch = device_get_softc(device_get_parent(request->dev)); + struct ata_channel *ch = device_get_softc(request->parent); /* * if in ATA_STALL_QUEUE state or request has ATA_R_DIRECT flags set @@ -247,7 +248,7 @@ ata_completed(void *context, int dummy) { struct ata_request *request = (struct ata_request *)context; - struct ata_channel *ch = device_get_softc(device_get_parent(request->dev)); + struct ata_channel *ch = device_get_softc(request->parent); struct ata_device *atadev = device_get_softc(request->dev); struct ata_composite *composite; @@ -466,7 +467,7 @@ void ata_timeout(struct ata_request *request) { - struct ata_channel *ch = device_get_softc(device_get_parent(request->dev)); + struct ata_channel *ch = device_get_softc(request->parent); //request->flags |= ATA_R_DEBUG; ATA_DEBUG_RQ(request, "timeout"); @@ -479,7 +480,6 @@ */ if (ch->state == ATA_ACTIVE) { request->flags |= ATA_R_TIMEOUT; - ch->running = NULL; mtx_unlock(&ch->state_mtx); ATA_LOCKING(ch->dev, ATA_LF_UNLOCK); ata_finish(request); @@ -493,34 +493,43 @@ ata_fail_requests(device_t dev) { struct ata_channel *ch = device_get_softc(device_get_parent(dev)); - struct ata_request *request; + struct ata_request *request, *tmp; + TAILQ_HEAD(, ata_request) fail_requests; + TAILQ_INIT(&fail_requests); - /* do we have any outstanding request to care about ?*/ + /* grap all channel locks to avoid races */ + mtx_lock(&ch->queue_mtx); mtx_lock(&ch->state_mtx); + + /* do we have any running request to care about ? */ if ((request = ch->running) && (!dev || request->dev == dev)) { callout_stop(&request->callout); ch->running = NULL; - } - else - request = NULL; - mtx_unlock(&ch->state_mtx); - if (request) { + ch->state = ATA_IDLE; request->result = ENXIO; - ata_finish(request); + TAILQ_INSERT_TAIL(&fail_requests, request, chain); } /* fail all requests queued on this channel for device dev if !NULL */ - mtx_lock(&ch->queue_mtx); - while ((request = TAILQ_FIRST(&ch->ata_queue))) { + TAILQ_FOREACH_SAFE(request, &ch->ata_queue, chain, tmp) { if (!dev || request->dev == dev) { TAILQ_REMOVE(&ch->ata_queue, request, chain); - mtx_unlock(&ch->queue_mtx); request->result = ENXIO; - ata_finish(request); - mtx_lock(&ch->queue_mtx); + TAILQ_INSERT_TAIL(&fail_requests, request, chain); } } + + mtx_unlock(&ch->state_mtx); mtx_unlock(&ch->queue_mtx); + + /* finish up all requests collected above */ + TAILQ_FOREACH_SAFE(request, &fail_requests, chain, tmp) { + TAILQ_REMOVE(&fail_requests, request, chain); + ata_finish(request); + } + + /* we might have work for the other device on this channel */ + ata_start(ch->dev); } static u_int64_t ==== //depot/projects/smpng/sys/dev/fdc/fdc.c#22 (text+ko) ==== @@ -51,7 +51,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/fdc/fdc.c,v 1.308 2005/08/30 23:12:18 rodrigc Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/fdc/fdc.c,v 1.309 2006/02/23 19:11:16 jhb Exp $"); #include "opt_fdc.h" ==== //depot/projects/smpng/sys/dev/ic/z8530.h#3 (text+ko) ==== @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ic/z8530.h,v 1.3 2005/01/06 01:42:44 imp Exp $ + * $FreeBSD: src/sys/dev/ic/z8530.h,v 1.4 2006/02/24 02:03:35 marcel Exp $ */ #ifndef _DEV_IC_Z8530_H_ @@ -34,9 +34,12 @@ * Channel B data: 1 * Channel A control: 2 * Channel A data: 3 - * - * We expect a seperate subregion for each channel. */ + +/* The following apply when using a device-scoped bus handle */ +#define CHAN_A 2 +#define CHAN_B 0 + #define REG_CTRL 0 #define REG_DATA 1 @@ -69,7 +72,7 @@ #define RR_BCL 6 /* Byte Count Low. */ #define RR_BCH 7 /* Byte Count High. */ #define RR_RB 8 /* Receive Buffer. */ -#define RR_RPC 9 /* Receive Parameters and Contro. */ +#define RR_RPC 9 /* Receive Parameters and Control. */ #define RR_MSB 10 /* Miscellaneous Status Bits. */ #define RR_MCB1 11 /* Miscellaneous Control Bits (part 1). */ #define RR_TCL 12 /* BRG Time Constant Low. */ ==== //depot/projects/smpng/sys/dev/ppc/ppc.c#10 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ppc/ppc.c,v 1.48 2006/02/22 18:16:25 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ppc/ppc.c,v 1.49 2006/02/22 21:47:04 jhb Exp $"); #include "opt_ppc.h" ==== //depot/projects/smpng/sys/dev/puc/puc_ebus.c#7 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/puc/puc_ebus.c,v 1.6 2005/08/07 13:37:25 marius Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/puc/puc_ebus.c,v 1.7 2006/02/24 02:06:57 marcel Exp $"); #include "opt_puc.h" @@ -54,7 +54,7 @@ cmpt = ofw_bus_get_compat(dev); if (!strcmp(nm, "se") || (cmpt != NULL && !strcmp(cmpt, "sab82532"))) { device_set_desc(dev, "Siemens SAB 82532 dual channel SCC"); - return (0); + return (BUS_PROBE_LOW_PRIORITY); } return (ENXIO); } ==== //depot/projects/smpng/sys/dev/puc/puc_sbus.c#9 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/puc/puc_sbus.c,v 1.8 2005/02/26 00:25:43 marius Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/puc/puc_sbus.c,v 1.9 2006/02/24 02:06:57 marcel Exp $"); #include "opt_puc.h" @@ -53,7 +53,7 @@ nm = ofw_bus_get_name(dev); if (!strcmp(nm, "zs")) { device_set_desc(dev, "Zilog Z8530 dual channel SCC"); - return (0); + return (BUS_PROBE_LOW_PRIORITY); } return (ENXIO); } ==== //depot/projects/smpng/sys/dev/sound/pci/atiixp.c#5 (text+ko) ==== @@ -63,7 +63,7 @@ #include <dev/sound/pci/atiixp.h> -SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/atiixp.c,v 1.4 2006/02/18 10:24:48 ariff Exp $"); +SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/atiixp.c,v 1.5 2006/02/24 09:29:32 ariff Exp $"); struct atiixp_dma_op { @@ -614,7 +614,7 @@ } #endif - return (retry > 0) ? ptr & ~align : 0; + return (retry > 0) ? ptr : 0; } static struct pcmchan_caps * ==== //depot/projects/smpng/sys/dev/sound/pcm/feeder.c#15 (text+ko) ==== @@ -28,7 +28,7 @@ #include "feeder_if.h" -SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/feeder.c,v 1.36 2006/01/29 01:32:37 ariff Exp $"); +SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/feeder.c,v 1.37 2006/02/23 19:23:55 jhb Exp $"); MALLOC_DEFINE(M_FEEDER, "feeder", "pcm feeder"); @@ -385,10 +385,8 @@ } } else if (best2 == 0) return best1; - else if (best1 == 0) + else return best2; - - return best1; } u_int32_t ==== //depot/projects/smpng/sys/dev/uart/uart_bus.h#8 (text+ko) ==== @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/uart/uart_bus.h,v 1.9 2005/01/06 01:43:26 imp Exp $ + * $FreeBSD: src/sys/dev/uart/uart_bus.h,v 1.11 2006/02/24 05:40:17 marcel Exp $ */ #ifndef _DEV_UART_BUS_H_ @@ -42,32 +42,12 @@ #define UART_FLUSH_RECEIVER UART_DRAIN_RECEIVER #define UART_FLUSH_TRANSMITTER UART_DRAIN_TRANSMITTER -/* - * Interrupt sources (in priority order). See also uart_core.c - * Note that the low order 16 bits are used to pass modem signals - * from the hardware interrupt handler to the software interrupt - * handler. - */ -#define UART_IPEND_OVERRUN 0x010000 -#define UART_IPEND_BREAK 0x020000 -#define UART_IPEND_RXREADY 0x040000 -#define UART_IPEND_SIGCHG 0x080000 -#define UART_IPEND_TXIDLE 0x100000 - -#define UART_IPEND_MASK 0x1f0000 -#define UART_IPEND_SIGMASK 0x00ffff - /* Received character status bits. */ #define UART_STAT_BREAK 0x0100 #define UART_STAT_FRAMERR 0x0200 #define UART_STAT_OVERRUN 0x0400 #define UART_STAT_PARERR 0x0800 -#define UART_SIGMASK_DTE (SER_DTR | SER_RTS) -#define UART_SIGMASK_DCE (SER_DSR | SER_CTS | SER_DCD | SER_RI) -#define UART_SIGMASK_STATE (UART_SIGMASK_DTE | UART_SIGMASK_DCE) -#define UART_SIGMASK_DELTA (UART_SIGMASK_STATE << 8) - #ifdef UART_PPS_ON_CTS #define UART_SIG_DPPS SER_DCTS #define UART_SIG_PPS SER_CTS ==== //depot/projects/smpng/sys/dev/uart/uart_bus_ebus.c#10 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/uart/uart_bus_ebus.c,v 1.9 2006/02/04 23:27:16 marius Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/uart/uart_bus_ebus.c,v 1.10 2006/02/24 05:36:44 marcel Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -66,6 +66,7 @@ const char *nm, *cmpt; struct uart_softc *sc; struct uart_devinfo dummy; + int error; sc = device_get_softc(dev); sc->sc_class = NULL; @@ -101,7 +102,8 @@ } if (!strcmp(nm, "se") || !strcmp(cmpt, "sab82532")) { sc->sc_class = &uart_sab82532_class; - return (uart_bus_probe(dev, 0, 0, 0, 1)); + error = uart_bus_probe(dev, 0, 0, 0, 1); + return ((error <= 0) ? BUS_PROBE_GENERIC : error); } return (ENXIO); ==== //depot/projects/smpng/sys/dev/uart/uart_core.c#11 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/uart/uart_core.c,v 1.15 2006/02/22 18:16:26 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/uart/uart_core.c,v 1.17 2006/02/24 05:40:17 marcel Exp $"); #ifndef KLD_MODULE #include "opt_comconsole.h" @@ -90,7 +90,7 @@ } #endif if (sc->sc_opened) - atomic_set_32(&sc->sc_ttypend, UART_IPEND_BREAK); + atomic_set_32(&sc->sc_ttypend, SER_INT_BREAK); } /* @@ -116,7 +116,7 @@ UART_RECEIVE(sc); if (uart_rx_put(sc, UART_STAT_OVERRUN)) sc->sc_rxbuf[sc->sc_rxput] = UART_STAT_OVERRUN; - atomic_set_32(&sc->sc_ttypend, UART_IPEND_RXREADY); + atomic_set_32(&sc->sc_ttypend, SER_INT_RXREADY); } UART_FLUSH(sc, UART_FLUSH_RECEIVER); } @@ -142,7 +142,7 @@ } #endif if (sc->sc_opened) - atomic_set_32(&sc->sc_ttypend, UART_IPEND_RXREADY); + atomic_set_32(&sc->sc_ttypend, SER_INT_RXREADY); else sc->sc_rxput = sc->sc_rxget; /* Ignore received data. */ } @@ -171,9 +171,9 @@ do { old = sc->sc_ttypend; - new = old & ~UART_SIGMASK_STATE; - new |= sig & UART_IPEND_SIGMASK; - new |= UART_IPEND_SIGCHG; + new = old & ~SER_MASK_STATE; + new |= sig & SER_INT_SIGMASK; + new |= SER_INT_SIGCHG; } while (!atomic_cmpset_32(&sc->sc_ttypend, old, new)); } @@ -185,7 +185,7 @@ { if (sc->sc_txbusy) { sc->sc_txbusy = 0; - atomic_set_32(&sc->sc_ttypend, UART_IPEND_TXIDLE); + atomic_set_32(&sc->sc_ttypend, SER_INT_TXIDLE); } } @@ -202,15 +202,15 @@ ipend = UART_IPEND(sc); if (ipend == 0) break; - if (ipend & UART_IPEND_OVERRUN) + if (ipend & SER_INT_OVERRUN) uart_intr_overrun(sc); - if (ipend & UART_IPEND_BREAK) + if (ipend & SER_INT_BREAK) uart_intr_break(sc); - if (ipend & UART_IPEND_RXREADY) + if (ipend & SER_INT_RXREADY) uart_intr_rxready(sc); - if (ipend & UART_IPEND_SIGCHG) + if (ipend & SER_INT_SIGCHG) uart_intr_sigchg(sc); - if (ipend & UART_IPEND_TXIDLE) + if (ipend & SER_INT_TXIDLE) uart_intr_txidle(sc); } while (1); ==== //depot/projects/smpng/sys/dev/uart/uart_dev_ns8250.c#10 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/uart/uart_dev_ns8250.c,v 1.14 2005/01/06 01:43:26 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/uart/uart_dev_ns8250.c,v 1.16 2006/02/24 05:40:17 marcel Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -460,7 +460,7 @@ SIGCHG(msr & MSR_CTS, sig, SER_CTS, SER_DCTS); SIGCHG(msr & MSR_DCD, sig, SER_DCD, SER_DDCD); SIGCHG(msr & MSR_RI, sig, SER_RI, SER_DRI); - new = sig & ~UART_SIGMASK_DELTA; + new = sig & ~SER_MASK_DELTA; } while (!atomic_cmpset_32(&sc->sc_hwsig, old, new)); return (sig); } @@ -556,17 +556,17 @@ lsr = uart_getreg(bas, REG_LSR); mtx_unlock_spin(&sc->sc_hwmtx); if (lsr & LSR_OE) - ipend |= UART_IPEND_OVERRUN; + ipend |= SER_INT_OVERRUN; if (lsr & LSR_BI) - ipend |= UART_IPEND_BREAK; + ipend |= SER_INT_BREAK; if (lsr & LSR_RXRDY) - ipend |= UART_IPEND_RXREADY; + ipend |= SER_INT_RXREADY; } else { mtx_unlock_spin(&sc->sc_hwmtx); if (iir & IIR_TXRDY) - ipend |= UART_IPEND_TXIDLE; + ipend |= SER_INT_TXIDLE; else - ipend |= UART_IPEND_SIGCHG; + ipend |= SER_INT_SIGCHG; } return ((sc->sc_leaving) ? 0 : ipend); } ==== //depot/projects/smpng/sys/dev/uart/uart_dev_sab82532.c#8 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/uart/uart_dev_sab82532.c,v 1.10 2005/01/30 22:14:30 marcel Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/uart/uart_dev_sab82532.c,v 1.12 2006/02/24 05:40:17 marcel Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -470,7 +470,7 @@ } SIGCHG(pvr, sig, SER_DSR, SER_DDSR); mtx_unlock_spin(&sc->sc_hwmtx); - new = sig & ~UART_SIGMASK_DELTA; + new = sig & ~SER_MASK_DELTA; } while (!atomic_cmpset_32(&sc->sc_hwsig, old, new)); return (sig); } @@ -546,15 +546,15 @@ ipend = 0; if (isr1 & SAB_ISR1_BRKT) - ipend |= UART_IPEND_BREAK; + ipend |= SER_INT_BREAK; if (isr0 & SAB_ISR0_RFO) - ipend |= UART_IPEND_OVERRUN; + ipend |= SER_INT_OVERRUN; if (isr0 & (SAB_ISR0_TCD|SAB_ISR0_RPF)) - ipend |= UART_IPEND_RXREADY; + ipend |= SER_INT_RXREADY; if ((isr0 & SAB_ISR0_CDSC) || (isr1 & SAB_ISR1_CSC)) - ipend |= UART_IPEND_SIGCHG; + ipend |= SER_INT_SIGCHG; if (isr1 & SAB_ISR1_ALLS) - ipend |= UART_IPEND_TXIDLE; + ipend |= SER_INT_TXIDLE; return (ipend); } ==== //depot/projects/smpng/sys/dev/uart/uart_dev_z8530.c#9 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/uart/uart_dev_z8530.c,v 1.12 2005/04/27 21:57:51 marcel Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/uart/uart_dev_z8530.c,v 1.14 2006/02/24 05:40:17 marcel Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -305,7 +305,7 @@ z8530->tpc = z8530_setup(bas, 9600, 8, 1, UART_PARITY_NONE); z8530->tpc &= ~(TPC_DTR|TPC_RTS); } - z8530->txidle = 1; /* Report UART_IPEND_TXIDLE. */ + z8530->txidle = 1; /* Report SER_INT_TXIDLE. */ sc->sc_rxfifosz = 3; sc->sc_txfifosz = 1; @@ -354,7 +354,7 @@ SIGCHG(bes & BES_CTS, sig, SER_CTS, SER_DCTS); SIGCHG(bes & BES_DCD, sig, SER_DCD, SER_DDCD); SIGCHG(bes & BES_SYNC, sig, SER_DSR, SER_DDSR); - new = sig & ~UART_SIGMASK_DELTA; + new = sig & ~SER_MASK_DELTA; } while (!atomic_cmpset_32(&sc->sc_hwsig, old, new)); return (sig); } @@ -418,14 +418,14 @@ } if (ip & IP_RIA) - ipend |= UART_IPEND_RXREADY; + ipend |= SER_INT_RXREADY; if (ip & IP_TIA) { uart_setreg(bas, REG_CTRL, CR_RSTTXI); uart_barrier(bas); if (z8530->txidle) { - ipend |= UART_IPEND_TXIDLE; - z8530->txidle = 0; /* Mask UART_IPEND_TXIDLE. */ + ipend |= SER_INT_TXIDLE; + z8530->txidle = 0; /* Mask SER_INT_TXIDLE. */ } } @@ -434,18 +434,18 @@ uart_barrier(bas); bes = uart_getmreg(bas, RR_BES); if (bes & BES_BRK) - ipend |= UART_IPEND_BREAK; + ipend |= SER_INT_BREAK; sig = sc->sc_hwsig; SIGCHG(bes & BES_CTS, sig, SER_CTS, SER_DCTS); SIGCHG(bes & BES_DCD, sig, SER_DCD, SER_DDCD); SIGCHG(bes & BES_SYNC, sig, SER_DSR, SER_DDSR); - if (sig & UART_SIGMASK_DELTA) - ipend |= UART_IPEND_SIGCHG; + if (sig & SER_MASK_DELTA) + ipend |= SER_INT_SIGCHG; src = uart_getmreg(bas, RR_SRC); if (src & SRC_OVR) { uart_setreg(bas, REG_CTRL, CR_RSTERR); uart_barrier(bas); - ipend |= UART_IPEND_OVERRUN; + ipend |= SER_INT_OVERRUN; } } @@ -586,7 +586,7 @@ uart_setreg(bas, REG_DATA, sc->sc_txbuf[0]); uart_barrier(bas); sc->sc_txbusy = 1; - z8530->txidle = 1; /* Report UART_IPEND_TXIDLE again. */ + z8530->txidle = 1; /* Report SER_INT_TXIDLE again. */ mtx_unlock_spin(&sc->sc_hwmtx); return (0); } ==== //depot/projects/smpng/sys/dev/uart/uart_kbd_sun.c#7 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/uart/uart_kbd_sun.c,v 1.6 2005/10/25 19:48:46 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/uart/uart_kbd_sun.c,v 1.7 2006/02/24 02:42:26 marcel Exp $"); #include "opt_kbd.h" @@ -274,10 +274,10 @@ return; pend = atomic_readandclear_32(&sc->sc_uart->sc_ttypend); - if (!(pend & UART_IPEND_MASK)) + if (!(pend & SER_INT_MASK)) return; - if (pend & UART_IPEND_RXREADY) { + if (pend & SER_INT_RXREADY) { if (KBD_IS_ACTIVE(&sc->sc_kbd) && KBD_IS_BUSY(&sc->sc_kbd)) { sc->sc_kbd.kb_callback.kc_func(&sc->sc_kbd, KBDIO_KEYINPUT, sc->sc_kbd.kb_callback.kc_arg); ==== //depot/projects/smpng/sys/dev/uart/uart_tty.c#17 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/uart/uart_tty.c,v 1.25 2005/10/26 15:52:16 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/uart/uart_tty.c,v 1.26 2006/02/24 02:42:26 marcel Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -307,12 +307,12 @@ return; pend = atomic_readandclear_32(&sc->sc_ttypend); - if (!(pend & UART_IPEND_MASK)) + if (!(pend & SER_INT_MASK)) return; tp = sc->sc_u.u_tty.tp; - if (pend & UART_IPEND_RXREADY) { + if (pend & SER_INT_RXREADY) { while (!uart_rx_empty(sc) && !(tp->t_state & TS_TBLOCK)) { xc = uart_rx_get(sc); c = xc & 0xff; @@ -324,13 +324,13 @@ } } - if (pend & UART_IPEND_BREAK) { + if (pend & SER_INT_BREAK) { if (tp != NULL && !(tp->t_iflag & IGNBRK)) ttyld_rint(tp, 0); } - if (pend & UART_IPEND_SIGCHG) { - sig = pend & UART_IPEND_SIGMASK; + if (pend & SER_INT_SIGCHG) { + sig = pend & SER_INT_SIGMASK; if (sig & SER_DDCD) ttyld_modem(tp, sig & SER_DCD); if ((sig & SER_DCTS) && (tp->t_cflag & CCTS_OFLOW) && @@ -343,7 +343,7 @@ } } - if (pend & UART_IPEND_TXIDLE) { + if (pend & SER_INT_TXIDLE) { tp->t_state &= ~TS_BUSY; ttyld_start(tp); } ==== //depot/projects/smpng/sys/i386/include/mptable.h#4 (text+ko) ==== @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/i386/include/mptable.h,v 1.222 2005/01/06 22:18:15 imp Exp $ + * $FreeBSD: src/sys/i386/include/mptable.h,v 1.223 2006/02/22 21:38:33 sam Exp $ */ #ifndef __MACHINE_MPTABLE_H__ @@ -139,7 +139,8 @@ char name[16]; } basetable_entry; +#ifdef _KERNEL int mptable_pci_probe_table(int bus); int mptable_pci_route_interrupt(device_t pcib, device_t dev, int pin); - +#endif #endif /* !__MACHINE_MPTABLE_H__ */ ==== //depot/projects/smpng/sys/kern/kern_condvar.c#42 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/kern_condvar.c,v 1.54 2006/02/15 23:52:00 davidxu Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_condvar.c,v 1.55 2006/02/23 00:13:58 davidxu Exp $"); #include "opt_ktrace.h" @@ -192,18 +192,6 @@ sleepq_lock(cvp); - /* - * Don't bother sleeping if we are exiting and not the exiting - * thread or if our thread is marked as interrupted. - */ - mtx_lock_spin(&sched_lock); - rval = thread_sleep_check(td); - mtx_unlock_spin(&sched_lock); - if (rval != 0) { - sleepq_release(cvp); - return (rval); - } - cvp->cv_waiters++; DROP_GIANT(); mtx_unlock(mp); @@ -315,18 +303,6 @@ sleepq_lock(cvp); - /* - * Don't bother sleeping if we are exiting and not the exiting - * thread or if our thread is marked as interrupted. - */ - mtx_lock_spin(&sched_lock); - rval = thread_sleep_check(td); - mtx_unlock_spin(&sched_lock); - if (rval != 0) { - sleepq_release(cvp); - return (rval); - } - cvp->cv_waiters++; DROP_GIANT(); mtx_unlock(mp); ==== //depot/projects/smpng/sys/kern/kern_sig.c#118 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/kern_sig.c,v 1.323 2006/02/15 23:52:00 davidxu Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_sig.c,v 1.325 2006/02/23 09:24:19 davidxu Exp $"); #include "opt_compat.h" #include "opt_ktrace.h" @@ -1189,35 +1189,40 @@ } } -again: +restart: for (i = 1; i <= _SIG_MAXSIG; ++i) { if (!SIGISMEMBER(waitset, i)) continue; - if (SIGISMEMBER(td->td_sigqueue.sq_signals, i)) { - SIGFILLSET(td->td_sigmask); - SIG_CANTMASK(td->td_sigmask); - SIGDELSET(td->td_sigmask, i); - mtx_lock(&ps->ps_mtx); - sig = cursig(td); - i = 0; - mtx_unlock(&ps->ps_mtx); - } else if (SIGISMEMBER(p->p_sigqueue.sq_signals, i)) { - if (p->p_flag & P_SA) { - p->p_flag |= P_SIGEVENT; - wakeup(&p->p_siglist); - } - sigqueue_move(&p->p_sigqueue, &td->td_sigqueue, i); - SIGFILLSET(td->td_sigmask); - SIG_CANTMASK(td->td_sigmask); - SIGDELSET(td->td_sigmask, i); - mtx_lock(&ps->ps_mtx); - sig = cursig(td); - i = 0; - mtx_unlock(&ps->ps_mtx); + if (!SIGISMEMBER(td->td_sigqueue.sq_signals, i)) { + if (SIGISMEMBER(p->p_sigqueue.sq_signals, i)) { + if (p->p_flag & P_SA) { + p->p_flag |= P_SIGEVENT; + wakeup(&p->p_siglist); + } + sigqueue_move(&p->p_sigqueue, + &td->td_sigqueue, i); + } else + continue; } + + SIGFILLSET(td->td_sigmask); + SIG_CANTMASK(td->td_sigmask); + SIGDELSET(td->td_sigmask, i); + mtx_lock(&ps->ps_mtx); + sig = cursig(td); + mtx_unlock(&ps->ps_mtx); if (sig) goto out; + else { + /* + * Because cursig() may have stopped current thread, + * after it is resumed, things may have already been + * changed, it should rescan any pending signals. + */ + goto restart; + } } + if (error) goto out; @@ -1255,30 +1260,37 @@ error = 0; } } - goto again; + goto restart; out: + td->td_sigmask = savedmask; + signotify(td); if (sig) { - sig_t action; - ksiginfo_init(ksi); sigqueue_get(&td->td_sigqueue, sig, ksi); ksi->ksi_signo = sig; if (ksi->ksi_code == SI_TIMER) itimer_accept(p, ksi->ksi_timerid, ksi); error = 0; - mtx_lock(&ps->ps_mtx); - action = ps->ps_sigact[_SIG_IDX(sig)]; - mtx_unlock(&ps->ps_mtx); + #ifdef KTRACE - if (KTRPOINT(td, KTR_PSIG)) + if (KTRPOINT(td, KTR_PSIG)) { + sig_t action; + + mtx_lock(&ps->ps_mtx); + action = ps->ps_sigact[_SIG_IDX(sig)]; + mtx_unlock(&ps->ps_mtx); ktrpsig(sig, action, &td->td_sigmask, 0); + } #endif _STOPEVENT(p, S_SIG, sig); + if (sig == SIGKILL) { + p->p_code = ksi->ksi_code; + p->p_sig = sig; + sigexit(td, sig); + } } - td->td_sigmask = savedmask; - signotify(td); PROC_UNLOCK(p); return (error); } @@ -2673,13 +2685,12 @@ void thread_stopped(struct proc *p) { - struct proc *p1 = curthread->td_proc; int n; PROC_LOCK_ASSERT(p, MA_OWNED); mtx_assert(&sched_lock, MA_OWNED); n = p->p_suspcount; - if (p == p1) + if (p == curproc) n++; if ((p->p_flag & P_STOPPED_SIG) && (n == p->p_numthreads)) { >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200602242247.k1OMltXS036013>