56 setpcr t0, status, SR_EV
58 ## if that didn't stick, we don't have an FPU, so don't initialize it
97 lui a0, %hi(trap_entry)
98 add a0, a0, %lo(trap_entry)
102 add a0, a0, %lo(main)
105 # only allow core 0 to proceed
111 # jmp to main as a user program
117 trap_entry: # only check for SYS_exit, otherwise crash out
118 li a3, 1337 # magic "bad things" happened error code
120 li a2, 6 # syscall exception number
121 bne a1, a2, exit_error
123 li a1, 93 # SYS_exit number
124 bne v0, a1, exit_error
125 li a1, 1 # successful exit code
127 bne a3, a1, exit_error
128 mtpcr a1, tohost # exit successfully (tohost == 1)