aboutsummaryrefslogtreecommitdiff
path: root/i686/sys/io.hpp
blob: bea93235bbfe6471e3bfb684df81066e317c97f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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);
  }
};