[ioapi] Absorb virt_to_phys() and phys_to_virt() into the I/O API
This commit is contained in:
@@ -28,6 +28,26 @@
|
||||
*
|
||||
*/
|
||||
|
||||
static inline __always_inline unsigned long
|
||||
IOAPI_INLINE ( x86, virt_to_phys ) ( volatile const void *addr ) {
|
||||
return ( ( ( unsigned long ) addr ) + virt_offset );
|
||||
}
|
||||
|
||||
static inline __always_inline void *
|
||||
IOAPI_INLINE ( x86, phys_to_virt ) ( unsigned long phys_addr ) {
|
||||
return ( ( void * ) ( phys_addr - virt_offset ) );
|
||||
}
|
||||
|
||||
static inline __always_inline unsigned long
|
||||
IOAPI_INLINE ( x86, virt_to_bus ) ( volatile const void *addr ) {
|
||||
return virt_to_phys ( addr );
|
||||
}
|
||||
|
||||
static inline __always_inline void *
|
||||
IOAPI_INLINE ( x86, bus_to_virt ) ( unsigned long bus_addr ) {
|
||||
return phys_to_virt ( bus_addr );
|
||||
}
|
||||
|
||||
static inline __always_inline void *
|
||||
IOAPI_INLINE ( x86, ioremap ) ( unsigned long bus_addr, size_t len __unused ) {
|
||||
return phys_to_virt ( bus_addr );
|
||||
@@ -43,16 +63,6 @@ IOAPI_INLINE ( x86, io_to_bus ) ( volatile const void *io_addr ) {
|
||||
return virt_to_phys ( io_addr );
|
||||
}
|
||||
|
||||
static inline __always_inline unsigned long
|
||||
IOAPI_INLINE ( x86, virt_to_bus ) ( volatile const void *addr ) {
|
||||
return virt_to_phys ( addr );
|
||||
}
|
||||
|
||||
static inline __always_inline void *
|
||||
IOAPI_INLINE ( x86, bus_to_virt ) ( unsigned long bus_addr ) {
|
||||
return phys_to_virt ( bus_addr );
|
||||
}
|
||||
|
||||
/*
|
||||
* MMIO reads and writes up to 32 bits
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user