Rev 2726 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2726 | vana | 1 | #include <efi.h> |
2 | #include <efilib.h> |
||
3 | |||
4 | typedef EFI_STATUS (*foo_t)(EFI_HANDLE, EFI_GUID *, VOID **); |
||
5 | typedef struct { |
||
6 | unsigned long addr; |
||
7 | unsigned long gp; |
||
8 | } fdesc_t; |
||
9 | |||
10 | EFI_LOADED_IMAGE my_loaded; |
||
11 | |||
12 | EFI_STATUS |
||
13 | efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab) |
||
14 | { |
||
15 | EFI_LOADED_IMAGE *loaded_image = NULL; |
||
16 | #if 0 |
||
17 | EFI_DEVICE_PATH *dev_path; |
||
18 | #endif |
||
19 | EFI_STATUS status; |
||
20 | |||
21 | InitializeLib(image, systab); |
||
22 | status = systab->BootServices->HandleProtocol(image, &LoadedImageProtocol, (void **) &loaded_image); |
||
23 | if (EFI_ERROR(status)) { |
||
24 | Print(L"handleprotocol: %r\n", status); |
||
25 | } |
||
26 | |||
27 | #if 0 |
||
28 | BS->HandleProtocol(loaded_image->DeviceHandle, &DevicePathProtocol, (void **) &dev_path); |
||
29 | |||
30 | Print(L"Image device : %s\n", DevicePathToStr(dev_path)); |
||
31 | Print(L"Image file : %s\n", DevicePathToStr(loaded_image->FilePath)); |
||
32 | #endif |
||
33 | Print(L"Image base : %lx\n", loaded_image->ImageBase); |
||
34 | Print(L"Image size : %lx\n", loaded_image->ImageSize); |
||
35 | Print(L"Load options size : %lx\n", loaded_image->LoadOptionsSize); |
||
36 | Print(L"Load options : %s\n", loaded_image->LoadOptions); |
||
37 | |||
38 | return EFI_SUCCESS; |
||
39 | } |