Date: Wed, 2 Jul 2003 22:37:37 -0700 (PDT) From: Marcel Moolenaar <marcel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 34006 for review Message-ID: <200307030537.h635bbRI099806@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=34006 Change 34006 by marcel@marcel_nfs on 2003/07/02 22:37:28 IFC @34004 Affected files ... .. //depot/projects/uart/alpha/alpha/mp_machdep.c#2 integrate .. //depot/projects/uart/boot/efi/libefi/Makefile#2 integrate .. //depot/projects/uart/boot/i386/libi386/Makefile#2 integrate .. //depot/projects/uart/boot/ia64/libski/Makefile#2 integrate .. //depot/projects/uart/boot/ia64/libski/pal_stub.S#1 branch .. //depot/projects/uart/boot/ia64/libski/pal_stub.s#2 delete .. //depot/projects/uart/boot/pc98/libpc98/Makefile#2 integrate .. //depot/projects/uart/conf/files.ia64#3 integrate .. //depot/projects/uart/dev/acpica/acpi.c#2 integrate .. //depot/projects/uart/dev/ata/ata-chipset.c#2 integrate .. //depot/projects/uart/dev/ata/ata-pci.c#2 integrate .. //depot/projects/uart/dev/ata/ata-pci.h#2 integrate .. //depot/projects/uart/dev/fatm/if_fatm.c#3 integrate .. //depot/projects/uart/dev/ips/ips_pci.c#3 integrate .. //depot/projects/uart/dev/kbd/atkbd.c#2 integrate .. //depot/projects/uart/dev/ppc/ppc.c#1 branch .. //depot/projects/uart/dev/ppc/ppcreg.h#1 branch .. //depot/projects/uart/dev/random/randomdev.c#2 integrate .. //depot/projects/uart/dev/sio/sio.c#2 integrate .. //depot/projects/uart/geom/geom_ctl.c#2 integrate .. //depot/projects/uart/i386/bios/apm.c#2 integrate .. //depot/projects/uart/i386/isa/pcvt/pcvt_drv.c#2 integrate .. //depot/projects/uart/ia64/ia64/context.S#1 branch .. //depot/projects/uart/ia64/ia64/context.s#2 delete .. //depot/projects/uart/ia64/ia64/exception.S#1 branch .. //depot/projects/uart/ia64/ia64/exception.s#2 delete .. //depot/projects/uart/ia64/ia64/locore.S#1 branch .. //depot/projects/uart/ia64/ia64/locore.s#2 delete .. //depot/projects/uart/ia64/ia64/pal.S#1 branch .. //depot/projects/uart/ia64/ia64/pal.s#2 delete .. //depot/projects/uart/ia64/ia64/setjmp.S#1 branch .. //depot/projects/uart/ia64/ia64/setjmp.s#2 delete .. //depot/projects/uart/ia64/ia64/support.S#1 branch .. //depot/projects/uart/ia64/ia64/support.s#2 delete .. //depot/projects/uart/ia64/ia64/syscall.S#1 branch .. //depot/projects/uart/ia64/ia64/syscall.s#2 delete .. //depot/projects/uart/isa/atkbdc_isa.c#2 integrate .. //depot/projects/uart/isa/fd.c#2 integrate .. //depot/projects/uart/isa/isahint.c#2 integrate .. //depot/projects/uart/isa/syscons_isa.c#2 integrate .. //depot/projects/uart/kern/kern_mutex.c#2 integrate .. //depot/projects/uart/kern/kern_tc.c#2 integrate .. //depot/projects/uart/kern/subr_hints.c#2 integrate .. //depot/projects/uart/netgraph/atm/ng_atm.c#2 integrate .. //depot/projects/uart/nfsclient/nfs_nfsiod.c#2 integrate .. //depot/projects/uart/nfsserver/nfs_syscalls.c#2 integrate .. //depot/projects/uart/pc98/pc98/fd.c#2 integrate .. //depot/projects/uart/pc98/pc98/pc98kbd.c#2 integrate .. //depot/projects/uart/pc98/pc98/sio.c#2 integrate .. //depot/projects/uart/pc98/pc98/syscons_pc98.c#2 integrate .. //depot/projects/uart/sys/bus.h#2 integrate Differences ... ==== //depot/projects/uart/alpha/alpha/mp_machdep.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/alpha/alpha/mp_machdep.c,v 1.42 2003/06/10 16:50:43 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/alpha/mp_machdep.c,v 1.43 2003/07/02 16:09:00 jhb Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -349,7 +349,6 @@ mtx_init(&ap_boot_mtx, "ap boot", NULL, MTX_SPIN); for (i = 0; i < hwrpb->rpb_pcs_cnt; i++) { - int dv; struct pcs *pcsp; if (i == boot_cpu_id) @@ -380,8 +379,7 @@ } continue; } - dv = 0; - if (resource_int_value("cpu", i, "disable", &dv) == 0 && dv) { + if (resource_disabled("cpu", i)) printf("CPU %d disabled by loader.\n", i); continue; } ==== //depot/projects/uart/boot/efi/libefi/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/boot/efi/libefi/Makefile,v 1.11 2002/12/10 06:22:25 marcel Exp $ +# $FreeBSD: src/sys/boot/efi/libefi/Makefile,v 1.12 2003/07/02 11:53:55 ru Exp $ .PATH: ${.CURDIR}/../../../${MACHINE_ARCH}/${MACHINE_ARCH} @@ -6,7 +6,7 @@ INTERNALLIB= true SRCS= libefi.c efi_console.c time.c copy.c devicename.c module.c -SRCS+= delay.c efifs.c efinet.c elf_freebsd.c bootinfo.c pal.s +SRCS+= delay.c efifs.c efinet.c elf_freebsd.c bootinfo.c pal.S .if ${MACHINE_ARCH} == "ia64" SRCS+= efifpswa.c ==== //depot/projects/uart/boot/i386/libi386/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/boot/i386/libi386/Makefile,v 1.31 2003/06/07 17:42:26 obrien Exp $ +# $FreeBSD: src/sys/boot/i386/libi386/Makefile,v 1.32 2003/07/02 12:45:45 ru Exp $ # LIB= i386 INTERNALLIB= true @@ -7,7 +7,7 @@ biospci.c biossmap.c bootinfo.c bootinfo32.c bootinfo64.c \ comconsole.c devicename.c elf32_freebsd.c \ elf64_freebsd.c gatea20.c \ - i386_copy.c i386_module.c nullconsole.c pxe.c \ + i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \ time.c vidconsole.c amd64_tramp.S CFLAGS+= -ffreestanding @@ -45,8 +45,4 @@ .endif -OBJS+= pxetramp.o -pxetramp.o: pxetramp.s - ${AS} ${AFLAGS} -o ${.TARGET} ${.ALLSRC:M*pxetramp*} - .include <bsd.lib.mk> ==== //depot/projects/uart/boot/ia64/libski/Makefile#2 (text+ko) ==== @@ -1,11 +1,11 @@ -# $FreeBSD: src/sys/boot/ia64/libski/Makefile,v 1.9 2003/02/01 22:50:08 marcel Exp $ +# $FreeBSD: src/sys/boot/ia64/libski/Makefile,v 1.10 2003/07/02 11:47:33 ru Exp $ LIB= ski INTERNALLIB= true SRCS= skiconsole.c time.c copy.c devicename.c module.c exit.c SRCS+= delay.c skifs.c elf_freebsd.c bootinfo.c ssc.c -SRCS+= acpi_stub.c efi_stub.c pal_stub.s sal_stub.c +SRCS+= acpi_stub.c efi_stub.c pal_stub.S sal_stub.c CFLAGS+= -ffreestanding -fpic -g CFLAGS+= -I${.CURDIR}/../include ==== //depot/projects/uart/boot/pc98/libpc98/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/boot/pc98/libpc98/Makefile,v 1.17 2003/06/08 03:16:59 nyan Exp $ +# $FreeBSD: src/sys/boot/pc98/libpc98/Makefile,v 1.18 2003/07/02 12:45:45 ru Exp $ # LIB= pc98 INTERNALLIB= true @@ -7,7 +7,7 @@ SRCS= bioscd.c biosdisk.c biosmem.c biospnp.c biospci.c biossmap.c \ bootinfo.c bootinfo32.c comconsole.c devicename.c elf32_freebsd.c \ - gatea20.c i386_copy.c i386_module.c nullconsole.c pxe.c \ + gatea20.c i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \ time.c vidconsole.c CFLAGS+= -ffreestanding @@ -46,8 +46,4 @@ .endif -OBJS+= pxetramp.o -pxetramp.o: pxetramp.s - ${AS} ${AFLAGS} -o ${.TARGET} ${.ALLSRC:M*pxetramp*} - .include <bsd.lib.mk> ==== //depot/projects/uart/conf/files.ia64#3 (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.ia64,v 1.52 2003/05/16 21:26:40 marcel Exp $ +# $FreeBSD: src/sys/conf/files.ia64,v 1.53 2003/07/02 12:57:06 ru Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -76,7 +76,7 @@ ia64/ia64/busdma_machdep.c standard ia64/ia64/clock.c standard ia64/ia64/clock_if.m standard -ia64/ia64/context.s standard +ia64/ia64/context.S standard ia64/ia64/critical.c standard ia64/ia64/db_disasm.c optional ddb ia64/ia64/db_interface.c optional ddb @@ -85,26 +85,26 @@ ia64/ia64/efi.c standard ia64/ia64/eficlock.c standard ia64/ia64/elf_machdep.c standard -ia64/ia64/exception.s standard +ia64/ia64/exception.S standard ia64/ia64/ia64-gdbstub.c optional ddb ia64/ia64/in_cksum.c optional inet ia64/ia64/interrupt.c standard -ia64/ia64/locore.s standard no-obj +ia64/ia64/locore.S standard no-obj ia64/ia64/machdep.c standard ia64/ia64/mca.c standard ia64/ia64/mem.c standard ia64/ia64/mp_machdep.c optional smp ia64/ia64/nexus.c standard -ia64/ia64/pal.s standard +ia64/ia64/pal.S standard ia64/ia64/pmap.c standard ia64/ia64/sal.c standard ia64/ia64/sapic.c standard -ia64/ia64/setjmp.s standard +ia64/ia64/setjmp.S standard ia64/ia64/ssc.c optional ski ia64/ia64/sscdisk.c optional ski -ia64/ia64/support.s standard +ia64/ia64/support.S standard ia64/ia64/sys_machdep.c standard -ia64/ia64/syscall.s standard +ia64/ia64/syscall.S standard ia64/ia64/trap.c standard ia64/ia64/unaligned.c standard ia64/ia64/unwind.c standard ==== //depot/projects/uart/dev/acpica/acpi.c#2 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/acpica/acpi.c,v 1.89 2003/05/01 18:51:43 jhb Exp $ + * $FreeBSD: src/sys/dev/acpica/acpi.c,v 1.90 2003/07/02 16:09:00 jhb Exp $ */ #include "opt_acpi.h" @@ -215,8 +215,7 @@ /* * Check that we haven't been disabled with a hint. */ - if (!resource_int_value("acpi", 0, "disabled", &error) && - (error != 0)) + if (resource_disabled("acpi", 0)) return_VOID; /* @@ -2175,13 +2174,11 @@ static void acpi_pm_register(void *arg) { - int error; if (!cold) return; - if (!resource_int_value("acpi", 0, "disabled", &error) && - (error != 0)) + if (resource_disabled("acpi", 0)) return; power_pm_register(POWER_PM_TYPE_ACPI, acpi_pm_func, NULL); ==== //depot/projects/uart/dev/ata/ata-chipset.c#2 (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-chipset.c,v 1.31 2003/06/27 10:11:54 grehan Exp $ + * $FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.32 2003/07/02 10:50:44 sos Exp $ */ #include "opt_ata.h" #include <sys/param.h> @@ -93,6 +93,8 @@ static int ata_serverworks_chipinit(device_t); static void ata_serverworks_setmode(struct ata_device *, int); static int ata_sii_chipinit(device_t); +static int ata_sii_mio_allocate(device_t, struct ata_channel *); +static void ata_sii_intr(void *); static void ata_cmd_intr(void *); static void ata_sii_setmode(struct ata_device *, int); static void ata_cmd_setmode(struct ata_device *, int); @@ -838,11 +840,6 @@ mode = ata_limit_mode(atadev, mode, ctlr->chip->max_dma); - if (mode >= ATA_SA150) { - atadev->mode = mode; - return; - } - if (ctlr->chip->max_dma && mode > ATA_UDMA2 && !(reg54 & (0x10 << devno))) { ata_prtdev(atadev,"DMA limited to UDMA33, non-ATA66 cable or device\n"); mode = ATA_UDMA2; @@ -854,7 +851,10 @@ ata_prtdev(atadev, "%s setting %s on %s chip\n", (error) ? "failed" : "success", ata_mode2str(mode), ctlr->chip->text); - if (!error) { + if (error) + return; + + if (ctlr->chip->max_dma < ATA_SA150) { if (mode >= ATA_UDMA0) { pci_write_config(parent, 0x48, reg48 | (0x0001 << devno), 2); pci_write_config(parent, 0x4a, (reg4a & ~(0x3 << (devno<<2))) | @@ -894,8 +894,8 @@ } pci_write_config(parent, 0x40, (reg40 & ~mask40) | new40, 4); pci_write_config(parent, 0x44, (reg44 & ~mask44) | new44, 1); - atadev->mode = mode; } + atadev->mode = mode; } /* @@ -1244,11 +1244,6 @@ break; } - if (mode >= ATA_SA150) { - atadev->mode = mode; - return; - } - error = ata_command(atadev, ATA_C_SETFEATURES, 0, mode, ATA_C_F_SETXFER, ATA_WAIT_READY); if (bootverbose) @@ -1458,11 +1453,12 @@ struct ata_pci_controller *ctlr = device_get_softc(dev); struct ata_chip_id *idx; static struct ata_chip_id ids[] = - {{ ATA_SII0680, 0x00, 0, SII_SETCLK, ATA_UDMA6, "SiI 0680" }, - { ATA_CMD649, 0x00, 0, SII_INTR|SII_ENINTR, ATA_UDMA5, "CMD 649" }, - { ATA_CMD648, 0x00, 0, SII_INTR|SII_ENINTR, ATA_UDMA4, "CMD 648" }, - { ATA_CMD646, 0x07, 0, SII_ENINTR, ATA_UDMA2, "CMD 646U2" }, - { ATA_CMD646, 0x00, 0, SII_ENINTR, ATA_WDMA2, "CMD 646" }, + {{ ATA_SII3112, 0x00, SIIMEMIO, 0, ATA_SA150, "SiI 3112" }, + { ATA_SII0680, 0x00, SIIMEMIO, SIISETCLK, ATA_UDMA6, "SiI 0680" }, + { ATA_CMD649, 0x00, 0, SIIINTR, ATA_UDMA5, "CMD 649" }, + { ATA_CMD648, 0x00, 0, SIIINTR, ATA_UDMA4, "CMD 648" }, + { ATA_CMD646, 0x07, 0, 0, ATA_UDMA2, "CMD 646U2" }, + { ATA_CMD646, 0x00, 0, 0, ATA_WDMA2, "CMD 646" }, { 0, 0, 0, 0, 0, 0}}; char buffer[64]; @@ -1487,38 +1483,105 @@ device_printf(dev, "unable to map interrupt\n"); return ENXIO; } - if ((bus_setup_intr(dev, ctlr->r_irq, INTR_TYPE_BIO | INTR_ENTROPY, - ctlr->chip->cfg2 & SII_INTR ? - ata_cmd_intr : ata_generic_intr, - ctlr, &ctlr->handle))) { - device_printf(dev, "unable to setup interrupt\n"); - return ENXIO; + + if (ctlr->chip->cfg1 == SIIMEMIO) { + if ((bus_setup_intr(dev, ctlr->r_irq, INTR_TYPE_BIO | INTR_ENTROPY, + ata_sii_intr, ctlr, &ctlr->handle))) { + device_printf(dev, "unable to setup interrupt\n"); + return ENXIO; + } + rid = 0x24; + if (!(ctlr->r_io2 = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, + 0, ~0, 1, RF_ACTIVE))) + return ENXIO; + + if (ctlr->chip->cfg2 & SIISETCLK) { + if ((pci_read_config(dev, 0x8a, 1) & 0x30) != 0x10) + pci_write_config(dev, 0x8a, + (pci_read_config(dev, 0x8a, 1) & 0x0F)|0x10,1); + if ((pci_read_config(dev, 0x8a, 1) & 0x30) != 0x10) + device_printf(dev, "%s could not set ATA133 clock\n", + ctlr->chip->text); + } + ctlr->allocate = ata_sii_mio_allocate; + ctlr->setmode = ata_sii_setmode; } + else { + if ((bus_setup_intr(dev, ctlr->r_irq, INTR_TYPE_BIO | INTR_ENTROPY, + ctlr->chip->cfg2 & SIIINTR ? + ata_cmd_intr : ata_generic_intr, + ctlr, &ctlr->handle))) { + device_printf(dev, "unable to setup interrupt\n"); + return ENXIO; + } + + if ((pci_read_config(dev, 0x51, 1) & 0x08) != 0x08) { + device_printf(dev, "HW has secondary channel disabled\n"); + ctlr->channels = 1; + } - if (ctlr->chip->cfg2 & SII_ENINTR) + /* enable interrupt as BIOS might not */ pci_write_config(dev, 0x71, 0x01, 1); - if (ctlr->chip->cfg2 & SII_SETCLK) { - if ((pci_read_config(dev, 0x8a, 1) & 0x30) != 0x10) - pci_write_config(dev, 0x8a, - (pci_read_config(dev, 0x8a, 1) & 0x0F) | 0x10, 1); - if ((pci_read_config(dev, 0x8a, 1) & 0x30) != 0x10) - device_printf(dev, "%s could not set ATA133 clock\n", - ctlr->chip->text); - ctlr->setmode = ata_sii_setmode; + ctlr->setmode = ata_cmd_setmode; } - else - ctlr->setmode = ata_cmd_setmode; + return 0; +} + +static int +ata_sii_mio_allocate(device_t dev, struct ata_channel *ch) +{ + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); + int i; - if ((pci_read_config(dev, 0x51, 1) & 0x08) != 0x08) { - device_printf(dev, "secondary channel disabled\n"); - ctlr->channels = 1; - } + for (i = ATA_DATA; i <= ATA_STATUS; i++) { + ch->r_io[i].res = ctlr->r_io2; + ch->r_io[i].offset = 0x80 + i + (ch->unit << 6); + } + ch->r_io[ATA_ALTSTAT].res = ctlr->r_io2; + ch->r_io[ATA_ALTSTAT].offset = 0x8a + (ch->unit << 6); + ch->r_io[ATA_BMCMD_PORT].res = ctlr->r_io2; + ch->r_io[ATA_BMCMD_PORT].offset = 0x00 + (ch->unit << 3); + ch->r_io[ATA_BMSTAT_PORT].res = ctlr->r_io2; + ch->r_io[ATA_BMSTAT_PORT].offset = 0x02 + (ch->unit << 3); + ch->r_io[ATA_BMDTP_PORT].res = ctlr->r_io2; + ch->r_io[ATA_BMDTP_PORT].offset = 0x04 + (ch->unit << 3); + ch->r_io[ATA_BMDEVSPEC_0].res = ctlr->r_io2; + ch->r_io[ATA_BMDEVSPEC_0].offset = 0xa1 + (ch->unit << 6); + ch->r_io[ATA_IDX_ADDR].res = ctlr->r_io2; + if (ctlr->chip->max_dma >= ATA_SA150) + ch->flags |= ATA_NO_SLAVE; + ctlr->dmainit(ch); return 0; } static void +ata_sii_intr(void *data) +{ + struct ata_pci_controller *ctlr = data; + struct ata_channel *ch; + u_int8_t dmastat; + int unit; + + /* implement this as a toggle instead to balance load XXX */ + for (unit = 0; unit < 2; unit++) { + if (!(ch = ctlr->interrupt[unit].argument)) + continue; + if (ATA_IDX_INB(ch, ATA_BMDEVSPEC_0) & 0x08) { + if (ch->dma->flags & ATA_DMA_ACTIVE) { + if (!((dmastat = (ATA_IDX_INB(ch, ATA_BMSTAT_PORT) & + ATA_BMSTAT_MASK)) & ATA_BMSTAT_INTERRUPT)) + continue; + ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, dmastat|ATA_BMSTAT_INTERRUPT); + DELAY(1); + } + ctlr->interrupt[unit].function(ch); + } + } +} + +static void ata_cmd_intr(void *data) { struct ata_pci_controller *ctlr = data; @@ -1551,7 +1614,7 @@ { device_t parent = device_get_parent(atadev->channel->dev); struct ata_pci_controller *ctlr = device_get_softc(parent); - int devno = (atadev->channel->unit << 4) + (ATA_DEV(atadev->unit) << 1); + int rego = (atadev->channel->unit << 4) + (ATA_DEV(atadev->unit) << 1); int mreg = atadev->channel->unit ? 0x84 : 0x80; int mask = 0x03 << (ATA_DEV(atadev->unit) << 2); int mval = pci_read_config(parent, mreg, 1) & ~mask; @@ -1559,7 +1622,8 @@ mode = ata_limit_mode(atadev, mode, ctlr->chip->max_dma); - mode = ata_check_80pin(atadev, mode); + if (ctlr->chip->max_dma < ATA_SA150) + mode = ata_check_80pin(atadev, mode); error = ata_command(atadev, ATA_C_SETFEATURES, 0, mode, ATA_C_F_SETXFER, ATA_WAIT_READY); @@ -1567,20 +1631,24 @@ ata_prtdev(atadev, "%s setting %s on %s chip\n", (error) ? "failed" : "success", ata_mode2str(mode), ctlr->chip->text); - if (!error) { + + if (error) + return; + + if (ctlr->chip->max_dma < ATA_SA150) { if (mode >= ATA_UDMA0) { u_int8_t udmatimings[] = { 0xf, 0xb, 0x7, 0x5, 0x3, 0x2, 0x1 }; - u_int8_t ureg = 0xac + devno; + u_int8_t ureg = 0xac + rego; pci_write_config(parent, mreg, mval | (0x03 << (ATA_DEV(atadev->unit) << 2)), 1); pci_write_config(parent, ureg, - (pci_read_config(parent, ureg, 1) & 0x3f) | + (pci_read_config(parent, ureg, 1) & ~0x3f) | udmatimings[mode & ATA_MODE_MASK], 1); } else if (mode >= ATA_WDMA0) { - u_int8_t dreg = 0xa8 + devno; + u_int8_t dreg = 0xa8 + rego; u_int16_t dmatimings[] = { 0x2208, 0x10c2, 0x10c1 }; pci_write_config(parent, mreg, @@ -1589,15 +1657,15 @@ } else { - u_int8_t preg = 0xa4 + devno; + u_int8_t preg = 0xa4 + rego; u_int16_t piotimings[] = { 0x328a, 0x2283, 0x1104, 0x10c3, 0x10c1 }; pci_write_config(parent, mreg, mval | (0x01 << (ATA_DEV(atadev->unit) << 2)), 1); pci_write_config(parent, preg, piotimings[mode & ATA_MODE_MASK], 2); } - atadev->mode = mode; } + atadev->mode = mode; } static void ==== //depot/projects/uart/dev/ata/ata-pci.c#2 (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-pci.c,v 1.62 2003/06/07 15:19:16 sos Exp $ + * $FreeBSD: src/sys/dev/ata/ata-pci.c,v 1.63 2003/07/02 10:50:44 sos Exp $ */ #include "opt_ata.h" @@ -152,18 +152,13 @@ cmd = pci_read_config(dev, PCIR_COMMAND, 2); } #endif - /* is busmastering supported and configured ? */ + /* if busmastering configured get the I/O resource */ if ((cmd & PCIM_CMD_BUSMASTEREN) == PCIM_CMD_BUSMASTEREN) { int rid = ATA_BMADDR_RID; - if (!ctlr->r_io2) { - if (!(ctlr->r_io1 = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, 1, RF_ACTIVE))) - device_printf(dev, "Busmastering DMA not configured\n"); - } + ctlr->r_io1 = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, + 0, ~0, 1, RF_ACTIVE); } - else - device_printf(dev, "Busmastering DMA not supported\n"); ctlr->chipinit(dev); ==== //depot/projects/uart/dev/ata/ata-pci.h#2 (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-pci.h,v 1.11 2003/05/18 16:45:48 sos Exp $ + * $FreeBSD: src/sys/dev/ata/ata-pci.h,v 1.12 2003/07/02 10:50:44 sos Exp $ */ /* structure holding chipset config info */ @@ -154,6 +154,7 @@ #define ATA_SILICON_IMAGE_ID 0x1095 #define ATA_SII0680 0x06801095 +#define ATA_SII3112 0x31121095 #define ATA_CMD646 0x06461095 #define ATA_CMD648 0x06481095 #define ATA_CMD649 0x06491095 @@ -242,9 +243,9 @@ #define SWKS66 1 #define SWKS100 2 -#define SII_INTR 0x01 -#define SII_SETCLK 0x02 -#define SII_ENINTR 0x04 +#define SIIMEMIO 1 +#define SIIINTR 0x01 +#define SIISETCLK 0x02 #define SIS_SOUTH 1 #define SIS133NEW 2 ==== //depot/projects/uart/dev/fatm/if_fatm.c#3 (text+ko) ==== @@ -29,7 +29,7 @@ * Fore PCA200E driver for NATM */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/fatm/if_fatm.c,v 1.2 2003/07/01 15:51:56 scottl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/fatm/if_fatm.c,v 1.3 2003/07/02 13:53:41 harti Exp $"); #include "opt_inet.h" #include "opt_natm.h" @@ -2877,7 +2877,7 @@ if (bus_dma_tag_create(NULL, 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, MAXDMASEGS, - BUS_SPACE_MAXSIZE_32BIT, 0, busdma_lock_mutex, &Giant, + BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, &sc->parent_dmat)) { if_printf(ifp, "could not allocate parent DMA tag\n"); error = ENOMEM; @@ -2891,20 +2891,21 @@ if (bus_dma_tag_create(sc->parent_dmat, 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, 1, MCLBYTES, 0, - busdma_lock_mutex, &Giant, &sc->rbuf_tag)) { + NULL, NULL, &sc->rbuf_tag)) { if_printf(ifp, "could not allocate rbuf DMA tag\n"); error = ENOMEM; goto fail; } /* - * Allocate the transmission DMA tag. + * Allocate the transmission DMA tag. Must add 1, because + * rounded up PDU will be 65536 bytes long. */ if (bus_dma_tag_create(sc->parent_dmat, 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, - FATM_MAXPDU, TPD_EXTENSIONS + TXD_FIXED, MCLBYTES, 0, - busdma_lock_mutex, &Giant, &sc->tx_tag)) { + FATM_MAXPDU + 1, TPD_EXTENSIONS + TXD_FIXED, MCLBYTES, 0, + NULL, NULL, &sc->tx_tag)) { if_printf(ifp, "could not allocate tx DMA tag\n"); error = ENOMEM; goto fail; ==== //depot/projects/uart/dev/ips/ips_pci.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ips/ips_pci.c,v 1.3 2003/07/01 15:51:58 scottl Exp $ + * $FreeBSD: src/sys/dev/ips/ips_pci.c,v 1.4 2003/07/02 16:09:00 jhb Exp $ */ @@ -50,13 +50,10 @@ static int ips_pci_attach(device_t dev) { u_int32_t command; - int tval; ips_softc_t *sc; - tval = 0; - if (resource_int_value(device_get_name(dev), device_get_unit(dev), - "disable", &tval) == 0 && tval) { + if (resource_disabled(device_get_name(dev), device_get_unit(dev))) { device_printf(dev, "device is disabled\n"); /* but return 0 so the !$)$)*!$*) unit isn't reused */ return (0); ==== //depot/projects/uart/dev/kbd/atkbd.c#2 (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/kbd/atkbd.c,v 1.38 2003/04/30 12:57:38 markm Exp $ + * $FreeBSD: src/sys/dev/kbd/atkbd.c,v 1.39 2003/07/02 16:09:01 jhb Exp $ */ #include "opt_kbd.h" @@ -277,8 +277,7 @@ atkbdc_configure(); /* if the driver is disabled, unregister the keyboard if any */ - if ((resource_int_value("atkbd", ATKBD_DEFAULT, "disabled", &i) == 0) - && i != 0) { + if (resource_disabled("atkbd", ATKBD_DEFAULT)) { i = kbd_find_keyboard(ATKBD_DRIVER_NAME, ATKBD_DEFAULT); if (i >= 0) { kbd = kbd_get_keyboard(i); ==== //depot/projects/uart/dev/random/randomdev.c#2 (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/random/randomdev.c,v 1.40 2003/03/03 12:15:45 phk Exp $ + * $FreeBSD: src/sys/dev/random/randomdev.c,v 1.41 2003/07/02 08:04:57 phk Exp $ */ #include <sys/param.h> @@ -327,7 +327,7 @@ if ((harvestring.tail == harvestring.head) || (random_systat.burst && burst == random_systat.burst)) { - tsleep(&harvestring, PUSER, "sleep", hz/10); + tsleep(&harvestring, PUSER, "-", hz/10); burst = 0; } ==== //depot/projects/uart/dev/sio/sio.c#2 (text+ko) ==== @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/sio/sio.c,v 1.400 2003/06/09 21:25:14 scottl Exp $ + * $FreeBSD: src/sys/dev/sio/sio.c,v 1.401 2003/07/02 16:09:01 jhb Exp $ * from: @(#)com.c 7.5 (Berkeley) 5/16/91 * from: i386/isa sio.c,v 1.234 */ @@ -2967,11 +2967,9 @@ for (unit = 0; unit < 16; unit++) { /* XXX need to know how many */ int flags; - int disabled; - if (resource_int_value("sio", unit, "disabled", &disabled) == 0) { - if (disabled) - continue; - } + + if (resource_disabled("sio", unit)) + continue; if (resource_int_value("sio", unit, "flags", &flags)) continue; if (COM_CONSOLE(flags) || COM_DEBUGGER(flags)) { ==== //depot/projects/uart/geom/geom_ctl.c#2 (text+ko) ==== @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/geom/geom_ctl.c,v 1.28 2003/06/11 06:49:15 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/geom/geom_ctl.c,v 1.29 2003/07/02 08:07:07 phk Exp $"); #include "opt_geom.h" @@ -266,7 +266,7 @@ } else if (ap->flag & GCTL_PARAM_ASCII) { printf("\"%s\"", (char *)ap->kvalue); } else if (ap->len > 0) { - for (j = 0; j < ap->len; j++) + for (j = 0; j < ap->len && j < 512; j++) printf(" %02x", ((u_char *)ap->kvalue)[j]); } else { printf(" = %p", ap->kvalue); @@ -473,6 +473,7 @@ gctl_copyout(req); } + g_waitidle(); gctl_free(req); return (req->nerror); } ==== //depot/projects/uart/i386/bios/apm.c#2 (text+ko) ==== @@ -17,7 +17,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/i386/bios/apm.c,v 1.135 2003/06/22 05:08:10 mdodd Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/bios/apm.c,v 1.136 2003/07/02 16:09:01 jhb Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -846,6 +846,9 @@ return; } + if (resource_disabled("apm", 0)) + return; + child = BUS_ADD_CHILD(parent, 0, "apm", 0); if (child == NULL) panic("apm_identify"); @@ -860,18 +863,12 @@ #define APM_KERNBASE KERNBASE struct vm86frame vmf; struct apm_softc *sc = &apm_softc; - int disabled, flags; + int flags; #ifdef PC98 int rid; #endif device_set_desc(dev, "APM BIOS"); - - if (resource_int_value("apm", 0, "disabled", &disabled) != 0) - disabled = 0; - if (disabled) - return ENXIO; - if (device_get_unit(dev) > 0) { printf("apm: Only one APM driver supported.\n"); return ENXIO; @@ -1544,10 +1541,8 @@ static void apm_pm_register(void *arg) { - int disabled = 0; - resource_int_value("apm", 0, "disabled", &disabled); - if (disabled == 0) + if (!resource_disabled("apm", 0)) power_pm_register(POWER_PM_TYPE_APM, apm_pm_func, NULL); } ==== //depot/projects/uart/i386/isa/pcvt/pcvt_drv.c#2 (text+ko) ==== @@ -50,7 +50,7 @@ * * Last Edit-Date: [Sat Jul 15 15:06:06 2000] * - * $FreeBSD: src/sys/i386/isa/pcvt/pcvt_drv.c,v 1.77 2003/03/25 00:07:03 jake Exp $ + * $FreeBSD: src/sys/i386/isa/pcvt/pcvt_drv.c,v 1.78 2003/07/02 16:09:01 jhb Exp $ * *---------------------------------------------------------------------------*/ @@ -642,8 +642,8 @@ int unit = 0; int i; - /* See if this driver is disabled in probe hint. */ - if (resource_int_value("vt", unit, "disabled", &i) == 0 && i) + /* See if this driver is disabled in probe hint. */ + if (resource_disabled("vt", unit)) { cp->cn_pri = CN_DEAD; return; ==== //depot/projects/uart/isa/atkbdc_isa.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/isa/atkbdc_isa.c,v 1.26 2003/06/11 00:32:45 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/isa/atkbdc_isa.c,v 1.27 2003/07/02 16:09:01 jhb Exp $"); #include "opt_kbd.h" @@ -255,7 +255,7 @@ if (resource_int_value(name, unit, "flags", &t) == 0) device_set_flags(child, t); - if (resource_int_value(name, unit, "disabled", &t) == 0 && t != 0) + if (resource_disabled(name, unit)) device_disable(child); device_set_ivars(child, ivar); ==== //depot/projects/uart/isa/fd.c#2 (text+ko) ==== @@ -53,7 +53,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/isa/fd.c,v 1.255 2003/06/16 08:42:20 yar Exp $"); +__FBSDID("$FreeBSD: src/sys/isa/fd.c,v 1.256 2003/07/02 16:09:01 jhb Exp $"); #include "opt_fdc.h" #include "card.h" @@ -973,7 +973,7 @@ static void fdc_add_child(device_t dev, const char *name, int unit) { - int disabled, flags; + int flags; struct fdc_ivars *ivar; device_t child; @@ -990,8 +990,7 @@ device_set_ivars(child, ivar); if (resource_int_value(name, unit, "flags", &flags) == 0) device_set_flags(child, flags); - if (resource_int_value(name, unit, "disabled", &disabled) == 0 - && disabled != 0) + if (resource_disabled(name, unit)) device_disable(child); } ==== //depot/projects/uart/isa/isahint.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/isa/isahint.c,v 1.13 2003/06/11 00:32:45 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/isa/isahint.c,v 1.14 2003/07/02 16:09:01 jhb Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -79,7 +79,7 @@ if (resource_int_value(name, unit, "flags", &t) == 0) device_set_flags(child, t); - if (resource_int_value(name, unit, "disabled", &t) == 0 && t != 0) + if (resource_disabled(name, unit)) device_disable(child); } ==== //depot/projects/uart/isa/syscons_isa.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/isa/syscons_isa.c,v 1.22 2003/06/11 00:32:45 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/isa/syscons_isa.c,v 1.23 2003/07/02 16:09:01 jhb Exp $"); #include "opt_syscons.h" @@ -195,14 +195,12 @@ int sc_get_cons_priority(int *unit, int *flags) { - int disabled; const char *at; int u, f; *unit = -1; for (u = 0; u < 16; u++) { - if ((resource_int_value(SC_DRIVER_NAME, u, "disabled", - &disabled) == 0) && disabled) + if (resource_disabled(SC_DRIVER_NAME, u)) continue; if (resource_string_value(SC_DRIVER_NAME, u, "at", &at) != 0) continue; ==== //depot/projects/uart/kern/kern_mutex.c#2 (text+ko) ==== @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/kern_mutex.c,v 1.128 2003/06/11 00:56:56 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_mutex.c,v 1.129 2003/07/02 16:14:09 jhb Exp $"); #include "opt_adaptive_mutexes.h" #include "opt_ddb.h" @@ -524,12 +524,15 @@ /* * The mutex was marked contested on release. This means that - * there are threads blocked on it. + * there are other threads blocked on it. Grab ownership of + * it and propagate its priority to the current thread if + * necessary. */ if (v == MTX_CONTESTED) { td1 = TAILQ_FIRST(&m->mtx_blocked); MPASS(td1 != NULL); m->mtx_lock = (uintptr_t)td | MTX_CONTESTED; + LIST_INSERT_HEAD(&td->td_contested, m, mtx_contested); if (td1->td_priority < td->td_priority) td->td_priority = td1->td_priority; @@ -593,7 +596,9 @@ #endif /* - * Put us on the list of threads blocked on this mutex. + * Put us on the list of threads blocked on this mutex >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200307030537.h635bbRI099806>