When creating a handle for a subregion, be sure to actually math out the new

handle address, where we're using handles as raw addresses.

This fixes devices with subregions on Octeon PCI specifically, and likely also on
MIPS more generally, where there isn't another bus_space in use that was doing the
math already.
This commit is contained in:
jmallett 2012-03-02 21:46:31 +00:00
parent 99e7ee266b
commit 85b7bc5919
2 changed files with 8 additions and 10 deletions

View File

@ -230,13 +230,12 @@ octopci_bs_unmap(void *t __unused, bus_space_handle_t bh __unused,
}
int
octopci_bs_subregion(void *t __unused, bus_space_handle_t handle __unused,
bus_size_t offset __unused, bus_size_t size __unused,
bus_space_handle_t *nhandle __unused)
octopci_bs_subregion(void *t __unused, bus_space_handle_t handle,
bus_size_t offset, bus_size_t size __unused,
bus_space_handle_t *bshp)
{
printf("SUBREGION?!?!?!\n");
/* Do nothing */
*bshp = handle + offset;
return (0);
}

View File

@ -245,13 +245,12 @@ generic_bs_unmap(void *t __unused, bus_space_handle_t bh __unused,
}
int
generic_bs_subregion(void *t __unused, bus_space_handle_t handle __unused,
bus_size_t offset __unused, bus_size_t size __unused,
bus_space_handle_t *nhandle __unused)
generic_bs_subregion(void *t __unused, bus_space_handle_t handle,
bus_size_t offset, bus_size_t size __unused,
bus_space_handle_t *bshp)
{
printf("SUBREGION?!?!?!\n");
/* Do nothing */
*bshp = handle + offset;
return (0);
}