From 42636b818a2f8e1b14917e6060fc149f39987299 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Tue, 31 Dec 2019 18:59:17 +0100 Subject: add cpsr-writing function --- psr.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'psr.h') 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; -- cgit v1.2.3