Move the bus_space_subregion function from the puc driver to the bus_space

sutff.

Reviewed by:	jhay
This commit is contained in:
Yoshihiro Takahashi 2002-02-17 09:41:23 +00:00
parent 9d139b79d4
commit 9f67ccb7e5
4 changed files with 42 additions and 21 deletions

View File

@ -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.

View File

@ -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.

View File

@ -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)

View File

@ -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.