From ace65b453151845bc361f21f3e5b651c35f9f126 Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Wed, 22 May 2024 13:00:41 -0400 Subject: massive refactor for mp and organization --- include/device/uart.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 include/device/uart.h (limited to 'include/device/uart.h') diff --git a/include/device/uart.h b/include/device/uart.h new file mode 100644 index 0000000..1724eb5 --- /dev/null +++ b/include/device/uart.h @@ -0,0 +1,19 @@ +#ifndef JOVE_KERNEL_ARCH_x86_64_UART_H +#define JOVE_KERNEL_ARCH_x86_64_UART_H 1 + +#include "jove.h" +#include + +ALWAYS_INLINE uint8_t pinb(uint16_t port) +{ + uint8_t v; + __asm__ volatile("inb %1, %0": "=a"(v): "Nd"(port)); + return v; +} + +ALWAYS_INLINE void poutb(uint16_t port, uint8_t b) +{ + __asm__ volatile("outb %0, %1":: "a"(b), "Nd"(port)); +} + +#endif -- cgit v1.2.1