\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
**/\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
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
**/\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
/// 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
#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"
}
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;
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,
* 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"
* 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)
{
* 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,