pci_pir.c (31893) | pci_pir.c (47307) |
---|---|
1/* 2 * Copyright (c) 1997, Stefan Esser <se@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * | 1/* 2 * Copyright (c) 1997, Stefan Esser <se@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * |
26 * $Id: pcibus.c,v 1.40 1997/07/20 14:10:08 bde Exp $ | 26 * $Id: pcibus.c,v 1.41 1997/12/20 09:04:25 se Exp $ |
27 * 28 */ 29 | 27 * 28 */ 29 |
30#include <sys/types.h> | 30#include <sys/param.h> |
31#include <sys/systm.h> | 31#include <sys/systm.h> |
32#include <sys/bus.h> 33#include <sys/kernel.h> |
|
32 33#include <pci/pcivar.h> 34#include <i386/isa/pcibus.h> 35 36#ifdef PCI_COMPAT 37/* XXX this is a terrible hack, which keeps the Tekram AMD SCSI driver happy */ 38#define cfgmech pci_mechanism 39int cfgmech; --- 139 unchanged lines hidden (view full) --- 179 } 180 if (bootverbose) 181 printf("-- nothing found\n"); 182 183 pci_cfgdisable(); 184 return (0); 185} 186 | 34 35#include <pci/pcivar.h> 36#include <i386/isa/pcibus.h> 37 38#ifdef PCI_COMPAT 39/* XXX this is a terrible hack, which keeps the Tekram AMD SCSI driver happy */ 40#define cfgmech pci_mechanism 41int cfgmech; --- 139 unchanged lines hidden (view full) --- 181 } 182 if (bootverbose) 183 printf("-- nothing found\n"); 184 185 pci_cfgdisable(); 186 return (0); 187} 188 |
187int | 189static int |
188pci_cfgopen(void) 189{ 190 unsigned long mode1res,oldval1; 191 unsigned char mode2res,oldval2; 192 193 oldval1 = inl(CONF1_ADDR_PORT); 194 195 if (bootverbose) { --- 62 unchanged lines hidden (view full) --- 258 return (cfgmech); 259 } 260 } 261 262 cfgmech = 0; 263 devmax = 0; 264 return (cfgmech); 265} | 190pci_cfgopen(void) 191{ 192 unsigned long mode1res,oldval1; 193 unsigned char mode2res,oldval2; 194 195 oldval1 = inl(CONF1_ADDR_PORT); 196 197 if (bootverbose) { --- 62 unchanged lines hidden (view full) --- 260 return (cfgmech); 261 } 262 } 263 264 cfgmech = 0; 265 devmax = 0; 266 return (cfgmech); 267} |
268 269static devclass_t pcib_devclass; 270 271static int 272nexus_pcib_probe(device_t dev) 273{ 274 if (pci_cfgopen() != 0) { 275 device_set_desc(dev, "PCI host bus adapter"); 276 277 device_add_child(dev, "pci", 0, 0); 278 return 0; 279 } 280 return ENXIO; 281} 282 283static device_method_t nexus_pcib_methods[] = { 284 /* Device interface */ 285 DEVMETHOD(device_probe, nexus_pcib_probe), 286 DEVMETHOD(device_attach, bus_generic_attach), 287 DEVMETHOD(device_shutdown, bus_generic_shutdown), 288 DEVMETHOD(device_suspend, bus_generic_suspend), 289 DEVMETHOD(device_resume, bus_generic_resume), 290 291 /* Bus interface */ 292 DEVMETHOD(bus_print_child, bus_generic_print_child), 293 DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), 294 DEVMETHOD(bus_release_resource, bus_generic_release_resource), 295 DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), 296 DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), 297 DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), 298 DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), 299 300 { 0, 0 } 301}; 302 303static driver_t nexus_pcib_driver = { 304 "pcib", 305 nexus_pcib_methods, 306 1, 307}; 308 309DRIVER_MODULE(pcib, nexus, nexus_pcib_driver, pcib_devclass, 0, 0); |
|