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

Commit 8384597

Browse files
committed
Add TCR_EL1 A1 Constants
1 parent ffcb3eb commit 8384597

File tree

2 files changed

+41
-35
lines changed

2 files changed

+41
-35
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cortex-a"
3-
version = "5.1.4"
3+
version = "5.1.5"
44
authors = ["Andre Richter <andre.o.richter@gmail.com>"]
55
description = "Low level access to Cortex-A processors"
66
homepage = "https://github.com/rust-embedded/cortex-a"

src/regs/tcr_el1.rs

Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,23 @@ register_bitfields! {u64,
3333
/// Reserved, RES0.
3434
TBID0 OFFSET(51) NUMBITS(1) [],
3535

36-
/// Top Byte ignored - indicates whether the top byte of an address is
37-
/// used for address match for the TTBR1_EL1 region, or ignored and used
38-
/// for tagged addresses. Defined values are:
36+
/// Top Byte ignored - indicates whether the top byte of an address is used for address
37+
/// match for the TTBR1_EL1 region, or ignored and used for tagged addresses. Defined values
38+
/// are:
3939
///
4040
/// 0 Top Byte used in the address calculation.
41+
///
4142
/// 1 Top Byte ignored in the address calculation.
4243
///
43-
/// This affects addresses generated in EL0 and EL1 using AArch64 where
44-
/// the address would be translated by tables pointed to by TTBR1_EL1.
45-
/// It has an effect whether the EL1&0 translation regime is enabled or not.
44+
/// This affects addresses generated in EL0 and EL1 using AArch64 where the address would be
45+
/// translated by tables pointed to by TTBR1_EL1. It has an effect whether the EL1&0
46+
/// translation regime is enabled or not.
4647
///
47-
/// If ARMv8.3-PAuth is implemented and TCR_EL1.TBID1 is 1, then this field
48-
/// only applies to Data accesses.
49-
/// Otherwise, if the value of TBI1 is 1 and bit [55] of the target address
50-
/// to be stored to the PC is 0, then bits[63:56] of that target address are
51-
/// also set to 0 before the address is stored in the PC, in the following cases:
48+
/// If ARMv8.3-PAuth is implemented and TCR_EL1.TBID1 is 1, then this field only applies to
49+
/// Data accesses.
50+
/// Otherwise, if the value of TBI1 is 1 and bit [55] of the target address to be stored to
51+
/// the PC is 0, then bits[63:56] of that target address are also set to 0 before the
52+
/// address is stored in the PC, in the following cases:
5253
///
5354
/// • A branch or procedure return within EL0 or EL1.
5455
/// • An exception taken to EL1.
@@ -58,22 +59,23 @@ register_bitfields! {u64,
5859
Ignored = 1
5960
],
6061

61-
/// Top Byte ignored - indicates whether the top byte of an address is
62-
/// used for address match for the TTBR0_EL1 region, or ignored and used
63-
/// for tagged addresses. Defined values are:
62+
/// Top Byte ignored - indicates whether the top byte of an address is used for address
63+
/// match for the TTBR0_EL1 region, or ignored and used for tagged addresses. Defined values
64+
/// are:
6465
///
6566
/// 0 Top Byte used in the address calculation.
67+
///
6668
/// 1 Top Byte ignored in the address calculation.
6769
///
68-
/// This affects addresses generated in EL0 and EL1 using AArch64 where
69-
/// the address would be translated by tables pointed to by TTBR0_EL1.
70-
/// It has an effect whether the EL1&0 translation regime is enabled or not.
70+
/// This affects addresses generated in EL0 and EL1 using AArch64 where the address would be
71+
/// translated by tables pointed to by TTBR0_EL1. It has an effect whether the EL1&0
72+
/// translation regime is enabled or not.
7173
///
72-
/// If ARMv8.3-PAuth is implemented and TCR_EL1.TBID0 is 1, then this field
73-
/// only applies to Data accesses.
74-
/// Otherwise, if the value of TBI0 is 1 and bit [55] of the target address
75-
/// to be stored to the PC is 0, then bits[63:56] of that target address are
76-
/// also set to 0 before the address is stored in the PC, in the following cases:
74+
/// If ARMv8.3-PAuth is implemented and TCR_EL1.TBID0 is 1, then this field only applies to
75+
/// Data accesses.
76+
/// Otherwise, if the value of TBI0 is 1 and bit [55] of the target address to be stored to
77+
/// the PC is 0, then bits[63:56] of that target address are also set to 0 before the
78+
/// address is stored in the PC, in the following cases:
7779
///
7880
/// • A branch or procedure return within EL0 or EL1.
7981
/// • An exception taken to EL1.
@@ -85,12 +87,12 @@ register_bitfields! {u64,
8587

8688
/// ASID Size. Defined values are:
8789
///
88-
/// 0 8 bit - the upper 8 bits of TTBR0_EL1 and TTBR1_EL1 are ignored by hardware
89-
/// for every purpose except reading back the register, and are treated
90-
/// as if they are all zeros for when used for allocation and matching
91-
/// entries in the TLB.
92-
/// 1 16 bit - the upper 16 bits of TTBR0_EL1 and TTBR1_EL1 are used for allocation
93-
/// and matching in the TLB.
90+
/// 0 8 bit - the upper 8 bits of TTBR0_EL1 and TTBR1_EL1 are ignored by hardware for every
91+
/// purpose except reading back the register, and are treated as if they are all
92+
/// zeros for when used for allocation and matching entries in the TLB.
93+
///
94+
/// 1 16 bit - the upper 16 bits of TTBR0_EL1 and TTBR1_EL1 are used for allocation and
95+
/// matching in the TLB.
9496
///
9597
/// If the implementation has only 8 bits of ASID, this field is RES0.
9698
AS OFFSET(36) NUMBITS(1) [
@@ -212,19 +214,23 @@ register_bitfields! {u64,
212214
DisableTTBR1Walks = 1
213215
],
214216

215-
/// Selects whether TTBR0_EL1 or TTBR1_EL1 defines the ASID.
216-
/// The encoding of this bit is:
217+
/// Selects whether TTBR0_EL1 or TTBR1_EL1 defines the ASID. The encoding of this bit is:
217218
///
218219
/// 0 TTBR0_EL1.ASID defines the ASID.
219220
/// 1 TTBR1_EL1.ASID defines the ASID.
220-
A1 OFFSET(22) NUMBITS(1) [],
221+
A1 OFFSET(22) NUMBITS(1) [
222+
TTBR0 = 0,
223+
TTBR1 = 1
224+
],
221225

222-
/// The size offset of the memory region addressed by TTBR0_EL1. The region size is
223-
/// 2^(64-T0SZ) bytes.
226+
/// The size offset of the memory region addressed by TTBR1_EL1. The region size is
227+
/// 2^(64-T1SZ) bytes.
224228
///
225-
/// The maximum and minimum possible values for T0SZ depend on the level of translation
229+
/// The maximum and minimum possible values for T1SZ depend on the level of translation
226230
/// table and the memory translation granule size, as described in the AArch64 Virtual
227231
/// Memory System Architecture chapter.
232+
///
233+
/// This field resets to an architecturally UNKNOWN value.
228234
T1SZ OFFSET(16) NUMBITS(6) [],
229235

230236
/// Granule size for the TTBR0_EL1.

0 commit comments

Comments
 (0)