aboutsummaryrefslogtreecommitdiff
path: root/i686/sys/io.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'i686/sys/io.hpp')
-rw-r--r--i686/sys/io.hpp33
1 files changed, 0 insertions, 33 deletions
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);
- }
-
-};