aboutsummaryrefslogtreecommitdiff
path: root/kapi
diff options
context:
space:
mode:
Diffstat (limited to 'kapi')
-rw-r--r--kapi/CMakeLists.txt3
-rw-r--r--kapi/include/kapi/cpu.hpp1
-rw-r--r--kapi/include/kapi/interrupts.hpp (renamed from kapi/include/kapi/cpu/interrupts.hpp)24
3 files changed, 12 insertions, 16 deletions
diff --git a/kapi/CMakeLists.txt b/kapi/CMakeLists.txt
index 4c94829..99b737c 100644
--- a/kapi/CMakeLists.txt
+++ b/kapi/CMakeLists.txt
@@ -9,8 +9,7 @@ target_sources("kapi" PUBLIC
"include/kapi/boot.hpp"
"include/kapi/cio.hpp"
"include/kapi/cpu.hpp"
- "include/kapi/cpu/interrupts.hpp"
- "include/kapi/cpu/exception.hpp"
+ "include/kapi/interrupts.hpp"
"include/kapi/boot_module/boot_module.hpp"
"include/kapi/boot_module/boot_module_registry.hpp"
"include/kapi/memory.hpp"
diff --git a/kapi/include/kapi/cpu.hpp b/kapi/include/kapi/cpu.hpp
index 041a5db..c6aa6ff 100644
--- a/kapi/include/kapi/cpu.hpp
+++ b/kapi/include/kapi/cpu.hpp
@@ -1,7 +1,6 @@
#ifndef TEACHOS_KAPI_CPU_HPP
#define TEACHOS_KAPI_CPU_HPP
-#include "kapi/cpu/interrupts.hpp" // IWYU pragma: export
#include "kapi/memory.hpp"
#include <kstd/format>
diff --git a/kapi/include/kapi/cpu/interrupts.hpp b/kapi/include/kapi/interrupts.hpp
index 328e4a7..fa4bc95 100644
--- a/kapi/include/kapi/cpu/interrupts.hpp
+++ b/kapi/include/kapi/interrupts.hpp
@@ -1,11 +1,9 @@
-#ifndef TEACHOS_KAPI_CPU_INTERRUPTS_HPP
-#define TEACHOS_KAPI_CPU_INTERRUPTS_HPP
-
-// IWYU pragma: private, include "kapi/cpu.hpp"
+#ifndef TEACHOS_KAPI_INTERRUPTS_HPP
+#define TEACHOS_KAPI_INTERRUPTS_HPP
#include <cstdint>
-namespace kapi::cpu
+namespace kapi::interrupts
{
enum class status : bool
@@ -15,9 +13,9 @@ namespace kapi::cpu
};
//! The interface for all interrupt handlers.
- struct interrupt_handler
+ struct handler
{
- virtual ~interrupt_handler() = default;
+ virtual ~handler() = default;
//! Handle an interrupt with the given IRQ number.
//
@@ -31,33 +29,33 @@ namespace kapi::cpu
//! @qualifier platform-defined
//! Enable external interrupts.
- auto enable_interrupts() -> void;
+ auto enable() -> void;
//! @qualifier platform-defined
//! Disable external interrupts.
- auto disable_interrupts() -> void;
+ auto disable() -> void;
//! @qualifier platform-defined
//! Register an interrupt handler for the given IRQ number.
//!
//! @param irq_number The IRQ number to register the handler for.
//! @param handler The interrupt handler to register.
- auto register_interrupt_handler(std::uint32_t irq_number, interrupt_handler & handler) -> void;
+ auto register_handler(std::uint32_t irq_number, handler & handler) -> void;
//! @qualifier platform-defined
//! Unregister a previously registered interrupt handler.
//!
//! @param irq_number The IRQ number to unregister the handler for.
//! @param handler The interrupt handler to unregister.
- auto unregister_interrupt_handler(std::uint32_t irq_number, interrupt_handler & handler) -> void;
+ auto unregister_handler(std::uint32_t irq_number, handler & handler) -> void;
//! @qualifier platform-defined
//! Dispatch an interrupt to all registered handlers.
//!
//! @param irq_number The IRQ number to dispatch.
//! @return status::handled if the interrupt was handled by at least one handler, status::unhandled otherwise.
- auto dispatch_interrupt(std::uint32_t irq_number) -> status;
+ auto dispatch(std::uint32_t irq_number) -> status;
-} // namespace kapi::cpu
+} // namespace kapi::interrupts
#endif \ No newline at end of file