MFi386: pci attribute allocation fixes.

This commit is contained in:
Warner Losh 2005-09-18 01:42:43 +00:00
parent fe0519b171
commit 62061bf002
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=150266
3 changed files with 6 additions and 2 deletions

View File

@ -84,7 +84,7 @@ static device_method_t mptable_hostb_methods[] = {
DEVMETHOD(bus_print_child, bus_generic_print_child),
DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar),
DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar),
DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource),
DEVMETHOD(bus_release_resource, bus_generic_release_resource),
DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),

View File

@ -49,5 +49,7 @@ void legacy_pcib_write_config(device_t dev, int bus, int slot, int func,
int reg, u_int32_t data, int bytes);
int legacy_pcib_write_ivar(device_t dev, device_t child, int which,
uintptr_t value);
struct resource *legacy_pcib_alloc_resource(device_t dev, device_t child,
int type, int *rid, u_long start, u_long end, u_long count, u_int flags);
#endif /* !_MACHINE_LEGACYVAR_H_ */

View File

@ -273,7 +273,7 @@ SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN,
"Limit the host bridge memory to being above this address. Must be\n\
set at boot via a tunable.");
static struct resource *
struct resource *
legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
{
@ -291,6 +291,8 @@ legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
*/
if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL)
start = legacy_host_mem_start;
if (type == SYS_RES_IOPORT && start == 0UL && end == ~0UL)
start = 0x1000;
return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
count, flags));
}