aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/include
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2026-04-02 15:07:54 +0200
committerFelix Morgner <felix.morgner@ost.ch>2026-04-02 15:07:54 +0200
commitab4c59912c526d515e6e72188c08a7f92e5573e8 (patch)
tree0b6b561efb6fd8ac7a174edc6d4514a98f890861 /arch/x86_64/include
parent66ffd2ad8c793c4eea1527848fe4772e42595718 (diff)
downloadteachos-ab4c59912c526d515e6e72188c08a7f92e5573e8.tar.xz
teachos-ab4c59912c526d515e6e72188c08a7f92e5573e8.zip
x86_64: implement legacy PIT driver
Diffstat (limited to 'arch/x86_64/include')
-rw-r--r--arch/x86_64/include/arch/devices/legacy_pit.hpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/x86_64/include/arch/devices/legacy_pit.hpp b/arch/x86_64/include/arch/devices/legacy_pit.hpp
new file mode 100644
index 0000000..d28e4d6
--- /dev/null
+++ b/arch/x86_64/include/arch/devices/legacy_pit.hpp
@@ -0,0 +1,28 @@
+#ifndef TEACHOS_ARCH_X86_64_DEVICES_LEGACY_PIT_HPP
+#define TEACHOS_ARCH_X86_64_DEVICES_LEGACY_PIT_HPP
+
+#include "kapi/devices/device.hpp"
+#include "kapi/interrupts.hpp"
+
+#include <cstdint>
+
+namespace arch::devices
+{
+
+ struct legacy_pit : kapi::devices::device, kapi::interrupts::handler
+ {
+ explicit legacy_pit(std::uint32_t frequency_in_hz);
+
+ auto init() -> bool override;
+
+ auto handle_interrupt(std::uint32_t irq_number) -> kapi::interrupts::status override;
+
+ private:
+ std::uint32_t m_irq_number{};
+ std::uint32_t m_frequency_in_hz{};
+ std::uint64_t m_ticks{};
+ };
+
+} // namespace arch::devices
+
+#endif \ No newline at end of file