IgrOS-Kernel 0.1.34.545
Simple C++20 Kernel for i386/x86_64
Loading...
Searching...
No Matches
cpu.hpp
Go to the documentation of this file.
1
11
12
13#pragma once
14
15
16// IgrOS-Kernel arch
17#include <arch/register.hpp>
18
19#if defined(IGROS_ARCH_i386) || defined(IGROS_ARCH_x86_64)
20
21// IgrOS-Kernel arch x86
22#include <arch/x86/native.hpp>
23
24#else
25
26#error "Unknown architecture!"
27
28#endif
29
30
31// Arch namespace
32namespace igros::arch {
33
34
36 template<class T>
37 concept Cpu = requires(const register_t* const regs) {
38 // Halt CPU (never returns)
39 T::halt();
40 // Dump CPU registers
41 T::dumpRegisters(regs);
42 };
43
44
45#if defined(IGROS_ARCH_i386) || defined(IGROS_ARCH_x86_64)
46
48 using x86::cpu;
49
50#endif
51
52
53 static_assert(Cpu<cpu>, "Architecture CPU doesn't provide CPU interface!");
54
55
56} // namespace igros::arch
57
CPU control every architecture must provide.
Definition cpu.hpp:37
Architecture-independent interface: drivers and aliases of current architecture types.
x86 family current (native) architecture selection
Architecture register type deduction.
x86_64 task switch registers save
Definition register.hpp:32