From nobody Sat Nov 2 14:29:56 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1488856477639771.4036316976789; Mon, 6 Mar 2017 19:14:37 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 7ED648034C; Mon, 6 Mar 2017 19:14:35 -0800 (PST) Received: from mail-qk0-x241.google.com (mail-qk0-x241.google.com [IPv6:2607:f8b0:400d:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B276C80347 for ; Mon, 6 Mar 2017 19:14:34 -0800 (PST) Received: by mail-qk0-x241.google.com with SMTP id o135so8866576qke.2 for ; Mon, 06 Mar 2017 19:14:34 -0800 (PST) Received: from foober.ini.cmu.edu (pool-108-39-248-175.pitbpa.fios.verizon.net. [108.39.248.175]) by smtp.gmail.com with ESMTPSA id v26sm2901013qtc.13.2017.03.06.19.14.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Mar 2017 19:14:33 -0800 (PST) X-Original-To: edk2-devel@ml01.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VFuRPx3NFwuMbXVJqYrZzkSXCE7Vu8r8bNhZdVd9TlY=; b=F5Fl5cCGWAXBZAv/pO73LbiVVWj6DEK11FJ+F67DedoWiELluzGl6UIlO0FK8AMWmy cQe3vTstGk/xpqwid/UZqj0Ir7BiidYTFEqOQysw2pYEuX8KSvpUei9gX8E3XAJtw39V mF6GkY6mw3v2cI+ng3h8hHKaNjMhvvkZJoe6c3k1Qsz03HiGX9GgfhV5W9LFpl5JFwzA yyJ0xoHawkp5sfEeACGt/CRLaTGZVoBjI6gb1OvqtojgVSKe1mPrOGGYoBRHb0RKeTXd HNARSI0kAUtcvTKS8kx+5lsVLmwgCK4Top4AAGl0D+v8trdospNMN20+8dstldjN9F6h f8mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VFuRPx3NFwuMbXVJqYrZzkSXCE7Vu8r8bNhZdVd9TlY=; b=DQa96QvGcyfUtfYadqKbgxzynBeDhB8I6e6gpPJ5vDAQQ6UAVkY+wXB05oahgNe6aF 0KGb4e8DU4hed6WFjGzHSoVzj4HDIlV018UVe/trKMQDgQIgnfbDerP1RS+OJcf27H75 X7xr2WksQE3DCDwDfJwHQeAnOsqarCwKtBapJ+psGYE5+6jO/Qu6/nScMZqEcCmlVkJ+ BwrYQ17FuLgvEZQa7ntYB9spxlJMBopgDkkMlk6XMne8sKgs5Sw5RxlqQOydI41LGbIF plFzjnG3e35kxvZvpdhcL6cOSPBXtgqAAQBc+L7bRH8K+IMGEEi8XewURp0o4AsSfNHv 0iUg== X-Gm-Message-State: AMke39ketS2Uj7dPTc1tGyfhuYp+zQxfVg3AZ2XgF9db2qWd9VFELMGh8BfK3wm1TpMhFw== X-Received: by 10.200.56.210 with SMTP id g18mr18236769qtc.63.1488856473890; Mon, 06 Mar 2017 19:14:33 -0800 (PST) From: "Gabriel L. Somlo" To: edk2-devel@ml01.01.org Date: Mon, 6 Mar 2017 22:14:21 -0500 Message-Id: <1488856465-8965-3-git-send-email-gsomlo@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488856465-8965-1-git-send-email-gsomlo@gmail.com> References: <1488856465-8965-1-git-send-email-gsomlo@gmail.com> Subject: [edk2] [RFC PATCH 2/6] FswHfsPlus: connect FSW code to EDK2, fix compile discrepancies X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jordan.l.justen@intel.com, lersek@redhat.com, agraf@suse.de MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Connect FSW to EDK2: - in fsw_efi_base.h, s/efi[lib].h/fsw_efi_edk2_base.h/ Fix compile discrepancies: - Fix FSW_INVALID_BNO, FSW_EFI_STRINGIFY macros - Remove EFI_DRIVER_ENTRY_POINT, InitializeLib() call - use correct protocol name GUIDs (gEfiGuid) - edk2's CompareGuid returns TRUE on equal, not 0 like gnu-efi Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gabriel Somlo --- OvmfPkg/FswHfsPlus/fsw_core.h | 2 +- OvmfPkg/FswHfsPlus/fsw_efi.c | 36 ++++++++++++++++-------------------- OvmfPkg/FswHfsPlus/fsw_efi_base.h | 3 +-- 3 files changed, 18 insertions(+), 23 deletions(-) diff --git a/OvmfPkg/FswHfsPlus/fsw_core.h b/OvmfPkg/FswHfsPlus/fsw_core.h index 0041ce1..a611b19 100644 --- a/OvmfPkg/FswHfsPlus/fsw_core.h +++ b/OvmfPkg/FswHfsPlus/fsw_core.h @@ -52,7 +52,7 @@ #define FSW_FSTYPE_TABLE_NAME(t) FSW_CONCAT3(fsw_,t,_table) =20 /** Indicates that the block cache entry is empty. */ -#define FSW_INVALID_BNO (~0UL) +#define FSW_INVALID_BNO (~0U) =20 =20 // diff --git a/OvmfPkg/FswHfsPlus/fsw_efi.c b/OvmfPkg/FswHfsPlus/fsw_efi.c index c024162..d2b53a7 100644 --- a/OvmfPkg/FswHfsPlus/fsw_efi.c +++ b/OvmfPkg/FswHfsPlus/fsw_efi.c @@ -46,7 +46,7 @@ #endif =20 /** Helper macro for stringification. */ -#define FSW_EFI_STRINGIFY(x) L#x +#define FSW_EFI_STRINGIFY(x) #x /** Expands to the EFI driver name given the file system type name. */ #define FSW_EFI_DRIVER_NAME(t) L"Fsw " FSW_EFI_STRINGIFY(t) L" File System= Driver" =20 @@ -149,8 +149,6 @@ struct fsw_host_table fsw_efi_host_table =3D { extern struct fsw_fstype_table FSW_FSTYPE_TABLE_NAME(FSTYPE); =20 =20 -EFI_DRIVER_ENTRY_POINT(fsw_efi_main) - /** * Image entry point. Installs the Driver Binding and Component Name proto= cols * on the image's handle. Actually mounting a file system is initiated thr= ough @@ -162,14 +160,12 @@ EFI_STATUS EFIAPI fsw_efi_main(IN EFI_HANDLE = ImageHandle, { EFI_STATUS Status; =20 - InitializeLib(ImageHandle, SystemTable); - =20 // complete Driver Binding protocol instance fsw_efi_DriverBinding_table.ImageHandle =3D ImageHandle; fsw_efi_DriverBinding_table.DriverBindingHandle =3D ImageHandle; // install Driver Binding protocol Status =3D BS->InstallProtocolInterface(&fsw_efi_DriverBinding_table.D= riverBindingHandle, - &DriverBindingProtocol, + &gEfiDriverBindingProtocolGuid, EFI_NATIVE_INTERFACE, &fsw_efi_DriverBinding_table); if (EFI_ERROR (Status)) { @@ -178,7 +174,7 @@ EFI_STATUS EFIAPI fsw_efi_main(IN EFI_HANDLE Im= ageHandle, =20 // install Component Name protocol Status =3D BS->InstallProtocolInterface(&fsw_efi_DriverBinding_table.D= riverBindingHandle, - &ComponentNameProtocol, + &gEfiComponentNameProtocolGuid, EFI_NATIVE_INTERFACE, &fsw_efi_ComponentName_table); if (EFI_ERROR (Status)) { @@ -206,7 +202,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Supported(IN EF= I_DRIVER_BINDING_PROTOCOL =20 // first, open DiskIO Status =3D BS->OpenProtocol(ControllerHandle, - &DiskIoProtocol, + &gEfiDiskIoProtocolGuid, (VOID **) &DiskIo, This->DriverBindingHandle, ControllerHandle, @@ -216,13 +212,13 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Supported(IN = EFI_DRIVER_BINDING_PROTOCOL =20 // we were just checking, close it again BS->CloseProtocol(ControllerHandle, - &DiskIoProtocol, + &gEfiDiskIoProtocolGuid, This->DriverBindingHandle, ControllerHandle); =20 // next, check BlockIO without actually opening it Status =3D BS->OpenProtocol(ControllerHandle, - &BlockIoProtocol, + &gEfiBlockIoProtocolGuid, NULL, This->DriverBindingHandle, ControllerHandle, @@ -258,7 +254,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Start(IN EFI_DR= IVER_BINDING_PROTOCOL *T =20 // open consumed protocols Status =3D BS->OpenProtocol(ControllerHandle, - &BlockIoProtocol, + &gEfiBlockIoProtocolGuid, (VOID **) &BlockIo, This->DriverBindingHandle, ControllerHandle, @@ -269,7 +265,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Start(IN EFI_DR= IVER_BINDING_PROTOCOL *T } =20 Status =3D BS->OpenProtocol(ControllerHandle, - &DiskIoProtocol, + &gEfiDiskIoProtocolGuid, (VOID **) &DiskIo, This->DriverBindingHandle, ControllerHandle, @@ -297,7 +293,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Start(IN EFI_DR= IVER_BINDING_PROTOCOL *T Volume->FileSystem.Revision =3D EFI_FILE_IO_INTERFACE_REVISION; Volume->FileSystem.OpenVolume =3D fsw_efi_FileSystem_OpenVolume; Status =3D BS->InstallMultipleProtocolInterfaces(&ControllerHandle, - &FileSystemProtocol= , &Volume->FileSystem, + &gEfiSimpleFileSyst= emProtocolGuid, &Volume->FileSystem, NULL); if (EFI_ERROR(Status)) Print(L"Fsw ERROR: InstallMultipleProtocolInterfaces returned = %x\n", Status); @@ -310,7 +306,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Start(IN EFI_DR= IVER_BINDING_PROTOCOL *T FreePool(Volume); =20 BS->CloseProtocol(ControllerHandle, - &DiskIoProtocol, + &gEfiDiskIoProtocolGuid, This->DriverBindingHandle, ControllerHandle); } @@ -343,7 +339,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Stop(IN EFI_DR= IVER_BINDING_PROTOCOL *T =20 // get the installed SimpleFileSystem interface Status =3D BS->OpenProtocol(ControllerHandle, - &FileSystemProtocol, + &gEfiSimpleFileSystemProtocolGuid, (VOID **) &FileSystem, This->DriverBindingHandle, ControllerHandle, @@ -356,7 +352,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Stop(IN EFI_DR= IVER_BINDING_PROTOCOL *T =20 // uninstall Simple File System protocol Status =3D BS->UninstallMultipleProtocolInterfaces(ControllerHandle, - &FileSystemProtocol, = &Volume->FileSystem, + &gEfiSimpleFileSystem= ProtocolGuid, &Volume->FileSystem, NULL); if (EFI_ERROR(Status)) { Print(L"Fsw ERROR: UninstallMultipleProtocolInterfaces returned %x= \n", Status); @@ -373,7 +369,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Stop(IN EFI_DR= IVER_BINDING_PROTOCOL *T =20 // close the consumed protocols Status =3D BS->CloseProtocol(ControllerHandle, - &DiskIoProtocol, + &gEfiDiskIoProtocolGuid, This->DriverBindingHandle, ControllerHandle); =20 @@ -884,14 +880,14 @@ EFI_STATUS fsw_efi_dnode_getinfo(IN FSW_FILE_DATA *Fi= le, UINTN RequiredSize; struct fsw_volume_stat vsb; =20 - if (CompareGuid(InformationType, &GenericFileInfo) =3D=3D 0) { + if (CompareGuid(InformationType, &gEfiFileInfoGuid)) { #if DEBUG_LEVEL Print(L"fsw_efi_dnode_getinfo: FILE_INFO\n"); #endif =20 Status =3D fsw_efi_dnode_fill_FileInfo(Volume, File->shand.dnode, = BufferSize, Buffer); =20 - } else if (CompareGuid(InformationType, &FileSystemInfo) =3D=3D 0) { + } else if (CompareGuid(InformationType, &gEfiFileSystemInfoGuid)) { #if DEBUG_LEVEL Print(L"fsw_efi_dnode_getinfo: FILE_SYSTEM_INFO\n"); #endif @@ -922,7 +918,7 @@ EFI_STATUS fsw_efi_dnode_getinfo(IN FSW_FILE_DATA *File, *BufferSize =3D RequiredSize; Status =3D EFI_SUCCESS; =20 - } else if (CompareGuid(InformationType, &FileSystemVolumeLabelInfo) = =3D=3D 0) { + } else if (CompareGuid(InformationType, &gEfiFileSystemVolumeLabelInfo= IdGuid)) { #if DEBUG_LEVEL Print(L"fsw_efi_dnode_getinfo: FILE_SYSTEM_VOLUME_LABEL\n"); #endif diff --git a/OvmfPkg/FswHfsPlus/fsw_efi_base.h b/OvmfPkg/FswHfsPlus/fsw_efi= _base.h index 3643b3b..5884b92 100644 --- a/OvmfPkg/FswHfsPlus/fsw_efi_base.h +++ b/OvmfPkg/FswHfsPlus/fsw_efi_base.h @@ -39,8 +39,7 @@ #define _FSW_EFI_BASE_H_ =20 =20 -#include -#include +#include "fsw_efi_edk2_base.h" =20 #define FSW_LITTLE_ENDIAN (1) =20 --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel