]> code.delx.au - refind/commitdiff
Changed names in ComponentName.h, included from TianoCore, and
authorsrs5694 <srs5694@users.sourceforge.net>
Thu, 6 Oct 2016 19:29:29 +0000 (15:29 -0400)
committersrs5694 <srs5694@users.sourceforge.net>
Thu, 6 Oct 2016 19:29:29 +0000 (15:29 -0400)
matching changes in fsw_efi.c. This is done to work around problems
compiling with recent versions of GNU-EFI, which provide SOME of the
features of that file.

Makefile
filesystems/edk2/ComponentName.h
filesystems/fsw_efi.c

index 99b14ce958021bfca535ca4836129a23155f3168..04b0ca77a862788216b2b9aa2de52dccdf90392b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,7 @@ MOK_DIR=mok
 GPTSYNC_DIR=gptsync
 EFILIB_DIR=EfiLib
 export EDK2BASE=/usr/local/UDK2014/MyWorkSpace
-export REFIND_VERSION='L"0.10.3.1"'
+export REFIND_VERSION='L"0.10.3.2"'
 
 # The "all" target builds with the TianoCore library if possible, but falls
 # back on the more easily-installed GNU-EFI library if TianoCore isn't
index a4c3749133ca28a2f1d683720d417ce958532b3e..7fcc6f779eec400dd7d88f13395e17fa4184412a 100644 (file)
@@ -14,24 +14,37 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#ifndef __EFI_COMPONENT_NAME_H__\r
-#define __EFI_COMPONENT_NAME_H__\r
+/*\r
+ * rEFInd NOTE: This file is included only when compiling with GNU-EFI,\r
+ * which has not traditionally provided the definitions supplied here.\r
+ * Unfortunately, recent (ca. 3.0.4) versions of GNU-EFI have added\r
+ * SOME of these functions to an existing header file, creating problems\r
+ * when trying to maintain compatibility with multiple GNU-EFI versions.\r
+ * I've therefore renamed the relevant defines, types, and functions,\r
+ * both here and in fsw_efi.c; and included a define to match the only\r
+ * used name (REFIND_EFI_COMPONENT_NAME_PROTOCOL) to the traditional\r
+ * name (EFI_COMPONENT_NAME_PROTOCOL) in fsw_efi.c for compiling with\r
+ * TianoCore.\r
+ */\r
+\r
+#ifndef __REFIND_EFI_COMPONENT_NAME_H__\r
+#define __REFIND_EFI_COMPONENT_NAME_H__\r
 \r
 ///\r
 /// The global ID for the Component Name Protocol.\r
 ///\r
-#define EFI_COMPONENT_NAME_PROTOCOL_GUID \\r
+#define REFIND_EFI_COMPONENT_NAME_PROTOCOL_GUID \\r
   { \\r
     0x107a772c, 0xd5e1, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
   }\r
 \r
