aboutsummaryrefslogtreecommitdiff
path: root/kernel/kapi/cpu.cpp
blob: 2089098fc9aed9c9bd615bbeb3d40cbaefb34af5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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