aboutsummaryrefslogtreecommitdiff
path: root/include/system.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/system.h')
-rw-r--r--include/system.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/system.h b/include/system.h
new file mode 100644
index 0000000..6184c31
--- /dev/null
+++ b/include/system.h
@@ -0,0 +1,16 @@
+#ifndef SYSTEM_H
+#define SYSTEM_H
+#include "types.h"
+uint8 inportb (uint16 _port)
+{
+ uint8 rv;
+ __asm__ __volatile__ ("inb %1, %0" : "=a" (rv) : "dN" (_port));
+ return rv;
+}
+
+void outportb (uint16 _port, uint8 _data)
+{
+ __asm__ __volatile__ ("outb %1, %0" : : "dN" (_port), "a" (_data));
+}
+
+#endif