]> Git Repo - J-u-boot.git/blame - lib/efi_selftest/efi_selftest_miniapp_exception.c
Merge tag 'u-boot-rockchip-20200522' of https://gitlab.denx.de/u-boot/custodians...
[J-u-boot.git] / lib / efi_selftest / efi_selftest_miniapp_exception.c
CommitLineData
53c70172
HS
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * efi_selftest_miniapp_return
4 *
5 * Copyright (c) 2019 Heinrich Schuchardt
6 *
7 * This EFI application triggers an exception.
8 */
9
10#include <common.h>
11#include <efi_api.h>
12
13/*
14 * Entry point of the EFI application.
15 *
16 * @handle handle of the loaded image
17 * @systable system table
18 * @return status code
19 */
20efi_status_t EFIAPI efi_main(efi_handle_t handle,
21 struct efi_system_table *systable)
22{
23 struct efi_simple_text_output_protocol *con_out = systable->con_out;
24
25 con_out->output_string(con_out,
26 L"EFI application triggers exception.\n");
27
28#if defined(CONFIG_ARM)
29 /*
30 * 0xe7f...f. is undefined in ARM mode
31 * 0xde.. is undefined in Thumb mode
32 */
33 asm volatile (".word 0xe7f7defb\n");
34#elif defined(CONFIG_RISCV)
35 asm volatile (".word 0xffffffff\n");
36#elif defined(CONFIG_X86)
37 asm volatile (".word 0xffff\n");
38#endif
39 con_out->output_string(con_out, L"Exception not triggered.\n");
40 return EFI_ABORTED;
41}
This page took 0.049854 seconds and 4 git commands to generate.