aboutsummaryrefslogtreecommitdiffstats
path: root/src/arch/arm64/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/arm64/include')
-rw-r--r--src/arch/arm64/include/arch/startup.h4
-rw-r--r--src/arch/arm64/include/armv8/arch/lib_helpers.h10
2 files changed, 13 insertions, 1 deletions
diff --git a/src/arch/arm64/include/arch/startup.h b/src/arch/arm64/include/arch/startup.h
index 671c13e4c..6e55190e8 100644
--- a/src/arch/arm64/include/arch/startup.h
+++ b/src/arch/arm64/include/arch/startup.h
@@ -30,8 +30,10 @@
#define SCR_INDEX 3
#define VBAR_INDEX 4
#define CNTFRQ_INDEX 5
+#define CPTR_INDEX 6
+#define CPACR_INDEX 7
/* IMPORTANT!!! If any new element is added please update NUM_ELEMENTS */
-#define NUM_ELEMENTS 6
+#define NUM_ELEMENTS 8
#ifndef __ASSEMBLY__
diff --git a/src/arch/arm64/include/armv8/arch/lib_helpers.h b/src/arch/arm64/include/armv8/arch/lib_helpers.h
index bb7300f2b..315a0c0b0 100644
--- a/src/arch/arm64/include/armv8/arch/lib_helpers.h
+++ b/src/arch/arm64/include/armv8/arch/lib_helpers.h
@@ -261,6 +261,16 @@
402:
.endm
+/* Macro to read from an el1 register */
+.macro read_el1 xreg sysreg
+ mrs \xreg, \sysreg\()_el1
+.endm
+
+/* Macro to write to an el1 register */
+.macro write_el1 sysreg xreg temp
+ msr \sysreg\()_el1, \xreg
+.endm
+
/* Macro to read from an el0 register */
.macro read_el0 xreg sysreg
mrs \xreg, \sysreg\()_el0