diff options
author | Anna (navi) Figueiredo Gomes <navi@vlhl.dev> | 2024-06-06 15:00:08 +0200 |
---|---|---|
committer | Anna (navi) Figueiredo Gomes <navi@vlhl.dev> | 2024-06-06 15:00:08 +0200 |
commit | e827ed5d15baa60955ddd6361e4689cc285de1a4 (patch) | |
tree | ebf85665b3b87d0f9e67fb3b6bf7339f00ec87ba | |
parent | 791a5a398556fdfb883b80566ceee4a7fc00c984 (diff) |
use __asm__ instead of asm
Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
-rw-r--r-- | include/nrvn.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/include/nrvn.h b/include/nrvn.h index abb03b4..98b4c78 100644 --- a/include/nrvn.h +++ b/include/nrvn.h @@ -6,12 +6,26 @@ #include <stdint.h> static inline void outb(uint16_t port, uint8_t val) { - asm volatile ("outb %0, %1" : : "a"(val), "Nd"(port) : "memory"); + __asm__ volatile ("outb %0, %1" : : "a"(val), "Nd"(port) : "memory"); +} + +static inline void outl(uint32_t port, uint32_t val) { + __asm__ volatile ("outl %0, %1" : : "a"(val), "Nd"(port) : "memory"); +} + +static inline void outw(uint16_t port, uint16_t val) { + __asm__ volatile ("outw %0, %1" : : "a"(val), "Nd"(port) : "memory"); } static inline uint8_t inb(uint16_t port) { uint8_t ret; - asm volatile ("inb %1, %0" : "=a"(ret) : "Nd"(port) : "memory"); + __asm__ volatile ("inb %1, %0" : "=a"(ret) : "Nd"(port) : "memory"); + return ret; +} + +static inline uint32_t inl(uint16_t port) { + uint32_t ret; + __asm__ volatile ("inl %1, %0" : "=a"(ret) : "Nd"(port) : "memory"); return ret; } |