From e2fcbd04ea8a9334b6c961a2f19933d8b9d675d4 Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Sat, 5 Mar 2022 09:23:54 +0000 Subject: x1000: bootloader: split off rockbox boot code Change-Id: Ie3a097b24ee96551f6c3d08938dcb83f59ba1073 --- bootloader/x1000.c | 42 ------------------------------------------ 1 file changed, 42 deletions(-) (limited to 'bootloader/x1000.c') 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); void recovery_menu(void) __attribute__((noreturn)); -void boot_rockbox(void); void usb_mode(void); -void shutdown(void); -void reboot(void); /* Defines the recovery menu contents */ const struct menuitem recovery_items[] = { @@ -212,31 +209,6 @@ void recovery_menu(void) } } -void boot_rockbox(void) -{ - if(init_disk() != 0) - return; - - size_t max_size = 0; - int handle = core_alloc_maximum("rockbox", &max_size, &buflib_ops_locked); - if(handle < 0) { - splash(5*HZ, "Out of memory"); - return; - } - - unsigned char* loadbuffer = core_get_data(handle); - int rc = load_firmware(loadbuffer, BOOTFILE, max_size); - if(rc <= 0) { - core_free(handle); - splash2(5*HZ, "Error loading Rockbox", loader_strerror(rc)); - return; - } - - gui_shutdown(); - - x1000_boot_rockbox(loadbuffer, rc); -} - void usb_mode(void) { init_usb(); @@ -257,20 +229,6 @@ void usb_mode(void) splash(3*HZ, "USB disconnected"); } -void shutdown(void) -{ - splash(HZ, "Shutting down"); - power_off(); - while(1); -} - -void reboot(void) -{ - splash(HZ, "Rebooting"); - system_reboot(); - while(1); -} - void main(void) { system_init(); -- cgit v1.2.3