diff options
| author | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-10-20 12:17:44 +0000 |
|---|---|---|
| committer | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-10-20 12:17:44 +0000 |
| commit | 2129bdb22bab7dc5a9d23a31c23f38e847511a46 (patch) | |
| tree | d4a06737bdc54c77506faaf803ef077cb93574c0 /arch/x86_64/src/exception_handling | |
| parent | da2341ec12128d3b4983a67d39aeaf76b1781fa8 (diff) | |
| download | teachos-2129bdb22bab7dc5a9d23a31c23f38e847511a46.tar.xz teachos-2129bdb22bab7dc5a9d23a31c23f38e847511a46.zip | |
Revert assert with printf functionality, requires malloc 😭
Diffstat (limited to 'arch/x86_64/src/exception_handling')
| -rw-r--r-- | arch/x86_64/src/exception_handling/abort.cpp | 1 | ||||
| -rw-r--r-- | arch/x86_64/src/exception_handling/assert.cpp | 13 |
2 files changed, 13 insertions, 1 deletions
diff --git a/arch/x86_64/src/exception_handling/abort.cpp b/arch/x86_64/src/exception_handling/abort.cpp index 77576b1..e331d34 100644 --- a/arch/x86_64/src/exception_handling/abort.cpp +++ b/arch/x86_64/src/exception_handling/abort.cpp @@ -12,5 +12,4 @@ namespace teachos::arch::exception_handling * currently implement, @p ::abort gets overridden to simply panic. */ extern "C" auto abort() -> void { panic("Terminate was called, possibly due to an unhandled exception"); } - } // namespace teachos::arch::exception_handling diff --git a/arch/x86_64/src/exception_handling/assert.cpp b/arch/x86_64/src/exception_handling/assert.cpp new file mode 100644 index 0000000..b36f52d --- /dev/null +++ b/arch/x86_64/src/exception_handling/assert.cpp @@ -0,0 +1,13 @@ +#include "arch/exception_handling/assert.hpp" + +namespace teachos::arch::exception_handling +{ + auto assert(bool condition, char const * message) -> void + { + if (condition) + { + return; + } + panic("Assertion Violation: ", message); + } +} // namespace teachos::arch::exception_handling |
