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

Commit 24233dc

Browse files
authored
Add Alignment Check bits to SCTLR_EL1 (#23)
1 parent a1e9540 commit 24233dc

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

src/regs/sctlr_el1.rs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,37 @@ register_bitfields! {u64,
4242
Cacheable = 1
4343
],
4444

45+
/// Non-aligned access. This bit controls generation of Alignment faults at EL1 and EL0 under certain conditions.
46+
///
47+
/// LDAPR, LDAPRH, LDAPUR, LDAPURH, LDAPURSH, LDAPURSW, LDAR, LDARH, LDLAR, LDLARH,
48+
/// STLLR, STLLRH, STLR, STLRH, STLUR, and STLURH will or will not generate an Alignment
49+
/// fault if all bytes being accessed are not within a single 16-byte quantity,
50+
/// aligned to 16 bytes for accesses.
51+
NAA OFFSET(6) NUMBITS(1) [
52+
Disable = 0,
53+
Enable = 1
54+
],
55+
56+
/// SP Alignment check enable for EL0.
57+
///
58+
/// When set to 1, if a load or store instruction executed at EL0 uses the SP
59+
/// as the base address and the SP is not aligned to a 16-byte boundary,
60+
/// then a SP alignment fault exception is generated.
61+
SA0 OFFSET(4) NUMBITS(1) [
62+
Disable = 0,
63+
Enable = 1
64+
],
65+
66+
/// SP Alignment check enable.
67+
///
68+
/// When set to 1, if a load or store instruction executed at EL1 uses the SP
69+
/// as the base address and the SP is not aligned to a 16-byte boundary,
70+
/// then a SP alignment fault exception is generated.
71+
SA OFFSET(3) NUMBITS(1) [
72+
Disable = 0,
73+
Enable = 1
74+
],
75+
4576
/// Cacheability control, for data accesses.
4677
///
4778
/// 0 All data access to Normal memory from EL0 and EL1, and all Normal memory accesses to
@@ -64,6 +95,19 @@ register_bitfields! {u64,
6495
Cacheable = 1
6596
],
6697

98+
/// Alignment check enable. This is the enable bit for Alignment fault checking at EL1 and EL0.
99+
///
100+
/// Instructions that load or store one or more registers, other than load/store exclusive
101+
/// and load-acquire/store-release, will or will not check that the address being accessed
102+
/// is aligned to the size of the data element(s) being accessed depending on this flag.
103+
///
104+
/// Load/store exclusive and load-acquire/store-release instructions have an alignment check
105+
/// regardless of the value of the A bit.
106+
A OFFSET(1) NUMBITS(1) [
107+
Disable = 0,
108+
Enable = 1
109+
],
110+
67111
/// MMU enable for EL1 and EL0 stage 1 address translation. Possible values of this bit are:
68112
///
69113
/// 0 EL1 and EL0 stage 1 address translation disabled.

0 commit comments

Comments
 (0)