From aa8d179b2df2ce031a84172a70be88697dfda7c4 Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Thu, 6 Jan 2022 23:20:04 -0800 Subject: Rewrote scheduler in Assembly --- include/sys/core.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include/sys/core.h') diff --git a/include/sys/core.h b/include/sys/core.h index 361ffb1..eb1f1e6 100644 --- a/include/sys/core.h +++ b/include/sys/core.h @@ -21,6 +21,20 @@ static inline void delay(unsigned long cycles) : "=r"(cycles): [cycles]"0"(cycles) : "cc"); } +static inline void* getlr(void) +{ + void* out; + asm volatile ("mov %0, lr" : "=r"(out)); + return out; +} + +static inline void* getpc(void) +{ + void* out; + asm volatile ("mov %0, pc" : "=r"(out)); + return out; +} + static inline void* getsp(void) { void* out; -- cgit v1.2.1