efi_selftest_miniapp_exit.c 882 B

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