libmicroemu 0.2.0
ARM Microcontroller Emulator Library
Loading...
Searching...
No Matches
special_register_id.h
Go to the documentation of this file.
1
6#pragma once
7
8#include "libmicroemu/types.h"
9
10namespace libmicroemu {
11
18enum class SpecialRegisterId : u8 {
19
20 //---------------------
21 // Persistent registers
22 // These registers are part of the processor and have a state that persists.
23 //---------------------
24
25 kSysCtrl = 0U,
39
40 //---------------------
41 // Runtime registers
42 // These registers are not persitent, but are built during runtime.
43 //---------------------
47};
48
49constexpr auto kLastPersistentSpecialRegister = SpecialRegisterId::kSysTickCalib;
50constexpr auto kFirstRuntimeSpecialRegister = SpecialRegisterId::kEpsr;
51constexpr auto kLastRuntimeSpecialRegister = SpecialRegisterId::kControl;
52constexpr auto kLastSpecialRegister = kLastRuntimeSpecialRegister;
53
62static constexpr u32 CountPersistentSpecialRegisters() noexcept {
63 return static_cast<u32>(kLastPersistentSpecialRegister) + 1U;
64};
65
73static constexpr u32 CountSpecialRegisters() noexcept {
74 return static_cast<u32>(kLastSpecialRegister) + 1U;
75};
76
77} // namespace libmicroemu
The libmicroemu namespace contains all classes and functions of the libmicroemu which are public.
Definition bkpt_flags.h:6
SpecialRegisterId
Enumeration of special register IDs.
Definition special_register_id.h:18
@ kSpMain
Main Stack Pointer, MSP.
Definition special_register_id.h:33
@ kSpProcess
Process Stack Pointer, PSP.
Definition special_register_id.h:34
@ kVtor
Vector Table Offset Register, VTOR.
Definition special_register_id.h:29
@ kCfsr
Configurable Fault Status Register, CFSR.
Definition special_register_id.h:31
@ kSysTickCsr
SYSTICK_CSR - SysTick Control and Status Register.
Definition special_register_id.h:35
@ kEpsr
Execution Program Status Register, EPSR.
Definition special_register_id.h:44
@ kSysTickCalib
SYST_CALIB - SysTick Calibration Value Register.
Definition special_register_id.h:38
@ kSysTickCvr
SYST_CVR - SysTick Current Value Register.
Definition special_register_id.h:37
@ kIstate
If-Then Execution state bits.
Definition special_register_id.h:27
@ kIpsr
Interrupt Program Status Register, IPSR.
Definition special_register_id.h:28
@ kSysTickRvr
SYSTICK_RVR - SysTick Reload Value Register.
Definition special_register_id.h:36
@ kBfar
Bus Fault Address Register, BFAR.
Definition special_register_id.h:32
@ kSysCtrl
System Control Register, SYSCTRL.
Definition special_register_id.h:25
@ kApsr
Application Program Status Register, APSR.
Definition special_register_id.h:26
@ kControl
Control register, CONTROL.
Definition special_register_id.h:46
@ kCcr
Configuration and Control Register, CCR.
Definition special_register_id.h:30
@ kXpsr
Program status register, XPSR.
Definition special_register_id.h:45
static constexpr u32 CountSpecialRegisters() noexcept
Returns the number of special registers.
Definition special_register_id.h:73
static constexpr u32 CountPersistentSpecialRegisters() noexcept
Returns the number of persistent special registers.
Definition special_register_id.h:62