\r
**/\r
\r
+#ifdef __MAKEWITH_TIANO\r
#include "Platform.h"\r
+#else\r
+#include "gnuefi-helper.h"\r
+#endif\r
+#include "../include/refit_call_wrapper.h"\r
+\r
/**\r
\r
Find the first instance of this Protocol\r
{\r
EFI_STATUS Status;\r
\r
- Status = gBS->LocateProtocol (\r
+ Status = refit_call3_wrapper(gBS->LocateProtocol,\r
ProtocolGuid,\r
NULL,\r
(VOID **) Interface\r
//\r
// File the file system interface to the device\r
//\r
- Status = gBS->HandleProtocol (\r
+ Status = refit_call3_wrapper(gBS->HandleProtocol,\r
DeviceHandle,\r
&gEfiSimpleFileSystemProtocolGuid,\r
(VOID **) &Volume\r
return EFI_ERROR (Status) ? NULL : File;\r
}\r
\r
-/**\r
-\r
- Function gets the file system information from an open file descriptor,\r
- and stores it in a buffer allocated from pool.\r
-\r
-\r
- @param FHand The file handle.\r
-\r
- @return A pointer to a buffer with file information.\r
- @retval NULL is returned if failed to get Volume Label Info.\r
-\r
-**/\r
-EFI_FILE_SYSTEM_VOLUME_LABEL *\r
-EfiLibFileSystemVolumeLabelInfo (\r
- IN EFI_FILE_HANDLE FHand\r
- )\r
-{\r
- EFI_STATUS Status;\r
- EFI_FILE_SYSTEM_VOLUME_LABEL *VolumeInfo = NULL;\r
- UINTN Size = 0;\r
- \r
- Status = FHand->GetInfo (FHand, &gEfiFileSystemVolumeLabelInfoIdGuid, &Size, VolumeInfo);\r
- if (Status == EFI_BUFFER_TOO_SMALL) {\r
- VolumeInfo = AllocateZeroPool (Size);\r
- Status = FHand->GetInfo (FHand, &gEfiFileSystemVolumeLabelInfoIdGuid, &Size, VolumeInfo);\r
- }\r
- \r
- return EFI_ERROR(Status)?NULL:VolumeInfo; \r
-}\r
-\r
/**\r
Duplicate a string.\r
\r
\r
Size = StrSize (Src); //at least 2bytes\r
Dest = AllocateZeroPool (Size);\r
-// ASSERT (Dest != NULL);\r
if (Dest != NULL) {\r
CopyMem (Dest, Src, Size);\r
}\r
\r
return Dest;\r
}\r
-//Compare strings case insensitive\r
-INTN\r
-EFIAPI\r
-StriCmp (\r
- IN CONST CHAR16 *FirstString,\r
- IN CONST CHAR16 *SecondString\r
- )\r
-{\r
- \r
- while ((*FirstString != L'\0') && ((*FirstString & ~0x20) == (*SecondString & ~0x20))) {\r
- FirstString++;\r
- SecondString++;\r
- }\r
- return *FirstString - *SecondString;\r
-}\r
-\r
\r
/**\r
\r
EFI_STATUS Status;\r
EFI_FILE_SYSTEM_INFO *FileSystemInfo = NULL;\r
UINTN Size = 0;\r
- \r
+\r
Status = FHand->GetInfo (FHand, &gEfiFileSystemInfoGuid, &Size, FileSystemInfo);\r
if (Status == EFI_BUFFER_TOO_SMALL) {\r
FileSystemInfo = AllocateZeroPool (Size);\r
Status = FHand->GetInfo (FHand, &gEfiFileSystemInfoGuid, &Size, FileSystemInfo);\r
}\r
- \r
- return EFI_ERROR(Status)?NULL:FileSystemInfo;\r
-}\r
-\r
-/**\r
- Function is used to determine the number of device path instances\r
- that exist in a device path.\r
-\r
\r
- @param DevicePath A pointer to a device path data structure.\r
-\r
- @return This function counts and returns the number of device path instances\r
- in DevicePath.\r
-\r
-**/\r
-UINTN\r
-EfiDevicePathInstanceCount (\r
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
- )\r
-{\r
- UINTN Count;\r
- UINTN Size;\r
-\r
- Count = 0;\r
- while (GetNextDevicePathInstance (&DevicePath, &Size) != NULL) {\r
- Count += 1;\r
- }\r
-\r
- return Count;\r
+ return EFI_ERROR(Status)?NULL:FileSystemInfo;\r
}\r
\r
/**\r
\r
return NewPool;\r
}\r
-\r
-/**\r
- Compare two EFI_TIME data.\r
-\r
-\r
- @param FirstTime - A pointer to the first EFI_TIME data.\r
- @param SecondTime - A pointer to the second EFI_TIME data.\r
-\r
- @retval TRUE The FirstTime is not later than the SecondTime.\r
- @retval FALSE The FirstTime is later than the SecondTime.\r
-\r
-**/\r
-BOOLEAN\r
-TimeCompare (\r
- IN EFI_TIME *FirstTime,\r
- IN EFI_TIME *SecondTime\r
- )\r
-{\r
- if (FirstTime->Year != SecondTime->Year) {\r
- return (BOOLEAN) (FirstTime->Year < SecondTime->Year);\r
- } else if (FirstTime->Month != SecondTime->Month) {\r
- return (BOOLEAN) (FirstTime->Month < SecondTime->Month);\r
- } else if (FirstTime->Day != SecondTime->Day) {\r
- return (BOOLEAN) (FirstTime->Day < SecondTime->Day);\r
- } else if (FirstTime->Hour != SecondTime->Hour) {\r
- return (BOOLEAN) (FirstTime->Hour < SecondTime->Hour);\r
- } else if (FirstTime->Minute != SecondTime->Minute) {\r
- return (BOOLEAN) (FirstTime->Minute < FirstTime->Minute);\r
- } else if (FirstTime->Second != SecondTime->Second) {\r
- return (BOOLEAN) (FirstTime->Second < SecondTime->Second);\r
- }\r
-\r
- return (BOOLEAN) (FirstTime->Nanosecond <= SecondTime->Nanosecond);\r
-}\r
-\r
-/**\r
- Get a string from the Data Hub record based on \r
- a device path.\r
-\r
- @param DevPath The device Path.\r
-\r
- @return A string located from the Data Hub records based on\r
- the device path.\r
- @retval NULL If failed to get the String from Data Hub.\r
-\r
-**/\r
-/*\r
-UINT16 *\r
-EfiLibStrFromDatahub (\r
- IN EFI_DEVICE_PATH_PROTOCOL *DevPath\r
- )\r
-{\r
- return NULL;\r
-}*/\r