Date: Mon, 23 Aug 2004 20:39:56 GMT From: Julian Elischer <julian@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 60321 for review Message-ID: <200408232039.i7NKduIL092789@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=60321 Change 60321 by julian@julian_ref on 2004/08/23 20:39:14 IFC Affected files ... .. //depot/projects/nsched/sys/boot/alpha/Makefile.inc#2 integrate .. //depot/projects/nsched/sys/boot/common/load.c#2 integrate .. //depot/projects/nsched/sys/boot/ficl/Makefile#2 integrate .. //depot/projects/nsched/sys/compat/linux/linux_socket.c#4 integrate .. //depot/projects/nsched/sys/conf/files#18 integrate .. //depot/projects/nsched/sys/conf/options.pc98#4 integrate .. //depot/projects/nsched/sys/contrib/pf/net/pf_ioctl.c#7 integrate .. //depot/projects/nsched/sys/dev/acpica/acpi.c#11 integrate .. //depot/projects/nsched/sys/dev/acpica/acpi_resource.c#8 integrate .. //depot/projects/nsched/sys/dev/acpica/acpivar.h#10 integrate .. //depot/projects/nsched/sys/dev/aic7xxx/aic79xx_pci.c#4 integrate .. //depot/projects/nsched/sys/dev/aic7xxx/aic7xxx_pci.c#2 integrate .. //depot/projects/nsched/sys/dev/ata/ata-queue.c#5 integrate .. //depot/projects/nsched/sys/dev/isp/isp_freebsd.c#4 integrate .. //depot/projects/nsched/sys/dev/lnc/if_lnc_pci.c#3 integrate .. //depot/projects/nsched/sys/dev/md/md.c#8 integrate .. //depot/projects/nsched/sys/dev/sound/pci/maestro.c#3 integrate .. //depot/projects/nsched/sys/geom/raid3/g_raid3.c#2 integrate .. //depot/projects/nsched/sys/geom/raid3/g_raid3.h#2 integrate .. //depot/projects/nsched/sys/geom/raid3/g_raid3_ctl.c#2 integrate .. //depot/projects/nsched/sys/geom/vinum/geom_vinum_raid5.c#3 integrate .. //depot/projects/nsched/sys/geom/vinum/geom_vinum_rm.c#2 integrate .. //depot/projects/nsched/sys/geom/vinum/geom_vinum_subr.c#4 integrate .. //depot/projects/nsched/sys/i386/conf/NOTES#10 integrate .. //depot/projects/nsched/sys/i386/i386/nexus.c#6 integrate .. //depot/projects/nsched/sys/i386/i386/p4tcc.c#2 integrate .. //depot/projects/nsched/sys/kern/kern_lock.c#4 integrate .. //depot/projects/nsched/sys/kern/subr_kdb.c#3 integrate .. //depot/projects/nsched/sys/modules/agp/Makefile#3 integrate .. //depot/projects/nsched/sys/modules/ipfw/Makefile#3 integrate .. //depot/projects/nsched/sys/net/if_fwsubr.c#3 integrate .. //depot/projects/nsched/sys/net/if_sl.c#8 integrate .. //depot/projects/nsched/sys/netinet/ip_output.c#8 integrate .. //depot/projects/nsched/sys/netinet6/in6.c#3 integrate .. //depot/projects/nsched/sys/netinet6/in6_ifattach.c#2 integrate .. //depot/projects/nsched/sys/netinet6/in6_prefix.c#3 delete .. //depot/projects/nsched/sys/netinet6/in6_prefix.h#2 delete .. //depot/projects/nsched/sys/netinet6/in6_proto.c#4 integrate .. //depot/projects/nsched/sys/netinet6/ip6_input.c#6 integrate .. //depot/projects/nsched/sys/netinet6/nd6.c#3 integrate .. //depot/projects/nsched/sys/pc98/pc98/fd.c#6 integrate .. //depot/projects/nsched/sys/sys/fdcio.h#3 integrate .. //depot/projects/nsched/sys/vm/vm_page.h#6 integrate Differences ... ==== //depot/projects/nsched/sys/boot/alpha/Makefile.inc#2 (text+ko) ==== @@ -1,9 +1,9 @@ -# $FreeBSD: src/sys/boot/alpha/Makefile.inc,v 1.9 2004/02/11 22:01:16 ru Exp $ +# $FreeBSD: src/sys/boot/alpha/Makefile.inc,v 1.11 2004/08/23 16:25:07 obrien Exp $ # Options used when building app-specific libalpha components BINDIR?= /boot -CFLAGS+= -ffreestanding -mno-fp-regs +CFLAGS+= -ffreestanding -mno-fp-regs -Os LDFLAGS+= -nostdlib PRIMARY_LOAD_ADDRESS= 0x20000000 # "Region 1 start" SECONDARY_LOAD_ADDRESS= 0x2000c000 # "Region 1 start" + 48k ==== //depot/projects/nsched/sys/boot/common/load.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/boot/common/load.c,v 1.3 2003/08/25 23:30:41 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/common/load.c,v 1.5 2004/08/22 08:57:05 maxim Exp $"); #include <stand.h> @@ -45,10 +45,10 @@ char *buf; int fd; size_t size, result; - + if ((fd = open(path, F_READ | flags)) == -1) return(NULL); - + printf("%s open, flags 0x%x\n", path, files[fd].f_flags); buf = alloc(LOAD_TINYBUF); @@ -68,12 +68,11 @@ printf("tinybuf loaded, size %d\n", size); getchar(); - - + /* Read everything until we know how big it is */ for (;;) { result = read(fd, buf, LOAD_TINYBUF); - if (size == -1) { + if (result == -1) { free(buf, LOAD_TINYBUF); close(fd); return(NULL); @@ -82,7 +81,7 @@ break; size += result; } - + /* discard the old buffer, close the file */ free(buf, LOAD_TINYBUF); close(fd); ==== //depot/projects/nsched/sys/boot/ficl/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/boot/ficl/Makefile,v 1.37 2004/02/07 08:10:07 ru Exp $ +# $FreeBSD: src/sys/boot/ficl/Makefile,v 1.39 2004/08/23 16:25:07 obrien Exp $ # .PATH: ${.CURDIR}/${MACHINE_ARCH:S/amd64/i386/} BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c math64.c \ @@ -8,7 +8,7 @@ CLEANFILES= softcore.c testmain testmain.o CFLAGS+= -ffreestanding .if ${MACHINE_ARCH} == "alpha" -CFLAGS+= -mno-fp-regs +CFLAGS+= -mno-fp-regs -Os .endif .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" CFLAGS+= -mpreferred-stack-boundary=2 ==== //depot/projects/nsched/sys/compat/linux/linux_socket.c#4 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_socket.c,v 1.51 2004/08/16 07:28:16 tjr Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_socket.c,v 1.52 2004/08/23 12:41:29 des Exp $"); /* XXX we use functions that might not exist. */ #include "opt_compat.h" @@ -1011,7 +1011,8 @@ if (error) return (error); - if (bsd_args.msg->msg_control != NULL) { + if (bsd_args.msg->msg_control != NULL && + bsd_args.msg->msg_controllen > 0) { cmsg = (struct cmsghdr*)bsd_args.msg->msg_control; cmsg->cmsg_level = bsd_to_linux_sockopt_level(cmsg->cmsg_level); } ==== //depot/projects/nsched/sys/conf/files#18 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.943 2004/08/17 22:05:53 andre Exp $ +# $FreeBSD: src/sys/conf/files,v 1.944 2004/08/23 03:00:25 rwatson Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -1516,7 +1516,6 @@ netinet6/in6_gif.c optional gif inet6 netinet6/in6_ifattach.c optional inet6 netinet6/in6_pcb.c optional inet6 -netinet6/in6_prefix.c optional inet6 netinet6/in6_proto.c optional inet6 netinet6/in6_rmx.c optional inet6 netinet6/in6_src.c optional inet6 ==== //depot/projects/nsched/sys/conf/options.pc98#4 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options.pc98,v 1.178 2004/08/18 03:46:39 rwatson Exp $ +# $FreeBSD: src/sys/conf/options.pc98,v 1.179 2004/08/22 15:13:08 nyan Exp $ # Options specific to the pc98 platform kernels AUTO_EOI_1 opt_auto_eoi.h @@ -108,6 +108,3 @@ DEV_APIC opt_apic.h DEV_MECIA opt_mecia.h DEV_NPX opt_npx.h - -# agp options -AGP_AMD64_GART opt_agp.h ==== //depot/projects/nsched/sys/contrib/pf/net/pf_ioctl.c#7 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/contrib/pf/net/pf_ioctl.c,v 1.12 2004/08/12 14:15:42 mlaier Exp $ */ +/* $FreeBSD: src/sys/contrib/pf/net/pf_ioctl.c,v 1.13 2004/08/22 15:23:48 mlaier Exp $ */ /* $OpenBSD: pf_ioctl.c,v 1.112.2.2 2004/07/24 18:28:12 brad Exp $ */ /* @@ -66,6 +66,7 @@ #ifdef __FreeBSD__ #include <sys/module.h> #include <sys/conf.h> +#include <sys/proc.h> #else #include <sys/timeout.h> #include <sys/pool.h> @@ -979,7 +980,11 @@ int error = 0; /* XXX keep in sync with switch() below */ +#ifdef __FreeBSD__ + if (securelevel_gt(td->td_ucred, 1)) +#else if (securelevel > 1) +#endif switch (cmd) { case DIOCGETRULES: case DIOCGETRULE: ==== //depot/projects/nsched/sys/dev/acpica/acpi.c#11 (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.188 2004/08/18 07:00:43 njl Exp $ + * $FreeBSD: src/sys/dev/acpica/acpi.c,v 1.189 2004/08/23 16:28:42 njl Exp $ */ #include "opt_acpi.h" @@ -83,9 +83,6 @@ /* Bitmap of device quirks. */ int acpi_quirks; -/* Local pools for managing system resources for ACPI child devices. */ -struct rman acpi_rman_io, acpi_rman_mem; - static int acpi_modevent(struct module *mod, int event, void *junk); static void acpi_identify(driver_t *driver, device_t parent); static int acpi_probe(device_t dev); @@ -99,6 +96,9 @@ static int acpi_write_ivar(device_t dev, device_t child, int index, uintptr_t value); static struct resource_list *acpi_get_rlist(device_t dev, device_t child); +static int acpi_sysres_alloc(device_t dev); +static struct resource_list_entry *acpi_sysres_find(device_t dev, int type, + u_long addr); static struct resource *acpi_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags); @@ -189,6 +189,9 @@ ACPI_SERIAL_DECL(acpi, "ACPI root bus"); +/* Local pools for managing system resources for ACPI child devices. */ +static struct rman acpi_rman_io, acpi_rman_mem; + #define ACPI_MINIMUM_AWAKETIME 5 static const char* sleep_state_names[] = { @@ -745,6 +748,75 @@ return (&ad->ad_rl); } +/* + * Pre-allocate/manage all memory and IO resources. Since rman can't handle + * duplicates, we merge any in the sysresource attach routine. + */ +static int +acpi_sysres_alloc(device_t dev) +{ + struct resource *res; + struct resource_list *rl; + struct resource_list_entry *rle; + struct rman *rm; + + rl = BUS_GET_RESOURCE_LIST(device_get_parent(dev), dev); + SLIST_FOREACH(rle, rl, link) { + if (rle->res != NULL) { + device_printf(dev, "duplicate resource for %lx\n", rle->start); + continue; + } + + /* Only memory and IO resources are valid here. */ + switch (rle->type) { + case SYS_RES_IOPORT: + rm = &acpi_rman_io; + break; + case SYS_RES_MEMORY: + rm = &acpi_rman_mem; + break; + default: + continue; + } + + /* Pre-allocate resource and add to our rman pool. */ + res = BUS_ALLOC_RESOURCE(device_get_parent(dev), dev, rle->type, + &rle->rid, rle->start, rle->start + rle->count - 1, rle->count, 0); + if (res != NULL) { + rman_manage_region(rm, rman_get_start(res), rman_get_end(res)); + rle->res = res; + } else + device_printf(dev, "reservation of %lx, %lx (%d) failed\n", + rle->start, rle->count, rle->type); + } + return (0); +} + +/* Find if we manage a given resource. */ +static struct resource_list_entry * +acpi_sysres_find(device_t dev, int type, u_long addr) +{ + struct resource_list *rl; + struct resource_list_entry *rle; + + ACPI_SERIAL_ASSERT(acpi); + + /* We only consider IO and memory resources for our pool. */ + rle = NULL; + if (type != SYS_RES_IOPORT && type != SYS_RES_MEMORY) + goto out; + + rl = BUS_GET_RESOURCE_LIST(device_get_parent(dev), dev); + SLIST_FOREACH(rle, rl, link) { + if (type == rle->type && addr >= rle->start && + addr < rle->start + rle->count) + break; + } + +out: + return (rle); +} + static struct resource * acpi_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) @@ -774,7 +846,7 @@ } /* If we don't manage this address, pass the request up to the parent. */ - rle = acpi_sysres_find(type, start); + rle = acpi_sysres_find(bus, type, start); if (rle == NULL) { res = BUS_ALLOC_RESOURCE(device_get_parent(bus), child, type, rid, start, end, count, flags); @@ -844,7 +916,7 @@ * If we know about this address, deactivate it and release it to the * local pool. If we don't, pass this request up to the parent. */ - if (acpi_sysres_find(type, rman_get_start(r)) == NULL) { + if (acpi_sysres_find(bus, type, rman_get_start(r)) == NULL) { if (rman_get_flags(r) & RF_ACTIVE) { ret = bus_deactivate_resource(child, type, rid, r); if (ret != 0) @@ -1134,6 +1206,9 @@ } } + /* Pre-allocate resources for our rman from any sysresource devices. */ + acpi_sysres_alloc(bus); + /* Create any static children by calling device identify methods. */ ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "device identify routines\n")); bus_generic_probe(bus); @@ -1757,7 +1832,7 @@ case ACPI_STATE_S2: case ACPI_STATE_S3: case ACPI_STATE_S4: - status = AcpiGetSleepTypeData((UINT8)state, &TypeA, &TypeB); + status = AcpiGetSleepTypeData(state, &TypeA, &TypeB); if (status == AE_NOT_FOUND) { device_printf(sc->acpi_dev, "Sleep state S%d not supported by BIOS\n", state); @@ -1807,7 +1882,7 @@ AcpiEnable(); } else { ACPI_DISABLE_IRQS(); - status = AcpiEnterSleepState((UINT8)state); + status = AcpiEnterSleepState(state); if (ACPI_FAILURE(status)) { device_printf(sc->acpi_dev, "AcpiEnterSleepState failed - %s\n", AcpiFormatException(status)); ==== //depot/projects/nsched/sys/dev/acpica/acpi_resource.c#8 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_resource.c,v 1.30 2004/08/20 17:04:49 njl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_resource.c,v 1.31 2004/08/23 16:28:42 njl Exp $"); #include "opt_acpi.h" #include <sys/param.h> @@ -504,51 +504,6 @@ void *ar_parent; }; -/* - * Add a resource to the device's resource list. We define our own function - * for this since bus_set_resource() doesn't handle duplicates of any kind. - * - * XXX This should be merged into resource_list_add() eventually. - */ -static int -acpi_reslist_add(device_t dev, int type, int rid, u_long start, u_long count) -{ - struct resource_list_entry *rle; - struct resource_list *rl; - u_long end; - - end = start + count - 1; - rl = BUS_GET_RESOURCE_LIST(device_get_parent(dev), dev); - - /* - * Loop through all current resources to see if the new one overlaps - * any existing ones. If so, the old one always takes precedence and - * the new one is adjusted (or rejected). We check for three cases: - * - * 1. Tail of new resource overlaps head of old resource: truncate the - * new resource so it is contiguous with the start of the old. - * 2. New resource wholly contained within the old resource: error. - * 3. Head of new resource overlaps tail of old resource: truncate the - * new resource so it is contiguous, following the old. - */ - SLIST_FOREACH(rle, rl, link) { - if (rle->type == type) { - if (start < rle->start && end >= rle->start) { - count = rle->start - start; - break; - } else if (start >= rle->start && start <= rle->end) { - if (end > rle->end) { - start = rle->end + 1; - count = end - start + 1; - break; - } else - return (EEXIST); - } - } - } - return (bus_set_resource(dev, type, rid, start, count)); -} - static void acpi_res_set_init(device_t dev, void *arg, void **context) { @@ -579,7 +534,7 @@ if (cp == NULL) return; - acpi_reslist_add(dev, SYS_RES_IOPORT, cp->ar_nio++, base, length); + bus_set_resource(dev, SYS_RES_IOPORT, cp->ar_nio++, base, length); } static void @@ -602,7 +557,7 @@ if (cp == NULL) return; - acpi_reslist_add(dev, SYS_RES_MEMORY, cp->ar_nmem++, base, length); + bus_set_resource(dev, SYS_RES_MEMORY, cp->ar_nmem++, base, length); } static void @@ -629,7 +584,7 @@ if (count != 1) return; - acpi_reslist_add(dev, SYS_RES_IRQ, cp->ar_nirq++, *irq, 1); + bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, *irq, 1); } static void @@ -644,7 +599,7 @@ if (count != 1) return; - acpi_reslist_add(dev, SYS_RES_DRQ, cp->ar_ndrq++, *drq, 1); + bus_set_resource(dev, SYS_RES_DRQ, cp->ar_ndrq++, *drq, 1); } static void @@ -670,11 +625,13 @@ /* * Resource-owning placeholders for IO and memory pseudo-devices. * - * This code allocates system resource objects that will be owned by ACPI - * child devices. Really, the acpi parent device should have the resources - * but this would significantly affect the device probe code. + * This code allocates system resources that will be used by ACPI + * child devices. The acpi parent manages these resources through a + * private rman. */ +static int acpi_sysres_rid = 100; + static int acpi_sysres_probe(device_t dev); static int acpi_sysres_attach(device_t dev); @@ -714,79 +671,66 @@ static int acpi_sysres_attach(device_t dev) { - device_t gparent; - struct resource *res; - struct rman *rm; - struct resource_list_entry *rle; - struct resource_list *rl; + device_t bus; + struct resource_list_entry *bus_rle, *dev_rle; + struct resource_list *bus_rl, *dev_rl; + int done, type; + u_long start, end, count; /* - * Pre-allocate/manage all memory and IO resources. We detect duplicates - * by setting rle->res to the resource we got from the parent. We can't - * ignore them since rman can't handle duplicates. + * Loop through all current resources to see if the new one overlaps + * any existing ones. If so, grow the old one up and/or down + * accordingly. Discard any that are wholly contained in the old. If + * the resource is unique, add it to the parent. It will later go into + * the rman pool. */ - rl = BUS_GET_RESOURCE_LIST(device_get_parent(dev), dev); - SLIST_FOREACH(rle, rl, link) { - if (rle->res != NULL) { - device_printf(dev, "duplicate resource for %lx\n", rle->start); + bus = device_get_parent(dev); + dev_rl = BUS_GET_RESOURCE_LIST(bus, dev); + bus_rl = BUS_GET_RESOURCE_LIST(device_get_parent(bus), bus); + SLIST_FOREACH(dev_rle, dev_rl, link) { + if (dev_rle->type != SYS_RES_IOPORT && dev_rle->type != SYS_RES_MEMORY) continue; - } - /* Only memory and IO resources are valid here. */ - switch (rle->type) { - case SYS_RES_IOPORT: - rm = &acpi_rman_io; - break; - case SYS_RES_MEMORY: - rm = &acpi_rman_mem; - break; - default: - continue; - } + start = dev_rle->start; + end = dev_rle->end; + count = dev_rle->count; + type = dev_rle->type; + done = FALSE; - /* Pre-allocate resource and add to our rman pool. */ - gparent = device_get_parent(device_get_parent(dev)); - res = BUS_ALLOC_RESOURCE(gparent, dev, rle->type, &rle->rid, - rle->start, rle->start + rle->count - 1, rle->count, 0); - if (res != NULL) { - rman_manage_region(rm, rman_get_start(res), rman_get_end(res)); - rle->res = res; - } - } + SLIST_FOREACH(bus_rle, bus_rl, link) { + if (bus_rle->type != type) + continue; - return (0); -} + /* New resource wholly contained in old, discard. */ + if (start >= bus_rle->start && end <= bus_rle->end) + break; -/* XXX The resource list may require locking and refcounting. */ -struct resource_list_entry * -acpi_sysres_find(int type, u_long addr) -{ - device_t *devs; - int i, numdevs; - struct resource_list *rl; - struct resource_list_entry *rle; + /* New tail overlaps old head, grow existing resource downward. */ + if (start < bus_rle->start && end >= bus_rle->start) { + bus_rle->count += bus_rle->start - start; + bus_rle->start = start; + done = TRUE; + } - /* We only consider IO and memory resources for our pool. */ - rle = NULL; - if (type != SYS_RES_IOPORT && type != SYS_RES_MEMORY) - return (rle); + /* New head overlaps old tail, grow existing resource upward. */ + if (start <= bus_rle->end && end > bus_rle->end) { + bus_rle->count += end - bus_rle->end; + bus_rle->end = end; + done = TRUE; + } - /* Find all the sysresource devices. */ - if (devclass_get_devices(acpi_sysres_devclass, &devs, &numdevs) != 0) - return (rle); - - /* Check each device for a resource that contains "addr". */ - for (i = 0; i < numdevs && rle == NULL; i++) { - rl = BUS_GET_RESOURCE_LIST(device_get_parent(devs[i]), devs[i]); - if (rl == NULL) - continue; - SLIST_FOREACH(rle, rl, link) { - if (type == rle->type && addr >= rle->start && - addr < rle->start + rle->count) + /* If we adjusted the old resource, we're finished. */ + if (done) break; } + + /* If we didn't merge with anything, add this resource. */ + if (bus_rle == NULL) + bus_set_resource(bus, type, acpi_sysres_rid++, start, count); } - free(devs, M_TEMP); - return (rle); + /* After merging/moving resources to the parent, free the list. */ + resource_list_free(dev_rl); + + return (0); } ==== //depot/projects/nsched/sys/dev/acpica/acpivar.h#10 (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/acpica/acpivar.h,v 1.80 2004/08/18 05:48:24 njl Exp $ + * $FreeBSD: src/sys/dev/acpica/acpivar.h,v 1.81 2004/08/23 16:28:42 njl Exp $ */ #include "acpi_if.h" @@ -306,8 +306,6 @@ struct resource *res, ACPI_RESOURCE *acpi_res); ACPI_STATUS acpi_parse_resources(device_t dev, ACPI_HANDLE handle, struct acpi_parse_resource_set *set, void *arg); -extern struct rman acpi_rman_io, acpi_rman_mem; -struct resource_list_entry *acpi_sysres_find(int type, u_long addr); /* ACPI event handling */ UINT32 acpi_event_power_button_sleep(void *context); ==== //depot/projects/nsched/sys/dev/aic7xxx/aic79xx_pci.c#4 (text+ko) ==== @@ -46,7 +46,7 @@ #include "aic79xx_inline.h" #else #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/aic7xxx/aic79xx_pci.c,v 1.20 2004/08/04 17:55:34 gibbs Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/aic7xxx/aic79xx_pci.c,v 1.21 2004/08/22 13:54:27 gibbs Exp $"); #include <dev/aic7xxx/aic79xx_osm.h> #include <dev/aic7xxx/aic79xx_inline.h> #endif @@ -996,9 +996,9 @@ u_int devconfig1; ahd->features |= AHD_RTI|AHD_NEW_IOCELL_OPTS - | AHD_NEW_DFCNTRL_OPTS|AHD_FAST_CDB_DELIVERY - | AHD_BUSFREEREV_BUG; - ahd->bugs |= AHD_LQOOVERRUN_BUG|AHD_EARLY_REQ_BUG; + | AHD_NEW_DFCNTRL_OPTS|AHD_FAST_CDB_DELIVERY; + ahd->bugs |= AHD_LQOOVERRUN_BUG|AHD_EARLY_REQ_BUG + | AHD_BUSFREEREV_BUG; /* * Some issues have been resolved in the 7901B. ==== //depot/projects/nsched/sys/dev/aic7xxx/aic7xxx_pci.c#2 (text+ko) ==== @@ -48,7 +48,7 @@ #include "aic7xxx_93cx6.h" #else #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/aic7xxx/aic7xxx_pci.c,v 1.32 2003/12/17 00:02:10 gibbs Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/aic7xxx/aic7xxx_pci.c,v 1.33 2004/08/22 14:02:43 gibbs Exp $"); #include <dev/aic7xxx/aic7xxx_osm.h> #include <dev/aic7xxx/aic7xxx_inline.h> #include <dev/aic7xxx/aic7xxx_93cx6.h> @@ -2119,12 +2119,13 @@ * that the OS doesn't know about and rely on our chip * reset handler to handle the rest. */ - aic_pci_write_config(ahc->dev_softc, DEVCONFIG, /*bytes*/4, - ahc->bus_softc.pci_softc.devconfig); - aic_pci_write_config(ahc->dev_softc, PCIR_COMMAND, /*bytes*/1, - ahc->bus_softc.pci_softc.command); - aic_pci_write_config(ahc->dev_softc, CSIZE_LATTIME, /*bytes*/1, - ahc->bus_softc.pci_softc.csize_lattime); + aic_pci_write_config(ahc->dev_softc, DEVCONFIG, + ahc->bus_softc.pci_softc.devconfig, /*bytes*/4); + aic_pci_write_config(ahc->dev_softc, PCIR_COMMAND, + ahc->bus_softc.pci_softc.command, /*bytes*/1); + aic_pci_write_config(ahc->dev_softc, CSIZE_LATTIME, + ahc->bus_softc.pci_softc.csize_lattime, + /*bytes*/1); if ((ahc->flags & AHC_HAS_TERM_LOGIC) != 0) { struct seeprom_descriptor sd; u_int sxfrctl1; ==== //depot/projects/nsched/sys/dev/ata/ata-queue.c#5 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-queue.c,v 1.32 2004/08/16 09:32:35 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-queue.c,v 1.33 2004/08/22 15:54:08 sos Exp $"); #include "opt_ata.h" #include <sys/param.h> @@ -238,8 +238,16 @@ ATA_DEBUG_RQ(request, "completed called"); if (request->flags & ATA_R_TIMEOUT) { - /* workaround for devices failing to interrupt */ - if (request->status == (ATA_S_READY | ATA_S_DSC)) { + /* workarounds for devices failing to interrupt */ + if (!request->status) { + ata_prtdev(request->device, + "FAILURE - %s no interrupt\n", + ata_cmd2str(request)); + request->result = ENXIO; + ATA_UNLOCK_CH(channel); + channel->locking(channel, ATA_LF_UNLOCK); + } + else if (request->status == (ATA_S_READY | ATA_S_DSC)) { ata_prtdev(request->device, "WARNING - %s no interrupt but good status\n", ata_cmd2str(request)); ==== //depot/projects/nsched/sys/dev/isp/isp_freebsd.c#4 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/isp/isp_freebsd.c,v 1.102 2004/06/16 09:46:47 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/isp/isp_freebsd.c,v 1.103 2004/08/23 19:04:19 mjacob Exp $"); #include <dev/isp/isp_freebsd.h> #include <sys/unistd.h> @@ -515,7 +515,9 @@ struct ispsoftc *isp = arg; if (isp->isp_role != ISP_ROLE_NONE) { ENABLE_INTS(isp); +#if 0 isp->isp_osinfo.intsok = 1; +#endif } /* Release our hook so that the boot can continue. */ config_intrhook_disestablish(&isp->isp_osinfo.ehook); ==== //depot/projects/nsched/sys/dev/lnc/if_lnc_pci.c#3 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/lnc/if_lnc_pci.c,v 1.34 2004/05/30 20:08:35 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/lnc/if_lnc_pci.c,v 1.35 2004/08/22 23:01:13 mux Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -154,7 +154,7 @@ err = bus_dma_tag_create(NULL, /* parent */ 1, /* alignement */ 0, /* boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR_24BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ lnc_mem_size, /* segsize */ ==== //depot/projects/nsched/sys/dev/md/md.c#8 (text+ko) ==== @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $FreeBSD: src/sys/dev/md/md.c,v 1.127 2004/08/08 07:57:50 phk Exp $ + * $FreeBSD: src/sys/dev/md/md.c,v 1.128 2004/08/22 19:44:24 cperciva Exp $ * */ @@ -735,6 +735,7 @@ sc->pp = pp; g_error_provider(pp, 0); g_topology_unlock(); + g_waitidle(); PICKUP_GIANT(); } ==== //depot/projects/nsched/sys/dev/sound/pci/maestro.c#3 (text+ko) ==== @@ -51,7 +51,7 @@ #include <dev/sound/pci/maestro_reg.h> -SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/maestro.c,v 1.23 2004/07/16 03:59:27 tanimura Exp $"); +SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/maestro.c,v 1.24 2004/08/22 18:57:40 green Exp $"); #define inline __inline @@ -655,19 +655,10 @@ ch->num = ess->playchns; ch->dir = dir; - p = dma_malloc(ess, ess->bufsz, &physaddr); - if (p == NULL) - return NULL; + physaddr = ess->baseaddr + ch->offset; + p = ess->stat + ch->offset; sndbuf_setup(b, p, ess->bufsz); - ch->offset = physaddr - ess->baseaddr; - if (physaddr < ess->baseaddr || ch->offset > WPWA_MAXADDR) { - device_printf(ess->dev, - "offset %#llx exceeds limit. ", (long long)ch->offset); - dma_free(ess, sndbuf_getbuf(b)); - return NULL; - } - ch->wcreg_tpl = (physaddr - 16) & WAVCACHE_CHCTL_ADDRTAG_MASK; if (dir == PCMDIR_PLAY) { @@ -683,12 +674,6 @@ static int aggch_free(kobj_t obj, void *data) { - struct agg_chinfo *ch = data; - struct agg_info *ess = ch->parent; - - /* free up buffer - called after channel stopped */ - dma_free(ess, sndbuf_getbuf(ch->buffer)); - /* return 0 if ok */ return 0; } @@ -957,6 +942,8 @@ struct resource *irq = NULL; void *ih = NULL; char status[SND_STATUSLEN]; + bus_addr_t offset; + int i; if ((ess = malloc(sizeof *ess, M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL) { device_printf(dev, "cannot allocate softc\n"); @@ -971,21 +958,28 @@ /*boundary*/WPWA_MAXADDR + 1, /*lowaddr*/MAESTRO_MAXADDR, /*highaddr*/BUS_SPACE_MAXADDR, /*filter*/NULL, /*filterarg*/NULL, - /*maxsize*/ess->bufsz, /*nsegments*/1, /*maxsegz*/0x3ffff, - /*flags*/0, /*lockfunc*/busdma_lock_mutex, + /*maxsize*/ess->bufsz * (1 + AGG_MAXPLAYCH + 1), /*nsegments*/1, + /*maxsegz*/0x3ffff, /*flags*/0, /*lockfunc*/busdma_lock_mutex, /*lockarg*/&Giant, &ess->parent_dmat) != 0) { device_printf(dev, "unable to create dma tag\n"); goto bad; } - ess->stat = dma_malloc(ess, ess->bufsz, &ess->baseaddr); + ess->stat = dma_malloc(ess, ess->bufsz * (1 + AGG_MAXPLAYCH + 1), + &ess->baseaddr); if (ess->stat == NULL) { - device_printf(dev, "cannot allocate status buffer\n"); + device_printf(dev, "cannot allocate DMA memory\n"); goto bad; } if (bootverbose) device_printf(dev, "Maestro DMA base: %#llx\n", (long long)ess->baseaddr); + offset = ess->bufsz; + for (i = 0; i < AGG_MAXPLAYCH; i++) { + ess->pch[i].offset = offset; + offset += ess->bufsz; + } + ess->rch.offset = offset; agg_power(ess, PPMI_D0); DELAY(100000); ==== //depot/projects/nsched/sys/geom/raid3/g_raid3.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/geom/raid3/g_raid3.c,v 1.7 2004/08/21 18:11:46 pjd Exp $"); +__FBSDID("$FreeBSD: src/sys/geom/raid3/g_raid3.c,v 1.8 2004/08/22 16:21:12 pjd Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -80,6 +80,9 @@ SYSCTL_NODE(_kern_geom_raid3, OID_AUTO, stat, CTLFLAG_RW, 0, "GEOM_RAID3 statistics"); +static u_int g_raid3_parity_mismatch = 0; +SYSCTL_UINT(_kern_geom_raid3_stat, OID_AUTO, parity_mismatch, CTLFLAG_RD, + &g_raid3_parity_mismatch, 0, "Number of failures in VERIFY mode"); static u_int g_raid3_64k_requested = 0; SYSCTL_UINT(_kern_geom_raid3_stat, OID_AUTO, 64k_requested, CTLFLAG_RD, &g_raid3_64k_requested, 0, "Number of requested 64kB allocations"); @@ -214,6 +217,24 @@ } } +static int +g_raid3_is_zero(struct bio *bp) +{ + static const uint64_t zeros[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + }; + u_char *addr; + ssize_t size; + + size = bp->bio_length; + addr = (u_char *)bp->bio_data; + for (; size > 0; size -= sizeof(zeros), addr += sizeof(zeros)) { + if (bcmp(addr, zeros, sizeof(zeros)) != 0) + return (0); + } + return (1); +} + /* * --- Events handling functions --- * Events in geom_raid3 are used to maintain disks and device status @@ -727,6 +748,46 @@ } static void +g_raid3_remove_bio(struct bio *cbp) +{ + struct bio *pbp, *bp; + + pbp = cbp->bio_parent; + if (G_RAID3_HEAD_BIO(pbp) == cbp) + G_RAID3_HEAD_BIO(pbp) = G_RAID3_NEXT_BIO(cbp); + else { + G_RAID3_FOREACH_BIO(pbp, bp) { + if (G_RAID3_NEXT_BIO(bp) == cbp) { + G_RAID3_NEXT_BIO(bp) = G_RAID3_NEXT_BIO(cbp); + break; + } + } + } + G_RAID3_NEXT_BIO(cbp) = NULL; +} + +static void +g_raid3_replace_bio(struct bio *sbp, struct bio *dbp) +{ + struct bio *pbp, *bp; + + g_raid3_remove_bio(sbp); + pbp = dbp->bio_parent; + G_RAID3_NEXT_BIO(sbp) = G_RAID3_NEXT_BIO(dbp); + if (G_RAID3_HEAD_BIO(pbp) == dbp) + G_RAID3_HEAD_BIO(pbp) = sbp; + else { + G_RAID3_FOREACH_BIO(pbp, bp) { + if (G_RAID3_NEXT_BIO(bp) == dbp) { + G_RAID3_NEXT_BIO(bp) = sbp; + break; + } + } + } + G_RAID3_NEXT_BIO(dbp) = NULL; +} + +static void g_raid3_destroy_bio(struct g_raid3_softc *sc, struct bio *cbp) { struct bio *bp, *pbp; @@ -751,10 +812,12 @@ if (G_RAID3_NEXT_BIO(bp) == cbp) break; } - KASSERT(bp != NULL, ("NULL bp")); - KASSERT(G_RAID3_NEXT_BIO(bp) != NULL, ("NULL bp->bio_driver1")); - G_RAID3_NEXT_BIO(bp) = G_RAID3_NEXT_BIO(cbp); - G_RAID3_NEXT_BIO(cbp) = NULL; + if (bp != NULL) { + KASSERT(G_RAID3_NEXT_BIO(bp) != NULL, + ("NULL bp->bio_driver1")); + G_RAID3_NEXT_BIO(bp) = G_RAID3_NEXT_BIO(cbp); + G_RAID3_NEXT_BIO(cbp) = NULL; + } g_destroy_bio(cbp); } } @@ -928,7 +991,12 @@ } >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200408232039.i7NKduIL092789>