summaryrefslogtreecommitdiff
path: root/firmware/descramble.S
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-11-28 22:42:38 +0000
committerJens Arnold <amiconn@rockbox.org>2005-11-28 22:42:38 +0000
commit4d66fc8dc248e4169a5d1aa5bdc80c85dabbcee1 (patch)
tree9456f9bb076dd0df50e3ff170e321ec993301ef3 /firmware/descramble.S
parent27c658c8a655ebe4f8160c24486867aca2900754 (diff)
downloadrockbox-4d66fc8dc248e4169a5d1aa5bdc80c85dabbcee1.tar.gz
rockbox-4d66fc8dc248e4169a5d1aa5bdc80c85dabbcee1.zip
Fixed two more than 3 years old bugs in RoLo: (1) Read start address from image instead of using hard coded loadaddress+0x200. (2) Set desired stack pointer. The stack pointer used to remain wherever it was when invoking RoLo...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8100 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/descramble.S')
-rw-r--r--firmware/descramble.S10
1 files changed, 3 insertions, 7 deletions
diff --git a/firmware/descramble.S b/firmware/descramble.S
index 34e4d830c8..70b133460f 100644
--- a/firmware/descramble.S
+++ b/firmware/descramble.S
@@ -104,8 +104,6 @@ _rolo_restart:
104 sub r4,r0 /* r0 = dest - source */ 104 sub r4,r0 /* r0 = dest - source */
105 add #-4,r0 /* adjust for early increment */ 105 add #-4,r0 /* adjust for early increment */
106 add r4,r6 /* r6 = source + len */ 106 add r4,r6 /* r6 = source + len */
107 mov.w .offset,r1
108 add r1,r5 /* start_func() */
109 107
110.copy: /* loop takes 6 cycles per longword */ 108.copy: /* loop takes 6 cycles per longword */
111 mov.l @r4+,r1 109 mov.l @r4+,r1
@@ -113,11 +111,9 @@ _rolo_restart:
113 mov.l r1,@(r0,r4) 111 mov.l r1,@(r0,r4)
114 bt .copy 112 bt .copy
115 113
116 jmp @r5 114 mov.l @r5+,r0 /* start address from image */
117 nop 115 jmp @r0
118 116 mov.l @r5+,r15 /* stack pointer from image */
119.offset:
120 .word 0x200
121 117
122.end: 118.end:
123 .size _descramble,.end-_descramble 119 .size _descramble,.end-_descramble