efi_selftest_miniapp_exit.c 889 B

12345678910111213141516171819202122232425262728293031323334353637
  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. #include <common.h>
  12. #include <efi_api.h>
  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. */
  20. efi_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. con_out->output_string(con_out, L"EFI application calling Exit\n");
  25. /* The return value is checked by the calling test */
  26. systable->boottime->exit(handle, EFI_UNSUPPORTED, 0, NULL);
  27. /*
  28. * This statement should not be reached.
  29. * To enable testing use a different return value.
  30. */
  31. return EFI_SUCCESS;
  32. }