From owner-p4-projects@FreeBSD.ORG Sun May 23 14:07:53 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CECCC1065672; Sun, 23 May 2010 14:07:52 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93D0C106564A for ; Sun, 23 May 2010 14:07:52 +0000 (UTC) (envelope-from mav@freebsd.org) Received: from repoman.freebsd.org (unknown [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 7F50C8FC13 for ; Sun, 23 May 2010 14:07:52 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o4NE7qJC047061 for ; Sun, 23 May 2010 14:07:52 GMT (envelope-from mav@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o4NE7q4G047059 for perforce@freebsd.org; Sun, 23 May 2010 14:07:52 GMT (envelope-from mav@freebsd.org) Date: Sun, 23 May 2010 14:07:52 GMT Message-Id: <201005231407.o4NE7q4G047059@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mav@freebsd.org using -f From: Alexander Motin To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 178657 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 14:07:53 -0000 http://p4web.freebsd.org/@@178657?ac=10 Change 178657 by mav@mav_mavtest on 2010/05/23 14:07:51 IFC Affected files ... .. //depot/projects/scottl-camlock/src/lib/libc/posix1e/acl_get.c#5 integrate .. //depot/projects/scottl-camlock/src/lib/libc/posix1e/acl_perm.c#4 integrate .. //depot/projects/scottl-camlock/src/share/misc/committers-src.dot#15 integrate .. //depot/projects/scottl-camlock/src/share/mk/bsd.README#2 integrate .. //depot/projects/scottl-camlock/src/sys/amd64/amd64/db_interface.c#6 integrate .. //depot/projects/scottl-camlock/src/sys/boot/i386/zfsboot/zfsboot.c#8 integrate .. //depot/projects/scottl-camlock/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c#5 integrate .. //depot/projects/scottl-camlock/src/sys/dev/acpica/acpi.c#32 integrate .. //depot/projects/scottl-camlock/src/sys/dev/acpica/acpi_hpet.c#11 integrate .. //depot/projects/scottl-camlock/src/sys/dev/acpica/acpivar.h#20 integrate .. //depot/projects/scottl-camlock/src/sys/dev/ahci/ahci.c#114 integrate .. //depot/projects/scottl-camlock/src/sys/dev/ata/ata-pci.c#22 integrate .. //depot/projects/scottl-camlock/src/sys/dev/ata/ata-pci.h#32 integrate .. //depot/projects/scottl-camlock/src/sys/dev/mmc/mmc.c#6 integrate .. //depot/projects/scottl-camlock/src/sys/dev/mvs/mvs.c#24 integrate .. //depot/projects/scottl-camlock/src/sys/dev/mvs/mvs_pci.c#7 integrate .. //depot/projects/scottl-camlock/src/sys/dev/mvs/mvs_soc.c#7 integrate .. //depot/projects/scottl-camlock/src/sys/dev/mxge/if_mxge.c#31 integrate .. //depot/projects/scottl-camlock/src/sys/dev/pci/pci.c#33 integrate .. //depot/projects/scottl-camlock/src/sys/dev/siis/siis.c#49 integrate .. //depot/projects/scottl-camlock/src/sys/dev/syscons/syscons.c#26 integrate .. //depot/projects/scottl-camlock/src/sys/dev/syscons/syscons.h#15 integrate .. //depot/projects/scottl-camlock/src/sys/ia64/ia64/db_machdep.c#7 integrate .. //depot/projects/scottl-camlock/src/sys/isa/syscons_isa.c#9 integrate .. //depot/projects/scottl-camlock/src/sys/kern/kern_kthread.c#13 integrate .. //depot/projects/scottl-camlock/src/sys/kern/sched_4bsd.c#24 integrate .. //depot/projects/scottl-camlock/src/sys/kern/sched_ule.c#30 integrate .. //depot/projects/scottl-camlock/src/sys/kern/subr_pcpu.c#11 integrate .. //depot/projects/scottl-camlock/src/sys/mips/mips/db_trace.c#7 integrate .. //depot/projects/scottl-camlock/src/sys/mips/mips/pmap.c#18 integrate .. //depot/projects/scottl-camlock/src/sys/powerpc/aim/ofw_machdep.c#9 integrate .. //depot/projects/scottl-camlock/src/sys/sys/kthread.h#4 integrate .. //depot/projects/scottl-camlock/src/usr.bin/vmstat/vmstat.8#3 integrate .. //depot/projects/scottl-camlock/src/usr.bin/vmstat/vmstat.c#4 integrate .. //depot/projects/scottl-camlock/src/usr.sbin/iostat/iostat.8#2 integrate .. //depot/projects/scottl-camlock/src/usr.sbin/iostat/iostat.c#4 integrate .. //depot/projects/scottl-camlock/src/usr.sbin/sysinstall/network.c#2 integrate Differences ... ==== //depot/projects/scottl-camlock/src/lib/libc/posix1e/acl_get.c#5 (text+ko) ==== @@ -39,7 +39,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/posix1e/acl_get.c,v 1.15 2009/06/25 20:57:53 trasz Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/posix1e/acl_get.c,v 1.16 2010/05/23 08:12:36 trasz Exp $"); #include #include "namespace.h" @@ -132,30 +132,6 @@ return (aclp); } -int -acl_get_perm_np(acl_permset_t permset_d, acl_perm_t perm) -{ - - if (permset_d == NULL) { - errno = EINVAL; - return (-1); - } - - switch(perm) { - case ACL_READ: - case ACL_WRITE: - case ACL_EXECUTE: - if (*permset_d & perm) - return (1); - break; - default: - errno = EINVAL; - return (-1); - } - - return (0); -} - /* * acl_get_permset() (23.4.17): return via permset_p a descriptor to * the permission set in the ACL entry entry_d. ==== //depot/projects/scottl-camlock/src/lib/libc/posix1e/acl_perm.c#4 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/posix1e/acl_perm.c,v 1.8 2010/05/13 16:42:01 trasz Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/posix1e/acl_perm.c,v 1.9 2010/05/23 08:12:36 trasz Exp $"); #include #include "namespace.h" @@ -108,3 +108,21 @@ return (0); } + +int +acl_get_perm_np(acl_permset_t permset_d, acl_perm_t perm) +{ + + if (permset_d == NULL) { + errno = EINVAL; + return (-1); + } + + if (_perm_is_invalid(perm)) + return (-1); + + if (*permset_d & perm) + return (1); + + return (0); +} ==== //depot/projects/scottl-camlock/src/share/misc/committers-src.dot#15 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/share/misc/committers-src.dot,v 1.114 2010/05/20 17:30:55 jchandra Exp $ +# $FreeBSD: src/share/misc/committers-src.dot,v 1.115 2010/05/21 19:08:24 jchandra Exp $ # This file is meant to list all FreeBSD src committers and describe the # mentor-mentee relationships between them. @@ -111,12 +111,12 @@ jake [label="Jake Burkholder\njake@FreeBSD.org\n2000/05/16"] jamie [label="Jamie Gritton\njamie@FreeBSD.org\n2009/01/28"] jayanth [label="Jayanth Vijayaraghavan\njayanth@FreeBSD.org\n2000/05/08"] +jchandra [label="Jayachandran C.\njchandra@FreeBSD.org\n2010/05/19"] +jdp [label="John Polstra\njdp@FreeBSD.org\n????/??/??"] jh [label="Jaakko Heinonen\njh@FreeBSD.org\n2009/10/02"] +jhb [label="John Baldwin\njhb@FreeBSD.org\n1999/08/23"] jilles [label="Jilles Tjoelker\njilles@FreeBSD.org\n2009/05/22"] jinmei [label="JINMEI Tatuya\njinmei@FreeBSD.org\n2007/03/17"] -jchandra [label="Jayachandran C.\njchandra@FreeBSD.org\n2010/05/19"] -jdp [label="John Polstra\njdp@FreeBSD.org\n????/??/??"] -jhb [label="John Baldwin\njhb@FreeBSD.org\n1999/08/23"] jkh [label="Jordan K. Hubbard\njkh@FreeBSD.org\n1993/06/12"] jkim [label="Jung-uk Kim\njkim@FreeBSD.org\n2005/07/06"] jkoshy [label="A. Joseph Koshy\njkoshy@FreeBSD.org\n1998/05/13"] ==== //depot/projects/scottl-camlock/src/share/mk/bsd.README#2 (text+ko) ==== @@ -1,5 +1,5 @@ # @(#)bsd.README 8.2 (Berkeley) 4/2/94 -# $FreeBSD: src/share/mk/bsd.README,v 1.33 2006/06/18 11:26:17 yar Exp $ +# $FreeBSD: src/share/mk/bsd.README,v 1.35 2010/05/22 20:19:12 maxim Exp $ This is the README file for the "include" files for the FreeBSD source tree. The files are installed in /usr/share/mk, and are by @@ -91,12 +91,12 @@ way the V7 make behaved. It's fairly difficult to make the BSD .mk files work when you're building -multiple programs in a single directory. It's a lot easier split up the -programs than to deal with the problem. Most of the agony comes from making -the "obj" directory stuff work right, not because we switch to a new version -of make. So, don't get mad at us, figure out a better way to handle multiple -architectures so we can quit using the symbolic link stuff. (Imake doesn't -count.) +multiple programs in a single directory. It's a lot easier to split up +the programs than to deal with the problem. Most of the agony comes from +making the "obj" directory stuff work right, not because we switch to a new +version of make. So, don't get mad at us, figure out a better way to handle +multiple architectures so we can quit using the symbolic link stuff. +(Imake doesn't count.) The file .depend in the source directory is expected to contain dependencies for the source files. This file is read automatically by make after reading ==== //depot/projects/scottl-camlock/src/sys/amd64/amd64/db_interface.c#6 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/db_interface.c,v 1.82 2009/04/01 13:09:26 kib Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/db_interface.c,v 1.83 2010/05/21 17:17:56 jhb Exp $"); /* * Interface to new debugger. @@ -139,11 +139,11 @@ db_show_mdpcpu(struct pcpu *pc) { - db_printf("curpmap = %p\n", pc->pc_curpmap); - db_printf("tssp = %p\n", pc->pc_tssp); - db_printf("commontssp = %p\n", pc->pc_commontssp); - db_printf("rsp0 = 0x%lx\n", pc->pc_rsp0); - db_printf("gs32p = %p\n", pc->pc_gs32p); - db_printf("ldt = %p\n", pc->pc_ldt); - db_printf("tss = %p\n", pc->pc_tss); + db_printf("curpmap = %p\n", pc->pc_curpmap); + db_printf("tssp = %p\n", pc->pc_tssp); + db_printf("commontssp = %p\n", pc->pc_commontssp); + db_printf("rsp0 = 0x%lx\n", pc->pc_rsp0); + db_printf("gs32p = %p\n", pc->pc_gs32p); + db_printf("ldt = %p\n", pc->pc_ldt); + db_printf("tss = %p\n", pc->pc_tss); } ==== //depot/projects/scottl-camlock/src/sys/boot/i386/zfsboot/zfsboot.c#8 (text+ko) ==== @@ -14,7 +14,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/i386/zfsboot/zfsboot.c,v 1.10 2010/03/26 01:30:53 delphij Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/zfsboot/zfsboot.c,v 1.11 2010/05/21 16:58:52 jhb Exp $"); #include #include @@ -94,6 +94,7 @@ #define V86_CY(x) ((x) & 1) #define V86_ZR(x) ((x) & 0x40) +#define BIOS_NUMDRIVES 0x475 #define DRV_HARD 0x80 #define DRV_MASK 0x7f @@ -467,6 +468,7 @@ static inline void putc(int c) { + v86.ctl = 0; v86.addr = 0x10; v86.eax = 0xe00 | (c & 0xff); v86.ebx = 0x7; @@ -617,6 +619,8 @@ off_t off; struct dsk *dsk; + dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); + bios_getmem(); if (high_heap_size > 0) { @@ -627,9 +631,6 @@ heap_end = (char *) PTOV(bios_basemem); } - dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); - v86.ctl = V86_FLAGS; - dsk = malloc(sizeof(struct dsk)); dsk->drive = *(uint8_t *)PTOV(ARGS); dsk->type = dsk->drive & DRV_HARD ? TYPE_AD : TYPE_FD; @@ -666,7 +667,7 @@ * will find any other available pools and it may fill in missing * vdevs for the boot pool. */ - for (i = 0; i < 128; i++) { + for (i = 0; i < *(unsigned char *)PTOV(BIOS_NUMDRIVES); i++) { if ((i | DRV_HARD) == *(uint8_t *)PTOV(ARGS)) continue; @@ -1157,6 +1158,7 @@ * when no such key is pressed in reality. As far as I can tell, * this only happens shortly after a reboot. */ + v86.ctl = V86_FLAGS; v86.addr = 0x16; v86.eax = fn << 8; v86int(); ==== //depot/projects/scottl-camlock/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c#5 (text+ko) ==== @@ -2082,10 +2082,10 @@ if (version >= SPA_VERSION_ZPOOL_HISTORY && history_str != NULL) (void) spa_history_log(spa, history_str, LOG_CMD_POOL_CREATE); + spa->spa_minref = refcount_count(&spa->spa_refcount); + mutex_exit(&spa_namespace_lock); - spa->spa_minref = refcount_count(&spa->spa_refcount); - return (0); } @@ -2478,6 +2478,7 @@ char *poolname; spa_t *spa; uint64_t state; + int error; if (nvlist_lookup_string(tryconfig, ZPOOL_CONFIG_POOL_NAME, &poolname)) return (NULL); @@ -2497,7 +2498,7 @@ * Pass TRUE for mosconfig because the user-supplied config * is actually the one to trust when doing an import. */ - (void) spa_load(spa, tryconfig, SPA_LOAD_TRYIMPORT, B_TRUE); + error = spa_load(spa, tryconfig, SPA_LOAD_TRYIMPORT, B_TRUE); /* * If 'tryconfig' was at least parsable, return the current config. @@ -2516,7 +2517,7 @@ * copy it out so that external consumers can tell which * pools are bootable. */ - if (spa->spa_bootfs) { + if ((!error || error == EEXIST) && spa->spa_bootfs) { char *tmpname = kmem_alloc(MAXPATHLEN, KM_SLEEP); /* ==== //depot/projects/scottl-camlock/src/sys/dev/acpica/acpi.c#32 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi.c,v 1.277 2010/04/02 23:04:31 jkim Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi.c,v 1.278 2010/05/23 07:53:22 mav Exp $"); #include "opt_acpi.h" #include @@ -145,7 +145,6 @@ static void acpi_probe_order(ACPI_HANDLE handle, int *order); static ACPI_STATUS acpi_probe_child(ACPI_HANDLE handle, UINT32 level, void *context, void **status); -static BOOLEAN acpi_MatchHid(ACPI_HANDLE h, const char *hid); static void acpi_sleep_enable(void *arg); static ACPI_STATUS acpi_sleep_disable(struct acpi_softc *sc); static ACPI_STATUS acpi_EnterSleepState(struct acpi_softc *sc, int state); @@ -1944,7 +1943,7 @@ /* * Match a HID string against a handle */ -static BOOLEAN +BOOLEAN acpi_MatchHid(ACPI_HANDLE h, const char *hid) { ACPI_DEVICE_INFO *devinfo; ==== //depot/projects/scottl-camlock/src/sys/dev/acpica/acpi_hpet.c#11 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_hpet.c,v 1.18 2010/01/27 10:17:28 avg Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_hpet.c,v 1.20 2010/05/23 08:31:15 mav Exp $"); #include "opt_acpi.h" #include @@ -101,41 +101,60 @@ bus_write_4(sc->mem_res, HPET_CONFIG, val); } +static ACPI_STATUS +acpi_hpet_find(ACPI_HANDLE handle, UINT32 level, void *context, + void **status) +{ + char **ids; + uint32_t id = (uint32_t)(uintptr_t)context; + uint32_t uid = 0; + + for (ids = hpet_ids; *ids != NULL; ids++) { + if (acpi_MatchHid(handle, *ids)) + break; + } + if (*ids == NULL) + return (AE_OK); + if (ACPI_FAILURE(acpi_GetInteger(handle, "_UID", &uid))) + uid = 0; + if (id == uid) + *((int *)status) = 1; + return (AE_OK); +} + /* Discover the HPET via the ACPI table of the same name. */ static void acpi_hpet_identify(driver_t *driver, device_t parent) { ACPI_TABLE_HPET *hpet; - ACPI_TABLE_HEADER *hdr; ACPI_STATUS status; device_t child; + int i, found; /* Only one HPET device can be added. */ if (devclass_get_device(acpi_hpet_devclass, 0)) return; - - /* Currently, ID and minimum clock tick info is unused. */ - - status = AcpiGetTable(ACPI_SIG_HPET, 1, (ACPI_TABLE_HEADER **)&hdr); - if (ACPI_FAILURE(status)) - return; - - /* - * The unit number could be derived from hdr->Sequence but we only - * support one HPET device. - */ - hpet = (ACPI_TABLE_HPET *)hdr; - if (hpet->Sequence != 0) - printf("ACPI HPET table warning: Sequence is non-zero (%d)\n", - hpet->Sequence); - child = BUS_ADD_CHILD(parent, ACPI_DEV_BASE_ORDER, "acpi_hpet", 0); - if (child == NULL) { - printf("%s: can't add child\n", __func__); - return; + for (i = 1; ; i++) { + /* Search for HPET table. */ + status = AcpiGetTable(ACPI_SIG_HPET, i, (ACPI_TABLE_HEADER **)&hpet); + if (ACPI_FAILURE(status)) + return; + /* Search for HPET device with same ID. */ + found = 0; + AcpiWalkNamespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, + 100, acpi_hpet_find, NULL, (void *)(uintptr_t)hpet->Sequence, (void *)&found); + /* If found - let it be probed in normal way. */ + if (found) + continue; + /* If not - create it from table info. */ + child = BUS_ADD_CHILD(parent, ACPI_DEV_BASE_ORDER, "acpi_hpet", 0); + if (child == NULL) { + printf("%s: can't add child\n", __func__); + continue; + } + bus_set_resource(child, SYS_RES_MEMORY, 0, hpet->Address.Address, + HPET_MEM_WIDTH); } - - bus_set_resource(child, SYS_RES_MEMORY, 0, hpet->Address.Address, - HPET_MEM_WIDTH); } static int @@ -146,8 +165,7 @@ if (acpi_disabled("hpet")) return (ENXIO); if (acpi_get_handle(dev) != NULL && - (ACPI_ID_PROBE(device_get_parent(dev), dev, hpet_ids) == NULL || - device_get_unit(dev) != 0)) + ACPI_ID_PROBE(device_get_parent(dev), dev, hpet_ids) == NULL) return (ENXIO); device_set_desc(dev, "High Precision Event Timer"); @@ -233,11 +251,12 @@ bus_free_resource(dev, SYS_RES_MEMORY, sc->mem_res); return (ENXIO); } - - hpet_timecounter.tc_frequency = freq; - hpet_timecounter.tc_priv = sc; - tc_init(&hpet_timecounter); - + /* Announce first HPET as timecounter. */ + if (device_get_unit(dev) == 0) { + hpet_timecounter.tc_frequency = freq; + hpet_timecounter.tc_priv = sc; + tc_init(&hpet_timecounter); + } return (0); } ==== //depot/projects/scottl-camlock/src/sys/dev/acpica/acpivar.h#20 (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.116 2010/04/02 23:04:31 jkim Exp $ + * $FreeBSD: src/sys/dev/acpica/acpivar.h,v 1.117 2010/05/23 07:53:22 mav Exp $ */ #ifndef _ACPIVAR_H_ @@ -342,6 +342,7 @@ u_int flags); void acpi_walk_subtables(void *first, void *end, acpi_subtable_handler *handler, void *arg); +BOOLEAN acpi_MatchHid(ACPI_HANDLE h, const char *hid); struct acpi_parse_resource_set { void (*set_init)(device_t dev, void *arg, void **context); ==== //depot/projects/scottl-camlock/src/sys/dev/ahci/ahci.c#114 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ahci/ahci.c,v 1.36 2010/05/21 13:29:28 mav Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ahci/ahci.c,v 1.38 2010/05/22 08:30:47 mav Exp $"); #include #include @@ -330,6 +330,8 @@ &ctlr->r_rid, RF_ACTIVE))) return ENXIO; /* Setup our own memory management for channels. */ + ctlr->sc_iomem.rm_start = rman_get_start(ctlr->r_mem); + ctlr->sc_iomem.rm_end = rman_get_end(ctlr->r_mem); ctlr->sc_iomem.rm_type = RMAN_ARRAY; ctlr->sc_iomem.rm_descr = "I/O memory addresses"; if ((error = rman_init(&ctlr->sc_iomem)) != 0) { @@ -778,6 +780,16 @@ return (retval); } +static int +ahci_child_location_str(device_t dev, device_t child, char *buf, + size_t buflen) +{ + + snprintf(buf, buflen, "channel=%d", + (int)(intptr_t)device_get_ivars(child)); + return (0); +} + devclass_t ahci_devclass; static device_method_t ahci_methods[] = { DEVMETHOD(device_probe, ahci_probe), @@ -790,6 +802,7 @@ DEVMETHOD(bus_release_resource, ahci_release_resource), DEVMETHOD(bus_setup_intr, ahci_setup_intr), DEVMETHOD(bus_teardown_intr,ahci_teardown_intr), + DEVMETHOD(bus_child_location_str, ahci_child_location_str), { 0, 0 } }; static driver_t ahci_driver = { @@ -809,6 +822,7 @@ DEVMETHOD(bus_release_resource, ahci_release_resource), DEVMETHOD(bus_setup_intr, ahci_setup_intr), DEVMETHOD(bus_teardown_intr,ahci_teardown_intr), + DEVMETHOD(bus_child_location_str, ahci_child_location_str), { 0, 0 } }; static driver_t ahci_ata_driver = { ==== //depot/projects/scottl-camlock/src/sys/dev/ata/ata-pci.c#22 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-pci.c,v 1.150 2010/02/22 10:45:40 mav Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-pci.c,v 1.151 2010/05/22 07:32:47 mav Exp $"); #include "opt_ata.h" #include @@ -544,6 +544,16 @@ ata_dmafini(dev); } +int +ata_pci_child_location_str(device_t dev, device_t child, char *buf, + size_t buflen) +{ + + snprintf(buf, buflen, "channel=%d", + (int)(intptr_t)device_get_ivars(child)); + return (0); +} + static device_method_t ata_pci_methods[] = { /* device interface */ DEVMETHOD(device_probe, ata_pci_probe), @@ -564,6 +574,7 @@ DEVMETHOD(bus_teardown_intr, ata_pci_teardown_intr), DEVMETHOD(pci_read_config, ata_pci_read_config), DEVMETHOD(pci_write_config, ata_pci_write_config), + DEVMETHOD(bus_child_location_str, ata_pci_child_location_str), { 0, 0 } }; ==== //depot/projects/scottl-camlock/src/sys/dev/ata/ata-pci.h#32 (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-pci.h,v 1.120 2010/03/01 07:32:49 mav Exp $ + * $FreeBSD: src/sys/dev/ata/ata-pci.h,v 1.121 2010/05/22 07:32:47 mav Exp $ */ /* structure holding chipset config info */ @@ -502,6 +502,8 @@ uint32_t ata_pci_read_config(device_t dev, device_t child, int reg, int width); void ata_pci_write_config(device_t dev, device_t child, int reg, uint32_t val, int width); +int ata_pci_child_location_str(device_t dev, device_t child, char *buf, + size_t buflen); struct resource * ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags); int ata_pci_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r); int ata_pci_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, driver_filter_t *filter, driver_intr_t *function, void *argument, void **cookiep); @@ -550,6 +552,7 @@ DEVMETHOD(bus_teardown_intr, ata_pci_teardown_intr), \ DEVMETHOD(pci_read_config, ata_pci_read_config), \ DEVMETHOD(pci_write_config, ata_pci_write_config), \ + DEVMETHOD(bus_child_location_str, ata_pci_child_location_str), \ { 0, 0 } \ }; \ static driver_t __CONCAT(dname,_driver) = { \ ==== //depot/projects/scottl-camlock/src/sys/dev/mmc/mmc.c#6 (text+ko) ==== @@ -51,7 +51,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/mmc/mmc.c,v 1.38 2009/08/20 19:17:53 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/mmc/mmc.c,v 1.39 2010/05/23 09:44:48 mav Exp $"); #include #include @@ -1500,6 +1500,15 @@ config_intrhook_disestablish(&sc->config_intrhook); } +static int +mmc_child_location_str(device_t dev, device_t child, char *buf, + size_t buflen) +{ + + snprintf(buf, buflen, "rca=0x%04x", mmc_get_rca(child)); + return (0); +} + static device_method_t mmc_methods[] = { /* device_if */ DEVMETHOD(device_probe, mmc_probe), @@ -1511,6 +1520,7 @@ /* Bus interface */ DEVMETHOD(bus_read_ivar, mmc_read_ivar), DEVMETHOD(bus_write_ivar, mmc_write_ivar), + DEVMETHOD(bus_child_location_str, mmc_child_location_str), /* MMC Bus interface */ DEVMETHOD(mmcbus_wait_for_request, mmc_wait_for_request), ==== //depot/projects/scottl-camlock/src/sys/dev/mvs/mvs.c#24 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/mvs/mvs.c,v 1.2 2010/05/06 06:44:26 mav Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/mvs/mvs.c,v 1.3 2010/05/21 17:26:16 mav Exp $"); #include #include @@ -51,6 +51,8 @@ #include /* local prototypes */ +static int mvs_ch_init(device_t dev); +static int mvs_ch_deinit(device_t dev); static int mvs_ch_suspend(device_t dev); static int mvs_ch_resume(device_t dev); static void mvs_dmainit(device_t dev); @@ -133,7 +135,7 @@ return (ENXIO); mvs_dmainit(dev); mvs_slotsalloc(dev); - mvs_ch_resume(dev); + mvs_ch_init(dev); mtx_lock(&ch->mtx); rid = ATA_IRQ_RID; if (!(ch->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, @@ -215,7 +217,7 @@ bus_teardown_intr(dev, ch->r_irq, ch->ih); bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq); - mvs_ch_suspend(dev); + mvs_ch_deinit(dev); mvs_slotsfree(dev); mvs_dmafini(dev); @@ -225,21 +227,9 @@ } static int -mvs_ch_suspend(device_t dev) +mvs_ch_init(device_t dev) { struct mvs_channel *ch = device_get_softc(dev); - - /* Stop EDMA */ - mvs_set_edma_mode(dev, MVS_EDMA_OFF); - /* Disable port interrupts. */ - ATA_OUTL(ch->r_mem, EDMA_IEM, 0); - return (0); -} - -static int -mvs_ch_resume(device_t dev) -{ - struct mvs_channel *ch = device_get_softc(dev); uint32_t reg; /* Disable port interrupts */ @@ -264,6 +254,45 @@ return (0); } +static int +mvs_ch_deinit(device_t dev) +{ + struct mvs_channel *ch = device_get_softc(dev); + + /* Stop EDMA */ + mvs_set_edma_mode(dev, MVS_EDMA_OFF); + /* Disable port interrupts. */ + ATA_OUTL(ch->r_mem, EDMA_IEM, 0); + return (0); +} + +static int +mvs_ch_suspend(device_t dev) +{ + struct mvs_channel *ch = device_get_softc(dev); + + mtx_lock(&ch->mtx); + xpt_freeze_simq(ch->sim, 1); + while (ch->oslots) + msleep(ch, &ch->mtx, PRIBIO, "mvssusp", hz/100); + mvs_ch_deinit(dev); + mtx_unlock(&ch->mtx); + return (0); +} + +static int +mvs_ch_resume(device_t dev) +{ + struct mvs_channel *ch = device_get_softc(dev); + + mtx_lock(&ch->mtx); + mvs_ch_init(dev); + mvs_reset(dev); + xpt_release_simq(ch->sim, TRUE); + mtx_unlock(&ch->mtx); + return (0); +} + struct mvs_dc_cb_args { bus_addr_t maddr; int error; ==== //depot/projects/scottl-camlock/src/sys/dev/mvs/mvs_pci.c#7 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD$"); +__FBSDID("$FreeBSD: src/sys/dev/mvs/mvs_pci.c,v 1.3 2010/05/22 08:30:47 mav Exp $"); #include #include @@ -139,6 +139,8 @@ &ctlr->r_rid, RF_ACTIVE))) return ENXIO; /* Setup our own memory management for channels. */ + ctlr->sc_iomem.rm_start = rman_get_start(ctlr->r_mem); + ctlr->sc_iomem.rm_end = rman_get_end(ctlr->r_mem); ctlr->sc_iomem.rm_type = RMAN_ARRAY; ctlr->sc_iomem.rm_descr = "I/O memory addresses"; if ((error = rman_init(&ctlr->sc_iomem)) != 0) { @@ -482,6 +484,16 @@ return (retval); } +static int +mvs_child_location_str(device_t dev, device_t child, char *buf, + size_t buflen) +{ + + snprintf(buf, buflen, "channel=%d", + (int)(intptr_t)device_get_ivars(child)); + return (0); +} + static device_method_t mvs_methods[] = { DEVMETHOD(device_probe, mvs_probe), DEVMETHOD(device_attach, mvs_attach), @@ -493,6 +505,7 @@ DEVMETHOD(bus_release_resource, mvs_release_resource), DEVMETHOD(bus_setup_intr, mvs_setup_intr), DEVMETHOD(bus_teardown_intr,mvs_teardown_intr), + DEVMETHOD(bus_child_location_str, mvs_child_location_str), DEVMETHOD(mvs_edma, mvs_edma), { 0, 0 } }; ==== //depot/projects/scottl-camlock/src/sys/dev/mvs/mvs_soc.c#7 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD$"); +__FBSDID("$FreeBSD: src/sys/dev/mvs/mvs_soc.c,v 1.3 2010/05/22 08:30:47 mav Exp $"); #include #include @@ -131,6 +131,8 @@ &ctlr->r_rid, RF_ACTIVE))) return ENXIO; /* Setup our own memory management for channels. */ + ctlr->sc_iomem.rm_start = rman_get_start(ctlr->r_mem); + ctlr->sc_iomem.rm_end = rman_get_end(ctlr->r_mem); ctlr->sc_iomem.rm_type = RMAN_ARRAY; ctlr->sc_iomem.rm_descr = "I/O memory addresses"; if ((error = rman_init(&ctlr->sc_iomem)) != 0) { @@ -413,6 +415,16 @@ return (retval); } +static int +mvs_child_location_str(device_t dev, device_t child, char *buf, + size_t buflen) +{ + + snprintf(buf, buflen, "channel=%d", + (int)(intptr_t)device_get_ivars(child)); + return (0); +} + static device_method_t mvs_methods[] = { DEVMETHOD(device_probe, mvs_probe), DEVMETHOD(device_attach, mvs_attach), @@ -425,6 +437,7 @@ DEVMETHOD(bus_setup_intr, mvs_setup_intr), DEVMETHOD(bus_teardown_intr,mvs_teardown_intr), DEVMETHOD(mvs_edma, mvs_edma), + DEVMETHOD(bus_child_location_str, mvs_child_location_str), { 0, 0 } }; static driver_t mvs_driver = { ==== //depot/projects/scottl-camlock/src/sys/dev/mxge/if_mxge.c#31 (text+ko) ==== @@ -28,7 +28,7 @@ ***************************************************************************/ #include -__FBSDID("$FreeBSD: src/sys/dev/mxge/if_mxge.c,v 1.80 2010/05/19 20:00:15 gallatin Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/mxge/if_mxge.c,v 1.81 2010/05/21 15:57:24 gallatin Exp $"); #include #include @@ -4476,6 +4476,8 @@ "message %d\n", i); goto abort_with_intr; } + bus_describe_intr(sc->dev, sc->msix_irq_res[i], + sc->msix_ih[i], "s%d", i); } if (mxge_verbose) { ==== //depot/projects/scottl-camlock/src/sys/dev/pci/pci.c#33 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/pci/pci.c,v 1.397 2010/05/16 15:18:25 nwhitehorn Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/pci/pci.c,v 1.398 2010/05/22 03:19:30 mav Exp $"); #include "opt_bus.h" @@ -2988,6 +2988,8 @@ /* Now the device is powered up, restore its config space. */ pci_cfg_restore(child, dinfo); + if (!device_is_attached(child)) + pci_cfg_save(child, dinfo, 1); } free(devlist, M_TEMP); return (bus_generic_resume(dev)); ==== //depot/projects/scottl-camlock/src/sys/dev/siis/siis.c#49 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/siis/siis.c,v 1.26 2010/05/02 12:07:47 mav Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/siis/siis.c,v 1.29 2010/05/22 08:30:47 mav Exp $"); #include #include @@ -59,6 +59,8 @@ static void siis_intr(void *data); static int siis_suspend(device_t dev); static int siis_resume(device_t dev); +static int siis_ch_init(device_t dev); +static int siis_ch_deinit(device_t dev); static int siis_ch_suspend(device_t dev); static int siis_ch_resume(device_t dev); static void siis_ch_intr_locked(void *data); @@ -150,6 +152,8 @@ &ctlr->r_rid, RF_ACTIVE))) return (ENXIO); /* Setup our own memory management for channels. */ + ctlr->sc_iomem.rm_start = rman_get_start(ctlr->r_mem); + ctlr->sc_iomem.rm_end = rman_get_end(ctlr->r_mem); ctlr->sc_iomem.rm_type = RMAN_ARRAY; ctlr->sc_iomem.rm_descr = "I/O memory addresses"; if ((error = rman_init(&ctlr->sc_iomem)) != 0) { @@ -396,6 +400,16 @@ return (retval); } +static int +siis_child_location_str(device_t dev, device_t child, char *buf, + size_t buflen) +{ + + snprintf(buf, buflen, "channel=%d", + (int)(intptr_t)device_get_ivars(child)); + return (0); +} + devclass_t siis_devclass; static device_method_t siis_methods[] = { DEVMETHOD(device_probe, siis_probe), @@ -408,6 +422,7 @@ DEVMETHOD(bus_release_resource, siis_release_resource), DEVMETHOD(bus_setup_intr, siis_setup_intr), DEVMETHOD(bus_teardown_intr,siis_teardown_intr), + DEVMETHOD(bus_child_location_str, siis_child_location_str), { 0, 0 } }; static driver_t siis_driver = { @@ -458,7 +473,7 @@ return (ENXIO); siis_dmainit(dev); siis_slotsalloc(dev); - siis_ch_resume(dev); + siis_ch_init(dev); mtx_lock(&ch->mtx); rid = ATA_IRQ_RID; if (!(ch->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, @@ -528,7 +543,7 @@ bus_teardown_intr(dev, ch->r_irq, ch->ih); bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq); - siis_ch_suspend(dev); + siis_ch_deinit(dev); siis_slotsfree(dev); siis_dmafini(dev); @@ -538,7 +553,24 @@ } static int -siis_ch_suspend(device_t dev) +siis_ch_init(device_t dev) +{ + struct siis_channel *ch = device_get_softc(dev); + + /* Get port out of reset state. */ + ATA_OUTL(ch->r_mem, SIIS_P_CTLCLR, SIIS_P_CTL_PORT_RESET); + ATA_OUTL(ch->r_mem, SIIS_P_CTLCLR, SIIS_P_CTL_32BIT); + if (ch->pm_present) + ATA_OUTL(ch->r_mem, SIIS_P_CTLSET, SIIS_P_CTL_PME); + else + ATA_OUTL(ch->r_mem, SIIS_P_CTLCLR, SIIS_P_CTL_PME); + /* Enable port interrupts */ + ATA_OUTL(ch->r_mem, SIIS_P_IESET, SIIS_P_IX_ENABLED); + return (0); +} + +static int +siis_ch_deinit(device_t dev) { struct siis_channel *ch = device_get_softc(dev); @@ -548,19 +580,29 @@ } static int +siis_ch_suspend(device_t dev) +{ + struct siis_channel *ch = device_get_softc(dev); + + mtx_lock(&ch->mtx); + xpt_freeze_simq(ch->sim, 1); + while (ch->oslots) + msleep(ch, &ch->mtx, PRIBIO, "siissusp", hz/100); + siis_ch_deinit(dev); + mtx_unlock(&ch->mtx); + return (0); +} + >>> TRUNCATED FOR MAIL (1000 lines) <<<