aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--psr.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/psr.h b/psr.h
index b2adafb..5efc6d9 100644
--- a/psr.h
+++ b/psr.h
@@ -64,6 +64,12 @@ inline static PSR_t read_CPSR(void)
return CPSR;
}
+inline static void write_CPSR(PSR_t CPSR)
+{
+ // set content of current program status register
+ asm("msr cpsr, %0" :: "r" (CPSR.raw) : "memory");
+}
+
inline static PSR_t read_SPSR(void)
{
PSR_t SPSR;