diff options
author | nyan <nyan@FreeBSD.org> | 2002-02-18 13:44:46 +0000 |
---|---|---|
committer | nyan <nyan@FreeBSD.org> | 2002-02-18 13:44:46 +0000 |
commit | 338edfed4600d09a8ef0ebb4903f6a78a8a0cd76 (patch) | |
tree | e4bf2fe2debd664203d339befbc3391a41bb0856 | |
parent | 7e94257d40d5729ee049d42a51171f34048405f6 (diff) | |
download | FreeBSD-src-338edfed4600d09a8ef0ebb4903f6a78a8a0cd76.zip FreeBSD-src-338edfed4600d09a8ef0ebb4903f6a78a8a0cd76.tar.gz |
Add bus_space_unmap() and bus_space_free() functions to release
a bus_space_handle allocated by bus_space_subregion().
-rw-r--r-- | sys/i386/include/bus_pc98.h | 26 | ||||
-rw-r--r-- | sys/pc98/i386/busiosubr.c | 15 | ||||
-rw-r--r-- | sys/pc98/pc98/busiosubr.c | 15 |
3 files changed, 56 insertions, 0 deletions
diff --git a/sys/i386/include/bus_pc98.h b/sys/i386/include/bus_pc98.h index e1ab78f..8aab781 100644 --- a/sys/i386/include/bus_pc98.h +++ b/sys/i386/include/bus_pc98.h @@ -170,6 +170,19 @@ void i386_bus_space_handle_free(bus_space_tag_t t, bus_space_handle_t bsh, size_t size); /* + * int bus_space_unmap (bus_space_tag_t t, + * bus_space_handle_t bsh, bus_size_t size); + * + * Unmap a region of bus space. + */ + +void i386_memio_unmap(bus_space_tag_t t, bus_space_handle_t bsh, + bus_size_t size); + +#define bus_space_unmap(t, h, s) \ + i386_memio_unmap((t), (h), (s)) + +/* * 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); @@ -185,6 +198,19 @@ int i386_memio_subregion(bus_space_tag_t t, bus_space_handle_t bsh, i386_memio_subregion((t), (h), (o), (s), (nhp)) /* + * int bus_space_free (bus_space_tag_t t, + * bus_space_handle_t bsh, bus_size_t size); + * + * Free a region of bus space. + */ + +void i386_memio_free(bus_space_tag_t t, bus_space_handle_t bsh, + bus_size_t size); + +#define bus_space_free(t, h, s) \ + i386_memio_free((t), (h), (s)) + +/* * Access methods for bus resources and address space. */ #define _BUS_ACCESS_METHODS_PROTO(TYPE,BWN) \ diff --git a/sys/pc98/i386/busiosubr.c b/sys/pc98/i386/busiosubr.c index 4df0c1b..d8fadad 100644 --- a/sys/pc98/i386/busiosubr.c +++ b/sys/pc98/i386/busiosubr.c @@ -197,6 +197,21 @@ i386_bus_space_handle_free(bus_space_tag_t t, bus_space_handle_t bsh, /************************************************************************* * map *************************************************************************/ +void +i386_memio_unmap(bus_space_tag_t t, bus_space_handle_t bsh, bus_size_t size) +{ + + i386_bus_space_handle_free(t, bsh, bsh->bsh_sz); +} + +void +i386_memio_free(bus_space_tag_t t, bus_space_handle_t bsh, bus_size_t size) +{ + + /* i386_memio_unmap() does all that we need to do. */ + i386_memio_unmap(t, bsh, bsh->bsh_sz); +} + int i386_memio_subregion(bus_space_tag_t t, bus_space_handle_t pbsh, bus_size_t offset, bus_size_t size, diff --git a/sys/pc98/pc98/busiosubr.c b/sys/pc98/pc98/busiosubr.c index 4df0c1b..d8fadad 100644 --- a/sys/pc98/pc98/busiosubr.c +++ b/sys/pc98/pc98/busiosubr.c @@ -197,6 +197,21 @@ i386_bus_space_handle_free(bus_space_tag_t t, bus_space_handle_t bsh, /************************************************************************* * map *************************************************************************/ +void +i386_memio_unmap(bus_space_tag_t t, bus_space_handle_t bsh, bus_size_t size) +{ + + i386_bus_space_handle_free(t, bsh, bsh->bsh_sz); +} + +void +i386_memio_free(bus_space_tag_t t, bus_space_handle_t bsh, bus_size_t size) +{ + + /* i386_memio_unmap() does all that we need to do. */ + i386_memio_unmap(t, bsh, bsh->bsh_sz); +} + int i386_memio_subregion(bus_space_tag_t t, bus_space_handle_t pbsh, bus_size_t offset, bus_size_t size, |