diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-07-26 02:27:59 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-07-26 02:27:59 +0200 |
| commit | 59f54d012c71e782966e9d083f1ee9459fd3fd70 (patch) | |
| tree | fa1c34396c3b9e50c6128fa1b8e580abd4e44b3d /arch | |
| parent | b486b794abaf35b0b2376662173eb07549252cfc (diff) | |
| download | kernel-59f54d012c71e782966e9d083f1ee9459fd3fd70.tar.xz kernel-59f54d012c71e782966e9d083f1ee9459fd3fd70.zip | |
chore: replace "interface" with "facet"
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/x86_64/arch/bus/isa.cpp | 15 | ||||
| -rw-r--r-- | arch/x86_64/arch/bus/isa.hpp | 15 | ||||
| -rw-r--r-- | arch/x86_64/arch/devices/pit.cpp | 6 | ||||
| -rw-r--r-- | arch/x86_64/arch/devices/pit.hpp | 2 | ||||
| -rw-r--r-- | arch/x86_64/arch/drivers/pit.cpp | 6 | ||||
| -rw-r--r-- | arch/x86_64/arch/drivers/pit.hpp | 2 |
6 files changed, 27 insertions, 19 deletions
diff --git a/arch/x86_64/arch/bus/isa.cpp b/arch/x86_64/arch/bus/isa.cpp index ee195519..8e17c186 100644 --- a/arch/x86_64/arch/bus/isa.cpp +++ b/arch/x86_64/arch/bus/isa.cpp @@ -14,6 +14,8 @@ namespace arch::bus { struct isa_protocol final : kapi::devices::bus_protocol { + constexpr auto static id = kapi::capabilities::facet_id{"isa_protocol"}; + auto enumerate(kapi::devices::bus &) -> void override { // NOTE: ISA does not support enumeration, but we need to fulfill the interface. @@ -22,8 +24,8 @@ namespace arch::bus [[nodiscard]] auto match(kapi::devices::device const & device, kapi::devices::driver const & driver) const -> kstd::result<std::uint32_t> override { - auto device_signature = device.as<isa_signature>(); - auto driver_claim = driver.as<isa_claim>(); + auto device_signature = device.facet<isa_signature>(); + auto driver_claim = driver.facet<isa_claim>(); if (!device_signature || !driver_claim) { @@ -44,9 +46,14 @@ namespace arch::bus : kapi::devices::bus{"isa"} {} - auto isa::protocol() -> kapi::devices::bus_protocol * + auto isa::query_facet(kapi::capabilities::facet_id id) -> void * { - return &protocol_instance; + if (id == isa_protocol::id || id == kapi::devices::bus_protocol::id) + { + return &protocol_instance; + } + + return bus::query_facet(id); } } // namespace arch::bus
\ No newline at end of file diff --git a/arch/x86_64/arch/bus/isa.hpp b/arch/x86_64/arch/bus/isa.hpp index 87832c3c..db85f3f7 100644 --- a/arch/x86_64/arch/bus/isa.hpp +++ b/arch/x86_64/arch/bus/isa.hpp @@ -11,11 +11,11 @@ namespace arch::bus { - //! The signature interface used to identify ISA devices. + //! The signature facet used to identify ISA devices. struct isa_signature { - //! The ID of this interface. - constexpr auto static id = kapi::devices::interface_id{"isa_signature"}; + //! The ID of this facet. + constexpr auto static id = kapi::capabilities::facet_id{"isa_signature"}; //! Allow for correct destruction through base pointers. virtual ~isa_signature() = default; @@ -24,11 +24,11 @@ namespace arch::bus [[nodiscard]] virtual auto isa_name() const -> std::string_view = 0; }; - //! The claim interface used to match ISA drivers. + //! The claim facet used to match ISA drivers. struct isa_claim { - //! The ID of this interface - constexpr auto static id = kapi::devices::interface_id{"isa_claim"}; + //! The ID of this facet + constexpr auto static id = kapi::capabilities::facet_id{"isa_claim"}; //! Allow for correct destruction through base pointers. virtual ~isa_claim() = default; @@ -43,7 +43,8 @@ namespace arch::bus //! Construct a default ISA bus. isa(); - [[nodiscard]] auto protocol() -> kapi::devices::bus_protocol * override; + private: + auto query_facet(kapi::capabilities::facet_id id) -> void * override; }; } // namespace arch::bus diff --git a/arch/x86_64/arch/devices/pit.cpp b/arch/x86_64/arch/devices/pit.cpp index 6a8e9974..bfd6e84b 100644 --- a/arch/x86_64/arch/devices/pit.cpp +++ b/arch/x86_64/arch/devices/pit.cpp @@ -18,14 +18,14 @@ namespace arch::devices return "pit"; } - auto pit::query_interface(kapi::devices::interface_id interface) -> void * + auto pit::query_facet(kapi::capabilities::facet_id facet) -> void * { - if (interface == arch::bus::isa_signature::id) + if (facet == arch::bus::isa_signature::id) { return static_cast<arch::bus::isa_signature *>(this); } - return kapi::devices::device::query_interface(interface); + return kapi::devices::device::query_facet(facet); } } // namespace arch::devices
\ No newline at end of file diff --git a/arch/x86_64/arch/devices/pit.hpp b/arch/x86_64/arch/devices/pit.hpp index adb722ab..e2546d27 100644 --- a/arch/x86_64/arch/devices/pit.hpp +++ b/arch/x86_64/arch/devices/pit.hpp @@ -24,7 +24,7 @@ namespace arch::devices [[nodiscard]] auto isa_name() const -> std::string_view override; protected: - auto query_interface(kapi::devices::interface_id interface) -> void * override; + auto query_facet(kapi::capabilities::facet_id facet) -> void * override; }; } // namespace arch::devices diff --git a/arch/x86_64/arch/drivers/pit.cpp b/arch/x86_64/arch/drivers/pit.cpp index ea053319..650c4245 100644 --- a/arch/x86_64/arch/drivers/pit.cpp +++ b/arch/x86_64/arch/drivers/pit.cpp @@ -92,14 +92,14 @@ namespace arch::drivers return kapi::interrupts::status::handled; } - auto pit::query_interface(kapi::devices::interface_id interface) -> void * + auto pit::query_facet(kapi::capabilities::facet_id facet) -> void * { - if (interface == arch::bus::isa_claim::id) + if (facet == arch::bus::isa_claim::id) { return static_cast<arch::bus::isa_claim *>(this); } - return kapi::devices::driver::query_interface(interface); + return kapi::devices::driver::query_facet(facet); } } // namespace arch::drivers
\ No newline at end of file diff --git a/arch/x86_64/arch/drivers/pit.hpp b/arch/x86_64/arch/drivers/pit.hpp index e99bdf81..32ad7573 100644 --- a/arch/x86_64/arch/drivers/pit.hpp +++ b/arch/x86_64/arch/drivers/pit.hpp @@ -32,7 +32,7 @@ namespace arch::drivers [[nodiscard]] auto name() const noexcept -> std::string_view override; protected: - auto query_interface(kapi::devices::interface_id interface) -> void * override; + auto query_facet(kapi::capabilities::facet_id facet) -> void * override; private: struct data |
