aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2026-04-02 15:49:14 +0200
committerFelix Morgner <felix.morgner@ost.ch>2026-04-02 15:49:14 +0200
commit21489576381d827871e7cdf060929c5d7f3d4e9f (patch)
treea6be5285e475ba1e51eb78d312077c522aefd6e0 /arch/x86_64/src
parent33b43603936ed0108d67853727a17d6b3740b445 (diff)
downloadteachos-21489576381d827871e7cdf060929c5d7f3d4e9f.tar.xz
teachos-21489576381d827871e7cdf060929c5d7f3d4e9f.zip
devices: don't automatically allocate major numbers in ctors
Diffstat (limited to 'arch/x86_64/src')
-rw-r--r--arch/x86_64/src/bus/isa.cpp6
-rw-r--r--arch/x86_64/src/devices/legacy_pit.cpp5
2 files changed, 7 insertions, 4 deletions
diff --git a/arch/x86_64/src/bus/isa.cpp b/arch/x86_64/src/bus/isa.cpp
index 2ad4d21..ff4ad71 100644
--- a/arch/x86_64/src/bus/isa.cpp
+++ b/arch/x86_64/src/bus/isa.cpp
@@ -2,11 +2,13 @@
#include "kapi/devices.hpp"
+#include <cstddef>
+
namespace arch::bus
{
- isa::isa()
- : kapi::devices::bus(kapi::devices::allocate_major_number(), 0, "isa")
+ isa::isa(std::size_t major)
+ : kapi::devices::bus{major, 0, "isa"}
{}
} // namespace arch::bus \ No newline at end of file
diff --git a/arch/x86_64/src/devices/legacy_pit.cpp b/arch/x86_64/src/devices/legacy_pit.cpp
index f2fb70e..970f538 100644
--- a/arch/x86_64/src/devices/legacy_pit.cpp
+++ b/arch/x86_64/src/devices/legacy_pit.cpp
@@ -6,6 +6,7 @@
#include "arch/device_io/port_io.hpp"
+#include <cstddef>
#include <cstdint>
namespace arch::devices
@@ -19,8 +20,8 @@ namespace arch::devices
using channel_2_port = io::port<0x42, std::uint8_t, io::port_write>;
} // namespace
- legacy_pit::legacy_pit(std::uint32_t frequency_in_hz)
- : kapi::devices::device{kapi::devices::allocate_major_number(), 0, "legacy_pit"}
+ legacy_pit::legacy_pit(std::size_t major, std::uint32_t frequency_in_hz)
+ : kapi::devices::device{major, 0, "legacy_pit"}
, m_irq_number{0}
, m_frequency_in_hz{frequency_in_hz}
{}