stage2/cpu.c | raw changeset files shortlog | stage2-non-pic |
1.1 --- a/stage2/cpu.c Mon Feb 22 23:23:52 2016 +0100 1.2 +++ b/stage2/cpu.c Tue Feb 23 15:31:58 2016 +0100 1.3 @@ -87,6 +87,16 @@ 1.4 "nop\n"); 1.5 } 1.6 1.7 +void enter_user_mode(void) 1.8 +{ 1.9 + asm volatile( 1.10 + "mfc0 $t3, $12\n" /* CP0_STATUS */ 1.11 + "li $t4, 0xffffffef\n" /* KSU = 2 (UM = 1) */ 1.12 + "and $t3, $t3, $t4\n" 1.13 + "mtc0 $t3, $12\n" 1.14 + "nop\n"); 1.15 +} 1.16 + 1.17 void enable_interrupts(void) 1.18 { 1.19 asm volatile(