Ver código fonte

Restore correct operation of BS driver test

Attaching a patch to fix apps/drv0.efi and apps/drv0_use.efi,
which are both currently not working.

Signed-off-by: David Decotigny <gdaviddecotigny@users.sf.net>
Signed-off-by: Nigel Croxon <noxorc@mac.com>
Nigel Croxon 8 anos atrás
pai
commit
87484730de
3 arquivos alterados com 5 adições e 7 exclusões
  1. 1 1
      apps/drv0.c
  2. 1 3
      apps/drv0.h
  3. 3 3
      apps/drv0_use.c

+ 1 - 1
apps/drv0.c

@@ -164,7 +164,7 @@ efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SysTab)
   /* Grab handle to this image: we'll attach our proto instance to it */
   Status = uefi_call_wrapper(BS->OpenProtocol, 6,
                              ImageHandle, &LoadedImageProtocol,
-                             NULL, ImageHandle,
+                             (void**)&LoadedImage, ImageHandle,
                              NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
   if (EFI_ERROR(Status)) {
     Print(L"Could not open loaded image protocol: %d\n", Status);

+ 1 - 3
apps/drv0.h

@@ -7,21 +7,19 @@ extern "C" {
 
 /* UEFI naming conventions */
 #define GNU_EFI_APPS_DRV0_PROTOCOL_GUID \
-{ 0xe4dcafd0, 0x586c, 0x4b3d, {0x86, 0xe7, 0x28, 0xde, 0x7f, 0xcc, 0x04, 0xb8} }
+{ 0xe4dcafd0, 0x586c, 0x4b3d, {0x86, 0xe7, 0x28, 0xde, 0x7f, 0xcc, 0x04, 0xb9} }
 
 INTERFACE_DECL(_GNU_EFI_APPS_DRV0_PROTOCOL);
 
 typedef
 EFI_STATUS
 (EFIAPI *GNU_EFI_APPS_DRV0_SAY_HELLO) (
-    IN struct _GNU_EFI_APPS_DRV0_PROTOCOL *This,
     IN const CHAR16 *HelloWho
     );
 
 typedef
 EFI_STATUS
 (EFIAPI *GNU_EFI_APPS_DRV0_GET_NUMBER_OF_HELLO) (
-    IN struct _GNU_EFI_APPS_DRV0_PROTOCOL *This,
     OUT UINTN *NumberOfHello
     );
 

+ 3 - 3
apps/drv0_use.c

@@ -23,7 +23,7 @@ PlayWithGnuEfiAppsDrv0Protocol(IN EFI_HANDLE DrvHandle) {
   Status = uefi_call_wrapper(BS->OpenProtocol, 6,
                              DrvHandle,
                              &GnuEfiAppsDrv0ProtocolGuid,
-                             NULL,
+                             (void**)&drv,
                              DrvHandle,
                              NULL,
                              EFI_OPEN_PROTOCOL_GET_PROTOCOL);
@@ -32,12 +32,12 @@ PlayWithGnuEfiAppsDrv0Protocol(IN EFI_HANDLE DrvHandle) {
     return Status;
   }
 
-  Status = uefi_call_wrapper(drv->SayHello, 2, drv, L"Sample UEFI Driver");
+  Status = uefi_call_wrapper(drv->SayHello, 2, L"Sample UEFI Driver");
   if (EFI_ERROR(Status)) {
     Print(L"Cannot call SayHello: %d\n", Status);
   }
 
-  Status = uefi_call_wrapper(drv->GetNumberOfHello, 2, drv, &NumberOfHello);
+  Status = uefi_call_wrapper(drv->GetNumberOfHello, 2, &NumberOfHello);
   if (EFI_ERROR(Status)) {
     Print(L"Cannot call GetNumberOfHello: %d\n", Status);
   } else {