Changeset View
Changeset View
Standalone View
Standalone View
head/sys/x86/x86/mptable_pci.c
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | #ifdef NEW_PCIB | ||||
mptable_pci_host_res_init(dev); | mptable_pci_host_res_init(dev); | ||||
#endif | #endif | ||||
device_add_child(dev, "pci", -1); | device_add_child(dev, "pci", -1); | ||||
return (bus_generic_attach(dev)); | return (bus_generic_attach(dev)); | ||||
} | } | ||||
#ifdef NEW_PCIB | #ifdef NEW_PCIB | ||||
static int | static int | ||||
mptable_is_isa_range(u_long start, u_long end) | mptable_is_isa_range(rman_res_t start, rman_res_t end) | ||||
{ | { | ||||
if (end >= 0x10000) | if (end >= 0x10000) | ||||
return (0); | return (0); | ||||
if ((start & 0xfc00) != (end & 0xfc00)) | if ((start & 0xfc00) != (end & 0xfc00)) | ||||
return (0); | return (0); | ||||
start &= ~0xfc00; | start &= ~0xfc00; | ||||
end &= ~0xfc00; | end &= ~0xfc00; | ||||
return (start >= 0x100 && end <= 0x3ff); | return (start >= 0x100 && end <= 0x3ff); | ||||
} | } | ||||
static int | static int | ||||
mptable_is_vga_range(u_long start, u_long end) | mptable_is_vga_range(rman_res_t start, rman_res_t end) | ||||
{ | { | ||||
if (end >= 0x10000) | if (end >= 0x10000) | ||||
return (0); | return (0); | ||||
if ((start & 0xfc00) != (end & 0xfc00)) | if ((start & 0xfc00) != (end & 0xfc00)) | ||||
return (0); | return (0); | ||||
start &= ~0xfc00; | start &= ~0xfc00; | ||||
end &= ~0xfc00; | end &= ~0xfc00; | ||||
return (pci_is_vga_ioport_range(start, end)); | return (pci_is_vga_ioport_range(start, end)); | ||||
} | } | ||||
static struct resource * | static struct resource * | ||||
mptable_hostb_alloc_resource(device_t dev, device_t child, int type, int *rid, | mptable_hostb_alloc_resource(device_t dev, device_t child, int type, int *rid, | ||||
u_long start, u_long end, u_long count, u_int flags) | rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) | ||||
{ | { | ||||
struct mptable_hostb_softc *sc; | struct mptable_hostb_softc *sc; | ||||
#ifdef PCI_RES_BUS | #ifdef PCI_RES_BUS | ||||
if (type == PCI_RES_BUS) | if (type == PCI_RES_BUS) | ||||
return (pci_domain_alloc_bus(0, child, rid, start, end, count, | return (pci_domain_alloc_bus(0, child, rid, start, end, count, | ||||
flags)); | flags)); | ||||
#endif | #endif | ||||
Show All 24 Lines | #endif | ||||
} | } | ||||
start = hostb_alloc_start(type, start, end, count); | start = hostb_alloc_start(type, start, end, count); | ||||
return (pcib_host_res_alloc(&sc->sc_host_res, child, type, rid, start, | return (pcib_host_res_alloc(&sc->sc_host_res, child, type, rid, start, | ||||
end, count, flags)); | end, count, flags)); | ||||
} | } | ||||
static int | static int | ||||
mptable_hostb_adjust_resource(device_t dev, device_t child, int type, | mptable_hostb_adjust_resource(device_t dev, device_t child, int type, | ||||
struct resource *r, u_long start, u_long end) | struct resource *r, rman_res_t start, rman_res_t end) | ||||
{ | { | ||||
struct mptable_hostb_softc *sc; | struct mptable_hostb_softc *sc; | ||||
#ifdef PCI_RES_BUS | #ifdef PCI_RES_BUS | ||||
if (type == PCI_RES_BUS) | if (type == PCI_RES_BUS) | ||||
return (pci_domain_adjust_bus(0, child, r, start, end)); | return (pci_domain_adjust_bus(0, child, r, start, end)); | ||||
#endif | #endif | ||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |