1.1 --- a/stage2/cpu.c Sat Feb 27 16:59:27 2016 +0100
1.2 +++ b/stage2/cpu.c Sat Feb 27 17:02:23 2016 +0100
1.3 @@ -153,9 +153,10 @@
1.4 asm volatile(
1.5 "subu %1, %1, 0x80000000\n" /* obtain user mode addresses */
1.6 "subu %2, %2, 0x80000000\n"
1.7 - "sw %2, -100(%0)\n" /* store the function address */
1.8 + "sw %2, -100(%0)\n" /* store the function address as t9 */
1.9 "sw %1, -104(%0)\n" /* store the global pointer */
1.10 - "sw %2, -112(%0)\n" /* store the function address */
1.11 + "sw %2, -112(%0)\n" /* store the function address as ra (for invoke_task) */
1.12 + "sw %2, -116(%0)\n" /* store the function address as EPC (for the handler) */
1.13 :
1.14 : "r" (top), "r" (got), "r" (function)
1.15 );