summaryrefslogtreecommitdiffhomepage
path: root/dev/Kernel/KernelKit/PCI/IO.h
diff options
context:
space:
mode:
Diffstat (limited to 'dev/Kernel/KernelKit/PCI/IO.h')
-rw-r--r--dev/Kernel/KernelKit/PCI/IO.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/dev/Kernel/KernelKit/PCI/IO.h b/dev/Kernel/KernelKit/PCI/IO.h
index b6d491ce..1d60df8e 100644
--- a/dev/Kernel/KernelKit/PCI/IO.h
+++ b/dev/Kernel/KernelKit/PCI/IO.h
@@ -25,6 +25,7 @@ namespace NeOS
: fPorts(ports)
{
}
+
~IOArray()
{
}
@@ -49,11 +50,26 @@ namespace NeOS
Array<UShort, Sz> fPorts;
};
- using IOArray16 = IOArray<16>;
+ inline constexpr UInt16 kMaxPorts = 16;
+
+ using IOArray16 = IOArray<kMaxPorts>;
+
+ template <SizeT Sz>
+ inline Array<UShort, Sz> make_ports(UShort base)
+ {
+ Array<UShort, Sz> ports;
+
+ for (UShort i = 0; i < Sz; ++i)
+ {
+ ports[i] = base + i;
+ }
+
+ return ports;
+ }
} // namespace NeOS
#ifdef __x86_64__
-#include <KernelKit/PCI/IO-Impl-AMD64.inl>
+#include <KernelKit/PCI/IOArray+AMD64.inl>
#else
#error Please provide platform specific code for the I/O
#endif // ifdef __x86_64__