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>
This commit is contained in:
Nigel Croxon 2017-01-08 06:58:30 -05:00
parent fa1b977962
commit 87484730de
3 changed files with 5 additions and 7 deletions

View file

@ -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);

View file

@ -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
);

View file

@ -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 {