Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Heinrich Schuchardt | e3cde3a | 2018-01-19 19:01:05 +0100 | [diff] [blame] | 2 | /* |
| 3 | * efi_selftest_miniapp_exit |
| 4 | * |
| 5 | * Copyright (c) 2018 Heinrich Schuchardt |
| 6 | * |
Heinrich Schuchardt | e3cde3a | 2018-01-19 19:01:05 +0100 | [diff] [blame] | 7 | * This EFI application is run by the StartImage selftest. |
| 8 | * It uses the Exit boot service to return. |
| 9 | */ |
| 10 | |
| 11 | #include <common.h> |
| 12 | #include <efi_api.h> |
| 13 | |
| 14 | /* |
| 15 | * Entry point of the EFI application. |
| 16 | * |
| 17 | * @handle handle of the loaded image |
| 18 | * @systable system table |
| 19 | * @return status code |
| 20 | */ |
| 21 | efi_status_t EFIAPI efi_main(efi_handle_t handle, |
| 22 | struct efi_system_table *systable) |
| 23 | { |
| 24 | struct efi_simple_text_output_protocol *con_out = systable->con_out; |
| 25 | |
Heinrich Schuchardt | 4795aa7 | 2018-01-21 20:30:57 +0000 | [diff] [blame] | 26 | con_out->output_string(con_out, L"EFI application calling Exit\n"); |
Heinrich Schuchardt | e3cde3a | 2018-01-19 19:01:05 +0100 | [diff] [blame] | 27 | |
| 28 | /* The return value is checked by the calling test */ |
| 29 | systable->boottime->exit(handle, EFI_UNSUPPORTED, 0, NULL); |
| 30 | |
| 31 | /* |
| 32 | * This statement should not be reached. |
| 33 | * To enable testing use a different return value. |
| 34 | */ |
| 35 | return EFI_SUCCESS; |
| 36 | } |