mptable_pci.c (261520) | mptable_pci.c (261790) |
---|---|
1/*- 2 * Copyright (c) 2003 John Baldwin <jhb@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 --- 16 unchanged lines hidden (view full) --- 25 */ 26 27/* 28 * Host to PCI and PCI to PCI bridge drivers that use the MP Table to route 29 * interrupts from PCI devices to I/O APICs. 30 */ 31 32#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2003 John Baldwin <jhb@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 --- 16 unchanged lines hidden (view full) --- 25 */ 26 27/* 28 * Host to PCI and PCI to PCI bridge drivers that use the MP Table to route 29 * interrupts from PCI devices to I/O APICs. 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/x86/x86/mptable_pci.c 261520 2014-02-05 18:13:27Z jhb $"); | 33__FBSDID("$FreeBSD: head/sys/x86/x86/mptable_pci.c 261790 2014-02-12 04:30:37Z jhb $"); |
34 35#include <sys/param.h> 36#include <sys/systm.h> 37#include <sys/bus.h> 38#include <sys/kernel.h> 39#include <sys/module.h> 40#include <sys/rman.h> 41 --- 58 unchanged lines hidden (view full) --- 100} 101 102static struct resource * 103mptable_hostb_alloc_resource(device_t dev, device_t child, int type, int *rid, 104 u_long start, u_long end, u_long count, u_int flags) 105{ 106 struct mptable_hostb_softc *sc; 107 | 34 35#include <sys/param.h> 36#include <sys/systm.h> 37#include <sys/bus.h> 38#include <sys/kernel.h> 39#include <sys/module.h> 40#include <sys/rman.h> 41 --- 58 unchanged lines hidden (view full) --- 100} 101 102static struct resource * 103mptable_hostb_alloc_resource(device_t dev, device_t child, int type, int *rid, 104 u_long start, u_long end, u_long count, u_int flags) 105{ 106 struct mptable_hostb_softc *sc; 107 |
108#ifdef PCI_RES_BUS 109 if (type == PCI_RES_BUS) 110 return (pci_domain_alloc_bus(0, child, rid, start, end, count, 111 flags)); 112#endif |
|
108 sc = device_get_softc(dev); 109 if (type == SYS_RES_IOPORT && start + count - 1 == end) { 110 if (mptable_is_isa_range(start, end)) { 111 switch (sc->sc_decodes_isa_io) { 112 case -1: 113 return (NULL); 114 case 1: 115 return (bus_generic_alloc_resource(dev, child, --- 20 unchanged lines hidden (view full) --- 136} 137 138static int 139mptable_hostb_adjust_resource(device_t dev, device_t child, int type, 140 struct resource *r, u_long start, u_long end) 141{ 142 struct mptable_hostb_softc *sc; 143 | 113 sc = device_get_softc(dev); 114 if (type == SYS_RES_IOPORT && start + count - 1 == end) { 115 if (mptable_is_isa_range(start, end)) { 116 switch (sc->sc_decodes_isa_io) { 117 case -1: 118 return (NULL); 119 case 1: 120 return (bus_generic_alloc_resource(dev, child, --- 20 unchanged lines hidden (view full) --- 141} 142 143static int 144mptable_hostb_adjust_resource(device_t dev, device_t child, int type, 145 struct resource *r, u_long start, u_long end) 146{ 147 struct mptable_hostb_softc *sc; 148 |
149#ifdef PCI_RES_BUS 150 if (type == PCI_RES_BUS) 151 return (pci_domain_adjust_bus(0, child, r, start, end)); 152#endif |
|
144 sc = device_get_softc(dev); 145 return (pcib_host_res_adjust(&sc->sc_host_res, child, type, r, start, 146 end)); 147} 148#endif 149 150static device_method_t mptable_hostb_methods[] = { 151 /* Device interface */ --- 8 unchanged lines hidden (view full) --- 160 DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar), 161#ifdef NEW_PCIB 162 DEVMETHOD(bus_alloc_resource, mptable_hostb_alloc_resource), 163 DEVMETHOD(bus_adjust_resource, mptable_hostb_adjust_resource), 164#else 165 DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource), 166 DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), 167#endif | 153 sc = device_get_softc(dev); 154 return (pcib_host_res_adjust(&sc->sc_host_res, child, type, r, start, 155 end)); 156} 157#endif 158 159static device_method_t mptable_hostb_methods[] = { 160 /* Device interface */ --- 8 unchanged lines hidden (view full) --- 169 DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar), 170#ifdef NEW_PCIB 171 DEVMETHOD(bus_alloc_resource, mptable_hostb_alloc_resource), 172 DEVMETHOD(bus_adjust_resource, mptable_hostb_adjust_resource), 173#else 174 DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource), 175 DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), 176#endif |
177#if defined(NEW_PCIB) && defined(PCI_RES_BUS) 178 DEVMETHOD(bus_release_resource, legacy_pcib_release_resource), 179#else |
|
168 DEVMETHOD(bus_release_resource, bus_generic_release_resource), | 180 DEVMETHOD(bus_release_resource, bus_generic_release_resource), |
181#endif |
|
169 DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), 170 DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), 171 DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), 172 DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), 173 174 /* pcib interface */ 175 DEVMETHOD(pcib_maxslots, legacy_pcib_maxslots), 176 DEVMETHOD(pcib_read_config, legacy_pcib_read_config), --- 51 unchanged lines hidden --- | 182 DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), 183 DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), 184 DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), 185 DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), 186 187 /* pcib interface */ 188 DEVMETHOD(pcib_maxslots, legacy_pcib_maxslots), 189 DEVMETHOD(pcib_read_config, legacy_pcib_read_config), --- 51 unchanged lines hidden --- |