This module emulates the I/O resource management inside the Linux kernel.
More...
|
Functions |
struct resource * | request_region (unsigned long start, unsigned long n, const char *name) |
| Allocate I/O port region.
|
struct resource * | request_mem_region (unsigned long start, unsigned long n, const char *name) |
| Allocate I/O memory region.
|
void | release_region (unsigned long start, unsigned long n) |
| Release I/O port region.
|
void | release_mem_region (unsigned long start, unsigned long n) |
| Release I/O memory region.
|
int | release_resource (struct resource *res) |
| Release any resource.
|
int | check_region (unsigned long start, unsigned long n) |
| Check I/O port region availability.
|
int | check_mem_region (unsigned long start, unsigned long n) |
| Check I/O memory region availability.
|
void * | ioremap (unsigned long phys_addr, unsigned long size) |
| Remap I/O memory into kernel address space.
|
void * | ioremap_nocache (unsigned long phys_addr, unsigned long size) |
| Remap I/O memory into kernel address space (no cache).
|
void | iounmap (void *addr) |
| Unmap I/O memory from kernel address space.
|
Detailed Description
This module emulates the I/O resource management inside the Linux kernel.
It is mostly a wrapper to libio request/release functions for I/O port and memory regions with additional bookkeeping of allocations. The ioremap()/iounmap() interface is also provided by this module.
Requirements: (additionally to Global Requirements)
- Todo:
- I/O memory as dataspaces?!
- Todo:
- region handling
- put regions in conversion list via l4dde_add_region() too
- hold only 1 region list (
address.c
) and call address_*
() and _va()
Function Documentation
int check_mem_region |
( |
unsigned long |
start, |
|
|
unsigned long |
n | |
|
) |
| | |
Check I/O memory region availability.
- Parameters:
-
| start | begin of region |
| n | length of region |
- Returns:
- always 0
NO support for this.
Definition at line 197 of file res.c.
int check_region |
( |
unsigned long |
start, |
|
|
unsigned long |
n | |
|
) |
| | |
Check I/O port region availability.
- Parameters:
-
| start | begin of region |
| n | length of region |
- Returns:
- always 0
NO support for this.
Definition at line 182 of file res.c.
void* ioremap |
( |
unsigned long |
phys_addr, |
|
|
unsigned long |
size | |
|
) |
| | |
Remap I/O memory into kernel address space.
- Parameters:
-
| phys_addr | begin of physical address range |
| size | size of physical address range |
- Returns:
- virtual start address of mapped range
Here no real mapping is done. Only the virtual address is returned.
Definition at line 212 of file res.c.
void* ioremap_nocache |
( |
unsigned long |
phys_addr, |
|
|
unsigned long |
size | |
|
) |
| | |
Remap I/O memory into kernel address space (no cache).
- Parameters:
-
| phys_addr | begin of physical address range |
| size | size of physical address range |
- Returns:
- virtual start address of mapped range
Here no real mapping is done. Only the virtual address is returned (by calling
ioremap()).
Definition at line 258 of file res.c.
void iounmap |
( |
void * |
addr |
) |
|
Unmap I/O memory from kernel address space.
- Parameters:
-
| addr | virtual start address |
Do nothing.
Definition at line 272 of file res.c.
void release_mem_region |
( |
unsigned long |
start, |
|
|
unsigned long |
n | |
|
) |
| | |
Release I/O memory region.
- Parameters:
-
| start | begin of region |
| n | length of region |
Definition at line 140 of file res.c.
void release_region |
( |
unsigned long |
start, |
|
|
unsigned long |
n | |
|
) |
| | |
Release I/O port region.
- Parameters:
-
| start | begin of region |
| n | length of region |
Definition at line 123 of file res.c.
int release_resource |
( |
struct resource * |
res |
) |
|
Release any resource.
- Parameters:
-
| resource | the resource to free |
- Todo:
- implementation
Definition at line 165 of file res.c.
struct resource* request_mem_region |
( |
unsigned long |
start, |
|
|
unsigned long |
n, |
|
|
const char * |
name | |
|
) |
| | [read] |
Allocate I/O memory region.
- Parameters:
-
| start | begin of region |
| n | length of region |
| name | name of requester |
- Test:
- krishna: hopefully nobody uses return values
- Bug:
- Return value is a bogus pointer.
Definition at line 97 of file res.c.
struct resource* request_region |
( |
unsigned long |
start, |
|
|
unsigned long |
n, |
|
|
const char * |
name | |
|
) |
| | [read] |
Allocate I/O port region.
- Parameters:
-
| start | begin of region |
| n | length of region |
| name | name of requester |
- Test:
- krishna: hopefully nobody uses return values
- Bug:
- Return value is a bogus pointer.
Definition at line 70 of file res.c.