diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-03-24 17:35:54 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-03-27 07:02:35 +0100 |
| commit | cb60cdebdc36dd2358fe1ce06eec197e213af491 (patch) | |
| tree | e16c8aa92be11a1898dea4a955108085c2fe0239 /kernel/kapi | |
| parent | 05269b10e50a80f557c2be475904ff15dc1bbec4 (diff) | |
| download | teachos-cb60cdebdc36dd2358fe1ce06eec197e213af491.tar.xz teachos-cb60cdebdc36dd2358fe1ce06eec197e213af491.zip | |
kapi/cpu: introduce CPU API
Diffstat (limited to 'kernel/kapi')
| -rw-r--r-- | kernel/kapi/cpu.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/kernel/kapi/cpu.cpp b/kernel/kapi/cpu.cpp new file mode 100644 index 0000000..2089098 --- /dev/null +++ b/kernel/kapi/cpu.cpp @@ -0,0 +1,30 @@ +#include "kapi/cpu.hpp" + +namespace kapi::cpu +{ + + namespace + { + struct null_exception_handler : exception_handler + { + auto handle(exception const &) -> bool override + { + return false; + } + } static constinit default_exception_handler; + + exception_handler * current_handler = &default_exception_handler; + + } // namespace + + auto get_exception_handler() -> exception_handler & + { + return *current_handler; + } + + auto set_exception_handler(exception_handler & handler) -> void + { + current_handler = &handler; + } + +} // namespace kapi::cpu
\ No newline at end of file |
