blob: 3ecaadc13037c5040ec5c545a0b43255f535b329 (
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
|
#include "kernel/tests/cpu.hpp"
#include <kapi/cpu.hpp>
#include <atomic>
#include <stdexcept>
namespace kapi::cpu
{
auto init() -> void
{
auto static initialized = std::atomic_flag{};
if (initialized.test_and_set())
{
throw std::logic_error("kapi::cpu::init() called more than once");
}
// TODO: make sure that simulated interrupt can run.
return;
}
auto halt() -> void
{
throw kernel::tests::cpu::halt{};
}
} // namespace kapi::cpu
|