aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWojtek Kosior <kwojtus@protonmail.com>2019-12-31 18:59:17 +0100
committerWojtek Kosior <kwojtus@protonmail.com>2019-12-31 18:59:17 +0100
commit42636b818a2f8e1b14917e6060fc149f39987299 (patch)
tree21916685c95707b6f387eed3cd74aab7b5734435
parent0ec2016f80ffb5971362559b98b10744bb5bf893 (diff)
downloadrpi-MMU-example-42636b818a2f8e1b14917e6060fc149f39987299.tar.gz
rpi-MMU-example-42636b818a2f8e1b14917e6060fc149f39987299.zip
add cpsr-writing function
-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;