1 // SPDX-License-Identifier: GPL-2.0+
5 * Copyright (c) 2020 Heinrich Schuchardt <xypron.glpk@gmx.de>
7 * This test checks the following service at boot time or runtime:
11 #include <efi_selftest.h>
13 static struct efi_runtime_services *runtime;
18 * @handle: handle of the loaded image
19 * @systable: system table
20 * @return: EFI_ST_SUCCESS for success
22 static int setup(const efi_handle_t handle,
23 const struct efi_system_table *systable)
25 runtime = systable->runtime;
26 return EFI_ST_SUCCESS;
32 * @return: EFI_ST_SUCCESS for success
34 static int execute(void)
36 u16 reset_data[] = L"Reset by selftest";
38 runtime->reset_system(EFI_RESET_COLD, EFI_SUCCESS,
39 sizeof(reset_data), reset_data);
40 efi_st_error("Reset failed.\n");
41 return EFI_ST_FAILURE;
44 EFI_UNIT_TEST(reset) = {
45 .name = "reset system",
46 .phase = EFI_EXECUTE_BEFORE_BOOTTIME_EXIT,
52 EFI_UNIT_TEST(resetrt) = {
53 .name = "reset system runtime",
54 .phase = EFI_SETUP_BEFORE_BOOTTIME_EXIT,