MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mptable_hostb_alloc_resource

Function mptable_hostb_alloc_resource

freebsd/x86/x86/mptable_pci.c:103–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103static struct resource *
104mptable_hostb_alloc_resource(device_t dev, device_t child, int type, int *rid,
105 rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
106{
107 struct mptable_hostb_softc *sc;
108
109#ifdef PCI_RES_BUS
110 if (type == PCI_RES_BUS)
111 return (pci_domain_alloc_bus(0, child, rid, start, end, count,
112 flags));
113#endif
114 sc = device_get_softc(dev);
115 if (type == SYS_RES_IOPORT && start + count - 1 == end) {
116 if (mptable_is_isa_range(start, end)) {
117 switch (sc->sc_decodes_isa_io) {
118 case -1:
119 return (NULL);
120 case 1:
121 return (bus_generic_alloc_resource(dev, child,
122 type, rid, start, end, count, flags));
123 default:
124 break;
125 }
126 }
127 if (mptable_is_vga_range(start, end)) {
128 switch (sc->sc_decodes_vga_io) {
129 case -1:
130 return (NULL);
131 case 1:
132 return (bus_generic_alloc_resource(dev, child,
133 type, rid, start, end, count, flags));
134 default:
135 break;
136 }
137 }
138 }
139 start = hostb_alloc_start(type, start, end, count);
140 return (pcib_host_res_alloc(&sc->sc_host_res, child, type, rid, start,
141 end, count, flags));
142}
143
144static int
145mptable_hostb_adjust_resource(device_t dev, device_t child, int type,

Callers

nothing calls this directly

Calls 5

device_get_softcFunction · 0.85
mptable_is_isa_rangeFunction · 0.85
mptable_is_vga_rangeFunction · 0.85
hostb_alloc_startFunction · 0.85

Tested by

no test coverage detected