1 /* 2 * Copyright 1998 Massachusetts Institute of Technology 3 * 4 * Permission to use, copy, modify, and distribute this software and 5 * its documentation for any purpose and without fee is hereby 6 * granted, provided that both the above copyright notice and this 7 * permission notice appear in all copies, that both the above 8 * copyright notice and this permission notice appear in all 9 * supporting documentation, and that the name of M.I.T. not be used 10 * in advertising or publicity pertaining to distribution of the 11 * software without specific, written prior permission. M.I.T. makes 12 * no representations about the suitability of this software for any 13 * purpose. It is provided "as is" without express or implied 14 * warranty. 15 * 16 * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS 17 * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, 18 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT 20 * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 23 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 26 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * $FreeBSD: src/sys/i386/i386/nexus.c,v 1.26.2.10 2003/02/22 13:16:45 imp Exp $ 30 * $DragonFly: src/sys/bus/isa/pnpeat.c,v 1.5 2008/08/02 01:14:39 dillon Exp $ 31 */ 32 33 /* 34 * This code implements a `root nexus' for Intel Architecture 35 * machines. The function of the root nexus is to serve as an 36 * attachment point for both processors and buses, and to manage 37 * resources which are common to all of them. In particular, 38 * this code implements the core resource managers for interrupt 39 * requests, DMA requests (which rightfully should be a part of the 40 * ISA code but it's easier to do it here for now), I/O port addresses, 41 * and I/O memory address space. 42 */ 43 44 #include <sys/param.h> 45 #include <sys/systm.h> 46 #include <sys/bus.h> 47 #include <sys/kernel.h> 48 #include <sys/malloc.h> 49 #include <sys/module.h> 50 #include <sys/rman.h> 51 52 #include <machine/vmparam.h> 53 #include <vm/vm.h> 54 #include <vm/pmap.h> 55 #include <machine/pmap.h> 56 57 #include <machine/nexusvar.h> 58 #include <machine/smp.h> 59 #include <machine_base/apic/mpapic.h> 60 61 #include "isavar.h" 62 #include "isa.h" 63 #include <machine_base/isa/intr_machdep.h> 64 65 /* 66 * Placeholder which claims PnP 'devices' which describe system 67 * resources. 68 */ 69 static struct isa_pnp_id sysresource_ids[] = { 70 { 0x010cd041 /* PNP0c01 */, "System Memory" }, 71 { 0x020cd041 /* PNP0c02 */, "System Resource" }, 72 { 0 } 73 }; 74 75 static int 76 sysresource_probe(device_t dev) 77 { 78 int result; 79 80 if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, sysresource_ids)) >= 0) { 81 device_quiet(dev); 82 } 83 return (result); 84 } 85 86 static int 87 sysresource_attach(device_t dev) 88 { 89 return (0); 90 } 91 92 static device_method_t sysresource_methods[] = { 93 /* Device interface */ 94 DEVMETHOD(device_probe, sysresource_probe), 95 DEVMETHOD(device_attach, sysresource_attach), 96 DEVMETHOD(device_detach, bus_generic_detach), 97 DEVMETHOD(device_shutdown, bus_generic_shutdown), 98 DEVMETHOD(device_suspend, bus_generic_suspend), 99 DEVMETHOD(device_resume, bus_generic_resume), 100 { 0, 0 } 101 }; 102 103 static driver_t sysresource_driver = { 104 "sysresource", 105 sysresource_methods, 106 1, /* no softc */ 107 }; 108 109 static devclass_t sysresource_devclass; 110 111 DRIVER_MODULE(sysresource, isa, sysresource_driver, sysresource_devclass, 0, 0); 112