summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2014-01-03 08:45:57 +0100
committerMarcin Bukat <marcin.bukat@gmail.com>2014-01-03 09:00:11 +0100
commit062801e3ed560418264a0fc7954a2008102a4713 (patch)
tree4e65ed20244a6901aa6c14234ab0e19ac1ffd4d8
parent9dbdec14f080456ff3eaeb619f321e4e34aa8a0e (diff)
downloadrockbox-062801e.tar.gz
rockbox-062801e.tar.bz2
rockbox-062801e.zip
atj213x: obtain PC value in more elegant way
Change-Id: I2e6ffb3b58ddda0ea62ce5d4cd71ac5475b34495
-rw-r--r--utils/atj2137/adfuload/test_binary/backlight_c/crt0.S13
1 files changed, 6 insertions, 7 deletions
diff --git a/utils/atj2137/adfuload/test_binary/backlight_c/crt0.S b/utils/atj2137/adfuload/test_binary/backlight_c/crt0.S
index e3817fcfb7..e03b8b5439 100644
--- a/utils/atj2137/adfuload/test_binary/backlight_c/crt0.S
+++ b/utils/atj2137/adfuload/test_binary/backlight_c/crt0.S
@@ -11,9 +11,13 @@
start:
di # disable interrupts
- bal get_pc # v0 = PC + 8 actually
+ bltzal zero, load_addr # ra = PC + 8, branch not taken
nop
- addiu v0, -12 # calc real load address
+
+load_addr:
+ addiu v0, ra, -12 # calc real load address
+ # account for branch delay slot
+ # and very first 'di' instruction
la t0, relocstart
la t1, relocend
beq t0, v0, entry_point # no relocation needed
@@ -31,11 +35,6 @@ entry_point_jump:
jr t0
nop
-get_pc:
- move v0, ra
- jr ra
- nop
-
entry_point:
# setup caches
# 4-way, 256 sets, 16 bytes cacheline I/D