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