aboutsummaryrefslogtreecommitdiff
path: root/kapi
diff options
context:
space:
mode:
Diffstat (limited to 'kapi')
-rw-r--r--kapi/kapi/interrupts.hpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/kapi/kapi/interrupts.hpp b/kapi/kapi/interrupts.hpp
index 4ba06848..41710c2b 100644
--- a/kapi/kapi/interrupts.hpp
+++ b/kapi/kapi/interrupts.hpp
@@ -1,6 +1,8 @@
#ifndef TEACHOS_KAPI_INTERRUPTS_HPP
#define TEACHOS_KAPI_INTERRUPTS_HPP
+#include <kstd/memory.hpp>
+
#include <cstdint>
namespace kapi::interrupts
@@ -29,8 +31,9 @@ namespace kapi::interrupts
//! task quickly and must take care when acquiring globally shared locks.
//!
//! @param irq_number The identifier of the interrupt request that triggered the handler.
+ //! @param context Additional context data associated during handler registration.
//! @return status::handled if the handler successfully handled the interrupt, status::unhandled otherwise.
- virtual auto handle_interrupt(std::uint32_t irq_number) -> status = 0;
+ virtual auto handle_interrupt(std::uint32_t irq_number, kstd::weak_ptr<void> context) -> status = 0;
};
//! @}
@@ -42,7 +45,8 @@ namespace kapi::interrupts
//!
//! @param irq_number The IRQ number to register the handler for.
//! @param handler The interrupt handler to register.
- auto register_handler(std::uint32_t irq_number, handler & handler) -> void;
+ //! @param context Additional context data to be passed back to the handler when the interrupt occurs.
+ auto register_handler(std::uint32_t irq_number, handler & handler, kstd::weak_ptr<void> context) -> void;
//! Unregister a previously registered interrupt handler.
//!