diff options
Diffstat (limited to 'src/loader/cpu.c')
-rw-r--r-- | src/loader/cpu.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/loader/cpu.c b/src/loader/cpu.c index a12d2fa..a0694ed 100644 --- a/src/loader/cpu.c +++ b/src/loader/cpu.c @@ -3,7 +3,7 @@ #include <cpu.h> /** - * CPU IO + * CPU serial I/O */ u8 inb(u16 port) @@ -20,7 +20,24 @@ u16 inw(u16 port) return value; } +u32 inl(u16 port) +{ + u32 value; + __asm__ volatile("inl %1, %0" : "=a"(value) : "Nd"(port)); + return value; +} + void outb(u16 port, u8 data) { __asm__ volatile("outb %0, %1" ::"a"(data), "Nd"(port)); } + +void outw(u16 port, u16 data) +{ + __asm__ volatile("outw %0, %1" ::"a"(data), "Nd"(port)); +} + +void outl(u16 port, u32 data) +{ + __asm__ volatile("outl %0, %1" ::"a"(data), "Nd"(port)); +} |