aboutsummaryrefslogtreecommitdiff
path: root/pk/entry.S
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@s144.Millennium.Berkeley.EDU>2010-11-02 16:00:37 -0700
committerAndrew Waterman <waterman@s144.Millennium.Berkeley.EDU>2010-11-21 16:54:33 -0800
commit4daccfc1cf46ee25b73bc39dcc89844d696c6ec9 (patch)
treedc1733b8fa81b204a71c411a4df90b6cffe76a0f /pk/entry.S
parent664411d5e692b487409dfb1c2ede9e214dd15602 (diff)
downloadriscv-pk-4daccfc1cf46ee25b73bc39dcc89844d696c6ec9.zip
riscv-pk-4daccfc1cf46ee25b73bc39dcc89844d696c6ec9.tar.gz
riscv-pk-4daccfc1cf46ee25b73bc39dcc89844d696c6ec9.tar.bz2
[xcc, sim, pk] link register is now x1
Diffstat (limited to 'pk/entry.S')
-rw-r--r--pk/entry.S99
1 files changed, 50 insertions, 49 deletions
diff --git a/pk/entry.S b/pk/entry.S
index 628ecd5..15cb871 100644
--- a/pk/entry.S
+++ b/pk/entry.S
@@ -15,56 +15,57 @@
save_tf: # write the trap frame onto the stack
# save gprs
- STORE $x2,2*REGBYTES($x1)
- mfpcr $x2,ASM_CR(PCR_K1)
- STORE $x2,1*REGBYTES($x1) # $x1 is actually in $PCR_K1
- STORE $x3,3*REGBYTES($x1)
- STORE $x4,4*REGBYTES($x1)
- STORE $x5,5*REGBYTES($x1)
- STORE $x6,6*REGBYTES($x1)
- STORE $x7,7*REGBYTES($x1)
- STORE $x8,8*REGBYTES($x1)
- STORE $x9,9*REGBYTES($x1)
- STORE $x10,10*REGBYTES($x1)
- STORE $x11,11*REGBYTES($x1)
- STORE $x12,12*REGBYTES($x1)
- STORE $x13,13*REGBYTES($x1)
- STORE $x14,14*REGBYTES($x1)
- STORE $x15,15*REGBYTES($x1)
- STORE $x16,16*REGBYTES($x1)
- STORE $x17,17*REGBYTES($x1)
- STORE $x18,18*REGBYTES($x1)
- STORE $x19,19*REGBYTES($x1)
- STORE $x20,20*REGBYTES($x1)
- STORE $x21,21*REGBYTES($x1)
- STORE $x22,22*REGBYTES($x1)
- STORE $x23,23*REGBYTES($x1)
- STORE $x24,24*REGBYTES($x1)
- STORE $x25,25*REGBYTES($x1)
- STORE $x26,26*REGBYTES($x1)
- STORE $x27,27*REGBYTES($x1)
- STORE $x28,28*REGBYTES($x1)
- STORE $x29,29*REGBYTES($x1)
- STORE $x30,30*REGBYTES($x1)
- mfpcr $x2,ASM_CR(PCR_K0)
- STORE $x2,31*REGBYTES($x1) # $ra is actually in $PCR_K0
+ STORE $x3,3*REGBYTES($x2)
+ STORE $x4,4*REGBYTES($x2)
+ STORE $x5,5*REGBYTES($x2)
+ STORE $x6,6*REGBYTES($x2)
+ STORE $x7,7*REGBYTES($x2)
+ STORE $x8,8*REGBYTES($x2)
+ STORE $x9,9*REGBYTES($x2)
+ STORE $x10,10*REGBYTES($x2)
+ STORE $x11,11*REGBYTES($x2)
+ STORE $x12,12*REGBYTES($x2)
+ STORE $x13,13*REGBYTES($x2)
+ STORE $x14,14*REGBYTES($x2)
+ STORE $x15,15*REGBYTES($x2)
+ STORE $x16,16*REGBYTES($x2)
+ STORE $x17,17*REGBYTES($x2)
+ STORE $x18,18*REGBYTES($x2)
+ STORE $x19,19*REGBYTES($x2)
+ STORE $x20,20*REGBYTES($x2)
+ STORE $x21,21*REGBYTES($x2)
+ STORE $x22,22*REGBYTES($x2)
+ STORE $x23,23*REGBYTES($x2)
+ STORE $x24,24*REGBYTES($x2)
+ STORE $x25,25*REGBYTES($x2)
+ STORE $x26,26*REGBYTES($x2)
+ STORE $x27,27*REGBYTES($x2)
+ STORE $x28,28*REGBYTES($x2)
+ STORE $x29,29*REGBYTES($x2)
+ STORE $x30,30*REGBYTES($x2)
+ STORE $x31,31*REGBYTES($x2)
+
+ mfpcr $x3,ASM_CR(PCR_K0)
+ STORE $x3,1*REGBYTES($x2) # $x1 is in $PCR_K0
+ mfpcr $x3,ASM_CR(PCR_K1)
+ STORE $x3,2*REGBYTES($x2) # $x2 is in $PCR_K1
# get sr, epc, badvaddr, cause
- mfpcr $x2,ASM_CR(PCR_SR) # sr
- STORE $x2,32*REGBYTES($x1)
- mfpcr $x3,ASM_CR(PCR_EPC) # epc
- STORE $x3,33*REGBYTES($x1)
- mfpcr $x2,ASM_CR(PCR_BADVADDR) # badvaddr
- STORE $x2,34*REGBYTES($x1)
- mfpcr $x2,ASM_CR(PCR_CAUSE) # cause
- STORE $x2,35*REGBYTES($x1)
+ mfpcr $x3,ASM_CR(PCR_SR) # sr
+ STORE $x3,32*REGBYTES($x2)
+ mfpcr $x4,ASM_CR(PCR_EPC) # epc
+ STORE $x4,33*REGBYTES($x2)
+ mfpcr $x3,ASM_CR(PCR_BADVADDR) # badvaddr
+ STORE $x3,34*REGBYTES($x2)
+ mfpcr $x3,ASM_CR(PCR_CAUSE) # cause
+ STORE $x3,35*REGBYTES($x2)
# get insn
- and $x3,$x3,~3
- lw $x2,0($x3)
- STORE $x2, 36*REGBYTES($x1)
+ and $x4,$x4,~3
+ lw $x3,0($x4)
+ STORE $x3, 36*REGBYTES($x2)
- jr $ra
+ ret
.end save_tf
.globl pop_tf
@@ -121,11 +122,11 @@ pop_tf: # write the trap frame onto the stack
.ent trap_entry
trap_entry:
mtpcr $ra,ASM_CR(PCR_K0)
- mtpcr $x1,ASM_CR(PCR_K1)
- law $x1,stack_top-320
+ mtpcr $x2,ASM_CR(PCR_K1)
+ law $x2,stack_top-320
jal save_tf
- move $sp,$x1
- move $a0,$x1
+ move $sp,$x2
+ move $a0,$x2
ei
jal handle_trap
unimp