From 25483b7af8df6b08d460f807fda04c6d409bd44e Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Mon, 14 Jul 2025 16:02:43 +0000 Subject: ide: start large-scale restructuring --- kern/include/kern/error.hpp | 13 +++++++++++++ kern/include/kern/print.hpp | 26 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 kern/include/kern/error.hpp create mode 100644 kern/include/kern/print.hpp (limited to 'kern/include') diff --git a/kern/include/kern/error.hpp b/kern/include/kern/error.hpp new file mode 100644 index 0000000..e58b9f1 --- /dev/null +++ b/kern/include/kern/error.hpp @@ -0,0 +1,13 @@ +#ifndef TEACHOS_KERN_ERROR_HPP +#define TEACHOS_KERN_ERROR_HPP + +#include +#include + +namespace teachos +{ + [[noreturn]] + auto panic(std::string_view message, std::source_location = std::source_location::current()) -> void; +} + +#endif diff --git a/kern/include/kern/print.hpp b/kern/include/kern/print.hpp new file mode 100644 index 0000000..fc9b5d6 --- /dev/null +++ b/kern/include/kern/print.hpp @@ -0,0 +1,26 @@ + +#ifndef TEACHOS_KERN_PRINT_HPP +#define TEACHOS_KERN_PRINT_HPP + +#include + +namespace teachos +{ + + using print_handler = auto(std::string_view) -> void; + using println_handler = auto(std::string_view) -> void; + + auto print(std::string_view text) -> void; + auto println(std::string_view text) -> void; + + auto print_error(std::string_view text) -> void; + auto println_error(std::string_view text) -> void; + + auto set_print_handler(print_handler handler) -> print_handler *; + auto set_println_handler(println_handler handler) -> print_handler *; + auto set_print_error_handler(print_handler handler) -> print_handler *; + auto set_println_error_handler(println_handler handler) -> print_handler *; + +} // namespace teachos + +#endif -- cgit v1.2.3