mirror of
https://github.com/ipxe/ipxe
synced 2026-01-01 09:09:32 +03:00
[ioapi] Split ioremap() out to a separate IOMAP API
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -74,9 +74,6 @@ static __unused void i386_writeq ( uint64_t data, volatile uint64_t *io_addr ) {
|
||||
|
||||
PROVIDE_IOAPI_INLINE ( x86, phys_to_bus );
|
||||
PROVIDE_IOAPI_INLINE ( x86, bus_to_phys );
|
||||
PROVIDE_IOAPI_INLINE ( x86, ioremap );
|
||||
PROVIDE_IOAPI_INLINE ( x86, iounmap );
|
||||
PROVIDE_IOAPI_INLINE ( x86, io_to_bus );
|
||||
PROVIDE_IOAPI_INLINE ( x86, readb );
|
||||
PROVIDE_IOAPI_INLINE ( x86, readw );
|
||||
PROVIDE_IOAPI_INLINE ( x86, readl );
|
||||
|
||||
12
src/arch/x86/include/bits/iomap.h
Normal file
12
src/arch/x86/include/bits/iomap.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef _BITS_IOMAP_H
|
||||
#define _BITS_IOMAP_H
|
||||
|
||||
/** @file
|
||||
*
|
||||
* x86-specific I/O mapping API implementations
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
|
||||
#endif /* _BITS_IOMAP_H */
|
||||
@@ -32,7 +32,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
#define PAGE_SHIFT 12
|
||||
|
||||
/*
|
||||
* Physical<->Bus and Bus<->I/O address mappings
|
||||
* Physical<->Bus address mappings
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -46,21 +46,6 @@ IOAPI_INLINE ( x86, bus_to_phys ) ( unsigned long bus_addr ) {
|
||||
return bus_addr;
|
||||
}
|
||||
|
||||
static inline __always_inline void *
|
||||
IOAPI_INLINE ( x86, ioremap ) ( unsigned long bus_addr, size_t len __unused ) {
|
||||
return ( bus_addr ? phys_to_virt ( bus_addr ) : NULL );
|
||||
}
|
||||
|
||||
static inline __always_inline void
|
||||
IOAPI_INLINE ( x86, iounmap ) ( volatile const void *io_addr __unused ) {
|
||||
/* Nothing to do */
|
||||
}
|
||||
|
||||
static inline __always_inline unsigned long
|
||||
IOAPI_INLINE ( x86, io_to_bus ) ( volatile const void *io_addr ) {
|
||||
return virt_to_phys ( io_addr );
|
||||
}
|
||||
|
||||
/*
|
||||
* MMIO reads and writes up to native word size
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user