FreeNOS
lib
libarch
arm
ARMControl.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2015 Niek Linnenbank
3
*
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation, either version 3 of the License, or
7
* (at your option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
#ifndef __ARM_CONTROL_H
19
#define __ARM_CONTROL_H
20
21
#include <
Types.h
>
22
#include <
Macros.h
>
23
47
class
ARMControl
48
{
49
public
:
50
54
enum
Register
55
{
56
MainID
= 0,
57
CoreID
,
58
SystemControl
,
59
AuxControl
,
60
DomainControl
,
61
TranslationTable0
,
62
TranslationTable1
,
63
TranslationTableCtrl
,
64
CacheClear
,
65
DataCacheClean
,
66
FlushPrefetchBuffer
,
67
InstructionCacheClear
,
68
InstructionTLBClear
,
69
DataTLBClear
,
70
UnifiedTLBClear
,
71
UserProcID
,
72
InstructionFaultAddress
,
73
InstructionFaultStatus
,
74
DataFaultAddress
,
75
DataFaultStatus
,
76
SystemFrequency
77
};
78
82
enum
SystemControlFlags
83
{
84
MMUEnabled
= (1 << 0),
85
InstructionCache
= (1 << 12),
86
DataCache
= (1 << 2),
87
ExtendedPaging
= (1 << 23),
88
AccessPermissions
= (1 << 29),
89
BranchPrediction
= (1 << 11),
90
AlignmentCorrect
= (1 << 22),
91
AlignmentFaults
= (1 << 1),
92
#ifdef ARMV6
93
BigEndian
= (1 << 7)
94
#
else
95
BigEndian
= (1 << 25)
96
#endif
97
};
98
102
enum
AuxControlFlags
103
{
104
DisablePageColoring
= (1 << 6),
105
SMPBit
= (1 << 6)
106
};
107
111
enum
DomainControlFlags
112
{
113
DomainClient
= 1,
114
DomainManager
= 3
115
};
116
120
ARMControl
();
121
125
virtual
~ARMControl
();
126
134
u32
read
(
Register
reg)
const
;
135
142
void
write
(
Register
reg,
u32
value);
143
149
void
set
(
SystemControlFlags
flags
);
150
156
void
unset
(
SystemControlFlags
flags
);
157
163
void
set
(
AuxControlFlags
flags
);
164
170
void
set
(
DomainControlFlags
flags
);
171
172
private
:
173
180
void
set
(
Register
reg,
u32
flags
);
181
188
void
unset
(
Register
reg,
u32
flags
);
189
};
190
197
#endif
/* __ARM_CONTROL_H */
ARMControl::FlushPrefetchBuffer
@ FlushPrefetchBuffer
Definition:
ARMControl.h:66
ARMControl::Register
Register
System Control Registers.
Definition:
ARMControl.h:54
ARMControl::InstructionTLBClear
@ InstructionTLBClear
Definition:
ARMControl.h:68
ARMControl::unset
void unset(SystemControlFlags flags)
Unset system control flags in CP15.
Definition:
ARMControl.cpp:93
ARMControl::AlignmentFaults
@ AlignmentFaults
Definition:
ARMControl.h:91
ARMControl::AccessPermissions
@ AccessPermissions
Definition:
ARMControl.h:88
Macros.h
ARMControl::DataFaultAddress
@ DataFaultAddress
Definition:
ARMControl.h:74
Types.h
ARMControl::write
void write(Register reg, u32 value)
Write register to the CP15.
Definition:
ARMControl.cpp:52
ARMControl::DomainControlFlags
DomainControlFlags
Domain Control flags.
Definition:
ARMControl.h:111
ARMControl::DataCache
@ DataCache
Definition:
ARMControl.h:86
flags
u32 flags
Definition:
IntelACPI.h:66
ARMControl::AuxControlFlags
AuxControlFlags
Aux Control flags.
Definition:
ARMControl.h:102
ARMControl::TranslationTableCtrl
@ TranslationTableCtrl
Definition:
ARMControl.h:63
ARMControl::ARMControl
ARMControl()
Constructor.
Definition:
ARMControl.cpp:21
ARMControl::DataTLBClear
@ DataTLBClear
Definition:
ARMControl.h:69
ARMControl::InstructionFaultAddress
@ InstructionFaultAddress
Definition:
ARMControl.h:72
ARMControl::DomainManager
@ DomainManager
Definition:
ARMControl.h:114
ARMControl::~ARMControl
virtual ~ARMControl()
Destructor.
Definition:
ARMControl.cpp:25
ARMControl::MainID
@ MainID
Definition:
ARMControl.h:56
ARMControl::MMUEnabled
@ MMUEnabled
Definition:
ARMControl.h:84
ARMControl::CoreID
@ CoreID
Definition:
ARMControl.h:57
ARMControl::InstructionFaultStatus
@ InstructionFaultStatus
Definition:
ARMControl.h:73
ARMControl::TranslationTable0
@ TranslationTable0
Definition:
ARMControl.h:61
ARMControl::UserProcID
@ UserProcID
Definition:
ARMControl.h:71
ARMControl
ARM System Control Coprocessor (CP15).
Definition:
ARMControl.h:47
ARMControl::BigEndian
@ BigEndian
Definition:
ARMControl.h:95
ARMControl::SystemFrequency
@ SystemFrequency
Definition:
ARMControl.h:76
ARMControl::CacheClear
@ CacheClear
Definition:
ARMControl.h:64
ARMControl::BranchPrediction
@ BranchPrediction
Definition:
ARMControl.h:89
u32
unsigned int u32
Unsigned 32-bit number.
Definition:
Types.h:53
ARMControl::DataCacheClean
@ DataCacheClean
Definition:
ARMControl.h:65
ARMControl::UnifiedTLBClear
@ UnifiedTLBClear
Definition:
ARMControl.h:70
ARMControl::SystemControlFlags
SystemControlFlags
System Control flags.
Definition:
ARMControl.h:82
ARMControl::DomainControl
@ DomainControl
Definition:
ARMControl.h:60
ARMControl::InstructionCache
@ InstructionCache
Definition:
ARMControl.h:85
ARMControl::DisablePageColoring
@ DisablePageColoring
Definition:
ARMControl.h:104
ARMControl::set
void set(SystemControlFlags flags)
Set system control flags in CP15.
Definition:
ARMControl.cpp:88
ARMControl::AuxControl
@ AuxControl
Definition:
ARMControl.h:59
ARMControl::DataFaultStatus
@ DataFaultStatus
Definition:
ARMControl.h:75
ARMControl::InstructionCacheClear
@ InstructionCacheClear
Definition:
ARMControl.h:67
ARMControl::AlignmentCorrect
@ AlignmentCorrect
Definition:
ARMControl.h:90
ARMControl::SystemControl
@ SystemControl
Definition:
ARMControl.h:58
ARMControl::TranslationTable1
@ TranslationTable1
Definition:
ARMControl.h:62
ARMControl::ExtendedPaging
@ ExtendedPaging
Definition:
ARMControl.h:87
ARMControl::DomainClient
@ DomainClient
Definition:
ARMControl.h:113
ARMControl::read
u32 read(Register reg) const
Read a register from the CP15.
Definition:
ARMControl.cpp:29
ARMControl::SMPBit
@ SMPBit
Definition:
ARMControl.h:105
Generated by
1.8.17