aboutsummaryrefslogtreecommitdiff
path: root/i686/sys/io.h
diff options
context:
space:
mode:
Diffstat (limited to 'i686/sys/io.h')
-rw-r--r--i686/sys/io.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/i686/sys/io.h b/i686/sys/io.h
index 74d4950..b6c24c5 100644
--- a/i686/sys/io.h
+++ b/i686/sys/io.h
@@ -1,5 +1,27 @@
#pragma once
+// port listings
+enum UART {
+ COM1 = 0x3f8,
+ COM2 = 0x2f8,
+ COM3 = 0x3e8,
+ COM4 = 0x2e8,
+ COM5 = 0x5f8,
+ COM6 = 0x4f8,
+ 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)
{
@@ -77,3 +99,4 @@ insl(unsigned short port, void *__buf, unsigned long __n)
{
asm volatile("cld; rep; insl" : "+D"(__buf), "+c"(__n) : "d"(port));
}
+