9
0
Fork 0

efi: add proper reset hook

This allows to actually reset the system from barebox
instead of dropping back into the EFI firmware.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Lucas Stach 2014-12-08 14:42:29 +01:00 committed by Sascha Hauer
parent da94ff1e37
commit e4f3215be2
2 changed files with 8 additions and 5 deletions

View File

@ -248,7 +248,7 @@ console_initcall(efi_console_init);
void reset_cpu(unsigned long addr) void reset_cpu(unsigned long addr)
{ {
BS->exit(efi_parent_image, EFI_SUCCESS, 0, NULL); RT->reset_system(EFI_RESET_WARM, EFI_SUCCESS, 0, NULL);
while(1); while(1);
} }

View File

@ -255,9 +255,11 @@ extern efi_boot_services_t *BS;
/* /*
* Types and defines for EFI ResetSystem * Types and defines for EFI ResetSystem
*/ */
#define EFI_RESET_COLD 0 typedef enum {
#define EFI_RESET_WARM 1 EFI_RESET_COLD = 0,
#define EFI_RESET_SHUTDOWN 2 EFI_RESET_WARM = 1,
EFI_RESET_SHUTDOWN = 2
} efi_reset_type_t;
/* /*
* EFI Runtime Services table * EFI Runtime Services table
@ -279,7 +281,8 @@ typedef struct {
s16 *variable_name, efi_guid_t *vendor); s16 *variable_name, efi_guid_t *vendor);
void *set_variable; void *set_variable;
void *get_next_high_mono_count; void *get_next_high_mono_count;
void *reset_system; void (EFIAPI *reset_system)(efi_reset_type_t reset_type, efi_status_t reset_status,
unsigned long data_size, void *reset_data);
void *update_capsule; void *update_capsule;
void *query_capsule_caps; void *query_capsule_caps;
void *query_variable_info; void *query_variable_info;