diff options
author | Yoshihiro Takahashi <nyan@FreeBSD.org> | 2003-09-23 08:22:34 +0000 |
---|---|---|
committer | Yoshihiro Takahashi <nyan@FreeBSD.org> | 2003-09-23 08:22:34 +0000 |
commit | 33e38a2cc803aff0524deee574cfea00029feaa7 (patch) | |
tree | 7c37e05e21434e51e4ee071cbbd03a0e312848b9 /sys | |
parent | eb98005f8d4d638b0781a4eb2f7b9260aebc6a07 (diff) | |
download | src-33e38a2cc803aff0524deee574cfea00029feaa7.tar.gz src-33e38a2cc803aff0524deee574cfea00029feaa7.zip |
Implement the bus_space_map() function to allocate resources and initialize
a bus_handle, but currently it does only initializing a bus_handle.
Notes
Notes:
svn path=/head/; revision=120375
Diffstat (limited to 'sys')
-rw-r--r-- | sys/alpha/include/bus.h | 18 | ||||
-rw-r--r-- | sys/amd64/include/bus_amd64.h | 16 | ||||
-rw-r--r-- | sys/i386/include/bus_at386.h | 16 | ||||
-rw-r--r-- | sys/i386/include/bus_pc98.h | 13 | ||||
-rw-r--r-- | sys/ia64/include/bus.h | 17 | ||||
-rw-r--r-- | sys/pc98/i386/busiosubr.c | 8 | ||||
-rw-r--r-- | sys/pc98/pc98/busiosubr.c | 8 | ||||
-rw-r--r-- | sys/sparc64/include/bus.h | 19 |
8 files changed, 102 insertions, 13 deletions
diff --git a/sys/alpha/include/bus.h b/sys/alpha/include/bus.h index 53eefd857541..8c6d3240b289 100644 --- a/sys/alpha/include/bus.h +++ b/sys/alpha/include/bus.h @@ -91,6 +91,24 @@ typedef u_int32_t bus_space_handle_t; #define BUS_SPACE_UNRESTRICTED (~0UL) /* + * Map a region of device bus space into CPU virtual address space. + */ + +static __inline int bus_space_map(bus_space_tag_t t, bus_addr_t addr, + bus_size_t size, int flags, + bus_space_handle_t *bshp); + +static __inline int +bus_space_map(bus_space_tag_t t __unused, bus_addr_t addr, + bus_size_t size __unused, int flags __unused, + bus_space_handle_t *bshp) +{ + + *bshp = addr; + return (0); +} + +/* * Unmap a region of device bus space. */ diff --git a/sys/amd64/include/bus_amd64.h b/sys/amd64/include/bus_amd64.h index 71a25e4bea6a..b0bc61b6096a 100644 --- a/sys/amd64/include/bus_amd64.h +++ b/sys/amd64/include/bus_amd64.h @@ -114,11 +114,19 @@ typedef uint64_t bus_space_handle_t; * Map a region of device bus space into CPU virtual address space. */ -#define BUS_SPACE_MAP_CACHEABLE 0x01 -#define BUS_SPACE_MAP_LINEAR 0x02 +static __inline int bus_space_map(bus_space_tag_t t, bus_addr_t addr, + bus_size_t size, int flags, + bus_space_handle_t *bshp); -int bus_space_map(bus_space_tag_t t, bus_addr_t addr, bus_size_t size, - int flags, bus_space_handle_t *bshp); +static __inline int +bus_space_map(bus_space_tag_t t __unused, bus_addr_t addr, + bus_size_t size __unused, int flags __unused, + bus_space_handle_t *bshp) +{ + + *bshp = addr; + return (0); +} /* * Unmap a region of device bus space. diff --git a/sys/i386/include/bus_at386.h b/sys/i386/include/bus_at386.h index e1f6e8e3a9a0..277badd0400b 100644 --- a/sys/i386/include/bus_at386.h +++ b/sys/i386/include/bus_at386.h @@ -122,11 +122,19 @@ typedef u_int bus_space_handle_t; * Map a region of device bus space into CPU virtual address space. */ -#define BUS_SPACE_MAP_CACHEABLE 0x01 -#define BUS_SPACE_MAP_LINEAR 0x02 +static __inline int bus_space_map(bus_space_tag_t t, bus_addr_t addr, + bus_size_t size, int flags, + bus_space_handle_t *bshp); -int bus_space_map(bus_space_tag_t t, bus_addr_t addr, bus_size_t size, - int flags, bus_space_handle_t *bshp); +static __inline int +bus_space_map(bus_space_tag_t t __unused, bus_addr_t addr, + bus_size_t size __unused, int flags __unused, + bus_space_handle_t *bshp) +{ + + *bshp = addr; + return (0); +} /* * Unmap a region of device bus space. diff --git a/sys/i386/include/bus_pc98.h b/sys/i386/include/bus_pc98.h index aa9f2b620de4..89066bcae992 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_map (bus_space_tag_t t, bus_addr_t addr, + * bus_size_t size, int flag, bus_space_handle_t *bshp); + * + * Map a region of bus space. + */ + +int i386_memio_map(bus_space_tag_t t, bus_addr_t addr, bus_size_t size, + int flag, bus_space_handle_t *bshp); + +#define bus_space_map(t, a, s, f, hp) \ + i386_memio_map((t), (a), (s), (f), (hp)) + +/* * int bus_space_unmap (bus_space_tag_t t, * bus_space_handle_t bsh, bus_size_t size); * diff --git a/sys/ia64/include/bus.h b/sys/ia64/include/bus.h index 0db84a489c84..9c9ae36c3a64 100644 --- a/sys/ia64/include/bus.h +++ b/sys/ia64/include/bus.h @@ -119,13 +119,20 @@ typedef u_long bus_space_handle_t; /* * Map a region of device bus space into CPU virtual address space. */ -#define BUS_SPACE_MAP_CACHEABLE 0x01 -#define BUS_SPACE_MAP_LINEAR 0x02 -int -bus_space_map(bus_space_tag_t bst, bus_addr_t addr, bus_size_t size, int flags, - bus_space_handle_t *bshp); +static __inline int bus_space_map(bus_space_tag_t t, bus_addr_t addr, + bus_size_t size, int flags, + bus_space_handle_t *bshp); + +static __inline int +bus_space_map(bus_space_tag_t t __unused, bus_addr_t addr, + bus_size_t size __unused, int flags __unused, + bus_space_handle_t *bshp) +{ + *bshp = addr; + return (0); +} /* * Unmap a region of device bus space. diff --git a/sys/pc98/i386/busiosubr.c b/sys/pc98/i386/busiosubr.c index d8fadadf3cbd..f88e8e489517 100644 --- a/sys/pc98/i386/busiosubr.c +++ b/sys/pc98/i386/busiosubr.c @@ -197,6 +197,14 @@ i386_bus_space_handle_free(bus_space_tag_t t, bus_space_handle_t bsh, /************************************************************************* * map *************************************************************************/ +int +i386_memio_map(bus_space_tag_t t, bus_addr_t bpa, bus_size_t size, int flags, + bus_space_handle_t *bshp) +{ + + return i386_bus_space_handle_alloc(t, bpa, size, bshp); +} + void i386_memio_unmap(bus_space_tag_t t, bus_space_handle_t bsh, bus_size_t size) { diff --git a/sys/pc98/pc98/busiosubr.c b/sys/pc98/pc98/busiosubr.c index d8fadadf3cbd..f88e8e489517 100644 --- a/sys/pc98/pc98/busiosubr.c +++ b/sys/pc98/pc98/busiosubr.c @@ -197,6 +197,14 @@ i386_bus_space_handle_free(bus_space_tag_t t, bus_space_handle_t bsh, /************************************************************************* * map *************************************************************************/ +int +i386_memio_map(bus_space_tag_t t, bus_addr_t bpa, bus_size_t size, int flags, + bus_space_handle_t *bshp) +{ + + return i386_bus_space_handle_alloc(t, bpa, size, bshp); +} + void i386_memio_unmap(bus_space_tag_t t, bus_space_handle_t bsh, bus_size_t size) { diff --git a/sys/sparc64/include/bus.h b/sys/sparc64/include/bus.h index 90d33ab41576..c65abee126ec 100644 --- a/sys/sparc64/include/bus.h +++ b/sys/sparc64/include/bus.h @@ -138,6 +138,25 @@ static void bus_space_barrier(bus_space_tag_t, bus_space_handle_t, bus_size_t, bus_size_t, int); static int bus_space_subregion(bus_space_tag_t, bus_space_handle_t, bus_size_t, bus_size_t, bus_space_handle_t *); + +/* + * Map a region of device bus space into CPU virtual address space. + */ + +static __inline int bus_space_map(bus_space_tag_t t, bus_addr_t addr, + bus_size_t size, int flags, + bus_space_handle_t *bshp); + +static __inline int +bus_space_map(bus_space_tag_t t __unused, bus_addr_t addr, + bus_size_t size __unused, int flags __unused, + bus_space_handle_t *bshp) +{ + + *bshp = addr; + return (0); +} + /* * Unmap a region of device bus space. */ |