From f06d29ca9da724866ae99ee2225d53f382d32bcd Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Wed, 25 Nov 2020 12:23:11 -0700 Subject: Add priv.h/c to allow switching to user mode. Change some things with the MPU in main() to actually work. --- include/kern/priv.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 include/kern/priv.h (limited to 'include/kern/priv.h') diff --git a/include/kern/priv.h b/include/kern/priv.h new file mode 100644 index 0000000..8940b23 --- /dev/null +++ b/include/kern/priv.h @@ -0,0 +1,14 @@ +#ifndef _KERN_PRIV_H_ +#define _KERN_PRIV_H_ + +#include "kern/common.h" + +uint32_t get_control_register(); + +void set_control_register(uint32_t reg); + +/* Enters user mode from privilieged mode. */ +void enter_user_mode(); + + +#endif /* _KERN_PRIV_H_ */ -- cgit