From 46ce42e9b13ce209c8c971084cfc849a83848270 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Mon, 5 Jul 2021 16:48:07 +0200 Subject: Added PCI, MBR, bugs and fixes --- src/loader/cpu.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/loader/cpu.c') 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 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)); +} -- cgit v1.2.3