FreeNOS
|
ARM System Control Coprocessor (CP15). More...
#include <ARMControl.h>
Public Types | |
enum | Register { MainID = 0, CoreID, SystemControl, AuxControl, DomainControl, TranslationTable0, TranslationTable1, TranslationTableCtrl, CacheClear, DataCacheClean, FlushPrefetchBuffer, InstructionCacheClear, InstructionTLBClear, DataTLBClear, UnifiedTLBClear, UserProcID, InstructionFaultAddress, InstructionFaultStatus, DataFaultAddress, DataFaultStatus, SystemFrequency } |
System Control Registers. More... | |
enum | SystemControlFlags { MMUEnabled = (1 << 0), InstructionCache = (1 << 12), DataCache = (1 << 2), ExtendedPaging = (1 << 23), AccessPermissions = (1 << 29), BranchPrediction = (1 << 11), AlignmentCorrect = (1 << 22), AlignmentFaults = (1 << 1), BigEndian = (1 << 25) } |
System Control flags. More... | |
enum | AuxControlFlags { DisablePageColoring = (1 << 6), SMPBit = (1 << 6) } |
Aux Control flags. More... | |
enum | DomainControlFlags { DomainClient = 1, DomainManager = 3 } |
Domain Control flags. More... | |
Public Member Functions | |
ARMControl () | |
Constructor. More... | |
virtual | ~ARMControl () |
Destructor. More... | |
u32 | read (Register reg) const |
Read a register from the CP15. More... | |
void | write (Register reg, u32 value) |
Write register to the CP15. More... | |
void | set (SystemControlFlags flags) |
Set system control flags in CP15. More... | |
void | unset (SystemControlFlags flags) |
Unset system control flags in CP15. More... | |
void | set (AuxControlFlags flags) |
Set auxillary flags in CP15. More... | |
void | set (DomainControlFlags flags) |
Set domain control flags in CP15. More... | |
Private Member Functions | |
void | set (Register reg, u32 flags) |
Set flag(s) in a CP15 register. More... | |
void | unset (Register reg, u32 flags) |
Unset flag(s) in a CP15 register. More... | |
ARM System Control Coprocessor (CP15).
The ARM Architecture defines a coprocessor to manage various subsystems in the ARM core, including virtual memory, interrupts, debugging and more. It appears as coprocessor number 15 to the ARM core and is accessible by the MRC (ARM Register from Coprocessor) and MCR () instructions.
Definition at line 47 of file ARMControl.h.
Aux Control flags.
Enumerator | |
---|---|
DisablePageColoring | |
SMPBit |
Definition at line 102 of file ARMControl.h.
Domain Control flags.
Enumerator | |
---|---|
DomainClient | |
DomainManager |
Definition at line 111 of file ARMControl.h.
enum ARMControl::Register |
System Control Registers.
Definition at line 54 of file ARMControl.h.
System Control flags.
Enumerator | |
---|---|
MMUEnabled | |
InstructionCache | |
DataCache | |
ExtendedPaging | |
AccessPermissions | |
BranchPrediction | |
AlignmentCorrect | |
AlignmentFaults | |
BigEndian |
Definition at line 82 of file ARMControl.h.
ARMControl::ARMControl | ( | ) |
Constructor.
Definition at line 21 of file ARMControl.cpp.
|
virtual |
Destructor.
Definition at line 25 of file ARMControl.cpp.
Read a register from the CP15.
reg | The Register to read. |
Definition at line 29 of file ARMControl.cpp.
References AuxControl, CoreID, DataFaultAddress, DataFaultStatus, DomainControl, InstructionFaultAddress, InstructionFaultStatus, MainID, mrc, SystemControl, SystemFrequency, TranslationTable0, TranslationTable1, TranslationTableCtrl, and UserProcID.
Referenced by ARMCore::logState(), RaspberryKernel::RaspberryKernel(), set(), and unset().
void ARMControl::set | ( | ARMControl::AuxControlFlags | flags | ) |
Set auxillary flags in CP15.
flags | Auxillary flags to set |
Definition at line 98 of file ARMControl.cpp.
References AuxControl, flags, and set().
void ARMControl::set | ( | ARMControl::DomainControlFlags | flags | ) |
Set domain control flags in CP15.
flags | New domain control flags |
Definition at line 103 of file ARMControl.cpp.
References DomainControl, flags, and set().
Set flag(s) in a CP15 register.
reg | Register to set |
flags | Flag values to set in the register |
Definition at line 74 of file ARMControl.cpp.
void ARMControl::set | ( | ARMControl::SystemControlFlags | flags | ) |
Set system control flags in CP15.
flags | New system control flags |
Definition at line 88 of file ARMControl.cpp.
References flags, and SystemControl.
Referenced by ARMKernel::ARMKernel(), kernel_main(), and set().
Unset flag(s) in a CP15 register.
reg | Register to unset |
flags | Flag values to remove from the register |
Definition at line 81 of file ARMControl.cpp.
void ARMControl::unset | ( | ARMControl::SystemControlFlags | flags | ) |
Unset system control flags in CP15.
flags | System control flags to remove |
Definition at line 93 of file ARMControl.cpp.
References flags, and SystemControl.
Referenced by ARMKernel::ARMKernel().
Write register to the CP15.
reg | The Register to write. |
value | 32-value to write. |
Definition at line 52 of file ARMControl.cpp.
References AuxControl, CacheClear, DataCacheClean, DataTLBClear, DomainControl, FlushPrefetchBuffer, flushPrefetchBuffer(), InstructionCacheClear, InstructionTLBClear, mcr, SystemControl, TranslationTable0, TranslationTable1, TranslationTableCtrl, UnifiedTLBClear, and UserProcID.
Referenced by ARMPaging::activate(), set(), and unset().