Home | History | Annotate | Line # | Download | only in apps
      1 /*	$NetBSD: t6.c,v 1.1.1.1 2014/04/01 16:16:06 jakllsch Exp $	*/
      2 
      3 #include <efi.h>
      4 #include <efilib.h>
      5 
      6 typedef EFI_STATUS (*foo_t)(EFI_HANDLE, EFI_GUID *, VOID **);
      7 typedef struct {
      8 	unsigned long addr;
      9 	unsigned long gp;
     10 } fdesc_t;
     11 
     12 EFI_LOADED_IMAGE my_loaded;
     13 
     14 EFI_STATUS
     15 efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
     16 {
     17 	EFI_LOADED_IMAGE *loaded_image = NULL;
     18 #if 0
     19 	EFI_DEVICE_PATH *dev_path;
     20 #endif
     21 	EFI_STATUS status;
     22 
     23 	InitializeLib(image, systab);
     24 	status = uefi_call_wrapper(systab->BootServices->HandleProtocol,
     25 				3,
     26 				image,
     27 				&LoadedImageProtocol,
     28 				(void **) &loaded_image);
     29 	if (EFI_ERROR(status)) {
     30 		Print(L"handleprotocol: %r\n", status);
     31 	}
     32 
     33 #if 0
     34 	BS->HandleProtocol(loaded_image->DeviceHandle, &DevicePathProtocol, (void **) &dev_path);
     35 
     36 	Print(L"Image device      : %s\n", DevicePathToStr(dev_path));
     37 	Print(L"Image file        : %s\n", DevicePathToStr(loaded_image->FilePath));
     38 #endif
     39 	Print(L"Image base        : %lx\n", loaded_image->ImageBase);
     40 	Print(L"Image size        : %lx\n", loaded_image->ImageSize);
     41 	Print(L"Load options size : %lx\n", loaded_image->LoadOptionsSize);
     42 	Print(L"Load options      : %s\n", loaded_image->LoadOptions);
     43 
     44 	return EFI_SUCCESS;
     45 }
     46