Author: jmallett
Date: Fri Mar 2 21:46:31 2012
New Revision: 232410
URL: http://svn.freebsd.org/changeset/base/232410
Log:
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.
Modified:
head/sys/mips/cavium/octopci_bus_space.c
head/sys/mips/mips/bus_space_generic.c
Modified: head/sys/mips/cavium/octopci_bus_space.c
==============================================================================
--- head/sys/mips/cavium/octopci_bus_space.c Fri Mar 2 21:44:39 2012
(r232409)
+++ head/sys/mips/cavium/octopci_bus_space.c Fri Mar 2 21:46:31 2012
(r232410)
@@ -230,13 +230,12 @@ octopci_bs_unmap(void *t __unused, bus_s
}
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);
}
Modified: head/sys/mips/mips/bus_space_generic.c
==============================================================================
--- head/sys/mips/mips/bus_space_generic.c Fri Mar 2 21:44:39 2012
(r232409)
+++ head/sys/mips/mips/bus_space_generic.c Fri Mar 2 21:46:31 2012
(r232410)
@@ -245,13 +245,12 @@ generic_bs_unmap(void *t __unused, bus_s
}
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);
}
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"