aboutsummaryrefslogtreecommitdiff
path: root/pk/pk.S
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@eecs.berkeley.edu>2014-01-13 16:29:53 -0800
committerAndrew Waterman <waterman@eecs.berkeley.edu>2014-01-13 16:29:53 -0800
commitb71e8ecfda6a75d4bcf240e61dbc3348e76af094 (patch)
tree7e50ac271e16414388e15e8a55e4312a2fbc008e /pk/pk.S
parent5cd583648dfcb1e36a0054efc910435293d216e3 (diff)
downloadpk-b71e8ecfda6a75d4bcf240e61dbc3348e76af094.zip
pk-b71e8ecfda6a75d4bcf240e61dbc3348e76af094.tar.gz
pk-b71e8ecfda6a75d4bcf240e61dbc3348e76af094.tar.bz2
Assume pc-relative addressing
Diffstat (limited to 'pk/pk.S')
-rw-r--r--pk/pk.S14
1 files changed, 7 insertions, 7 deletions
diff --git a/pk/pk.S b/pk/pk.S
index 9d6e93d..0273eca 100644
--- a/pk/pk.S
+++ b/pk/pk.S
@@ -8,6 +8,7 @@ _start:
la sp, stack_top
la a0, trap_entry
+ la gp, _gp
csrw evec, a0
li a0, SR_S | SR_PS | SR_EI | SR_S64
@@ -17,12 +18,11 @@ _start:
csrw status, a0
and a2, a1, SR_EF
- lui a0, %hi(have_fp)
- sw a2, %lo(have_fp)(a0)
+ auipc a0, %pcrel_hi(have_fp)
+ sw a2, %lo(have_fp)(a0)
- and a2, a1, SR_EA
- lui a0, %hi(have_accelerator)
- sw a2, %lo(have_accelerator)(a0)
+ and a2, a1, SR_EA
+ auipc a0, %pcrel_hi(have_accelerator)
+ sw a2, %lo(have_accelerator)(a0)
- lui a0, %hi(boot)
- jr a0, %lo(boot)
+ call boot