diff options
Diffstat (limited to 'i686/sys/io.hpp')
-rw-r--r-- | i686/sys/io.hpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/i686/sys/io.hpp b/i686/sys/io.hpp new file mode 100644 index 0000000..bea9323 --- /dev/null +++ b/i686/sys/io.hpp @@ -0,0 +1,15 @@ +#pragma once + +template <typename T, unsigned short port> struct Port { + static void + out(T val, unsigned short offset = 0) + { + outb(val, port + offset); + } + + static auto + in(unsigned short offset = 0) + { + return inb(port + offset); + } +}; |