diff options
Diffstat (limited to 'i686/sys')
-rw-r--r-- | i686/sys/io.h | 10 | ||||
-rw-r--r-- | i686/sys/io.hpp | 33 |
2 files changed, 0 insertions, 43 deletions
diff --git a/i686/sys/io.h b/i686/sys/io.h index b6c24c5..da586b9 100644 --- a/i686/sys/io.h +++ b/i686/sys/io.h @@ -11,16 +11,6 @@ enum UART { COM7 = 0x5e8, COM8 = 0x4e8, }; -enum UARTPortOffset { - Data = 0, // read from receive buffer / write to transmit buffer | BaudDiv_l - InterruptControl = 1, // interrupt enable | BaudDiv_h - FifoControl = 2, // interrupt ID and FIFO control - LineControl = 3, // most significant bit is the DLAB - ModemControl = 4, - LineStatus = 5, - ModemStatus = 6, - Scratch = 7, -}; static inline void outb(unsigned char val, unsigned short port) diff --git a/i686/sys/io.hpp b/i686/sys/io.hpp deleted file mode 100644 index 9759a3a..0000000 --- a/i686/sys/io.hpp +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once - -/** - * Ports provide communication with devices on the x86 IO bus. - */ -template <typename T, unsigned short port> struct Port { - /** - * Read value from port - */ - static T - in(unsigned short offset = 0) - { - if constexpr (sizeof(T) == sizeof(unsigned char)) return inb(port + offset); - else if constexpr (sizeof(T) == sizeof(unsigned short)) - return inw(port + offset); - else if constexpr (sizeof(T) == sizeof(unsigned int)) - return inl(port + offset); - } - - /** - * Write value to port - */ - static void - out(T val, unsigned short offset = 0) - { - if constexpr (sizeof(T) == sizeof(unsigned char)) outb(val, port + offset); - else if constexpr (sizeof(T) == sizeof(unsigned short)) - outw(val, port + offset); - else if constexpr (sizeof(T) == sizeof(unsigned int)) - outl(val, port + offset); - } - -}; |