summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authornyan <nyan@FreeBSD.org>2002-02-17 09:41:23 +0000
committernyan <nyan@FreeBSD.org>2002-02-17 09:41:23 +0000
commit22001980c0e3a79547ab6165337ad113341832bc (patch)
tree3607c09e0fe1e40e8470a9687a464f30e0d67675 /sys
parent1ed4a21d0776cd372c00c7ab70a145f6e190ca94 (diff)
downloadFreeBSD-src-22001980c0e3a79547ab6165337ad113341832bc.zip
FreeBSD-src-22001980c0e3a79547ab6165337ad113341832bc.tar.gz
Move the bus_space_subregion function from the puc driver to the bus_space
sutff. Reviewed by: jhay
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/include/bus_amd64.h17
-rw-r--r--sys/amd64/include/bus_at386.h17
-rw-r--r--sys/dev/puc/puc.c12
-rw-r--r--sys/i386/include/bus_at386.h17
4 files changed, 42 insertions, 21 deletions
diff --git a/sys/amd64/include/bus_amd64.h b/sys/amd64/include/bus_amd64.h
index 4914c54..5cd35d3 100644
--- a/sys/amd64/include/bus_amd64.h
+++ b/sys/amd64/include/bus_amd64.h
@@ -131,9 +131,20 @@ void bus_space_unmap(bus_space_tag_t t, bus_space_handle_t bsh,
* Get a new handle for a subregion of an already-mapped area of bus space.
*/
-int bus_space_subregion(bus_space_tag_t t, bus_space_handle_t bsh,
- bus_size_t offset, bus_size_t size,
- bus_space_handle_t *nbshp);
+static __inline int bus_space_subregion(bus_space_tag_t t,
+ bus_space_handle_t bsh,
+ bus_size_t offset, bus_size_t size,
+ bus_space_handle_t *nbshp);
+
+static __inline int
+bus_space_subregion(bus_space_tag_t t, bus_space_handle_t bsh,
+ bus_size_t offset, bus_size_t site,
+ bus_space_handle_t *nbshp)
+{
+
+ *nbshp = bsh + offset;
+ return (0);
+}
/*
* Allocate a region of memory that is accessible to devices in bus space.
diff --git a/sys/amd64/include/bus_at386.h b/sys/amd64/include/bus_at386.h
index 4914c54..5cd35d3 100644
--- a/sys/amd64/include/bus_at386.h
+++ b/sys/amd64/include/bus_at386.h
@@ -131,9 +131,20 @@ void bus_space_unmap(bus_space_tag_t t, bus_space_handle_t bsh,
* Get a new handle for a subregion of an already-mapped area of bus space.
*/
-int bus_space_subregion(bus_space_tag_t t, bus_space_handle_t bsh,
- bus_size_t offset, bus_size_t size,
- bus_space_handle_t *nbshp);
+static __inline int bus_space_subregion(bus_space_tag_t t,
+ bus_space_handle_t bsh,
+ bus_size_t offset, bus_size_t size,
+ bus_space_handle_t *nbshp);
+
+static __inline int
+bus_space_subregion(bus_space_tag_t t, bus_space_handle_t bsh,
+ bus_size_t offset, bus_size_t site,
+ bus_space_handle_t *nbshp)
+{
+
+ *nbshp = bsh + offset;
+ return (0);
+}
/*
* Allocate a region of memory that is accessible to devices in bus space.
diff --git a/sys/dev/puc/puc.c b/sys/dev/puc/puc.c
index 83da26c..563633f 100644
--- a/sys/dev/puc/puc.c
+++ b/sys/dev/puc/puc.c
@@ -537,18 +537,6 @@ puc_print_resource_list(struct resource_list *rl)
}
#endif
-/* XXX
- * This function should be part of the general bus_space_* functions. It
- * should also handle the PC98 case where bus_space_handle_t is a structure.
- */
-int
-bus_space_subregion(bus_space_tag_t t, bus_space_handle_t h, bus_size_t offset,
- bus_size_t s, bus_space_handle_t *newhandle)
-{
- *newhandle = h + offset;
- return (0);
-}
-
static struct resource *
puc_alloc_resource(device_t dev, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
diff --git a/sys/i386/include/bus_at386.h b/sys/i386/include/bus_at386.h
index 4914c54..5cd35d3 100644
--- a/sys/i386/include/bus_at386.h
+++ b/sys/i386/include/bus_at386.h
@@ -131,9 +131,20 @@ void bus_space_unmap(bus_space_tag_t t, bus_space_handle_t bsh,
* Get a new handle for a subregion of an already-mapped area of bus space.
*/
-int bus_space_subregion(bus_space_tag_t t, bus_space_handle_t bsh,
- bus_size_t offset, bus_size_t size,
- bus_space_handle_t *nbshp);
+static __inline int bus_space_subregion(bus_space_tag_t t,
+ bus_space_handle_t bsh,
+ bus_size_t offset, bus_size_t size,
+ bus_space_handle_t *nbshp);
+
+static __inline int
+bus_space_subregion(bus_space_tag_t t, bus_space_handle_t bsh,
+ bus_size_t offset, bus_size_t site,
+ bus_space_handle_t *nbshp)
+{
+
+ *nbshp = bsh + offset;
+ return (0);
+}
/*
* Allocate a region of memory that is accessible to devices in bus space.
OpenPOWER on IntegriCloud