PERFORCE change 42019 for review
Sam Leffler
sam at FreeBSD.org
Tue Nov 11 11:48:26 PST 2003
http://perforce.freebsd.org/chv.cgi?CH=42019
Change 42019 by sam at sam_ebb on 2003/11/11 11:48:11
IFC
Affected files ...
.. //depot/projects/netperf/sys/boot/i386/boot2/boot2.c#4 integrate
.. //depot/projects/netperf/sys/conf/files.sparc64#4 integrate
.. //depot/projects/netperf/sys/conf/options.i386#6 integrate
.. //depot/projects/netperf/sys/conf/options.pc98#4 integrate
.. //depot/projects/netperf/sys/dev/ata/ata-all.c#10 integrate
.. //depot/projects/netperf/sys/dev/ata/ata-all.h#5 integrate
.. //depot/projects/netperf/sys/dev/ata/ata-disk.c#7 integrate
.. //depot/projects/netperf/sys/dev/ata/atapi-cam.c#9 integrate
.. //depot/projects/netperf/sys/dev/ata/atapi-cd.c#13 integrate
.. //depot/projects/netperf/sys/dev/ata/atapi-fd.c#4 integrate
.. //depot/projects/netperf/sys/dev/ata/atapi-tape.c#4 integrate
.. //depot/projects/netperf/sys/dev/fb/creator.c#2 integrate
.. //depot/projects/netperf/sys/dev/sound/pci/cmi.c#4 integrate
.. //depot/projects/netperf/sys/dev/sound/pcm/dsp.c#4 integrate
.. //depot/projects/netperf/sys/dev/sound/pcm/mixer.c#3 integrate
.. //depot/projects/netperf/sys/dev/uart/uart_cpu_sparc64.c#5 integrate
.. //depot/projects/netperf/sys/dev/uart/uart_kbd_sun.c#1 branch
.. //depot/projects/netperf/sys/dev/uart/uart_kbd_sun.h#1 branch
.. //depot/projects/netperf/sys/dev/uart/uart_kbd_sun_tables.h#1 branch
.. //depot/projects/netperf/sys/i386/conf/NOTES#10 integrate
.. //depot/projects/netperf/sys/i386/i386/mp_machdep.c#12 integrate
.. //depot/projects/netperf/sys/i386/i386/mptable.c#4 integrate
.. //depot/projects/netperf/sys/ia64/ia64/machdep.c#17 integrate
.. //depot/projects/netperf/sys/ia64/ia64/syscall.S#7 integrate
.. //depot/projects/netperf/sys/kern/kern_ktrace.c#4 integrate
.. //depot/projects/netperf/sys/kern/kern_mac.c#8 integrate
.. //depot/projects/netperf/sys/kern/vfs_bio.c#14 integrate
.. //depot/projects/netperf/sys/netgraph/netgraph.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_UI.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_async.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_bpf.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_cisco.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_device.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_echo.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_eiface.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_etf.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_fec.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_frame_relay.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_hole.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_iface.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_ip_input.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_ksocket.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_l2tp.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_lmi.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_message.h#3 integrate
.. //depot/projects/netperf/sys/netgraph/ng_mppc.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_parse.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_ppp.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_pppoe.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_pptpgre.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_rfc1490.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_sample.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_socket.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_socketvar.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_source.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_split.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_tee.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_tty.h#2 integrate
.. //depot/projects/netperf/sys/netgraph/ng_vjc.h#2 integrate
.. //depot/projects/netperf/sys/netinet/tcp_syncache.c#11 edit
.. //depot/projects/netperf/sys/netkey/key.c#7 integrate
.. //depot/projects/netperf/sys/nfsclient/nfs_vnops.c#7 integrate
.. //depot/projects/netperf/sys/sparc64/conf/GENERIC#4 integrate
.. //depot/projects/netperf/sys/sparc64/creator/creator_upa.c#2 integrate
.. //depot/projects/netperf/sys/sparc64/include/cache.h#2 integrate
.. //depot/projects/netperf/sys/sparc64/sparc64/cache.c#3 integrate
.. //depot/projects/netperf/sys/sparc64/sparc64/cheetah.c#3 integrate
.. //depot/projects/netperf/sys/sparc64/sparc64/machdep.c#7 integrate
.. //depot/projects/netperf/sys/sparc64/sparc64/spitfire.c#3 integrate
.. //depot/projects/netperf/sys/sparc64/sparc64/support.S#3 integrate
.. //depot/projects/netperf/sys/sparc64/sparc64/trap.c#4 integrate
Differences ...
==== //depot/projects/netperf/sys/boot/i386/boot2/boot2.c#4 (text+ko) ====
@@ -14,12 +14,14 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/i386/boot2/boot2.c,v 1.65 2003/11/10 19:06:09 bde Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/i386/boot2/boot2.c,v 1.66 2003/11/11 06:27:34 bde Exp $");
#include <sys/param.h>
#include <sys/disklabel.h>
#include <sys/diskmbr.h>
#include <sys/dirent.h>
+#include <sys/reboot.h>
+
#include <machine/bootinfo.h>
#include <machine/elf.h>
==== //depot/projects/netperf/sys/conf/files.sparc64#4 (text+ko) ====
@@ -1,7 +1,7 @@
# This file tells config what files go into building a kernel,
# files marked standard are always included.
#
-# $FreeBSD: src/sys/conf/files.sparc64,v 1.46 2003/09/06 23:23:25 marcel Exp $
+# $FreeBSD: src/sys/conf/files.sparc64,v 1.47 2003/11/11 07:33:24 jake Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -33,6 +33,7 @@
dev/syscons/syscons.c optional sc
dev/syscons/sysmouse.c optional sc
dev/uart/uart_cpu_sparc64.c optional uart
+dev/uart/uart_kbd_sun.c optional uart sc
geom/geom_bsd.c standard
geom/geom_bsd_enc.c standard
geom/geom_sunlabel.c standard
==== //depot/projects/netperf/sys/conf/options.i386#6 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/options.i386,v 1.201 2003/11/07 15:14:53 bde Exp $
+# $FreeBSD: src/sys/conf/options.i386,v 1.202 2003/11/11 17:14:25 jhb Exp $
# Options specific to the i386 platform kernels
AUTO_EOI_1 opt_auto_eoi.h
@@ -7,6 +7,7 @@
COMPAT_OLDISA
I586_PMC_GUPROF opt_i586_guprof.h
MAXMEM
+MPTABLE_FORCE_HTT
NO_MIXED_MODE
PERFMON
DISABLE_PSE opt_pmap.h
==== //depot/projects/netperf/sys/conf/options.pc98#4 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/options.pc98,v 1.169 2003/11/04 12:19:54 nyan Exp $
+# $FreeBSD: src/sys/conf/options.pc98,v 1.170 2003/11/11 17:14:25 jhb Exp $
# Options specific to the pc98 platform kernels
AUTO_EOI_1 opt_auto_eoi.h
@@ -7,6 +7,7 @@
COMPAT_OLDISA
I586_PMC_GUPROF opt_i586_guprof.h
MAXMEM
+MPTABLE_FORCE_HTT
NO_MIXED_MODE
PERFMON
DISABLE_PSE opt_pmap.h
==== //depot/projects/netperf/sys/dev/ata/ata-all.c#10 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.196 2003/11/03 09:25:02 des Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.197 2003/11/11 14:55:35 sos Exp $");
#include "opt_ata.h"
#include <sys/param.h>
@@ -73,6 +73,16 @@
static void bpack(int8_t *, int8_t *, int);
static void ata_init(void);
+/* global vars */
+struct intr_config_hook *ata_delayed_attach = NULL;
+devclass_t ata_devclass;
+int ata_wc = 1;
+
+/* local vars */
+static MALLOC_DEFINE(M_ATA, "ATA generic", "ATA driver generic layer");
+static int ata_dma = 1;
+static int atapi_dma = 0;
+
/* sysctl vars */
SYSCTL_NODE(_hw, OID_AUTO, ata, CTLFLAG_RD, 0, "ATA driver parameters");
TUNABLE_INT("hw.ata.ata_dma", &ata_dma);
@@ -84,17 +94,7 @@
TUNABLE_INT("hw.ata.atapi_dma", &atapi_dma);
SYSCTL_INT(_hw_ata, OID_AUTO, atapi_dma, CTLFLAG_RDTUN, &atapi_dma, 0,
"ATAPI device DMA mode control");
-int ata_dma = 1;
-int ata_wc = 1;
-int atapi_dma = 0;
-/* global vars */
-struct intr_config_hook *ata_delayed_attach = NULL;
-devclass_t ata_devclass;
-
-/* local vars */
-static MALLOC_DEFINE(M_ATA, "ATA generic", "ATA driver generic layer");
-
/*
* newbus device interface related functions
*/
@@ -675,6 +675,23 @@
}
}
}
+
+ /* setup basic transfer mode by setting PIO mode and DMA if supported */
+ if (ch->device[MASTER].attach) {
+ ch->device[MASTER].setmode(&ch->device[MASTER], ATA_PIO_MAX);
+ if ((((ch->devices & ATA_ATAPI_MASTER) && atapi_dma &&
+ (ch->device[MASTER].param->config&ATA_DRQ_MASK) != ATA_DRQ_INTR)||
+ ((ch->devices & ATA_ATA_MASTER) && ata_dma)) && ch->dma)
+ ch->device[MASTER].setmode(&ch->device[MASTER], ATA_DMA_MAX);
+
+ }
+ if (ch->device[SLAVE].attach) {
+ ch->device[SLAVE].setmode(&ch->device[SLAVE], ATA_PIO_MAX);
+ if ((((ch->devices & ATA_ATAPI_SLAVE) && atapi_dma &&
+ (ch->device[SLAVE].param->config&ATA_DRQ_MASK) != ATA_DRQ_INTR) ||
+ ((ch->devices & ATA_ATA_SLAVE) && ata_dma)) && ch->dma)
+ ch->device[SLAVE].setmode(&ch->device[SLAVE], ATA_DMA_MAX);
+ }
}
static void
==== //depot/projects/netperf/sys/dev/ata/ata-all.h#5 (text+ko) ====
@@ -25,7 +25,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.66 2003/10/21 19:20:36 sos Exp $
+ * $FreeBSD: src/sys/dev/ata/ata-all.h,v 1.67 2003/11/11 14:55:35 sos Exp $
*/
/* ATA register defines */
@@ -345,7 +345,7 @@
/* externs */
extern devclass_t ata_devclass;
extern struct intr_config_hook *ata_delayed_attach;
-extern int ata_dma, ata_wc, atapi_dma;
+extern int ata_wc;
/* public prototypes */
/* ata-all.c: */
==== //depot/projects/netperf/sys/dev/ata/ata-disk.c#7 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-disk.c,v 1.162 2003/11/03 09:25:02 des Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-disk.c,v 1.164 2003/11/11 14:55:35 sos Exp $");
#include "opt_ata.h"
#include <sys/param.h>
@@ -137,12 +137,6 @@
adp->max_iosize = secsperint * DEV_BSIZE;
}
- /* use DMA if allowed and if drive/controller supports it */
- if (ata_dma && atadev->channel->dma)
- atadev->setmode(atadev, ATA_DMA_MAX);
- else
- atadev->setmode(atadev, ATA_PIO_MAX);
-
/* setup the function ptrs */
atadev->detach = ad_detach;
atadev->start = ad_start;
@@ -331,28 +325,34 @@
bzero(&request, sizeof(struct ata_request));
request.device = adp->device;
- request.data = virtual;
- request.bytecount = length;
- request.transfersize = min(length, adp->max_iosize);
- request.flags = ATA_R_WRITE;
- if (adp->max_iosize > DEV_BSIZE)
- request.u.ata.command = ATA_WRITE_MUL;
- else
- request.u.ata.command = ATA_WRITE;
- request.u.ata.lba = offset / DEV_BSIZE;
- request.u.ata.count = request.bytecount / DEV_BSIZE;
+ if (length) {
+ request.data = virtual;
+ request.bytecount = length;
+ request.transfersize = min(length, adp->max_iosize);
+ request.flags = ATA_R_WRITE;
+ if (adp->max_iosize > DEV_BSIZE)
+ request.u.ata.command = ATA_WRITE_MUL;
+ else
+ request.u.ata.command = ATA_WRITE;
+ request.u.ata.lba = offset / DEV_BSIZE;
+ request.u.ata.count = request.bytecount / DEV_BSIZE;
+ }
+ else {
+ request.u.ata.command = ATA_FLUSHCACHE;
+ request.flags = ATA_R_CONTROL;
+ }
- if (adp->device->channel->hw.transaction(&request) == ATA_OP_FINISHED)
+ if (request.device->channel->hw.transaction(&request) == ATA_OP_CONTINUES) {
+ while (request.device->channel->running == &request &&
+ !(request.status & ATA_S_ERROR)) {
+ DELAY(20);
+ request.device->channel->running = &request;
+ request.device->channel->hw.interrupt(request.device->channel);
+ }
+ }
+ if (request.status & ATA_S_ERROR)
return EIO;
- while (request.bytecount > request.donecount) {
- DELAY(20);
- adp->device->channel->running = &request;
- adp->device->channel->hw.interrupt(adp->device->channel);
- adp->device->channel->running = NULL;
- if (request.status & ATA_S_ERROR)
- return EIO;
- }
return 0;
}
==== //depot/projects/netperf/sys/dev/ata/atapi-cam.c#9 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-cam.c,v 1.27 2003/11/09 20:46:08 scottl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-cam.c,v 1.28 2003/11/11 14:55:35 sos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -227,11 +227,6 @@
2 * device_get_unit(atp->channel->dev) +
(atp->unit == ATA_MASTER) ? 0 : 1);
atp->softc = (void *)scp;
- if (atapi_dma && atp->channel->dma &&
- (atp->param->config & ATA_DRQ_MASK) != ATA_DRQ_INTR)
- atp->setmode(atp, ATA_DMA_MAX);
- else
- atp->setmode(atp, ATA_PIO_MAX);
}
}
==== //depot/projects/netperf/sys/dev/ata/atapi-cd.c#13 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-cd.c,v 1.153 2003/11/09 10:11:15 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-cd.c,v 1.154 2003/11/11 14:55:35 sos Exp $");
#include "opt_ata.h"
#include <sys/param.h>
@@ -171,13 +171,6 @@
else
g_post_event(acd_geom_create, cdp, M_WAITOK, NULL);
- /* use DMA if allowed and if drive/controller supports it */
- if (atapi_dma && atadev->channel->dma &&
- (atadev->param->config & ATA_DRQ_MASK) != ATA_DRQ_INTR)
- atadev->setmode(atadev, ATA_DMA_MAX);
- else
- atadev->setmode(atadev, ATA_PIO_MAX);
-
/* setup the function ptrs */
atadev->detach = acd_detach;
atadev->start = acd_start;
==== //depot/projects/netperf/sys/dev/ata/atapi-fd.c#4 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-fd.c,v 1.88 2003/08/25 09:01:49 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-fd.c,v 1.89 2003/11/11 14:55:35 sos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -87,13 +87,6 @@
return;
}
- /* use DMA if allowed and if drive/controller supports it */
- if (atapi_dma && atadev->channel->dma &&
- (atadev->param->config & ATA_DRQ_MASK) != ATA_DRQ_INTR)
- atadev->setmode(atadev, ATA_DMA_MAX);
- else
- atadev->setmode(atadev, ATA_PIO_MAX);
-
/* setup the function ptrs */
atadev->detach = afd_detach;
atadev->start = afd_start;
==== //depot/projects/netperf/sys/dev/ata/atapi-tape.c#4 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-tape.c,v 1.83 2003/08/25 09:01:49 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-tape.c,v 1.84 2003/11/11 14:55:36 sos Exp $");
#include "opt_ata.h"
#include <sys/param.h>
@@ -148,13 +148,6 @@
dev->si_iosize_max = DFLTPHYS;
stp->dev2 = dev;
- /* use DMA if allowed and if drive/controller supports it */
- if (atapi_dma && atadev->channel->dma &&
- (atadev->param->config & ATA_DRQ_MASK) != ATA_DRQ_INTR)
- atadev->setmode(atadev, ATA_DMA_MAX);
- else
- atadev->setmode(atadev, ATA_PIO_MAX);
-
/* setup the function ptrs */
atadev->detach = ast_detach;
atadev->start = ast_start;
==== //depot/projects/netperf/sys/dev/fb/creator.c#2 (text+ko) ====
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/fb/creator.c,v 1.1 2003/08/24 01:15:39 jake Exp $
+ * $FreeBSD: src/sys/dev/fb/creator.c,v 1.2 2003/11/11 07:34:08 jake Exp $
*/
#include <sys/param.h>
@@ -170,22 +170,21 @@
char buf[32];
int i;
- chosen = OF_finddevice("/chosen");
-
- OF_getprop(chosen, "stdout", &stdout, sizeof(stdout));
+ sc = &creator_softc;
for (child = OF_child(OF_peer(0)); child != 0;
child = OF_peer(child)) {
OF_getprop(child, "name", buf, sizeof(buf));
- if (child == OF_instance_to_package(stdout) &&
- (strcmp(buf, "SUNW,ffb") == 0 ||
- strcmp(buf, "SUNW,afb") == 0))
+ if (strcmp(buf, "SUNW,ffb") == 0 ||
+ strcmp(buf, "SUNW,afb") == 0)
break;
}
if (child == 0)
return (0);
- sc = &creator_softc;
- sc->sc_console = 1;
+ chosen = OF_finddevice("/chosen");
+ OF_getprop(chosen, "stdout", &stdout, sizeof(stdout));
+ if (child == stdout)
+ sc->sc_console = 1;
OF_getprop(child, "reg", reg, sizeof(reg));
for (i = 0; i < FFB_NREG; i++) {
@@ -439,7 +438,7 @@
struct creator_softc *sc;
sc = (struct creator_softc *)adp;
- if (sc->sc_colp != NULL ** sc->sc_rowp != NULL) {
+ if (sc->sc_colp != NULL && sc->sc_rowp != NULL) {
*sc->sc_colp = col;
*sc->sc_rowp = row;
}
==== //depot/projects/netperf/sys/dev/sound/pci/cmi.c#4 (text+ko) ====
@@ -51,7 +51,7 @@
#include "mixer_if.h"
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/cmi.c,v 1.23 2003/09/02 17:30:37 jhb Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/cmi.c,v 1.24 2003/11/11 05:38:27 scottl Exp $");
/* Supported chip ID's */
#define CMI8338A_PCI_ID 0x010013f6
@@ -516,41 +516,41 @@
{
struct sc_info *sc = data;
u_int32_t intrstat;
+ u_int32_t toclear;
snd_mtxlock(sc->lock);
intrstat = cmi_rd(sc, CMPCI_REG_INTR_STATUS, 4);
- if ((intrstat & CMPCI_REG_ANY_INTR) == 0) {
- goto out;
- }
+ if ((intrstat & CMPCI_REG_ANY_INTR) != 0) {
+
+ toclear = 0;
+ if (intrstat & CMPCI_REG_CH0_INTR) {
+ toclear |= CMPCI_REG_CH0_INTR_ENABLE;
+ //cmi_clr4(sc, CMPCI_REG_INTR_CTRL, CMPCI_REG_CH0_INTR_ENABLE);
+ }
- /* Disable interrupts */
- if (intrstat & CMPCI_REG_CH0_INTR) {
- cmi_clr4(sc, CMPCI_REG_INTR_CTRL, CMPCI_REG_CH0_INTR_ENABLE);
- }
+ if (intrstat & CMPCI_REG_CH1_INTR) {
+ toclear |= CMPCI_REG_CH1_INTR_ENABLE;
+ //cmi_clr4(sc, CMPCI_REG_INTR_CTRL, CMPCI_REG_CH1_INTR_ENABLE);
+ }
- if (intrstat & CMPCI_REG_CH1_INTR) {
- cmi_clr4(sc, CMPCI_REG_INTR_CTRL, CMPCI_REG_CH1_INTR_ENABLE);
- }
+ if (toclear) {
+ cmi_clr4(sc, CMPCI_REG_INTR_CTRL, toclear);
+ snd_mtxunlock(sc->lock);
- /* Signal interrupts to channel */
- if (intrstat & CMPCI_REG_CH0_INTR) {
- chn_intr(sc->pch.channel);
- }
+ /* Signal interrupts to channel */
+ if (intrstat & CMPCI_REG_CH0_INTR) {
+ chn_intr(sc->pch.channel);
+ }
- if (intrstat & CMPCI_REG_CH1_INTR) {
- chn_intr(sc->rch.channel);
- }
+ if (intrstat & CMPCI_REG_CH1_INTR) {
+ chn_intr(sc->rch.channel);
+ }
- /* Enable interrupts */
- if (intrstat & CMPCI_REG_CH0_INTR) {
- cmi_set4(sc, CMPCI_REG_INTR_CTRL, CMPCI_REG_CH0_INTR_ENABLE);
- }
+ snd_mtxlock(sc->lock);
+ cmi_set4(sc, CMPCI_REG_INTR_CTRL, toclear);
- if (intrstat & CMPCI_REG_CH1_INTR) {
- cmi_set4(sc, CMPCI_REG_INTR_CTRL, CMPCI_REG_CH1_INTR_ENABLE);
+ }
}
-
-out:
snd_mtxunlock(sc->lock);
return;
}
==== //depot/projects/netperf/sys/dev/sound/pcm/dsp.c#4 (text+ko) ====
@@ -29,7 +29,7 @@
#include <dev/sound/pcm/sound.h>
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/dsp.c,v 1.66 2003/09/07 16:28:03 cg Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/dsp.c,v 1.67 2003/11/11 05:38:28 scottl Exp $");
#define OLDPCM_IOCTL
@@ -172,6 +172,8 @@
intrmask_t s;
u_int32_t fmt;
int devtype;
+ int rdref;
+ int error;
s = spltty();
d = dsp_get_info(i_dev);
@@ -207,6 +209,8 @@
panic("impossible devtype %d", devtype);
}
+ rdref = 0;
+
/* lock snddev so nobody else can monkey with it */
pcm_lock(d);
@@ -249,67 +253,66 @@
return EBUSY;
}
/* got a channel, already locked for us */
- }
-
- if (flags & FWRITE) {
- /* open for write */
- wrch = pcm_chnalloc(d, PCMDIR_PLAY, td->td_proc->p_pid, -1);
- if (!wrch) {
- /* no channel available */
- if (flags & FREAD) {
- /* just opened a read channel, release it */
- pcm_chnrelease(rdch);
- }
- /* exit */
- pcm_unlock(d);
- splx(s);
- return EBUSY;
- }
- /* got a channel, already locked for us */
- }
-
- i_dev->si_drv1 = rdch;
- i_dev->si_drv2 = wrch;
-
- /* Bump refcounts, reset and unlock any channels that we just opened,
- * and then release device lock.
- */
- if (flags & FREAD) {
if (chn_reset(rdch, fmt)) {
pcm_chnrelease(rdch);
i_dev->si_drv1 = NULL;
- if (wrch && (flags & FWRITE)) {
- pcm_chnrelease(wrch);
- i_dev->si_drv2 = NULL;
- }
pcm_unlock(d);
splx(s);
return ENODEV;
}
+
if (flags & O_NONBLOCK)
rdch->flags |= CHN_F_NBIO;
pcm_chnref(rdch, 1);
CHN_UNLOCK(rdch);
+ rdref = 1;
+ /*
+ * Record channel created, ref'ed and unlocked
+ */
}
+
if (flags & FWRITE) {
- if (chn_reset(wrch, fmt)) {
- pcm_chnrelease(wrch);
- i_dev->si_drv2 = NULL;
- if (flags & FREAD) {
- CHN_LOCK(rdch);
- pcm_chnref(rdch, -1);
- pcm_chnrelease(rdch);
- i_dev->si_drv1 = NULL;
- }
- pcm_unlock(d);
- splx(s);
- return ENODEV;
+ /* open for write */
+ wrch = pcm_chnalloc(d, PCMDIR_PLAY, td->td_proc->p_pid, -1);
+ error = 0;
+
+ if (!wrch)
+ error = EBUSY; /* XXX Right return code? */
+ else if (chn_reset(wrch, fmt))
+ error = ENODEV;
+
+ if (error != 0) {
+ if (wrch) {
+ /*
+ * Free play channel
+ */
+ pcm_chnrelease(wrch);
+ i_dev->si_drv2 = NULL;
+ }
+ if (rdref) {
+ /*
+ * Lock, deref and release previously created record channel
+ */
+ CHN_LOCK(rdch);
+ pcm_chnref(rdch, -1);
+ pcm_chnrelease(rdch);
+ i_dev->si_drv1 = NULL;
}
- if (flags & O_NONBLOCK)
- wrch->flags |= CHN_F_NBIO;
- pcm_chnref(wrch, 1);
- CHN_UNLOCK(wrch);
+
+ pcm_unlock(d);
+ splx(s);
+ return error;
+ }
+
+ if (flags & O_NONBLOCK)
+ wrch->flags |= CHN_F_NBIO;
+ pcm_chnref(wrch, 1);
+ CHN_UNLOCK(wrch);
}
+
+ i_dev->si_drv1 = rdch;
+ i_dev->si_drv2 = wrch;
+
pcm_unlock(d);
splx(s);
return 0;
@@ -321,7 +324,7 @@
struct pcm_channel *rdch, *wrch;
struct snddev_info *d;
intrmask_t s;
- int exit;
+ int refs;
s = spltty();
d = dsp_get_info(i_dev);
@@ -329,53 +332,57 @@
rdch = i_dev->si_drv1;
wrch = i_dev->si_drv2;
- exit = 0;
+ refs = 0;
- /* decrement refcount for each channel, exit if nonzero */
if (rdch) {
CHN_LOCK(rdch);
- if (pcm_chnref(rdch, -1) > 0) {
- CHN_UNLOCK(rdch);
- exit = 1;
- }
+ refs += pcm_chnref(rdch, -1);
+ CHN_UNLOCK(rdch);
}
if (wrch) {
CHN_LOCK(wrch);
- if (pcm_chnref(wrch, -1) > 0) {
- CHN_UNLOCK(wrch);
- exit = 1;
- }
- }
- if (exit) {
- pcm_unlock(d);
- splx(s);
- return 0;
+ refs += pcm_chnref(wrch, -1);
+ CHN_UNLOCK(wrch);
}
- /* both refcounts are zero, abort and release */
+ /*
+ * If there are no more references, release the channels.
+ */
+ if ((rdch || wrch) && refs == 0) {
- if (pcm_getfakechan(d))
- pcm_getfakechan(d)->flags = 0;
+ if (pcm_getfakechan(d))
+ pcm_getfakechan(d)->flags = 0;
- i_dev->si_drv1 = NULL;
- i_dev->si_drv2 = NULL;
+ i_dev->si_drv1 = NULL;
+ i_dev->si_drv2 = NULL;
- dsp_set_flags(i_dev, dsp_get_flags(i_dev) & ~SD_F_TRANSIENT);
- pcm_unlock(d);
+ dsp_set_flags(i_dev, dsp_get_flags(i_dev) & ~SD_F_TRANSIENT);
- if (rdch) {
- chn_abort(rdch); /* won't sleep */
- rdch->flags &= ~(CHN_F_RUNNING | CHN_F_MAPPED | CHN_F_DEAD);
- chn_reset(rdch, 0);
- pcm_chnrelease(rdch);
- }
- if (wrch) {
- chn_flush(wrch); /* may sleep */
- wrch->flags &= ~(CHN_F_RUNNING | CHN_F_MAPPED | CHN_F_DEAD);
- chn_reset(wrch, 0);
- pcm_chnrelease(wrch);
- }
+ pcm_unlock(d);
+ if (rdch) {
+ CHN_LOCK(rdch);
+ chn_abort(rdch); /* won't sleep */
+ rdch->flags &= ~(CHN_F_RUNNING | CHN_F_MAPPED | CHN_F_DEAD);
+ chn_reset(rdch, 0);
+ pcm_chnrelease(rdch);
+ }
+ if (wrch) {
+ CHN_LOCK(wrch);
+ /*
+ * XXX: Maybe the right behaviour is to abort on non_block.
+ * It seems that mplayer flushes the audio queue by quickly
+ * closing and re-opening. In FBSD, there's a long pause
+ * while the audio queue flushes that I presume isn't there in
+ * linux.
+ */
+ chn_flush(wrch); /* may sleep */
+ wrch->flags &= ~(CHN_F_RUNNING | CHN_F_MAPPED | CHN_F_DEAD);
+ chn_reset(wrch, 0);
+ pcm_chnrelease(wrch);
+ }
+ } else
+ pcm_unlock(d);
splx(s);
return 0;
}
==== //depot/projects/netperf/sys/dev/sound/pcm/mixer.c#3 (text+ko) ====
@@ -28,7 +28,7 @@
#include "mixer_if.h"
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/mixer.c,v 1.32 2003/09/07 16:28:03 cg Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/mixer.c,v 1.33 2003/11/11 05:38:28 scottl Exp $");
MALLOC_DEFINE(M_MIXER, "mixer", "mixer");
@@ -319,7 +319,6 @@
pdev = mixer_get_devt(dev);
m = pdev->si_drv1;
- snd_mtxlock(m->lock);
m->hwvol_mixer = SOUND_MIXER_VOLUME;
m->hwvol_step = 5;
@@ -330,7 +329,6 @@
OID_AUTO, "hwvol_mixer", CTLTYPE_STRING | CTLFLAG_RW, m, 0,
sysctl_hw_snd_hwvol_mixer, "A", "");
#endif
- snd_mtxunlock(m->lock);
return 0;
}
==== //depot/projects/netperf/sys/dev/uart/uart_cpu_sparc64.c#5 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/uart/uart_cpu_sparc64.c,v 1.6 2003/09/28 07:06:34 jake Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/uart/uart_cpu_sparc64.c,v 1.7 2003/11/11 06:52:04 jake Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -39,6 +39,8 @@
#include <dev/uart/uart.h>
#include <dev/uart/uart_cpu.h>
+static phandle_t uart_cpu_getdev_keyboard(phandle_t root);
+
static struct bus_space_tag bst_store[3];
static int
@@ -65,6 +67,25 @@
return ((b1->bsh == b2->bsh) ? 1 : 0);
}
+static phandle_t
+uart_cpu_getdev_keyboard(phandle_t root)
+{
+ phandle_t child;
+ phandle_t node;
+ char buf[32];
+
+ for (child = OF_child(root); child != 0 && child != -1;
+ child = OF_peer(child)) {
+ if (OF_getprop(child, "device_type", buf, sizeof(buf)) != -1 &&
+ !strcmp(buf, "serial") &&
+ OF_getprop(child, "keyboard", buf, sizeof(buf)) != -1)
+ return (child);
+ if ((node = uart_cpu_getdev_keyboard(child)) != -1)
+ return (node);
+ }
+ return (-1);
+}
+
int
uart_cpu_getdev(int devtype, struct uart_devinfo *di)
{
@@ -86,20 +107,17 @@
* I would assume that the user expects that FreeBSD uses the new
* console setting. There's choice choice, really.
*/
- if ((options = OF_finddevice("/options")) == -1)
- return (ENXIO);
- if (OF_getprop(options, "input-device", dev, sizeof(dev)) == -1)
- return (ENXIO);
- if ((input = OF_finddevice(dev)) == -1)
- return (ENXIO);
- if (OF_getprop(input, "device_type", buf, sizeof(buf)) == -1)
- return (ENXIO);
- if (strcmp(buf, "serial"))
- return (ENODEV);
- if (devtype == UART_DEV_KEYBOARD) {
- if (OF_getprop(input, "keyboard", buf, sizeof(buf)) == -1)
+ if ((options = OF_finddevice("/options")) == -1)
+ return (ENXIO);
+ if (devtype == UART_DEV_CONSOLE) {
+ if (OF_getprop(options, "input-device", dev, sizeof(dev)) == -1)
+ return (ENXIO);
+ if ((input = OF_finddevice(dev)) == -1)
+ return (ENXIO);
+ if (OF_getprop(input, "device_type", buf, sizeof(buf)) == -1)
return (ENXIO);
- } else if (devtype == UART_DEV_CONSOLE) {
+ if (strcmp(buf, "serial"))
+ return (ENODEV);
if (OF_getprop(options, "output-device", buf, sizeof(buf))
== -1)
return (ENXIO);
@@ -107,6 +125,9 @@
return (ENXIO);
if (input != output)
return (ENXIO);
+ } else if (devtype == UART_DEV_KEYBOARD) {
+ if ((input = uart_cpu_getdev_keyboard(OF_peer(0))) == -1)
+ return (ENXIO);
} else
return (ENODEV);
==== //depot/projects/netperf/sys/i386/conf/NOTES#10 (text+ko) ====
@@ -4,7 +4,7 @@
# This file contains machine dependent kernel configuration notes. For
# machine independent notes, look in /sys/conf/NOTES.
#
-# $FreeBSD: src/sys/i386/conf/NOTES,v 1.1102 2003/11/10 15:54:32 jhb Exp $
+# $FreeBSD: src/sys/i386/conf/NOTES,v 1.1106 2003/11/11 17:14:25 jhb Exp $
#
#
@@ -22,38 +22,41 @@
#####################################################################
# SMP OPTIONS:
#
-# The apic device enables the use of the I/O APIC for Symmetric I/O.
+# The apic device enables the use of the I/O APIC for interrupt delivery.
+# The apic device can be used in both UP and SMP kernels, but is required
+# for SMP kernels. Thus, the apic device is not strictly an SMP option,
+# but it is a prerequisite for SMP.
#
# Notes:
#
-# Be sure to disable 'cpu I386_CPU' for SMP kernels.
+# Be sure to disable 'cpu I386_CPU' for SMP kernels.
#
-# Check the 'Rogue SMP hardware' section to see if additional options
-# are required by your hardware.
+# By default, mixed mode is used to route IRQ0 from the AT timer via
+# the 8259A master PIC through the ExtINT pin on the first I/O APIC.
+# This can be disabled via the NO_MIXED_MODE option. In that case,
+# IRQ0 will be routed via an intpin on the first I/O APIC. Not all
+# motherboards hook IRQ0 up to the first I/O APIC even though their
+# MP table or MADT may claim to do so. That is why mixed mode is
+# enabled by default.
#
-# By default, mixed mode is used to route IRQ0 from the AT timer via
-# the 8259A master PIC through the ExtINT pin on the first I/O APIC.
-# This can be disabled via the NO_MIXED_MODE option. In that case,
-# IRQ0 will be routed via an intpin on the first I/O APIC. Not all
-# motherboards hook IRQ0 up to the first I/O APIC even though their
-# MP table or MADT may claim to do so. That is why mixed mode is
-# enabled by default.
+# HTT CPUs should only be used if they are enabled in the BIOS. For
+# the ACPI case, ACPI only correctly tells us about any HTT CPUs if
+# they are enabled. However, most HTT systems do not list HTT CPUs
+# in the MP Table if they are enabled, thus we guess at the HTT CPUs
+# for the MP Table case. However, we shouldn't try to guess and use
+# these CPUs if HTTT is disabled. Thus, HTT guessing is only enabled
+# for the MP Table if the user explicitly asks for it via the
+# MPTABLE_FORCE_HTT option. Do NOT use this option if you have HTT
+# disabled in your BIOS.
#
# Mandatory:
device apic # I/O apic
+
+# Optional:
+options MPTABLE_FORCE_HTT # Enable HTT CPUs with the MP Table
options NO_MIXED_MODE # Disable use of mixed mode
-#
-# Rogue SMP hardware:
-#
-
-# Bridged PCI cards:
-#
-# The MP tables of most of the current generation MP motherboards
-# do NOT properly support bridged PCI cards. To use one of these
-# cards you should refer to ???
-
#####################################################################
# CPU OPTIONS
==== //depot/projects/netperf/sys/i386/i386/mp_machdep.c#12 (text+ko) ====
@@ -24,7 +24,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/mp_machdep.c,v 1.222 2003/11/10 21:24:34 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/mp_machdep.c,v 1.223 2003/11/11 17:16:15 jhb Exp $");
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list