summaryrefslogtreecommitdiffstats
path: root/arch/x86_64/hal/serial_com.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/hal/serial_com.h')
-rw-r--r--arch/x86_64/hal/serial_com.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/x86_64/hal/serial_com.h b/arch/x86_64/hal/serial_com.h
new file mode 100644
index 0000000..2dbb0cd
--- /dev/null
+++ b/arch/x86_64/hal/serial_com.h
@@ -0,0 +1,26 @@
+#ifndef _JOVE_SERIAL_COM_H
+#define _JOVE_SERIAL_COM_H 1
+
+#include <stdint.h>
+#include "obj.h"
+
+#define SERIAL_COM1 0x3F8
+
+#define SERIAL_COM_TR(com) (com)
+#define SERIAL_COM_IER(com) (com + 1)
+#define SERIAL_COM_II(com) (com + 2)
+#define SERIAL_COM_FIFO(com) (com + 2)
+#define SERIAL_COM_LCR(com) (com + 3)
+#define SERIAL_COM_MCR(com) (com + 4)
+#define SERIAL_COM_LSR(com) (com + 5)
+#define SERIAL_COM_MSR(com) (com + 6)
+#define SERIAL_COM_SR(com) (com + 7)
+
+#define SERIAL_COM_DLAB_BAUD_LO(com) (com)
+#define SERIAL_COM_DLAB_BAUD_HI(com) (com + 1)
+
+void serial_com_init(void);
+
+int serial_com_write(jove_owned_obj_t *obj, const char *s, size_t len);
+
+#endif