aboutsummaryrefslogtreecommitdiff
path: root/kernel/src/kapi/system.cpp
blob: 1cca82ecd1a19ddfc11c99cfb1df98afd1cf5eef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "kapi/system.hpp"

#include "kapi/cio.hpp"
#include "kapi/cpu.hpp"

#include <source_location>
#include <string_view>

namespace teachos::system
{

  [[gnu::weak]]
  auto panic(std::string_view message, std::source_location location) -> void
  {
    cio::println_error("[PANIC] in {} : {} @ {}:{}", location.function_name(), message, location.file_name(),
                       location.line());
    cpu::halt();
  }

}  // namespace teachos::system