Skip to content
This repository was archived by the owner on Nov 7, 2022. It is now read-only.

Commit 9ae6e8d

Browse files
vbe0201andre-richter
authored andcommitted
Define the DACR32_EL2 register
1 parent c7b7039 commit 9ae6e8d

File tree

2 files changed

+296
-0
lines changed

2 files changed

+296
-0
lines changed

src/registers.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ mod cntv_tval_el0;
2222
mod cntvct_el0;
2323
mod cntvoff_el2;
2424
mod csselr_el1;
25+
mod dacr32_el2;
2526
mod currentel;
2627
mod daif;
2728
mod elr_el1;
@@ -80,6 +81,7 @@ pub use cntv_tval_el0::CNTV_TVAL_EL0;
8081
pub use cntvct_el0::CNTVCT_EL0;
8182
pub use cntvoff_el2::CNTVOFF_EL2;
8283
pub use csselr_el1::CSSELR_EL1;
84+
pub use dacr32_el2::DACR32_EL2;
8385
pub use currentel::CurrentEL;
8486
pub use daif::DAIF;
8587
pub use elr_el1::ELR_EL1;

src/registers/dacr32_el2.rs

Lines changed: 294 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,294 @@
1+
// SPDX-License-Identifier: Apache-2.0 OR MIT
2+
//
3+
// Copyright (c) 2018-2022 by the author(s)
4+
//
5+
// Author(s):
6+
// - Valentin B. <valentin.be@protonmail.com>
7+
8+
//! Domain Access Control Register - EL2
9+
//!
10+
//! Allows access to the AArch32 DACR register from AArch64 state only. Its value
11+
//! has no effect on execution in AArch64 state.
12+
13+
use tock_registers::{
14+
interfaces::{Readable, Writeable},
15+
register_bitfields,
16+
};
17+
18+
register_bitfields! {u64,
19+
pub DACR32_EL2 [
20+
/// Domain 15 access permission.
21+
///
22+
/// Values other than the pre-defined ones are reserved.
23+
///
24+
/// NOTE: On Warm reset, this field resets to an undefined value.
25+
D15 OFFSET(30) NUMBITS(2) [
26+
/// No access. Any access to the domain generates a Domain fault.
27+
NoAccess = 0b00,
28+
/// Client access. Accesses are not checked against the permission bits
29+
/// in the translation tables.
30+
Client = 0b01,
31+
/// Manager access. Accesses are not checked against the permission bits
32+
/// in the translation tables.
33+
Manager = 0b11
34+
],
35+
36+
/// Domain 14 access permission.
37+
///
38+
/// Values other than the pre-defined ones are reserved.
39+
///
40+
/// NOTE: On Warm reset, this field resets to an undefined value.
41+
D14 OFFSET(28) NUMBITS(2) [
42+
/// No access. Any access to the domain generates a Domain fault.
43+
NoAccess = 0b00,
44+
/// Client access. Accesses are not checked against the permission bits
45+
/// in the translation tables.
46+
Client = 0b01,
47+
/// Manager access. Accesses are not checked against the permission bits
48+
/// in the translation tables.
49+
Manager = 0b11
50+
],
51+
52+
/// Domain 13 access permission.
53+
///
54+
/// Values other than the pre-defined ones are reserved.
55+
///
56+
/// NOTE: On Warm reset, this field resets to an undefined value.
57+
D13 OFFSET(26) NUMBITS(2) [
58+
/// No access. Any access to the domain generates a Domain fault.
59+
NoAccess = 0b00,
60+
/// Client access. Accesses are not checked against the permission bits
61+
/// in the translation tables.
62+
Client = 0b01,
63+
/// Manager access. Accesses are not checked against the permission bits
64+
/// in the translation tables.
65+
Manager = 0b11
66+
],
67+
68+
/// Domain 12 access permission.
69+
///
70+
/// Values other than the pre-defined ones are reserved.
71+
///
72+
/// NOTE: On Warm reset, this field resets to an undefined value.
73+
D12 OFFSET(24) NUMBITS(2) [
74+
/// No access. Any access to the domain generates a Domain fault.
75+
NoAccess = 0b00,
76+
/// Client access. Accesses are not checked against the permission bits
77+
/// in the translation tables.
78+
Client = 0b01,
79+
/// Manager access. Accesses are not checked against the permission bits
80+
/// in the translation tables.
81+
Manager = 0b11
82+
],
83+
84+
/// Domain 11 access permission.
85+
///
86+
/// Values other than the pre-defined ones are reserved.
87+
///
88+
/// NOTE: On Warm reset, this field resets to an undefined value.
89+
D11 OFFSET(22) NUMBITS(2) [
90+
/// No access. Any access to the domain generates a Domain fault.
91+
NoAccess = 0b00,
92+
/// Client access. Accesses are not checked against the permission bits
93+
/// in the translation tables.
94+
Client = 0b01,
95+
/// Manager access. Accesses are not checked against the permission bits
96+
/// in the translation tables.
97+
Manager = 0b11
98+
],
99+
100+
/// Domain 10 access permission.
101+
///
102+
/// Values other than the pre-defined ones are reserved.
103+
///
104+
/// NOTE: On Warm reset, this field resets to an undefined value.
105+
D10 OFFSET(20) NUMBITS(2) [
106+
/// No access. Any access to the domain generates a Domain fault.
107+
NoAccess = 0b00,
108+
/// Client access. Accesses are not checked against the permission bits
109+
/// in the translation tables.
110+
Client = 0b01,
111+
/// Manager access. Accesses are not checked against the permission bits
112+
/// in the translation tables.
113+
Manager = 0b11
114+
],
115+
116+
/// Domain 9 access permission.
117+
///
118+
/// Values other than the pre-defined ones are reserved.
119+
///
120+
/// NOTE: On Warm reset, this field resets to an undefined value.
121+
D9 OFFSET(18) NUMBITS(2) [
122+
/// No access. Any access to the domain generates a Domain fault.
123+
NoAccess = 0b00,
124+
/// Client access. Accesses are not checked against the permission bits
125+
/// in the translation tables.
126+
Client = 0b01,
127+
/// Manager access. Accesses are not checked against the permission bits
128+
/// in the translation tables.
129+
Manager = 0b11
130+
],
131+
132+
/// Domain 8 access permission.
133+
///
134+
/// Values other than the pre-defined ones are reserved.
135+
///
136+
/// NOTE: On Warm reset, this field resets to an undefined value.
137+
D8 OFFSET(16) NUMBITS(2) [
138+
/// No access. Any access to the domain generates a Domain fault.
139+
NoAccess = 0b00,
140+
/// Client access. Accesses are not checked against the permission bits
141+
/// in the translation tables.
142+
Client = 0b01,
143+
/// Manager access. Accesses are not checked against the permission bits
144+
/// in the translation tables.
145+
Manager = 0b11
146+
],
147+
148+
/// Domain 7 access permission.
149+
///
150+
/// Values other than the pre-defined ones are reserved.
151+
///
152+
/// NOTE: On Warm reset, this field resets to an undefined value.
153+
D7 OFFSET(14) NUMBITS(2) [
154+
/// No access. Any access to the domain generates a Domain fault.
155+
NoAccess = 0b00,
156+
/// Client access. Accesses are not checked against the permission bits
157+
/// in the translation tables.
158+
Client = 0b01,
159+
/// Manager access. Accesses are not checked against the permission bits
160+
/// in the translation tables.
161+
Manager = 0b11
162+
],
163+
164+
/// Domain 6 access permission.
165+
///
166+
/// Values other than the pre-defined ones are reserved.
167+
///
168+
/// NOTE: On Warm reset, this field resets to an undefined value.
169+
D6 OFFSET(12) NUMBITS(2) [
170+
/// No access. Any access to the domain generates a Domain fault.
171+
NoAccess = 0b00,
172+
/// Client access. Accesses are not checked against the permission bits
173+
/// in the translation tables.
174+
Client = 0b01,
175+
/// Manager access. Accesses are not checked against the permission bits
176+
/// in the translation tables.
177+
Manager = 0b11
178+
],
179+
180+
/// Domain 5 access permission.
181+
///
182+
/// Values other than the pre-defined ones are reserved.
183+
///
184+
/// NOTE: On Warm reset, this field resets to an undefined value.
185+
D5 OFFSET(10) NUMBITS(2) [
186+
/// No access. Any access to the domain generates a Domain fault.
187+
NoAccess = 0b00,
188+
/// Client access. Accesses are not checked against the permission bits
189+
/// in the translation tables.
190+
Client = 0b01,
191+
/// Manager access. Accesses are not checked against the permission bits
192+
/// in the translation tables.
193+
Manager = 0b11
194+
],
195+
196+
/// Domain 4 access permission.
197+
///
198+
/// Values other than the pre-defined ones are reserved.
199+
///
200+
/// NOTE: On Warm reset, this field resets to an undefined value.
201+
D4 OFFSET(8) NUMBITS(2) [
202+
/// No access. Any access to the domain generates a Domain fault.
203+
NoAccess = 0b00,
204+
/// Client access. Accesses are not checked against the permission bits
205+
/// in the translation tables.
206+
Client = 0b01,
207+
/// Manager access. Accesses are not checked against the permission bits
208+
/// in the translation tables.
209+
Manager = 0b11
210+
],
211+
212+
/// Domain 3 access permission.
213+
///
214+
/// Values other than the pre-defined ones are reserved.
215+
///
216+
/// NOTE: On Warm reset, this field resets to an undefined value.
217+
D3 OFFSET(6) NUMBITS(2) [
218+
/// No access. Any access to the domain generates a Domain fault.
219+
NoAccess = 0b00,
220+
/// Client access. Accesses are not checked against the permission bits
221+
/// in the translation tables.
222+
Client = 0b01,
223+
/// Manager access. Accesses are not checked against the permission bits
224+
/// in the translation tables.
225+
Manager = 0b11
226+
],
227+
228+
/// Domain 2 access permission.
229+
///
230+
/// Values other than the pre-defined ones are reserved.
231+
///
232+
/// NOTE: On Warm reset, this field resets to an undefined value.
233+
D2 OFFSET(4) NUMBITS(2) [
234+
/// No access. Any access to the domain generates a Domain fault.
235+
NoAccess = 0b00,
236+
/// Client access. Accesses are not checked against the permission bits
237+
/// in the translation tables.
238+
Client = 0b01,
239+
/// Manager access. Accesses are not checked against the permission bits
240+
/// in the translation tables.
241+
Manager = 0b11
242+
],
243+
244+
/// Domain 1 access permission.
245+
///
246+
/// Values other than the pre-defined ones are reserved.
247+
///
248+
/// NOTE: On Warm reset, this field resets to an undefined value.
249+
D1 OFFSET(2) NUMBITS(2) [
250+
/// No access. Any access to the domain generates a Domain fault.
251+
NoAccess = 0b00,
252+
/// Client access. Accesses are not checked against the permission bits
253+
/// in the translation tables.
254+
Client = 0b01,
255+
/// Manager access. Accesses are not checked against the permission bits
256+
/// in the translation tables.
257+
Manager = 0b11
258+
],
259+
260+
/// Domain 0 access permission.
261+
///
262+
/// Values other than the pre-defined ones are reserved.
263+
///
264+
/// NOTE: On Warm reset, this field resets to an undefined value.
265+
D0 OFFSET(0) NUMBITS(2) [
266+
/// No access. Any access to the domain generates a Domain fault.
267+
NoAccess = 0b00,
268+
/// Client access. Accesses are not checked against the permission bits
269+
/// in the translation tables.
270+
Client = 0b01,
271+
/// Manager access. Accesses are not checked against the permission bits
272+
/// in the translation tables.
273+
Manager = 0b11
274+
]
275+
]
276+
}
277+
278+
pub struct Reg;
279+
280+
impl Readable for Reg {
281+
type T = u64;
282+
type R = DACR32_EL2::Register;
283+
284+
sys_coproc_read_raw!(u64, "DACR32_EL2", "x");
285+
}
286+
287+
impl Writeable for Reg {
288+
type T = u64;
289+
type R = DACR32_EL2::Register;
290+
291+
sys_coproc_write_raw!(u64, "DACR32_EL2", "x");
292+
}
293+
294+
pub const DACR32_EL2: Reg = Reg;

0 commit comments

Comments
 (0)