2015-05-14 19:20:51 +03:00
|
|
|
|
|
|
|
#include <efi.h>
|
|
|
|
#include <efilib.h>
|
2019-05-15 06:32:21 +03:00
|
|
|
#include <efisetjmp.h>
|
2015-05-14 19:20:51 +03:00
|
|
|
|
|
|
|
EFI_STATUS
|
|
|
|
efi_main(
|
|
|
|
EFI_HANDLE image_handle,
|
|
|
|
EFI_SYSTEM_TABLE *systab
|
|
|
|
)
|
|
|
|
{
|
|
|
|
jmp_buf env;
|
|
|
|
int rc;
|
|
|
|
|
|
|
|
InitializeLib(image_handle, systab);
|
2019-03-15 16:32:06 +03:00
|
|
|
rc = setjmp(env);
|
2015-05-14 19:20:51 +03:00
|
|
|
Print(L"setjmp() = %d\n", rc);
|
|
|
|
|
|
|
|
if (rc == 3) {
|
|
|
|
Print(L"3 worked\n");
|
2019-03-15 16:32:06 +03:00
|
|
|
longjmp(env, 0);
|
2015-05-14 19:20:51 +03:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rc == 1) {
|
|
|
|
Print(L"0 got to be one yay\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-03-15 16:32:06 +03:00
|
|
|
longjmp(env, 3);
|
2015-05-14 19:20:51 +03:00
|
|
|
return 0;
|
|
|
|
}
|