summaryrefslogtreecommitdiff
path: root/bootloader/x1000.c
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-03-03 20:03:12 +0000
committerAidan MacDonald <amachronic@protonmail.com>2022-03-11 11:15:56 -0500
commit35242c8d98566da64f0f5210e0f580e7bcdb0365 (patch)
tree314df9f89199421e5945a7a5918829523131c556 /bootloader/x1000.c
parent428491df697e0a87eb14512151b3ce969dae8c54 (diff)
downloadrockbox-35242c8d98566da64f0f5210e0f580e7bcdb0365.tar.gz
rockbox-35242c8d98566da64f0f5210e0f580e7bcdb0365.zip
x1000: support new binary header in bootloader
Change-Id: I89754215139ec027bb122759f5b54400f544d3c1
Diffstat (limited to 'bootloader/x1000.c')
-rw-r--r--bootloader/x1000.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/bootloader/x1000.c b/bootloader/x1000.c
index 675a1c1840..bce7b69784 100644
--- a/bootloader/x1000.c
+++ b/bootloader/x1000.c
@@ -137,11 +137,6 @@ const struct menuitem recovery_items[] = {
137 {MENUITEM_ACTION, "Restore", &bootloader_restore}, 137 {MENUITEM_ACTION, "Restore", &bootloader_restore},
138}; 138};
139 139
140/* Final load address of rockbox binary.
141 * NOTE: this is really the load address of the bootloader... it relies
142 * on the fact that bootloader and app are linked at the same address. */
143extern unsigned char loadaddress[];
144
145/* Temp buffer to contain the binary in memory */ 140/* Temp buffer to contain the binary in memory */
146extern unsigned char loadbuffer[]; 141extern unsigned char loadbuffer[];
147extern unsigned char loadbufferend[]; 142extern unsigned char loadbufferend[];
@@ -156,20 +151,6 @@ bool disk_inited = false;
156 * Set to false if a SYS_USB_DISCONNECTED event is seen */ 151 * Set to false if a SYS_USB_DISCONNECTED event is seen */
157bool is_usb_connected = false; 152bool is_usb_connected = false;
158 153
159/* Jump to loaded binary */
160void exec(void* dst, const void* src, size_t bytes)
161 __attribute__((noinline, noreturn, section(".icode")));
162
163void exec(void* dst, const void* src, size_t bytes)
164{
165 memcpy(dst, src, bytes);
166 commit_discard_idcache();
167
168 typedef void(*entry_fn)(void) __attribute__((noreturn));
169 entry_fn fn = (entry_fn)dst;
170 fn();
171}
172
173void clearscreen(void) 154void clearscreen(void)
174{ 155{
175 init_lcd(); 156 init_lcd();
@@ -368,8 +349,7 @@ void boot_rockbox(void)
368 if(lcd_inited) 349 if(lcd_inited)
369 backlight_hw_off(); 350 backlight_hw_off();
370 351
371 disable_irq(); 352 x1000_boot_rockbox(loadbuffer, rc);
372 exec(loadaddress, loadbuffer, rc);
373} 353}
374 354
375void usb_mode(void) 355void usb_mode(void)