Changeset 113


Ignore:
Timestamp:
Mar 26, 2010, 12:55:18 PM (4 years ago)
Author:
stepan
Message:

use new libpayload HID mechanism to register reset handler for
USB and PS2 keyboard

Signed-off-by: Stefan Reinauer <stepan@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/filo/main/filo.c

    r107 r113  
    4646void relocate(void); 
    4747 
     48void filo_reset_handler(void) 
     49{ 
     50        void __attribute__((weak)) platform_reboot(void); 
     51 
     52        if (platform_reboot) 
     53                platform_reboot(); 
     54        else 
     55                printf("Rebooting not supported.\n"); 
     56 
     57} 
     58 
     59 
    4860static void init(void) 
    4961{ 
     62    /* Gather system information, and implicitly sets up timers */ 
     63    lib_get_sysinfo(); 
     64 
    5065    /* Set up the consoles. */ 
    5166    console_init(); 
    52  
    53     /* Gather system information, and implicitly sets up timers */ 
    54     lib_get_sysinfo(); 
    5567 
    5668    printf("%s version %s\n", program_name, program_version); 
     
    6981#endif 
    7082#endif 
    71  
    72  
     83#if defined(CONFIG_PC_KEYBOARD) || defined(CONFIG_USB_HID) 
     84    add_reset_handler(filo_reset_handler); 
     85#endif 
    7386#ifdef CONFIG_SUPPORT_SOUND 
    7487    sound_init(); 
     
    126139} 
    127140 
    128 void reset_handler(void) 
    129 { 
    130         void __attribute__((weak)) platform_reboot(void); 
    131  
    132         if (platform_reboot) 
    133                 platform_reboot(); 
    134         else 
    135                 printf("Rebooting not supported.\n"); 
    136  
    137 } 
    138  
    139141#if CONFIG_USE_GRUB 
    140142/* The main routine */ 
     
    146148    /* Initialize */ 
    147149    init(); 
    148 #ifdef CONFIG_PC_KEYBOARD 
    149     keyboard_add_reset_handler(reset_handler); 
    150 #endif 
    151150    grub_menulst(); 
    152151    grub_main(); 
Note: See TracChangeset for help on using the changeset viewer.