summaryrefslogtreecommitdiff
path: root/bootloader/x1000.c
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-03-05 09:23:54 +0000
committerAidan MacDonald <amachronic@protonmail.com>2022-03-12 18:25:10 +0000
commite2fcbd04ea8a9334b6c961a2f19933d8b9d675d4 (patch)
tree38c1c1b530bfed49263c89dc398f416ea0886982 /bootloader/x1000.c
parent22cf852db1a37349061a665ea5b7a45bb1b2c2a7 (diff)
downloadrockbox-e2fcbd04ea8a9334b6c961a2f19933d8b9d675d4.tar.gz
rockbox-e2fcbd04ea8a9334b6c961a2f19933d8b9d675d4.zip
x1000: bootloader: split off rockbox boot code
Change-Id: Ie3a097b24ee96551f6c3d08938dcb83f59ba1073
Diffstat (limited to 'bootloader/x1000.c')
-rw-r--r--bootloader/x1000.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/bootloader/x1000.c b/bootloader/x1000.c
index 72a02188c3..c57ddfff4e 100644
--- a/bootloader/x1000.c
+++ b/bootloader/x1000.c
@@ -73,10 +73,7 @@ int init_disk(void);
73 73
74void recovery_menu(void) __attribute__((noreturn)); 74void recovery_menu(void) __attribute__((noreturn));
75 75
76void boot_rockbox(void);
77void usb_mode(void); 76void usb_mode(void);
78void shutdown(void);
79void reboot(void);
80 77
81/* Defines the recovery menu contents */ 78/* Defines the recovery menu contents */
82const struct menuitem recovery_items[] = { 79const struct menuitem recovery_items[] = {
@@ -212,31 +209,6 @@ void recovery_menu(void)
212 } 209 }
213} 210}
214 211
215void boot_rockbox(void)
216{
217 if(init_disk() != 0)
218 return;
219
220 size_t max_size = 0;
221 int handle = core_alloc_maximum("rockbox", &max_size, &buflib_ops_locked);
222 if(handle < 0) {
223 splash(5*HZ, "Out of memory");
224 return;
225 }
226
227 unsigned char* loadbuffer = core_get_data(handle);
228 int rc = load_firmware(loadbuffer, BOOTFILE, max_size);
229 if(rc <= 0) {
230 core_free(handle);
231 splash2(5*HZ, "Error loading Rockbox", loader_strerror(rc));
232 return;
233 }
234
235 gui_shutdown();
236
237 x1000_boot_rockbox(loadbuffer, rc);
238}
239
240void usb_mode(void) 212void usb_mode(void)
241{ 213{
242 init_usb(); 214 init_usb();
@@ -257,20 +229,6 @@ void usb_mode(void)
257 splash(3*HZ, "USB disconnected"); 229 splash(3*HZ, "USB disconnected");
258} 230}
259 231
260void shutdown(void)
261{
262 splash(HZ, "Shutting down");
263 power_off();
264 while(1);
265}
266
267void reboot(void)
268{
269 splash(HZ, "Rebooting");
270 system_reboot();
271 while(1);
272}
273
274void main(void) 232void main(void)
275{ 233{
276 system_init(); 234 system_init();