aboutsummaryrefslogtreecommitdiff
path: root/kapi
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2026-07-21 17:27:05 +0200
committerFelix Morgner <felix.morgner@ost.ch>2026-07-21 17:27:05 +0200
commit4539791823a2fb1506e9091ec5087c80a87adfde (patch)
treec681ccdbb1664a5810b246bef08da20a34e61b30 /kapi
parentb312d810400f9be112f13df670d92aebfddc10a9 (diff)
downloadkernel-4539791823a2fb1506e9091ec5087c80a87adfde.tar.xz
kernel-4539791823a2fb1506e9091ec5087c80a87adfde.zip
kapi/device: remove major and minor
Diffstat (limited to 'kapi')
-rw-r--r--kapi/kapi/devices/bus.hpp5
-rw-r--r--kapi/kapi/devices/cpu.hpp10
-rw-r--r--kapi/kapi/devices/device.hpp20
-rw-r--r--kapi/kapi/devices/manager.hpp7
4 files changed, 5 insertions, 37 deletions
diff --git a/kapi/kapi/devices/bus.hpp b/kapi/kapi/devices/bus.hpp
index c4777616..913149fb 100644
--- a/kapi/kapi/devices/bus.hpp
+++ b/kapi/kapi/devices/bus.hpp
@@ -11,7 +11,6 @@
#include <kstd/vector.hpp>
#include <atomic>
-#include <cstddef>
namespace kapi::devices
{
@@ -24,10 +23,8 @@ namespace kapi::devices
{
//! Construct a bus with the given major number, minor number, and name.
//!
- //! @param major The major number of the bus.
- //! @param minor The minor number of the bus.
//! @param name The name of the bus.
- bus(std::size_t major, std::size_t minor, kstd::string const & name);
+ explicit bus(kstd::string const & name);
//! Initialize the bus and all of its children.
//!
diff --git a/kapi/kapi/devices/cpu.hpp b/kapi/kapi/devices/cpu.hpp
index 5f4228cc..708c803e 100644
--- a/kapi/kapi/devices/cpu.hpp
+++ b/kapi/kapi/devices/cpu.hpp
@@ -3,7 +3,6 @@
#include <kapi/devices/bus.hpp>
-#include <cstddef>
#include <cstdint>
namespace kapi::devices
@@ -15,7 +14,7 @@ namespace kapi::devices
//! A virtual CPU Core to host all core local devices.
struct core final : kapi::devices::bus
{
- explicit core(std::size_t major, std::size_t minor, std::uint64_t index, std::uint64_t hardware_id, bool is_bsp);
+ core(std::uint64_t index, std::uint64_t hardware_id, bool is_bsp);
[[nodiscard]] auto hardware_id() const -> std::uint64_t;
[[nodiscard]] auto is_bsp() const -> bool;
@@ -27,11 +26,8 @@ namespace kapi::devices
bool m_is_bsp;
};
- //! Create a new CPU with the given major and minor numbers.
- //!
- //! @param major The major number of this CPU
- //! @param minor The minor number of this CPU, identifying the physical CPU
- cpu(std::size_t major, std::size_t minor);
+ //! Create a new CPU.
+ cpu();
};
} // namespace kapi::devices
diff --git a/kapi/kapi/devices/device.hpp b/kapi/kapi/devices/device.hpp
index bf91dfcf..34254002 100644
--- a/kapi/kapi/devices/device.hpp
+++ b/kapi/kapi/devices/device.hpp
@@ -8,8 +8,6 @@
#include <kstd/memory.hpp>
#include <kstd/string.hpp>
-#include <cstddef>
-
namespace kapi::devices
{
@@ -23,11 +21,9 @@ namespace kapi::devices
{
/**
* @brief Create a device identifier from @p major, @p minor and @p name.
- * @param major Device major number.
- * @param minor Device minor number.
* @param name Device name.
*/
- device(size_t major, size_t minor, kstd::string const & name);
+ explicit device(kstd::string const & name);
/**
* @brief Virtual destructor for device.
@@ -59,18 +55,6 @@ namespace kapi::devices
}
/**
- * @brief Returns the major number of the device.
- * @return Device major number.
- */
- [[nodiscard]] auto major() const -> size_t;
-
- /**
- * @brief Returns the minor number of the device.
- * @return Device minor number.
- */
- [[nodiscard]] auto minor() const -> size_t;
-
- /**
* @brief Returns the name of the device.
* @return Device name.
*/
@@ -84,8 +68,6 @@ namespace kapi::devices
auto set_parent(kstd::observer_ptr<struct bus> parent) -> void;
- size_t m_major;
- size_t m_minor;
kstd::string m_name;
kstd::observer_ptr<bus> m_parent;
};
diff --git a/kapi/kapi/devices/manager.hpp b/kapi/kapi/devices/manager.hpp
index c317b61e..499b79ab 100644
--- a/kapi/kapi/devices/manager.hpp
+++ b/kapi/kapi/devices/manager.hpp
@@ -33,13 +33,6 @@ namespace kapi::devices
//! @return true if the device was unregistered successfully, false otherwise.
auto unregister_device(device & device) -> bool;
- //! Find a device by its major and minor numbers.
- //!
- //! @param major the major number of the device.
- //! @param minor the minor number of the device.
- //! @return a pointer to the device iff. the device was found, nullptr otherwise.
- auto find_device(std::size_t major, std::size_t minor) -> kstd::observer_ptr<device>;
-
//! Find a device by its name.
//!
//! @param name the name of the device.