diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2025-12-12 10:56:11 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2025-12-12 10:56:11 +0100 |
| commit | 0a2c2c408d8fda248d56df349b4c9f9cc5e8bade (patch) | |
| tree | aa9125813280d2db44f0b9a09c70a543023e7768 | |
| parent | 6fdfe22f75c7202eee84b9b89f6abd5dbc60fedc (diff) | |
| download | teachos-0a2c2c408d8fda248d56df349b4c9f9cc5e8bade.tar.xz teachos-0a2c2c408d8fda248d56df349b4c9f9cc5e8bade.zip | |
x86_64/cpu: move register definitions
| -rw-r--r-- | arch/x86_64/include/x86_64/cpu/control_register.hpp (renamed from arch/x86_64/include/x86_64/cpu/control_registers.hpp) | 15 | ||||
| -rw-r--r-- | arch/x86_64/include/x86_64/cpu/model_specific_register.hpp | 3 | ||||
| -rw-r--r-- | arch/x86_64/include/x86_64/cpu/registers.hpp | 25 |
3 files changed, 24 insertions, 19 deletions
diff --git a/arch/x86_64/include/x86_64/cpu/control_registers.hpp b/arch/x86_64/include/x86_64/cpu/control_register.hpp index 1f8c690..35ffcae 100644 --- a/arch/x86_64/include/x86_64/cpu/control_registers.hpp +++ b/arch/x86_64/include/x86_64/cpu/control_register.hpp @@ -239,21 +239,6 @@ namespace teachos::cpu::x86_64 static_assert(sizeof(cr3_value) == sizeof(std::uint64_t)); - //! Configuration Register 0. - //! - //! This configuration register holds various control flags to configure the configure the basic operation of the CPU. - using cr0 = control_register<cr0_flags, &impl::cr0_asm>; - - //! Configuration Register 2. - //! - //! This configuration register holds the memory address the access to which has triggered the most recent page fault. - using cr2 = control_register<memory::linear_address, &impl::cr2_asm>; - - //! Configuration Register 3. - //! - //! This register holds the configuration of the virtual memory protection configuration. - using cr3 = control_register<cr3_value, &impl::cr3_asm>; - } // namespace teachos::cpu::x86_64 #endif
\ No newline at end of file diff --git a/arch/x86_64/include/x86_64/cpu/model_specific_register.hpp b/arch/x86_64/include/x86_64/cpu/model_specific_register.hpp index 080b280..857b444 100644 --- a/arch/x86_64/include/x86_64/cpu/model_specific_register.hpp +++ b/arch/x86_64/include/x86_64/cpu/model_specific_register.hpp @@ -143,9 +143,6 @@ namespace teachos::cpu::x86_64 } }; - //! The I32_EFER (Extended Feature Enable Register) MSR - using i32_efer = model_specific_register<ia32_efer_number, ia32_efer_flags>; - } // namespace teachos::cpu::x86_64 #endif
\ No newline at end of file diff --git a/arch/x86_64/include/x86_64/cpu/registers.hpp b/arch/x86_64/include/x86_64/cpu/registers.hpp index cb56270..8eb89e3 100644 --- a/arch/x86_64/include/x86_64/cpu/registers.hpp +++ b/arch/x86_64/include/x86_64/cpu/registers.hpp @@ -1,7 +1,30 @@ #ifndef TEACHOS_X86_64_CPU_REGISTERS_HPP #define TEACHOS_X86_64_CPU_REGISTERS_HPP -#include "x86_64/cpu/control_registers.hpp" // IWYU pragma: export +#include "x86_64/cpu/control_register.hpp" // IWYU pragma: export #include "x86_64/cpu/model_specific_register.hpp" // IWYU pragma: export +namespace teachos::cpu::x86_64 +{ + + //! Configuration Register 0. + //! + //! This configuration register holds various control flags to configure the configure the basic operation of the CPU. + using cr0 = control_register<cr0_flags, &impl::cr0_asm>; + + //! Configuration Register 2. + //! + //! This configuration register holds the memory address the access to which has triggered the most recent page fault. + using cr2 = control_register<memory::linear_address, &impl::cr2_asm>; + + //! Configuration Register 3. + //! + //! This register holds the configuration of the virtual memory protection configuration. + using cr3 = control_register<cr3_value, &impl::cr3_asm>; + + //! The I32_EFER (Extended Feature Enable Register) MSR + using i32_efer = model_specific_register<ia32_efer_number, ia32_efer_flags>; + +} // namespace teachos::cpu::x86_64 + #endif
\ No newline at end of file |