-typedef struct _EFI_COMPONENT_NAME_PROTOCOL  EFI_COMPONENT_NAME_PROTOCOL;\r
+typedef struct _REFIND_EFI_COMPONENT_NAME_PROTOCOL  REFIND_EFI_COMPONENT_NAME_PROTOCOL;\r
 \r
 \r
 /**\r
   Retrieves a Unicode string that is the user-readable name of the EFI Driver.\r
 \r
-  @param  This       A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
+  @param  This       A pointer to the REFIND_EFI_COMPONENT_NAME_PROTOCOL instance.\r
   @param  Language   A pointer to a three-character ISO 639-2 language identifier.\r
                      This is the language of the driver name that that the caller\r
                      is requesting, and it must match one of the languages specified\r
@@ -52,8 +65,8 @@ typedef struct _EFI_COMPONENT_NAME_PROTOCOL  EFI_COMPONENT_NAME_PROTOCOL;
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFI_FUNCTION EFIAPI *EFI_COMPONENT_NAME_GET_DRIVER_NAME)(\r
-  IN EFI_COMPONENT_NAME_PROTOCOL           *This,\r
+(EFI_FUNCTION EFIAPI *REFIND_EFI_COMPONENT_NAME_GET_DRIVER_NAME)(\r
+  IN REFIND_EFI_COMPONENT_NAME_PROTOCOL    *This,\r
   IN  CHAR8                                *Language,\r
   OUT CHAR16                               **DriverName\r
   );\r
@@ -63,7 +76,7 @@ EFI_STATUS
   Retrieves a Unicode string that is the user readable name of the controller\r
   that is being managed by an EFI Driver.\r
 \r
-  @param  This             A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
+  @param  This             A pointer to the REFIND_EFI_COMPONENT_NAME_PROTOCOL instance.\r
   @param  ControllerHandle The handle of a controller that the driver specified by\r
                            This is managing.  This handle specifies the controller\r
                            whose name is to be returned.\r
@@ -101,8 +114,8 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFI_FUNCTION EFIAPI *EFI_COMPONENT_NAME_GET_CONTROLLER_NAME)(\r
-  IN EFI_COMPONENT_NAME_PROTOCOL                              *This,\r
+(EFI_FUNCTION EFIAPI *REFIND_EFI_COMPONENT_NAME_GET_CONTROLLER_NAME)(\r
+  IN  REFIND_EFI_COMPONENT_NAME_PROTOCOL                      *This,\r
   IN  EFI_HANDLE                                              ControllerHandle,\r
   IN  EFI_HANDLE                                              ChildHandle        OPTIONAL,\r
   IN  CHAR8                                                   *Language,\r
@@ -113,9 +126,9 @@ EFI_STATUS
 /// This protocol is used to retrieve user readable names of drivers \r
 /// and controllers managed by UEFI Drivers.\r
 ///\r
-struct _EFI_COMPONENT_NAME_PROTOCOL {\r
-  EFI_COMPONENT_NAME_GET_DRIVER_NAME      GetDriverName;\r
-  EFI_COMPONENT_NAME_GET_CONTROLLER_NAME  GetControllerName;\r
+struct _REFIND_EFI_COMPONENT_NAME_PROTOCOL {\r
+  REFIND_EFI_COMPONENT_NAME_GET_DRIVER_NAME      GetDriverName;\r
+  REFIND_EFI_COMPONENT_NAME_GET_CONTROLLER_NAME  GetControllerName;\r
   ///\r
   /// A Null-terminated ASCII string that contains one or more\r
   /// ISO 639-2 language codes. This is the list of language codes\r
index 3ec649455e9a040738c3c7475d8fac31c71f4d85..5ef49be662b1e8f1026d3d194af1d1cde40f1365 100644 (file)
@@ -43,6 +43,8 @@
 #ifdef __MAKEWITH_GNUEFI
 #include "edk2/DriverBinding.h"
 #include "edk2/ComponentName.h"
+#else
+#define REFIND_EFI_COMPONENT_NAME_PROTOCOL EFI_COMPONENT_NAME_PROTOCOL
 #endif
 #include "../include/refit_call_wrapper.h"
 
@@ -66,7 +68,7 @@
   }
 
 EFI_GUID gEfiDriverBindingProtocolGuid = EFI_DRIVER_BINDING_PROTOCOL_GUID;
-EFI_GUID gEfiComponentNameProtocolGuid = EFI_COMPONENT_NAME_PROTOCOL_GUID;
+EFI_GUID gEfiComponentNameProtocolGuid = REFIND_EFI_COMPONENT_NAME_PROTOCOL_GUID;
 EFI_GUID gEfiDiskIoProtocolGuid = EFI_DISK_IO_PROTOCOL_GUID;
 EFI_GUID gEfiBlockIoProtocolGuid = EFI_BLOCK_IO_PROTOCOL_GUID;
 EFI_GUID gEfiFileInfoGuid = EFI_FILE_INFO_ID;
@@ -93,10 +95,10 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Stop(IN  EFI_DRIVER_BINDING_PROTOCOL  *T
                                              IN  UINTN                        NumberOfChildren,
                                              IN  EFI_HANDLE                   *ChildHandleBuffer);
 
-EFI_STATUS EFIAPI fsw_efi_ComponentName_GetDriverName(IN  EFI_COMPONENT_NAME_PROTOCOL  *This,
+EFI_STATUS EFIAPI fsw_efi_ComponentName_GetDriverName(IN  REFIND_EFI_COMPONENT_NAME_PROTOCOL  *This,
                                                       IN  CHAR8                        *Language,
                                                       OUT CHAR16                       **DriverName);
-EFI_STATUS EFIAPI fsw_efi_ComponentName_GetControllerName(IN  EFI_COMPONENT_NAME_PROTOCOL    *This,
+EFI_STATUS EFIAPI fsw_efi_ComponentName_GetControllerName(IN  REFIND_EFI_COMPONENT_NAME_PROTOCOL    *This,
                                                           IN  EFI_HANDLE                     ControllerHandle,
                                                           IN  EFI_HANDLE                     ChildHandle  OPTIONAL,
                                                           IN  CHAR8                          *Language,
@@ -175,7 +177,7 @@ EFI_DRIVER_BINDING_PROTOCOL fsw_efi_DriverBinding_table = {
  * Interface structure for the EFI Component Name protocol.
  */
 
-EFI_COMPONENT_NAME_PROTOCOL fsw_efi_ComponentName_table = {
+REFIND_EFI_COMPONENT_NAME_PROTOCOL fsw_efi_ComponentName_table = {
     fsw_efi_ComponentName_GetDriverName,
     fsw_efi_ComponentName_GetControllerName,
     (CHAR8*) "eng"
@@ -465,7 +467,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Stop(IN  EFI_DRIVER_BINDING_PROTOCOL  *T
  * based on the file system type actually used in compilation.
  */
 
-EFI_STATUS EFIAPI fsw_efi_ComponentName_GetDriverName(IN  EFI_COMPONENT_NAME_PROTOCOL  *This,
+EFI_STATUS EFIAPI fsw_efi_ComponentName_GetDriverName(IN  REFIND_EFI_COMPONENT_NAME_PROTOCOL  *This,
                                                       IN  CHAR8                        *Language,
                                                       OUT CHAR16                       **DriverName)
 {
@@ -484,7 +486,7 @@ EFI_STATUS EFIAPI fsw_efi_ComponentName_GetDriverName(IN  EFI_COMPONENT_NAME_PRO
  * because this is not a "bus" driver in the sense of the EFI Driver Model.
  */
 
-EFI_STATUS EFIAPI fsw_efi_ComponentName_GetControllerName(IN  EFI_COMPONENT_NAME_PROTOCOL    *This,
+EFI_STATUS EFIAPI fsw_efi_ComponentName_GetControllerName(IN  REFIND_EFI_COMPONENT_NAME_PROTOCOL    *This,
                                                           IN  EFI_HANDLE                     ControllerHandle,
                                                           IN  EFI_HANDLE                     ChildHandle  OPTIONAL,
                                                           IN  CHAR8                          *Language,