From 7d78433e6ea80b651f80201b6c5beef799887e7f Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 23 Jul 2026 22:34:49 +0200 Subject: x86_64: port legacy PIT driver to new architecture --- kapi/kapi/devices/bus.hpp | 2 +- kapi/kapi/devices/driver.hpp | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'kapi') diff --git a/kapi/kapi/devices/bus.hpp b/kapi/kapi/devices/bus.hpp index 0e654072..10b9c39d 100644 --- a/kapi/kapi/devices/bus.hpp +++ b/kapi/kapi/devices/bus.hpp @@ -50,7 +50,7 @@ namespace kapi::devices //! Enumerate the devices on the bus. //! //! @return true iff. the bus hardware is healthy, false otherwise. - auto virtual enumerate() -> bool; + auto virtual enumerate_old() -> bool; private: kstd::vector> m_devices; diff --git a/kapi/kapi/devices/driver.hpp b/kapi/kapi/devices/driver.hpp index fde5068c..254f7977 100644 --- a/kapi/kapi/devices/driver.hpp +++ b/kapi/kapi/devices/driver.hpp @@ -54,6 +54,16 @@ namespace kapi::devices return static_cast(query_interface(InterfaceType::id)); } + //! Retrieve this drivers implementation of a given capability interface. + //! + //! @return A pointer to this drivers implementation of the requested interface, nullptr if this driver does not + //! support the requested interface. + template + [[nodiscard]] auto as() const -> InterfaceType const * + { + return static_cast(const_cast(this)->query_interface(InterfaceType::id)); + } + //! Check if this driver implements a given capability interface. //! //! @return true iff. this driver implements the requested capability interface, false otherwise. -- cgit v1.2.3