# HG changeset patch # User Paul Boddie # Date 1456588943 -3600 # Node ID 06fedf889745d7fcae57bd718f575485c4cbf02d # Parent bbc1b33982e05be2cc4ac7b2068ecd41bf49938f Fixed absent EPC initialisation. diff -r bbc1b33982e0 -r 06fedf889745 stage2/cpu.c --- a/stage2/cpu.c Sat Feb 27 16:59:27 2016 +0100 +++ b/stage2/cpu.c Sat Feb 27 17:02:23 2016 +0100 @@ -153,9 +153,10 @@ asm volatile( "subu %1, %1, 0x80000000\n" /* obtain user mode addresses */ "subu %2, %2, 0x80000000\n" - "sw %2, -100(%0)\n" /* store the function address */ + "sw %2, -100(%0)\n" /* store the function address as t9 */ "sw %1, -104(%0)\n" /* store the global pointer */ - "sw %2, -112(%0)\n" /* store the function address */ + "sw %2, -112(%0)\n" /* store the function address as ra (for invoke_task) */ + "sw %2, -116(%0)\n" /* store the function address as EPC (for the handler) */ : : "r" (top), "r" (got), "r" (function) );