diff options
author | Clifford Wolf <clifford@clifford.at> | 2015-06-28 20:52:52 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2015-06-28 20:52:52 +0200 |
commit | e5e5494ca2a23ff2ae627fbb838ee564888e381d (patch) | |
tree | 17f00f7f5c159041c70009f8a0cac5144f2248ce /firmware | |
parent | 21157b8f1dca8f27de0a14cfa852d7a51183fb56 (diff) | |
download | picorv32-e5e5494ca2a23ff2ae627fbb838ee564888e381d.tar.gz picorv32-e5e5494ca2a23ff2ae627fbb838ee564888e381d.zip |
Improved start.S IRQ code
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/start.S | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/firmware/start.S b/firmware/start.S index ed88be2..c5e1901 100644 --- a/firmware/start.S +++ b/firmware/start.S @@ -91,15 +91,15 @@ irq_vec: addi a0, a0, %lo(irq_regs) // arg1 = interrupt type - getq x11, q1 + getq a1, q1 // call to C function jal ra, irq /* restore registers */ - lui x1, %hi(irq_regs) - addi x1, x1, %lo(irq_regs) + // new irq_regs address returned from C code in a0 + addi x1, a0, 0 lw x2, 0*4(x1) setq q0, x2 @@ -261,6 +261,11 @@ start: /* set stack pointer */ lui sp,(64*1024)>>12 + /* set gp and tp */ + lui gp, %hi(0xdeadbeef) + addi gp, gp, %lo(0xdeadbeef) + addi tp, gp, 0 + #ifdef ENABLE_SIEVE /* call sieve C code */ jal ra,sieve |