diff options
author | Marvin Borner | 2021-07-05 16:48:07 +0200 |
---|---|---|
committer | Marvin Borner | 2021-07-05 16:51:23 +0200 |
commit | 46ce42e9b13ce209c8c971084cfc849a83848270 (patch) | |
tree | a85283f85c970bb26df6690a4ba08b017f1d4e25 /src/loader/cpu.c | |
parent | 981342ef807ebcefba8eeba74511cdcedf9c36bd (diff) |
Added PCI, MBR, bugs and fixes
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)); +} |