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

Commit 7c06962

Browse files
authored
Make SPSR_EL3 and SCR_EL3 bitfields accessible (#26)
* Make SPSR_EL3 bitfield public * Make SCR_EL3 bitfield public * Might as well add in some more bits I plan to use * Update src/regs/scr_el3.rs
1 parent 5f939df commit 7c06962

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

src/regs/scr_el3.rs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use register::{cpu::RegisterReadWrite, register_bitfields};
1515

1616
register_bitfields! {u64,
17-
SCR_EL3 [
17+
pub SCR_EL3 [
1818
/// Execution state control for lower Exception levels:
1919
///
2020
/// 0 Lower levels are all AArch32.
@@ -38,6 +38,25 @@ register_bitfields! {u64,
3838
NextELIsAarch64 = 1
3939
],
4040

41+
/// Hypervisor Call Enable
42+
///
43+
/// 0 The HVC instruction is undefined at all exception levels.
44+
/// 1 The HVC instruction is enabled at EL1, EL2, or EL3
45+
HCE OFFSET(8) NUMBITS(1) [
46+
HvcDisabled = 0,
47+
HvcEnabled = 1
48+
],
49+
50+
/// Secure Monitor call Disable
51+
///
52+
/// 0 The SMC instruction is enabled at EL1, EL2, and EL3.
53+
/// 1 The SMC instruction is undefined at all exception levels. At EL1, in the Non-secure
54+
/// state, the HCR_EL2.TSC bit has priority over this control.
55+
SMD OFFSET(7) NUMBITS(1) [
56+
SmcEnabled = 0,
57+
SmcDisabled = 1
58+
],
59+
4160
/// Non-secure bit.
4261
/// * 0b0 Indicates that EL0 and EL1 are in Secure state.
4362
/// * 0b1 Indicates that Exception levels lower than EL3 are in Non-secure state,

src/regs/spsr_el3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use register::{cpu::RegisterReadWrite, register_bitfields};
1414

1515
register_bitfields! {u64,
16-
SPSR_EL3 [
16+
pub SPSR_EL3 [
1717
/// Negative condition flag.
1818
///
1919
/// Set to the value of the N condition flag on taking an exception to EL3, and copied to

0 commit comments

Comments
 (0)