diff options
Diffstat (limited to 'kernel.c')
-rw-r--r-- | kernel.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -1,6 +1,6 @@ #include "uart.h" -#include "psr.h" #include "strings.h" +#include "psr.h" #include "translation_table_descriptors.h" #include "cp_regs.h" @@ -43,14 +43,13 @@ void kernel_main(uint32_t r0, uint32_t r1, uint32_t atags) uart_puts(paging); - uint32_t CPSR; // get content of current program status register to check the current // processor mode - asm("mrs %0, cpsr" : "=r" (CPSR) :: "memory"); - + PSR_t CPSR = read_CPSR(); + char *mode_name; - switch(read_processor_mode()) + switch(CPSR.fields.PSR_MODE_4_0) { case MODE_USER : mode_name = "User (PL0)\r\n"; break; case MODE_FIQ : mode_name = "FIQ (PL1)\r\n"; break; |