efi_loader: validate load option
[oweals/u-boot.git] / lib / efi_selftest / efi_selftest_miniapp_return.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * efi_selftest_miniapp_return
4  *
5  * Copyright (c) 2018 Heinrich Schuchardt
6  *
7  * This EFI application is run by the StartImage selftest.
8  * It returns directly without calling the Exit boot service.
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
26         con_out->output_string(con_out,
27                                L"EFI application returning w/o calling Exit\n");
28
29         /* The return value is checked by the calling test */
30         return EFI_INCOMPATIBLE_VERSION;
31 }