From 73a80de4228a498b483c8e10ab317920d978d507 Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Thu, 20 Jan 2022 23:22:42 -0700 Subject: Moved globals to file --- include/cpu.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'include/cpu.h') diff --git a/include/cpu.h b/include/cpu.h index eb2cdc0..68638a5 100644 --- a/include/cpu.h +++ b/include/cpu.h @@ -1,6 +1,8 @@ #ifndef CPU_H #define CPU_H +extern void _start(void); + static inline unsigned long getmode(void) { unsigned long mode; @@ -10,13 +12,7 @@ static inline unsigned long getmode(void) static inline void setsvc(void) { - unsigned long mode; - asm volatile ( - "mrs %0, cpsr\n" - "bic %0, %0, #0x1F\n" - "orr %0, %0, #0x13\n" - "msr cpsr_c, %0" - : "=r"(mode)); + asm volatile ( "cps #0x13" ); } static inline void setmode(unsigned long mode) -- cgit v1.2.1