diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/arch/i386/include/arch/io.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/arch/i386/include/arch/io.h b/src/arch/i386/include/arch/io.h index 411098128f..4bd2f4a4c3 100644 --- a/src/arch/i386/include/arch/io.h +++ b/src/arch/i386/include/arch/io.h @@ -138,5 +138,35 @@ static inline void insl(uint16_t port, void *addr, unsigned long count) ); } +static inline void writeb(uint8_t b, volatile void *addr) +{ + *(volatile uint8_t *) addr = b; +} + +static inline void writew(uint16_t b, volatile void *addr) +{ + *(volatile uint16_t *) addr = b; +} + +static inline void writel(uint32_t b, volatile void *addr) +{ + *(volatile uint32_t *) addr = b; +} + +static inline uint8_t readb(const volatile void *addr) +{ + return *(volatile uint8_t *) addr; +} + +static inline uint16_t readw(const volatile void *addr) +{ + return *(volatile uint16_t *) addr; +} + +static inline uint32_t readl(const volatile void *addr) +{ + return *(volatile uint32_t *) addr; +} + #endif |