iPXE
iomap_virt.h
Go to the documentation of this file.
00001 #ifndef _IPXE_IOMAP_VIRT_H
00002 #define _IPXE_IOMAP_VIRT_H
00003 
00004 /** @file
00005  *
00006  * iPXE I/O mapping API using phys_to_virt()
00007  *
00008  */
00009 
00010 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00011 
00012 #ifdef IOMAP_VIRT
00013 #define IOMAP_PREFIX_virt
00014 #else
00015 #define IOMAP_PREFIX_virt __virt_
00016 #endif
00017 
00018 static inline __always_inline void *
00019 IOMAP_INLINE ( virt, ioremap ) ( unsigned long bus_addr, size_t len __unused ) {
00020         return ( bus_addr ? phys_to_virt ( bus_addr ) : NULL );
00021 }
00022 
00023 static inline __always_inline void
00024 IOMAP_INLINE ( virt, iounmap ) ( volatile const void *io_addr __unused ) {
00025         /* Nothing to do */
00026 }
00027 
00028 static inline __always_inline unsigned long
00029 IOMAP_INLINE ( virt, io_to_bus ) ( volatile const void *io_addr ) {
00030         return virt_to_phys ( io_addr );
00031 }
00032 
00033 #endif /* _IPXE_IOMAP_VIRT_H */