Author: stepan Date: Fri Mar 26 12:55:18 2010 New Revision: 113 URL: http://tracker.coreboot.org/trac/filo/changeset/113
Log: use new libpayload HID mechanism to register reset handler for USB and PS2 keyboard
Signed-off-by: Stefan Reinauer stepan@coresystems.de
Modified: trunk/filo/main/filo.c
Modified: trunk/filo/main/filo.c ============================================================================== --- trunk/filo/main/filo.c Fri Mar 26 12:51:57 2010 (r112) +++ trunk/filo/main/filo.c Fri Mar 26 12:55:18 2010 (r113) @@ -45,14 +45,26 @@
void relocate(void);
-static void init(void) +void filo_reset_handler(void) { - /* Set up the consoles. */ - console_init(); + void __attribute__((weak)) platform_reboot(void); + + if (platform_reboot) + platform_reboot(); + else + printf("Rebooting not supported.\n"); + +} +
+static void init(void) +{ /* Gather system information, and implicitly sets up timers */ lib_get_sysinfo();
+ /* Set up the consoles. */ + console_init(); + printf("%s version %s\n", program_name, program_version); collect_sys_info(&sys_info); relocate(); @@ -68,8 +80,9 @@ printf("No USB stack in libpayload.\n"); #endif #endif - - +#if defined(CONFIG_PC_KEYBOARD) || defined(CONFIG_USB_HID) + add_reset_handler(filo_reset_handler); +#endif #ifdef CONFIG_SUPPORT_SOUND sound_init(); #endif @@ -125,17 +138,6 @@ return ret; }
-void reset_handler(void) -{ - void __attribute__((weak)) platform_reboot(void); - - if (platform_reboot) - platform_reboot(); - else - printf("Rebooting not supported.\n"); - -} - #if CONFIG_USE_GRUB /* The main routine */ int main(void) @@ -145,9 +147,6 @@
/* Initialize */ init(); -#ifdef CONFIG_PC_KEYBOARD - keyboard_add_reset_handler(reset_handler); -#endif grub_menulst(); grub_main(); return 0;