aboutsummaryrefslogtreecommitdiff
path: root/kernel/kapi/system.cpp
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2026-01-16 13:36:38 +0100
committerFelix Morgner <felix.morgner@ost.ch>2026-01-16 13:36:38 +0100
commit7d6f0ed063790042a808f4bf07c50d308b3f2de4 (patch)
tree1a2e1c4ed7e2f3d8e6cdcfb012e554d1a4eb1e5a /kernel/kapi/system.cpp
parent9750405757396d006ab6992fb93baf414b3e2ae8 (diff)
downloadteachos-7d6f0ed063790042a808f4bf07c50d308b3f2de4.tar.xz
teachos-7d6f0ed063790042a808f4bf07c50d308b3f2de4.zip
chore: restructure namespaces
Diffstat (limited to 'kernel/kapi/system.cpp')
-rw-r--r--kernel/kapi/system.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/kernel/kapi/system.cpp b/kernel/kapi/system.cpp
new file mode 100644
index 0000000..a17d9b9
--- /dev/null
+++ b/kernel/kapi/system.cpp
@@ -0,0 +1,21 @@
+#include "kapi/system.hpp"
+
+#include "kapi/cpu.hpp"
+
+#include <kstd/print>
+
+#include <source_location>
+#include <string_view>
+
+namespace kapi::system
+{
+
+ [[gnu::weak]]
+ auto panic(std::string_view message, std::source_location location) -> void
+ {
+ kstd::println(kstd::print_sink::stderr, "[PANIC] in {} : {} @ {}:{}", location.function_name(), message,
+ location.file_name(), location.line());
+ cpu::halt();
+ }
+
+} // namespace kapi::system