From owner-p4-projects@FreeBSD.ORG Wed Jun 23 20:45:10 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BC84A16A4D0; Wed, 23 Jun 2004 20:45:09 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7CF8516A4CE for ; Wed, 23 Jun 2004 20:45:09 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7502F43D60 for ; Wed, 23 Jun 2004 20:45:09 +0000 (GMT) (envelope-from ps@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i5NKix7q033232 for ; Wed, 23 Jun 2004 20:44:59 GMT (envelope-from ps@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i5NKiwTP033229 for perforce@freebsd.org; Wed, 23 Jun 2004 20:44:58 GMT (envelope-from ps@freebsd.org) Date: Wed, 23 Jun 2004 20:44:58 GMT Message-Id: <200406232044.i5NKiwTP033229@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to ps@freebsd.org using -f From: Paul Saab To: Perforce Change Reviews Subject: PERFORCE change 55630 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2004 20:45:10 -0000 http://perforce.freebsd.org/chv.cgi?CH=55630 Change 55630 by ps@butter.corp on 2004/06/23 20:44:23 IFC Affected files ... .. //depot/projects/sack/alpha/include/pmap.h#2 integrate .. //depot/projects/sack/amd64/amd64/pmap.c#4 integrate .. //depot/projects/sack/boot/forth/loader.conf#3 integrate .. //depot/projects/sack/boot/i386/cdboot/cdboot.s#2 integrate .. //depot/projects/sack/compat/linux/linux_util.c#3 integrate .. //depot/projects/sack/conf/NOTES#3 integrate .. //depot/projects/sack/conf/files#5 integrate .. //depot/projects/sack/conf/files.i386#2 integrate .. //depot/projects/sack/contrib/pf/net/if_pflog.c#4 integrate .. //depot/projects/sack/contrib/pf/net/if_pfsync.c#4 integrate .. //depot/projects/sack/contrib/pf/net/pfvar.h#4 integrate .. //depot/projects/sack/dev/acpica/acpi.c#4 integrate .. //depot/projects/sack/dev/acpica/acpi_pci.c#2 integrate .. //depot/projects/sack/dev/acpica/acpi_pcib.c#2 integrate .. //depot/projects/sack/dev/acpica/acpi_resource.c#3 integrate .. //depot/projects/sack/dev/acpica/acpiio.h#2 integrate .. //depot/projects/sack/dev/acpica/acpivar.h#4 integrate .. //depot/projects/sack/dev/ata/ata-all.c#3 integrate .. //depot/projects/sack/dev/ata/ata-chipset.c#3 integrate .. //depot/projects/sack/dev/ata/ata-disk.c#2 integrate .. //depot/projects/sack/dev/ata/atapi-cd.c#3 integrate .. //depot/projects/sack/dev/ata/atapi-fd.c#2 integrate .. //depot/projects/sack/dev/ata/atapi-tape.c#3 integrate .. //depot/projects/sack/dev/ciss/ciss.c#4 integrate .. //depot/projects/sack/dev/cp/if_cp.c#3 integrate .. //depot/projects/sack/dev/ctau/if_ct.c#3 integrate .. //depot/projects/sack/dev/cx/if_cx.c#4 integrate .. //depot/projects/sack/dev/cy/cy.c#5 integrate .. //depot/projects/sack/dev/digi/digi.h#3 integrate .. //depot/projects/sack/dev/pccbb/pccbb.c#2 integrate .. //depot/projects/sack/dev/sio/sio.c#5 integrate .. //depot/projects/sack/dev/uart/uart_tty.c#3 integrate .. //depot/projects/sack/dev/usb/ulpt.c#3 integrate .. //depot/projects/sack/dev/vinum/vinumio.c#3 integrate .. //depot/projects/sack/fs/fifofs/fifo_vnops.c#4 integrate .. //depot/projects/sack/fs/portalfs/portal_vnops.c#3 integrate .. //depot/projects/sack/fs/udf/udf.h#3 integrate .. //depot/projects/sack/fs/udf/udf_vfsops.c#2 integrate .. //depot/projects/sack/fs/udf/udf_vnops.c#2 integrate .. //depot/projects/sack/geom/vinum/geom_vinum_drive.c#3 integrate .. //depot/projects/sack/geom/vinum/geom_vinum_raid5.c#2 integrate .. //depot/projects/sack/i386/conf/NOTES#3 integrate .. //depot/projects/sack/i386/i386/bios.c#4 integrate .. //depot/projects/sack/i386/i386/io_apic.c#2 integrate .. //depot/projects/sack/i386/i386/mp_machdep.c#2 integrate .. //depot/projects/sack/i386/i386/mptable.c#2 integrate .. //depot/projects/sack/i386/i386/pmap.c#4 integrate .. //depot/projects/sack/i386/include/apicvar.h#2 integrate .. //depot/projects/sack/ia64/include/pmap.h#2 integrate .. //depot/projects/sack/kern/kern_conf.c#3 integrate .. //depot/projects/sack/kern/uipc_syscalls.c#4 integrate .. //depot/projects/sack/modules/Makefile#3 integrate .. //depot/projects/sack/modules/ctau/Makefile#2 integrate .. //depot/projects/sack/modules/cx/Makefile#2 integrate .. //depot/projects/sack/net/if.c#4 integrate .. //depot/projects/sack/net/if.h#2 integrate .. //depot/projects/sack/net/if_clone.c#1 branch .. //depot/projects/sack/net/if_clone.h#1 branch .. //depot/projects/sack/net/if_disc.c#2 integrate .. //depot/projects/sack/net/if_faith.c#2 integrate .. //depot/projects/sack/net/if_gif.c#2 integrate .. //depot/projects/sack/net/if_gre.c#2 integrate .. //depot/projects/sack/net/if_loop.c#2 integrate .. //depot/projects/sack/net/if_ppp.c#3 integrate .. //depot/projects/sack/net/if_stf.c#2 integrate .. //depot/projects/sack/net/if_var.h#4 integrate .. //depot/projects/sack/net/if_vlan.c#3 integrate .. //depot/projects/sack/netgraph/ng_bpf.c#2 integrate .. //depot/projects/sack/netgraph/ng_bridge.c#2 integrate .. //depot/projects/sack/netipsec/key.c#2 integrate .. //depot/projects/sack/netipsec/keysock.c#2 integrate .. //depot/projects/sack/netipx/ipx.h#2 integrate .. //depot/projects/sack/pc98/i386/machdep.c#4 integrate .. //depot/projects/sack/pc98/pc98/sio.c#4 integrate .. //depot/projects/sack/sys/imgact_aout.h#2 integrate .. //depot/projects/sack/sys/param.h#4 integrate .. //depot/projects/sack/sys/tty.h#4 integrate .. //depot/projects/sack/sys/ttycom.h#2 integrate .. //depot/projects/sack/vm/swap_pager.c#3 integrate Differences ... ==== //depot/projects/sack/alpha/include/pmap.h#2 (text+ko) ==== @@ -39,7 +39,7 @@ * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 * from: i386 pmap.h,v 1.54 1997/11/20 19:30:35 bde Exp - * $FreeBSD: src/sys/alpha/include/pmap.h,v 1.30 2004/04/11 05:08:26 alc Exp $ + * $FreeBSD: src/sys/alpha/include/pmap.h,v 1.31 2004/06/23 08:06:52 alc Exp $ */ #ifndef _MACHINE_PMAP_H_ @@ -178,11 +178,6 @@ LIST_ENTRY(pmap) pm_list; /* list of all pmaps. */ }; -#define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) - -#define PM_FLAG_LOCKED 0x1 -#define PM_FLAG_WANTED 0x2 - typedef struct pmap *pmap_t; #ifdef _KERNEL @@ -210,6 +205,8 @@ struct vmspace; +#define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) + vm_offset_t pmap_steal_memory(vm_size_t); void pmap_bootstrap(vm_offset_t, u_int); void pmap_kenter(vm_offset_t va, vm_offset_t pa); ==== //depot/projects/sack/amd64/amd64/pmap.c#4 (text+ko) ==== @@ -75,7 +75,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.478 2004/06/20 20:57:05 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.479 2004/06/23 04:37:14 alc Exp $"); /* * Manages physical address maps. @@ -801,18 +801,34 @@ vm_page_t pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot) { - vm_paddr_t pa; + pd_entry_t pde, *pdep; + pt_entry_t pte; vm_page_t m; m = NULL; - mtx_lock(&Giant); - if ((pa = pmap_extract(pmap, va)) != 0) { - m = PHYS_TO_VM_PAGE(pa); - vm_page_lock_queues(); - vm_page_hold(m); - vm_page_unlock_queues(); + if (pmap == NULL) + return (m); + vm_page_lock_queues(); + PMAP_LOCK(pmap); + pdep = pmap_pde(pmap, va); + if (pdep != NULL && (pde = *pdep)) { + if (pde & PG_PS) { + if ((pde & PG_RW) || (prot & VM_PROT_WRITE) == 0) { + m = PHYS_TO_VM_PAGE((pde & ~PDRMASK) | + (va & PDRMASK)); + vm_page_hold(m); + } + } else { + pte = *pmap_pte(pmap, va); + if ((pte & PG_V) && + ((pte & PG_RW) || (prot & VM_PROT_WRITE) == 0)) { + m = PHYS_TO_VM_PAGE(pte & PG_FRAME); + vm_page_hold(m); + } + } } - mtx_unlock(&Giant); + vm_page_unlock_queues(); + PMAP_UNLOCK(pmap); return (m); } ==== //depot/projects/sack/boot/forth/loader.conf#3 (text+ko) ==== @@ -6,7 +6,7 @@ # # All arguments must be in double quotes. # -# $FreeBSD: src/sys/boot/forth/loader.conf,v 1.78 2004/06/20 15:58:24 josef Exp $ +# $FreeBSD: src/sys/boot/forth/loader.conf,v 1.79 2004/06/22 22:57:13 brueffer Exp $ ############################################################## ### Basic configuration options ############################ @@ -172,8 +172,6 @@ if_tun_load="NO" # Tunnel driver (user process ppp) if_vlan_load="NO" # IEEE 802.1Q VLAN network interface ipfw_load="NO" # Firewall -pfsync_load="NO" # pfsync pseudo interface -pflog_load="NO" # pflog pseudo interface pf_load="NO" # packet filter ==== //depot/projects/sack/boot/i386/cdboot/cdboot.s#2 (text+ko) ==== @@ -1,19 +1,33 @@ # -# Copyright (c) 2001 John Baldwin +# Copyright (c) 2001 John Baldwin # All rights reserved. # -# Redistribution and use in source and binary forms are freely -# permitted provided that the above copyright notice and this -# paragraph and the following disclaimer are duplicated in all -# such forms. +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. Neither the name of the author nor the names of any co-contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. # -# This software is provided "AS IS" and without any express or -# implied warranties, including, without limitation, the implied -# warranties of merchantability and fitness for a particular -# purpose. +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (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/boot/i386/cdboot/cdboot.s,v 1.11 2004/01/12 20:34:42 jhb Exp $ +# $FreeBSD: src/sys/boot/i386/cdboot/cdboot.s,v 1.13 2004/06/22 21:55:22 jhb Exp $ # # This program is a freestanding boot program to load an a.out binary @@ -151,7 +165,6 @@ mov $0xffff,%cx # path name by repnz # scanning for scasb # nul char - inc %di # Skip nul mov %di,%si # Point %si at next path mov (%si),%al # Get first char of next path or %al,%al # Is it double nul? ==== //depot/projects/sack/compat/linux/linux_util.c#3 (text+ko) ==== @@ -30,13 +30,15 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_util.c,v 1.25 2004/06/22 04:22:34 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_util.c,v 1.26 2004/06/23 06:35:43 bde Exp $"); #include -#include +#include +#include +#include #include #include -#include +#include #include #include ==== //depot/projects/sack/conf/NOTES#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/NOTES,v 1.1232 2004/06/13 17:29:06 mlaier Exp $ +# $FreeBSD: src/sys/conf/NOTES,v 1.1233 2004/06/22 22:02:57 bms Exp $ # # NOTES -- Lines that can be cut/pasted into kernel and hints configs. # @@ -372,9 +372,8 @@ # The default is that packets coming from a tunnel are _not_ processed; # they are assumed trusted. # -# Note that enabling this can be problematic as there are no mechanisms -# in place for distinguishing packets coming out of a tunnel (e.g. no -# encX devices as found on openbsd). +# IPSEC history is preserved for such packets, and can be filtered +# using ipfw(8)'s 'ipsec' keyword, when this option is enabled. # #options IPSEC_FILTERGIF #filter ipsec packets from a tunnel ==== //depot/projects/sack/conf/files#5 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.906 2004/06/16 23:23:59 mlaier Exp $ +# $FreeBSD: src/sys/conf/files,v 1.907 2004/06/22 20:13:24 brooks Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -1222,6 +1222,7 @@ net/if.c standard net/if_arcsubr.c optional arcnet net/if_atmsubr.c optional atm +net/if_clone.c standard net/if_disc.c optional disc net/if_ef.c optional ef net/if_ethersubr.c optional ether ==== //depot/projects/sack/conf/files.i386#2 (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.i386,v 1.493 2004/05/26 07:43:40 bde Exp $ +# $FreeBSD: src/sys/conf/files.i386,v 1.494 2004/06/23 17:33:24 brooks Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -272,7 +272,7 @@ i386/isa/elcr.c standard i386/isa/elink.c optional ep i386/isa/elink.c optional ie -i386/isa/if_el.c count el +i386/isa/if_el.c optional el i386/isa/isa.c optional isa i386/isa/isa_dma.c optional isa i386/isa/mse.c optional mse ==== //depot/projects/sack/contrib/pf/net/if_pflog.c#4 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/contrib/pf/net/if_pflog.c,v 1.8 2004/06/16 23:24:00 mlaier Exp $ */ +/* $FreeBSD: src/sys/contrib/pf/net/if_pflog.c,v 1.9 2004/06/22 20:13:24 brooks Exp $ */ /* $OpenBSD: if_pflog.c,v 1.11 2003/12/31 11:18:25 cedric Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), @@ -63,6 +63,9 @@ #endif #include +#if defined(__FreeBSD__) +#include +#endif #include #include #include @@ -123,8 +126,7 @@ #ifdef __FreeBSD__ static MALLOC_DEFINE(M_PFLOG, PFLOGNAME, "Packet Filter Logging Interface"); static LIST_HEAD(pflog_list, pflog_softc) pflog_list; -struct if_clone pflog_cloner = IF_CLONE_INITIALIZER(PFLOGNAME, - pflog_clone_create, pflog_clone_destroy, 1, IF_MAXUNIT); +IFC_SIMPLE_DECLARE(pflog, 1); static void pflog_clone_destroy(struct ifnet *ifp) ==== //depot/projects/sack/contrib/pf/net/if_pfsync.c#4 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/contrib/pf/net/if_pfsync.c,v 1.8 2004/06/16 23:24:00 mlaier Exp $ */ +/* $FreeBSD: src/sys/contrib/pf/net/if_pfsync.c,v 1.9 2004/06/22 20:13:24 brooks Exp $ */ /* $OpenBSD: if_pfsync.c,v 1.26 2004/03/28 18:14:20 mcbride Exp $ */ /* @@ -62,6 +62,9 @@ #endif #include +#if defined(__FreeBSD__) +#include +#endif #include #include #include @@ -148,8 +151,7 @@ #ifdef __FreeBSD__ static MALLOC_DEFINE(M_PFSYNC, PFSYNCNAME, "Packet Filter State Sync. Interface"); static LIST_HEAD(pfsync_list, pfsync_softc) pfsync_list; -struct if_clone pfsync_cloner = IF_CLONE_INITIALIZER(PFSYNCNAME, - pfsync_clone_create, pfsync_clone_destroy, 1, IF_MAXUNIT); +IFC_SIMPLE_DECLARE(pfsync, 1); static void pfsync_clone_destroy(struct ifnet *ifp) ==== //depot/projects/sack/contrib/pf/net/pfvar.h#4 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/contrib/pf/net/pfvar.h,v 1.6 2004/06/16 23:24:00 mlaier Exp $ */ +/* $FreeBSD: src/sys/contrib/pf/net/pfvar.h,v 1.7 2004/06/22 20:13:25 brooks Exp $ */ /* $OpenBSD: pfvar.h,v 1.187 2004/03/22 04:54:18 mcbride Exp $ */ /* @@ -40,6 +40,7 @@ #include #ifdef __FreeBSD__ +#include #include #else #include ==== //depot/projects/sack/dev/acpica/acpi.c#4 (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.163 2004/06/16 09:46:35 phk Exp $ + * $FreeBSD: src/sys/dev/acpica/acpi.c,v 1.164 2004/06/23 17:21:02 jhb Exp $ */ #include "opt_acpi.h" @@ -846,12 +846,12 @@ 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) { + ACPI_RESOURCE ares; struct acpi_device *ad = device_get_ivars(child); struct resource_list *rl = &ad->ad_rl; struct resource_list_entry *rle; struct resource *res; struct rman *rm; - int needactivate; /* * If this is an allocation of the "default" range for a given RID, and @@ -870,41 +870,56 @@ /* If we don't manage this address, pass the request up to the parent. */ rle = acpi_sysres_find(type, start); if (rle == NULL) { - return (BUS_ALLOC_RESOURCE(device_get_parent(bus), child, type, rid, - start, end, count, flags)); - } + res = BUS_ALLOC_RESOURCE(device_get_parent(bus), child, type, rid, + start, end, count, flags); + } else { + + /* We only handle memory and IO resources through rman. */ + switch (type) { + case SYS_RES_IOPORT: + rm = &acpi_rman_io; + break; + case SYS_RES_MEMORY: + rm = &acpi_rman_mem; + break; + default: + panic("acpi_alloc_resource: invalid res type %d", type); + } - /* We only handle memory and IO resources through rman. */ - switch (type) { - case SYS_RES_IOPORT: - rm = &acpi_rman_io; - break; - case SYS_RES_MEMORY: - rm = &acpi_rman_mem; - break; - default: - panic("acpi_alloc_resource: invalid res type %d", type); - } + /* If we do know it, allocate it from the local pool. */ + res = rman_reserve_resource(rm, start, end, count, flags & ~RF_ACTIVE, + child); + if (res == NULL) + return (NULL); - /* If we do know it, allocate it from the local pool. */ - needactivate = flags & RF_ACTIVE; - flags &= ~RF_ACTIVE; - res = rman_reserve_resource(rm, start, end, count, flags, child); - if (res == NULL) - return (NULL); + /* Copy the bus tag from the pre-allocated resource. */ + rman_set_bustag(res, rman_get_bustag(rle->res)); + if (type == SYS_RES_IOPORT) + rman_set_bushandle(res, res->r_start); - /* Copy the bus tag from the pre-allocated resource. */ - rman_set_bustag(res, rman_get_bustag(rle->res)); - if (type == SYS_RES_IOPORT) - rman_set_bushandle(res, res->r_start); + /* If requested, activate the resource using the parent's method. */ + if (flags & RF_ACTIVE) + if (bus_activate_resource(child, type, *rid, res) != 0) { + rman_release_resource(res); + return (NULL); + } + } - /* If requested, activate the resource using the parent's method. */ - if (needactivate) - if (bus_activate_resource(child, type, *rid, res) != 0) { - rman_release_resource(res); - return (NULL); + if (res != NULL && device_get_parent(child) == bus) + switch (type) { + case SYS_RES_IRQ: + /* + * Since bus_config_intr() takes immediate effect, we cannot + * configure the interrupt associated with a device when we + * parse the resources but have to defer it until a driver + * actually allocates the interrupt via bus_alloc_resource(). + * + * XXX: Should we handle the lookup failing? + */ + if (ACPI_SUCCESS(acpi_lookup_irq_resource(child, *rid, res, &ares))) + acpi_config_intr(child, &ares); + break; } - return (res); } ==== //depot/projects/sack/dev/acpica/acpi_pci.c#2 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pci.c,v 1.18 2004/06/07 21:44:01 njl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pci.c,v 1.19 2004/06/23 15:08:40 jhb Exp $"); #include #include @@ -56,18 +56,17 @@ ACPI_HANDLE ap_handle; }; +static int acpi_pci_attach(device_t dev); +static int acpi_pci_child_location_str_method(device_t cbdev, + device_t child, char *buf, size_t buflen); static int acpi_pci_probe(device_t dev); -static int acpi_pci_attach(device_t dev); static int acpi_pci_read_ivar(device_t dev, device_t child, int which, uintptr_t *result); -static int acpi_pci_child_location_str_method(device_t cbdev, - device_t child, char *buf, size_t buflen); - - +static ACPI_STATUS acpi_pci_save_handle(ACPI_HANDLE handle, UINT32 level, + void *context, void **status); static int acpi_pci_set_powerstate_method(device_t dev, device_t child, int state); -static ACPI_STATUS acpi_pci_save_handle(ACPI_HANDLE handle, UINT32 level, - void *context, void **status); +static void acpi_pci_update_device(ACPI_HANDLE handle, device_t pci_child); static device_method_t acpi_pci_methods[] = { /* Device interface */ @@ -205,6 +204,40 @@ return (0); } +static void +acpi_pci_update_device(ACPI_HANDLE handle, device_t pci_child) +{ + ACPI_STATUS status; + device_t child; + + /* + * Lookup and remove the unused device that acpi0 creates when it walks + * the namespace creating devices. + */ + child = acpi_get_device(handle); + if (child != NULL) { + KASSERT(!device_is_alive(child), ("%s: deleting alive child %s", + __func__, device_get_nameunit(child))); + KASSERT(device_get_parent(child) == + devclass_get_device(devclass_find("acpi"), 0), + ("%s: child (%s)'s parent is not acpi0", __func__, + acpi_name(handle))); + device_delete_child(device_get_parent(child), child); + } + + /* + * Update ACPI-CA to use the PCI enumerated device_t for this handle. + */ + status = AcpiDetachData(handle, acpi_fake_objhandler); + if (ACPI_FAILURE(status)) + printf("WARNING: Unable to detach object data from %s - %s\n", + acpi_name(handle), AcpiFormatException(status)); + status = AcpiAttachData(handle, acpi_fake_objhandler, child); + if (ACPI_FAILURE(status)) + printf("WARNING: Unable to attach object data to %s - %s\n", + acpi_name(handle), AcpiFormatException(status)); +} + static ACPI_STATUS acpi_pci_save_handle(ACPI_HANDLE handle, UINT32 level, void *context, void **status) @@ -227,6 +260,7 @@ if (dinfo->ap_dinfo.cfg.func == func && dinfo->ap_dinfo.cfg.slot == slot) { dinfo->ap_handle = handle; + acpi_pci_update_device(handle, devlist[i]); free(devlist, M_TEMP); return_ACPI_STATUS (AE_OK); } ==== //depot/projects/sack/dev/acpica/acpi_pcib.c#2 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pcib.c,v 1.44 2004/06/07 17:36:22 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pcib.c,v 1.45 2004/06/23 17:21:02 jhb Exp $"); #include "opt_acpi.h" #include @@ -121,6 +121,7 @@ ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); + crsres = NULL; buf.Pointer = NULL; crsbuf.Pointer = NULL; prsbuf.Pointer = NULL; @@ -348,6 +349,7 @@ /* XXX Data.Irq and Data.ExtendedIrq are implicitly structure-copied. */ crsbuf.Pointer = NULL; + crsres = NULL; if (prsres->Id == ACPI_RSTYPE_IRQ) { resbuf.Id = ACPI_RSTYPE_IRQ; resbuf.Length = ACPI_SIZEOF_RESOURCE(ACPI_RESOURCE_IRQ); @@ -378,6 +380,7 @@ AcpiFormatException(status)); goto out; } + crsres = &resbuf; /* Return the interrupt we just routed. */ device_printf(pcib, "slot %d INT%c routed to irq %d via %s\n", @@ -386,6 +389,8 @@ interrupt = Interrupts[0]; out: + if (PCI_INTERRUPT_VALID(interrupt) && crsres != NULL) + acpi_config_intr(dev, crsres); if (crsbuf.Pointer != NULL) AcpiOsFree(crsbuf.Pointer); if (prsbuf.Pointer != NULL) ==== //depot/projects/sack/dev/acpica/acpi_resource.c#3 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_resource.c,v 1.25 2004/06/13 22:52:30 njl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_resource.c,v 1.26 2004/06/23 17:21:02 jhb Exp $"); #include "opt_acpi.h" #include @@ -46,6 +46,94 @@ #define _COMPONENT ACPI_BUS ACPI_MODULE_NAME("RESOURCE") +struct lookup_irq_request { + ACPI_RESOURCE *acpi_res; + struct resource *res; + int counter; + int rid; + int found; +}; + +static ACPI_STATUS +acpi_lookup_irq_handler(ACPI_RESOURCE *res, void *context) +{ + struct lookup_irq_request *req; + u_int irqnum, irq; + + switch (res->Id) { + case ACPI_RSTYPE_IRQ: + case ACPI_RSTYPE_EXT_IRQ: + if (res->Id == ACPI_RSTYPE_IRQ) { + irqnum = res->Data.Irq.NumberOfInterrupts; + irq = res->Data.Irq.Interrupts[0]; + } else { + irqnum = res->Data.ExtendedIrq.NumberOfInterrupts; + irq = res->Data.ExtendedIrq.Interrupts[0]; + } + if (irqnum != 1) + break; + req = (struct lookup_irq_request *)context; + if (req->counter != req->rid) { + req->counter++; + break; + } + req->found = 1; + KASSERT(irq == rman_get_start(req->res), + ("IRQ resources do not match")); + bcopy(res, req->acpi_res, sizeof(ACPI_RESOURCE)); + return (AE_CTRL_TERMINATE); + } + return (AE_OK); +} + +ACPI_STATUS +acpi_lookup_irq_resource(device_t dev, int rid, struct resource *res, + ACPI_RESOURCE *acpi_res) +{ + struct lookup_irq_request req; + ACPI_STATUS status; + + req.acpi_res = acpi_res; + req.res = res; + req.counter = 0; + req.rid = rid; + req.found = 0; + status = AcpiWalkResources(acpi_get_handle(dev), "_CRS", + acpi_lookup_irq_handler, &req); + if (ACPI_SUCCESS(status) && req.found == 0) + status = AE_NOT_FOUND; + return (status); +} + +void +acpi_config_intr(device_t dev, ACPI_RESOURCE *res) +{ + u_int irq; + int pol, trig; + + switch (res->Id) { + case ACPI_RSTYPE_IRQ: + KASSERT(res->Data.Irq.NumberOfInterrupts == 1, + ("%s: multiple interrupts", __func__)); + irq = res->Data.Irq.Interrupts[0]; + trig = res->Data.Irq.EdgeLevel; + pol = res->Data.Irq.ActiveHighLow; + break; + case ACPI_RSTYPE_EXT_IRQ: + KASSERT(res->Data.ExtendedIrq.NumberOfInterrupts == 1, + ("%s: multiple interrupts", __func__)); + irq = res->Data.ExtendedIrq.Interrupts[0]; + trig = res->Data.ExtendedIrq.EdgeLevel; + pol = res->Data.ExtendedIrq.ActiveHighLow; + break; + default: + panic("%s: bad resource type %u", __func__, res->Id); + } + BUS_CONFIG_INTR(dev, irq, (trig == ACPI_EDGE_SENSITIVE) ? + INTR_TRIGGER_EDGE : INTR_TRIGGER_LEVEL, (pol == ACPI_ACTIVE_HIGH) ? + INTR_POLARITY_HIGH : INTR_POLARITY_LOW); +} + /* * Fetch a device's resources and associate them with the device. * @@ -497,9 +585,6 @@ return; bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, *irq, 1); - BUS_CONFIG_INTR(dev, *irq, (trig == ACPI_EDGE_SENSITIVE) ? - INTR_TRIGGER_EDGE : INTR_TRIGGER_LEVEL, (pol == ACPI_ACTIVE_HIGH) ? - INTR_POLARITY_HIGH : INTR_POLARITY_LOW); } static void ==== //depot/projects/sack/dev/acpica/acpiio.h#2 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/acpica/acpiio.h,v 1.9 2003/09/13 20:13:01 njl Exp $ + * $FreeBSD: src/sys/dev/acpica/acpiio.h,v 1.10 2004/06/22 08:23:26 brueffer Exp $ */ /* @@ -44,7 +44,7 @@ struct acpi_battinfo { int cap; /* percent */ - int min; /* remianing time */ + int min; /* remaining time */ int state; /* battery state */ }; @@ -57,8 +57,8 @@ u_int32_t dvol; /* Design voltage (mV) */ u_int32_t wcap; /* WARN capacity */ u_int32_t lcap; /* Low capacity */ - u_int32_t gra1; /* Granulity 1(Warn to Low) */ - u_int32_t gra2; /* Granulity 2(Full to Warn) */ + u_int32_t gra1; /* Granularity 1 (Warn to Low) */ + u_int32_t gra2; /* Granularity 2 (Full to Warn) */ char model[ACPI_CMBAT_MAXSTRLEN]; /* model identifier */ char serial[ACPI_CMBAT_MAXSTRLEN]; /* Serial number */ char type[ACPI_CMBAT_MAXSTRLEN]; /* Type */ ==== //depot/projects/sack/dev/acpica/acpivar.h#4 (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.72 2004/06/16 09:46:35 phk Exp $ + * $FreeBSD: src/sys/dev/acpica/acpivar.h,v 1.73 2004/06/23 17:21:02 jhb Exp $ */ #include "bus_if.h" @@ -268,6 +268,10 @@ }; extern struct acpi_parse_resource_set acpi_res_parse_set; + +void acpi_config_intr(device_t dev, ACPI_RESOURCE *res); +ACPI_STATUS acpi_lookup_irq_resource(device_t dev, int rid, + 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; ==== //depot/projects/sack/dev/ata/ata-all.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.213 2004/06/16 09:46:37 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.214 2004/06/22 11:18:24 sos Exp $"); #include "opt_ata.h" #include @@ -156,7 +156,7 @@ /* initialize queue and associated lock */ bzero(&ch->queue_mtx, sizeof(struct mtx)); - mtx_init(&ch->queue_mtx, "ATA queue lock", MTX_DEF, 0); + mtx_init(&ch->queue_mtx, "ATA queue lock", NULL, MTX_DEF); TAILQ_INIT(&ch->ata_queue); /* do not attach devices if we are in early boot */ ==== //depot/projects/sack/dev/ata/ata-chipset.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.74 2004/06/17 21:36:10 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.75 2004/06/22 11:18:24 sos Exp $"); #include "opt_ata.h" #include @@ -1324,7 +1324,7 @@ ctlr->driver = malloc(sizeof(struct ata_promise_sx4), M_TEMP, M_NOWAIT | M_ZERO); hpkt = ctlr->driver; - mtx_init(&hpkt->mtx, "ATA promise HPKT lock", MTX_DEF, 0); + mtx_init(&hpkt->mtx, "ATA promise HPKT lock", NULL, MTX_DEF); hpkt->busy = hpkt->head = hpkt->tail = 0; if ((bus_setup_intr(dev, ctlr->r_irq, ATA_INTR_FLAGS, ==== //depot/projects/sack/dev/ata/ata-disk.c#2 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-disk.c,v 1.172 2004/04/13 09:44:20 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-disk.c,v 1.173 2004/06/22 11:18:24 sos Exp $"); #include "opt_ata.h" #include @@ -97,7 +97,7 @@ adp->sectors = 17; adp->heads = 8; } - mtx_init(&adp->queue_mtx, "ATA disk bioqueue lock", MTX_DEF, 0); + mtx_init(&adp->queue_mtx, "ATA disk bioqueue lock", NULL, MTX_DEF); bioq_init(&adp->queue); lbasize = (u_int32_t)atadev->param->lba_size_1 | ==== //depot/projects/sack/dev/ata/atapi-cd.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-cd.c,v 1.167 2004/06/21 20:42:03 green Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-cd.c,v 1.168 2004/06/22 11:18:24 sos Exp $"); #include "opt_ata.h" #include @@ -230,7 +230,7 @@ if (!(cdp = malloc(sizeof(struct acd_softc), M_ACD, M_NOWAIT | M_ZERO))) return NULL; bioq_init(&cdp->queue); - mtx_init(&cdp->queue_mtx, "ATAPI CD bioqueue lock", MTX_DEF, 0); + mtx_init(&cdp->queue_mtx, "ATAPI CD bioqueue lock", NULL, MTX_DEF); cdp->device = atadev; cdp->lun = ata_get_lun(&acd_lun_map); cdp->block_size = 2048; ==== //depot/projects/sack/dev/ata/atapi-fd.c#2 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-fd.c,v 1.95 2004/03/01 13:17:07 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-fd.c,v 1.96 2004/06/22 11:18:25 sos Exp $"); #include #include @@ -82,7 +82,7 @@ fdp->lun = ata_get_lun(&afd_lun_map); ata_set_name(atadev, "afd", fdp->lun); bioq_init(&fdp->queue); - mtx_init(&fdp->queue_mtx, "ATAPI FD bioqueue lock", MTX_DEF, 0); + mtx_init(&fdp->queue_mtx, "ATAPI FD bioqueue lock", NULL, MTX_DEF); if (afd_sense(fdp)) { free(fdp, M_AFD); ==== //depot/projects/sack/dev/ata/atapi-tape.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-tape.c,v 1.91 2004/06/16 09:46:37 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-tape.c,v 1.92 2004/06/22 11:18:25 sos Exp $"); #include "opt_ata.h" #include @@ -106,7 +106,7 @@ stp->lun = ata_get_lun(&ast_lun_map); ata_set_name(atadev, "ast", stp->lun); bioq_init(&stp->queue); - mtx_init(&stp->queue_mtx, "ATAPI TAPE bioqueue lock", MTX_DEF, 0); + mtx_init(&stp->queue_mtx, "ATAPI TAPE bioqueue lock", NULL, MTX_DEF); if (ast_sense(stp)) { free(stp, M_AST); ==== //depot/projects/sack/dev/ciss/ciss.c#4 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ciss/ciss.c,v 1.52 2004/06/21 22:57:10 ps Exp $ + * $FreeBSD: src/sys/dev/ciss/ciss.c,v 1.54 2004/06/22 23:05:06 ps Exp $ */ /* @@ -2493,7 +2493,7 @@ for (i = 0; i < sc->ciss_max_logical_bus; i++) ciss_cam_rescan_target(sc, i, CAM_TARGET_WILDCARD); /* Rescan the physical buses */ - for (i = CISS_PHYSICAL_BASE; i < sc->ciss_max_logical_bus + + for (i = CISS_PHYSICAL_BASE; i < sc->ciss_max_physical_bus + CISS_PHYSICAL_BASE; i++) ciss_cam_rescan_target(sc, i, CAM_TARGET_WILDCARD); } @@ -3414,6 +3414,7 @@ if (ld->cl_update == 0) continue; + ld->cl_update = 0; ld->cl_address = cll->lun[i]; ld->cl_controller = &sc->ciss_controllers[bus]; if (ciss_identify_logical(sc, ld) == 0) { ==== //depot/projects/sack/dev/cp/if_cp.c#3 (text+ko) ==== @@ -18,11 +18,11 @@ * as long as this message is kept with the software, all derivative * works or modified versions. * - * $Cronyx: if_cp.c,v 1.1.2.32 2004/02/26 17:56:39 rik Exp $ + * Cronyx Id: if_cp.c,v 1.1.2.41 2004/06/23 17:09:13 rik Exp $ */ #include -__FBSDID("$FreeBSD: src/sys/dev/cp/if_cp.c,v 1.6 2004/06/17 17:16:42 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/cp/if_cp.c,v 1.8 2004/06/23 18:13:09 rik Exp $"); #include @@ -45,9 +45,7 @@ #include #include #include -#if __FreeBSD_version >= 400000 >>> TRUNCATED FOR MAIL (1000 lines) <<<