[ioapi] Absorb virt_to_phys() and phys_to_virt() into the I/O API

This commit is contained in:
Michael Brown
2008-10-12 02:11:50 +01:00
parent 992bbf309c
commit aef6d0df5c
4 changed files with 65 additions and 44 deletions

View File

@@ -148,6 +148,46 @@
_func ( _io_addr, _data, _count ); \
} while ( 0 )
/**
* Convert virtual address to a physical address
*
* @v addr Virtual address
* @ret phys_addr Physical address
*/
unsigned long virt_to_phys ( volatile const void *addr );
/**
* Convert physical address to a virtual address
*
* @v addr Virtual address
* @ret phys_addr Physical address
*
* This operation isn't actually valid within our memory model, and is
* impossible to achieve under -DKEEP_IT_REAL. Some drivers haven't
* been updated to avoid it yet, though.
*/
void * phys_to_virt ( unsigned long phys_addr );
/**
* Convert virtual address to a bus address
*
* @v addr Virtual address
* @ret bus_addr Bus address
*/
unsigned long virt_to_bus ( volatile const void *addr );
/**
* Convert bus address to a virtual address
*
* @v bus_addr Bus address
* @ret addr Virtual address
*
* This operation isn't actually valid within our memory model, and is
* impossible to achieve under -DKEEP_IT_REAL. Some drivers haven't
* been updated to avoid it yet, though.
*/
void * bus_to_virt ( unsigned long bus_addr );
/**
* Map bus address as an I/O address
*
@@ -172,26 +212,6 @@ void iounmap ( volatile const void *io_addr );
*/
unsigned long io_to_bus ( volatile const void *io_addr );
/**
* Convert virtual address to a bus address
*
* @v addr Virtual address
* @ret bus_addr Bus address
*/
unsigned long virt_to_bus ( volatile const void *addr );
/**
* Convert bus address to a virtual address
*
* @v bus_addr Bus address
* @ret addr Virtual address
*
* This operation isn't actually valid within our memory model, and is
* impossible to achieve under -DKEEP_IT_REAL. Some drivers haven't
* been updated to avoid it yet, though.
*/
void * bus_to_virt ( unsigned long bus_addr );
/**
* Read byte from memory-mapped device
*