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