Main Page | Modules | Class List | File List | Class Members | File Members | Related Pages

I/O Resource Management
[Linux DDE Common]

This module emulates the I/O resource management inside the Linux kernel. More...

Functions

resource * request_region (unsigned long start, unsigned long n, const char *name)
 Allocate I/O port region.

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?!

region handling

  1. put regions in conversion list via address_add_region() too
  2. 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 198 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 183 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 213 of file res.c.

References __va(), DEBUG_RES, DEBUG_RES_TRACE, and regions.

Referenced by ioremap_nocache().

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 259 of file res.c.

References DEBUG_RES_TRACE, and ioremap().

void iounmap void *  addr  ) 
 

Unmap I/O memory from kernel address space.

Parameters:
addr virtual start address
Do nothing.

Definition at line 273 of file res.c.

References DEBUG_RES_TRACE.

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 141 of file res.c.

References dde_remove_region(), DEBUG_ERRORS, DEBUG_RES_TRACE, and regions.

Referenced by pci_release_region().

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 124 of file res.c.

References DEBUG_RES_TRACE.

Referenced by pci_release_region().

int release_resource struct resource *  res  ) 
 

Release any resource.

Parameters:
resource the resource to free

Todo:
implementation

Definition at line 166 of file res.c.

struct resource* request_mem_region unsigned long  start,
unsigned long  n,
const char *  name
 

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.

References dde_add_region(), DEBUG_ERRORS, DEBUG_RES_TRACE, and regions.

Referenced by pci_request_region().

struct resource* request_region unsigned long  start,
unsigned long  n,
const char *  name
 

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.

References DEBUG_ERRORS, and DEBUG_RES_TRACE.

Referenced by pci_request_region().


Linux DDE, written by Christian Helmuth  © 2003 Technische Universitaet Dresden