diff options
author | qwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-01-21 14:33:26 +0000 |
---|---|---|
committer | qwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-01-21 14:33:26 +0000 |
commit | dc7b4a5c436c3190fca6607e77711c3246d7290a (patch) | |
tree | ecbc58331518112534a47dafd85e4f6a6756799a /IntelFrameworkPkg/Library | |
parent | c03fbe30c1870c9f235eb101cba15e25c1fdd005 (diff) | |
download | edk2-platforms-dc7b4a5c436c3190fca6607e77711c3246d7290a.tar.xz |
UEFI HII: Merge UEFI HII support changes from branch.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4597 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkPkg/Library')
6 files changed, 460 insertions, 203 deletions
diff --git a/IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.c b/IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.c index 913b471c5a..1b4c0dd79a 100644 --- a/IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.c +++ b/IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.c @@ -17,10 +17,67 @@ #include <FrameworkDxe.h>
+#include <Protocol/FrameworkHii.h>
+
#include <Library/FrameworkHiiLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/BaseMemoryLib.h>
+
+EFI_HII_PROTOCOL *mHii = NULL;
+
+EFI_STATUS
+EFIAPI
+FrameworkHiiLibConstructor (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
+{
+ EFI_STATUS Status;
+
+ Status = gBS->LocateProtocol (
+ &gEfiHiiProtocolGuid,
+ NULL,
+ (VOID **) &mHii
+ );
+ ASSERT_EFI_ERROR (Status);
+ ASSERT (mHii != NULL);
+
+ return EFI_SUCCESS;
+}
+
+
+EFI_HII_PACKAGES *
+InternalPreparePackages (
+ IN UINTN NumberOfPackages,
+ IN CONST EFI_GUID *Guid OPTIONAL,
+ VA_LIST Marker
+ )
+{
+ EFI_HII_PACKAGES *HiiPackages;
+ VOID **Package;
+ UINTN Index;
+
+ ASSERT (NumberOfPackages > 0);
+
+ HiiPackages = AllocateZeroPool (sizeof (EFI_HII_PACKAGES) + NumberOfPackages * sizeof (VOID *));
+ ASSERT (HiiPackages != NULL);
+
+ HiiPackages->GuidId = (EFI_GUID *) Guid;
+ HiiPackages->NumberOfPackages = NumberOfPackages;
+ Package = (VOID **) (((UINT8 *) HiiPackages) + sizeof (EFI_HII_PACKAGES));
+
+ for (Index = 0; Index < NumberOfPackages; Index++) {
+ *Package = VA_ARG (Marker, VOID *);
+ Package++;
+ }
+
+ return HiiPackages;
+
+}
+
/**
This function allocates pool for an EFI_HII_PACKAGES structure
@@ -43,28 +100,219 @@ PreparePackages ( )
{
VA_LIST Args;
- EFI_HII_PACKAGES *HiiPackages;
- VOID **Package;
- UINTN Index;
- ASSERT (NumberOfPackages > 0);
+ VA_START (Args, Guid);
- HiiPackages = AllocateZeroPool (sizeof (EFI_HII_PACKAGES) + NumberOfPackages * sizeof (VOID *));
- ASSERT (HiiPackages != NULL);
+ return InternalPreparePackages (NumberOfPackages, Guid, Args);
+}
- HiiPackages->GuidId = (EFI_GUID *) Guid;
- HiiPackages->NumberOfPackages = NumberOfPackages;
- Package = (VOID **) (((UINT8 *) HiiPackages) + sizeof (EFI_HII_PACKAGES));
- VA_START (Args, Guid);
+/**
+ This function allocates pool for an EFI_HII_PACKAGE_LIST structure
+ with additional space that is big enough to host all packages described by the variable
+ argument list of package pointers. The allocated structure is initialized using NumberOfPackages,
+ GuidId, and the variable length argument list of package pointers.
- for (Index = 0; Index < NumberOfPackages; Index++) {
- *Package = VA_ARG (Args, VOID *);
- Package++;
+ Then, EFI_HII_PACKAGE_LIST will be register to the default System HII Database. The
+ Handle to the newly registered Package List is returned throught HiiHandle.
+
+ @param NumberOfPackages The number of HII packages to register.
+ @param GuidId Package List GUID ID.
+ @param HiiHandle The ID used to retrieve the Package List later.
+ @param ... The variable argument list describing all HII Package.
+
+ @return
+ The allocated and initialized packages.
+
+**/
+
+EFI_STATUS
+EFIAPI
+HiiLibAddPackagesToHiiDatabase (
+ IN UINTN NumberOfPackages,
+ IN CONST EFI_GUID *GuidId,
+ IN EFI_HANDLE DriverHandle, OPTIONAL
+ OUT EFI_HII_HANDLE *HiiHandle, OPTIONAL
+ ...
+ )
+{
+ VA_LIST Args;
+ EFI_HII_PACKAGES *FrameworkHiiPacages;
+ FRAMEWORK_EFI_HII_HANDLE FrameworkHiiHandle;
+ EFI_STATUS Status;
+
+
+ VA_START (Args, HiiHandle);
+ FrameworkHiiPacages = InternalPreparePackages (NumberOfPackages, GuidId, Args);
+
+ Status = mHii->NewPack (mHii, FrameworkHiiPacages, &FrameworkHiiHandle);
+ if (HiiHandle != NULL) {
+ if (EFI_ERROR (Status)) {
+ *HiiHandle = NULL;
+ } else {
+ *HiiHandle = (EFI_HII_HANDLE) (UINTN) FrameworkHiiHandle;
+ }
}
- VA_END (Args);
+ FreePool (FrameworkHiiPacages);
+
+ return Status;
+}
- return HiiPackages;
+EFI_STATUS
+EFIAPI
+HiiLibAddFontPackageToHiiDatabase (
+ IN UINTN FontSize,
+ IN CONST UINT8 *FontBinary,
+ IN CONST EFI_GUID *GuidId,
+ OUT EFI_HII_HANDLE *HiiHandle OPTIONAL
+ )
+{
+ EFI_STATUS Status;
+ EFI_HII_FONT_PACK *FontPack;
+ UINT8 *Location;
+
+ FontPack = AllocateZeroPool (sizeof (EFI_HII_FONT_PACK) + FontSize);
+ ASSERT (FontPack != NULL);
+
+ FontPack->Header.Length = (UINT32) (sizeof (EFI_HII_FONT_PACK) + FontSize);
+ FontPack->Header.Type = EFI_HII_FONT;
+ FontPack->NumberOfNarrowGlyphs = (UINT16) (FontSize / sizeof (EFI_NARROW_GLYPH));
+
+ Location = (UINT8 *) (&FontPack->NumberOfWideGlyphs + sizeof (UINT8));
+ CopyMem (Location, FontBinary, FontSize);
+
+
+ //
+ // Register our Fonts into the global database
+ //
+ Status = HiiLibAddPackagesToHiiDatabase (1, NULL, HiiHandle, NULL, FontPack);
+ //
+ // Free the font database
+ //
+ FreePool (FontPack);
+ return Status;
}
+
+EFI_STATUS
+EFIAPI
+HiiLibRemovePackagesFromHiiDatabase (
+ IN EFI_HII_HANDLE HiiHandle
+ )
+{
+ return mHii->RemovePack (mHii, (FRAMEWORK_EFI_HII_HANDLE) (UINTN) HiiHandle);
+}
+
+
+/**
+ This function adds the string into String Package of each language.
+
+ @param PackageList Handle of the package list where this string will
+ be added.
+ @param StringId On return, contains the new strings id, which is
+ unique within PackageList.
+ @param String Points to the new null-terminated string.
+
+ @retval EFI_SUCCESS The new string was added successfully.
+ @retval EFI_NOT_FOUND The specified PackageList could not be found in
+ database.
+ @retval EFI_OUT_OF_RESOURCES Could not add the string due to lack of resources.
+ @retval EFI_INVALID_PARAMETER String is NULL or StringId is NULL is NULL.
+
+**/
+EFI_STATUS
+EFIAPI
+HiiLibCreateString (
+ IN EFI_HII_HANDLE PackageList,
+ OUT EFI_STRING_ID *StringId,
+ IN CONST EFI_STRING String
+ )
+{
+ FRAMEWORK_EFI_HII_HANDLE FrameworkHiiHandle;
+ EFI_STATUS Status;
+
+ FrameworkHiiHandle = (FRAMEWORK_EFI_HII_HANDLE) (UINTN) PackageList;
+ Status = mHii->NewString (
+ mHii,
+ NULL,
+ FrameworkHiiHandle,
+ StringId,
+ String
+ );
+
+ return Status;
+}
+
+
+EFI_STATUS
+EFIAPI
+HiiLibUpdateString (
+ IN EFI_HII_HANDLE PackageList,
+ IN EFI_STRING_ID StringId,
+ IN CONST EFI_STRING String
+ )
+{
+ FRAMEWORK_EFI_HII_HANDLE FrameworkHiiHandle;
+ EFI_STATUS Status;
+
+ FrameworkHiiHandle = (FRAMEWORK_EFI_HII_HANDLE) (UINTN) PackageList;
+ Status = mHii->NewString (
+ mHii,
+ NULL,
+ FrameworkHiiHandle,
+ &StringId,
+ String
+ );
+
+ return Status;
+}
+
+//
+// Just use the UEFI prototype
+//
+EFI_STATUS
+EFIAPI
+HiiLibGetStringFromGuidId (
+ IN EFI_GUID *ProducerGuid,
+ IN EFI_STRING_ID StringId,
+ OUT EFI_STRING *String
+ )
+{
+ return EFI_SUCCESS;
+}
+
+//
+// Just use the UEFI prototype
+//
+EFI_STATUS
+EFIAPI
+HiiLibGetStringFromHandle (
+ IN EFI_HII_HANDLE PackageList,
+ IN EFI_STRING_ID StringId,
+ OUT EFI_STRING *String
+ )
+{
+ return EFI_SUCCESS;
+}
+
+//
+// Just use the UEFI prototype
+//
+EFI_STATUS
+EFIAPI
+HiiLibCreateHiiDriverHandle (
+ OUT EFI_HANDLE *DriverHandle
+ )
+{
+ //
+ // Driver
+ // This implementation does nothing as DriverHandle concept only
+ // applies to UEFI HII specification.
+ //
+
+ *DriverHandle = NULL;
+
+ return EFI_SUCCESS;
+}
+
diff --git a/IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.inf b/IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.inf index 98ee9f9ae2..d38275dd83 100644 --- a/IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.inf +++ b/IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.inf @@ -20,10 +20,12 @@ FILE_GUID = 1e2c4c2e-67e6-4e57-b3ae-cf5a5af72c2c
MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0
- LIBRARY_CLASS = FrameworkHiiLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER
+ LIBRARY_CLASS = FrameworkHiiLib,HiiLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER
EDK_RELEASE_VERSION = 0x00020000
EFI_SPECIFICATION_VERSION = 0x00020000
+ CONSTRUCTOR = FrameworkHiiLibConstructor
+
#
# The following information is for reference only and not required by the build tools.
@@ -41,4 +43,12 @@ [LibraryClasses]
MemoryAllocationLib
DebugLib
+ BaseMemoryLib
+ UefiBootServicesTableLib
+
+[Protocols]
+ gEfiHiiProtocolGuid # ALWAYS_CONSUMED
+
+[Depex]
+ gEfiHiiProtocolGuid # ALWAYS_CONSUMED
diff --git a/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrCommon.c b/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrCommon.c index d9894c4e6c..7e5182d7ed 100644 --- a/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrCommon.c +++ b/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrCommon.c @@ -372,52 +372,52 @@ Returns: //
// Copy data to the new buffer until we run into the end_form
//
- for (; ((EFI_IFR_OP_HEADER *) Source)->OpCode != EFI_IFR_END_FORM_OP;) {
+ for (; ((FRAMEWORK_EFI_IFR_OP_HEADER *) Source)->OpCode != FRAMEWORK_EFI_IFR_END_FORM_OP;) {
//
// If the this opcode is an end_form_set we better be creating and endform
// Nonetheless, we will add data before the end_form_set. This also provides
// for interesting behavior in the code we will run, but has no bad side-effects
// since we will possibly do a 0 byte copy in this particular end-case.
//
- if (((EFI_IFR_OP_HEADER *) Source)->OpCode == EFI_IFR_END_FORM_SET_OP) {
+ if (((FRAMEWORK_EFI_IFR_OP_HEADER *) Source)->OpCode == FRAMEWORK_EFI_IFR_END_FORM_SET_OP) {
break;
}
//
// Copy data to new buffer
//
- CopyMem (Destination, Source, ((EFI_IFR_OP_HEADER *) Source)->Length);
+ CopyMem (Destination, Source, ((FRAMEWORK_EFI_IFR_OP_HEADER *) Source)->Length);
//
// Adjust Source/Destination to next op-code location
//
- Destination = Destination + (UINTN) ((EFI_IFR_OP_HEADER *) Source)->Length;
- Source = Source + (UINTN) ((EFI_IFR_OP_HEADER *) Source)->Length;
+ Destination = Destination + (UINTN) ((FRAMEWORK_EFI_IFR_OP_HEADER *) Source)->Length;
+ Source = Source + (UINTN) ((FRAMEWORK_EFI_IFR_OP_HEADER *) Source)->Length;
}
//
// Prior to the end_form is where we insert the new op-code data
//
- CopyMem (Destination, OpCodeData, ((EFI_IFR_OP_HEADER *) OpCodeData)->Length);
- Destination = Destination + (UINTN) ((EFI_IFR_OP_HEADER *) OpCodeData)->Length;
+ CopyMem (Destination, OpCodeData, ((FRAMEWORK_EFI_IFR_OP_HEADER *) OpCodeData)->Length);
+ Destination = Destination + (UINTN) ((FRAMEWORK_EFI_IFR_OP_HEADER *) OpCodeData)->Length;
- NewBuffer->Length = (UINT32) (NewBuffer->Length + (UINT32) (((EFI_IFR_OP_HEADER *) OpCodeData)->Length));
+ NewBuffer->Length = (UINT32) (NewBuffer->Length + (UINT32) (((FRAMEWORK_EFI_IFR_OP_HEADER *) OpCodeData)->Length));
//
// Copy end-form data to new buffer
//
- CopyMem (Destination, Source, ((EFI_IFR_OP_HEADER *) Source)->Length);
+ CopyMem (Destination, Source, ((FRAMEWORK_EFI_IFR_OP_HEADER *) Source)->Length);
//
// Adjust Source/Destination to next op-code location
//
- Destination = Destination + (UINTN) ((EFI_IFR_OP_HEADER *) Source)->Length;
- Source = Source + (UINTN) ((EFI_IFR_OP_HEADER *) Source)->Length;
+ Destination = Destination + (UINTN) ((FRAMEWORK_EFI_IFR_OP_HEADER *) Source)->Length;
+ Source = Source + (UINTN) ((FRAMEWORK_EFI_IFR_OP_HEADER *) Source)->Length;
//
// Copy end-formset data to new buffer
//
- CopyMem (Destination, Source, ((EFI_IFR_OP_HEADER *) Source)->Length);
+ CopyMem (Destination, Source, ((FRAMEWORK_EFI_IFR_OP_HEADER *) Source)->Length);
//
// Zero out the original buffer and copy the updated data in the new buffer to the old buffer
@@ -470,7 +470,7 @@ Returns: EFI_STATUS
ExtractDataFromHiiHandle (
- IN EFI_HII_HANDLE HiiHandle,
+ IN FRAMEWORK_EFI_HII_HANDLE HiiHandle,
IN OUT UINT16 *ImageLength,
OUT UINT8 *DefaultImage,
OUT EFI_GUID *Guid
@@ -560,31 +560,31 @@ Returns: //
RawData = (UINT8 *) ((UINTN) RawData + sizeof (EFI_HII_PACK_HEADER));
- for (Index = 0; RawData[Index] != EFI_IFR_END_FORM_SET_OP;) {
+ for (Index = 0; RawData[Index] != FRAMEWORK_EFI_IFR_END_FORM_SET_OP;) {
switch (RawData[Index]) {
- case EFI_IFR_FORM_SET_OP:
+ case FRAMEWORK_EFI_IFR_FORM_SET_OP:
//
// Copy the GUID information from this handle
//
- CopyMem (Guid, &((EFI_IFR_FORM_SET *) &RawData[Index])->Guid, sizeof (EFI_GUID));
+ CopyMem (Guid, &((FRAMEWORK_EFI_IFR_FORM_SET *) &RawData[Index])->Guid, sizeof (EFI_GUID));
break;
- case EFI_IFR_ONE_OF_OP:
- case EFI_IFR_CHECKBOX_OP:
- case EFI_IFR_NUMERIC_OP:
- case EFI_IFR_DATE_OP:
- case EFI_IFR_TIME_OP:
- case EFI_IFR_PASSWORD_OP:
- case EFI_IFR_STRING_OP:
+ case FRAMEWORK_EFI_IFR_ONE_OF_OP:
+ case FRAMEWORK_EFI_IFR_CHECKBOX_OP:
+ case FRAMEWORK_EFI_IFR_NUMERIC_OP:
+ case FRAMEWORK_EFI_IFR_DATE_OP:
+ case FRAMEWORK_EFI_IFR_TIME_OP:
+ case FRAMEWORK_EFI_IFR_PASSWORD_OP:
+ case FRAMEWORK_EFI_IFR_STRING_OP:
//
// Remember, multiple op-codes may reference the same item, so let's keep a running
// marker of what the highest QuestionId that wasn't zero length. This will accurately
// maintain the Size of the NvStore
//
- if (((EFI_IFR_ONE_OF *) &RawData[Index])->Width != 0) {
- Temp = ((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId + ((EFI_IFR_ONE_OF *) &RawData[Index])->Width;
+ if (((FRAMEWORK_EFI_IFR_ONE_OF *) &RawData[Index])->Width != 0) {
+ Temp = ((FRAMEWORK_EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId + ((FRAMEWORK_EFI_IFR_ONE_OF *) &RawData[Index])->Width;
if (SizeOfNvStore < Temp) {
- SizeOfNvStore = ((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId + ((EFI_IFR_ONE_OF *) &RawData[Index])->Width;
+ SizeOfNvStore = ((FRAMEWORK_EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId + ((FRAMEWORK_EFI_IFR_ONE_OF *) &RawData[Index])->Width;
}
}
}
@@ -608,26 +608,26 @@ Returns: //
// Copy the default image information to the user's buffer
//
- for (Index = 0; RawData[Index] != EFI_IFR_END_FORM_SET_OP;) {
+ for (Index = 0; RawData[Index] != FRAMEWORK_EFI_IFR_END_FORM_SET_OP;) {
switch (RawData[Index]) {
- case EFI_IFR_ONE_OF_OP:
- CachedStart = ((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId;
+ case FRAMEWORK_EFI_IFR_ONE_OF_OP:
+ CachedStart = ((FRAMEWORK_EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId;
break;
- case EFI_IFR_ONE_OF_OPTION_OP:
- if (((EFI_IFR_ONE_OF_OPTION *) &RawData[Index])->Flags & EFI_IFR_FLAG_DEFAULT) {
- CopyMem (&DefaultImage[CachedStart], &((EFI_IFR_ONE_OF_OPTION *) &RawData[Index])->Value, 2);
+ case FRAMEWORK_EFI_IFR_ONE_OF_OPTION_OP:
+ if (((FRAMEWORK_EFI_IFR_ONE_OF_OPTION *) &RawData[Index])->Flags & FRAMEWORK_EFI_IFR_FLAG_DEFAULT) {
+ CopyMem (&DefaultImage[CachedStart], &((FRAMEWORK_EFI_IFR_ONE_OF_OPTION *) &RawData[Index])->Value, 2);
}
break;
- case EFI_IFR_CHECKBOX_OP:
- DefaultImage[((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId] = ((EFI_IFR_CHECKBOX *) &RawData[Index])->Flags;
+ case FRAMEWORK_EFI_IFR_CHECKBOX_OP:
+ DefaultImage[((FRAMEWORK_EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId] = ((FRAMEWORK_EFI_IFR_CHECKBOX *) &RawData[Index])->Flags;
break;
- case EFI_IFR_NUMERIC_OP:
+ case FRAMEWORK_EFI_IFR_NUMERIC_OP:
CopyMem (
- &DefaultImage[((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId],
- &((EFI_IFR_NUMERIC *) &RawData[Index])->Default,
+ &DefaultImage[((FRAMEWORK_EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId],
+ &((FRAMEWORK_EFI_IFR_NUMERIC *) &RawData[Index])->Default,
2
);
break;
@@ -648,7 +648,7 @@ Returns: }
-EFI_HII_HANDLE
+FRAMEWORK_EFI_HII_HANDLE
FindHiiHandle (
IN OUT EFI_HII_PROTOCOL **HiiProtocol, OPTIONAL
IN EFI_GUID *Guid
@@ -672,8 +672,8 @@ Returns: {
EFI_STATUS Status;
- EFI_HII_HANDLE *HiiHandleBuffer;
- EFI_HII_HANDLE HiiHandle;
+ FRAMEWORK_EFI_HII_HANDLE *HiiHandleBuffer;
+ FRAMEWORK_EFI_HII_HANDLE HiiHandle;
UINT16 HiiHandleBufferLength;
UINT32 NumberOfHiiHandles;
EFI_GUID HiiGuid;
@@ -741,7 +741,7 @@ Returns: goto lbl_exit;
}
- NumberOfHiiHandles = HiiHandleBufferLength / sizeof (EFI_HII_HANDLE);
+ NumberOfHiiHandles = HiiHandleBufferLength / sizeof (FRAMEWORK_EFI_HII_HANDLE );
//
// Iterate Hii handles and look for the one that matches our Guid
@@ -766,7 +766,7 @@ lbl_exit: EFI_STATUS
ValidateDataFromHiiHandle (
- IN EFI_HII_HANDLE HiiHandle,
+ IN FRAMEWORK_EFI_HII_HANDLE HiiHandle,
OUT BOOLEAN *Results
)
/*++
@@ -854,36 +854,36 @@ Returns: //
RawData = (UINT8 *) ((UINTN) RawData + sizeof (EFI_HII_PACK_HEADER));
- for (Index = 0; RawData[Index] != EFI_IFR_END_FORM_SET_OP;) {
- if (RawData[Index] == EFI_IFR_FORM_SET_OP) {
- CopyMem (&Guid, &((EFI_IFR_FORM_SET *) &RawData[Index])->Guid, sizeof (EFI_GUID));
+ for (Index = 0; RawData[Index] != FRAMEWORK_EFI_IFR_END_FORM_SET_OP;) {
+ if (RawData[Index] == FRAMEWORK_EFI_IFR_FORM_SET_OP) {
+ CopyMem (&Guid, &((FRAMEWORK_EFI_IFR_FORM_SET *) &RawData[Index])->Guid, sizeof (EFI_GUID));
break;
}
Index = RawData[Index + 1] + Index;
}
- for (Index = 0; RawData[Index] != EFI_IFR_END_FORM_SET_OP;) {
+ for (Index = 0; RawData[Index] != FRAMEWORK_EFI_IFR_END_FORM_SET_OP;) {
switch (RawData[Index]) {
- case EFI_IFR_FORM_SET_OP:
+ case FRAMEWORK_EFI_IFR_FORM_SET_OP:
break;
- case EFI_IFR_ONE_OF_OP:
- case EFI_IFR_CHECKBOX_OP:
- case EFI_IFR_NUMERIC_OP:
- case EFI_IFR_DATE_OP:
- case EFI_IFR_TIME_OP:
- case EFI_IFR_PASSWORD_OP:
- case EFI_IFR_STRING_OP:
+ case FRAMEWORK_EFI_IFR_ONE_OF_OP:
+ case FRAMEWORK_EFI_IFR_CHECKBOX_OP:
+ case FRAMEWORK_EFI_IFR_NUMERIC_OP:
+ case FRAMEWORK_EFI_IFR_DATE_OP:
+ case FRAMEWORK_EFI_IFR_TIME_OP:
+ case FRAMEWORK_EFI_IFR_PASSWORD_OP:
+ case FRAMEWORK_EFI_IFR_STRING_OP:
//
// Remember, multiple op-codes may reference the same item, so let's keep a running
// marker of what the highest QuestionId that wasn't zero length. This will accurately
// maintain the Size of the NvStore
//
- if (((EFI_IFR_ONE_OF *) &RawData[Index])->Width != 0) {
- Temp = ((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId + ((EFI_IFR_ONE_OF *) &RawData[Index])->Width;
+ if (((FRAMEWORK_EFI_IFR_ONE_OF *) &RawData[Index])->Width != 0) {
+ Temp = ((FRAMEWORK_EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId + ((FRAMEWORK_EFI_IFR_ONE_OF *) &RawData[Index])->Width;
if (SizeOfNvStore < Temp) {
- SizeOfNvStore = ((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId + ((EFI_IFR_ONE_OF *) &RawData[Index])->Width;
+ SizeOfNvStore = ((FRAMEWORK_EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId + ((FRAMEWORK_EFI_IFR_ONE_OF *) &RawData[Index])->Width;
}
}
}
@@ -942,25 +942,25 @@ Returns: // This allows for the possibility of stale (obsoleted) data in the variable
// can be overlooked without causing an error
//
- for (Index = 0; RawData[Index] != EFI_IFR_END_FORM_SET_OP;) {
+ for (Index = 0; RawData[Index] != FRAMEWORK_EFI_IFR_END_FORM_SET_OP;) {
switch (RawData[Index]) {
- case EFI_IFR_ONE_OF_OP:
+ case FRAMEWORK_EFI_IFR_ONE_OF_OP:
//
// A one_of has no data, its the option that does - cache the storage Id
//
- CachedStart = ((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId;
+ CachedStart = ((FRAMEWORK_EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId;
break;
- case EFI_IFR_ONE_OF_OPTION_OP:
+ case FRAMEWORK_EFI_IFR_ONE_OF_OPTION_OP:
//
// A one_of_option can be any value
//
- if (VariableData[CachedStart] == ((EFI_IFR_ONE_OF_OPTION *) &RawData[Index])->Value) {
+ if (VariableData[CachedStart] == ((FRAMEWORK_EFI_IFR_ONE_OF_OPTION *) &RawData[Index])->Value) {
GotMatch = TRUE;
}
break;
- case EFI_IFR_END_ONE_OF_OP:
+ case FRAMEWORK_EFI_IFR_END_ONE_OF_OP:
//
// At this point lets make sure that the data value in the NVRAM matches one of the options
//
@@ -970,20 +970,20 @@ Returns: }
break;
- case EFI_IFR_CHECKBOX_OP:
+ case FRAMEWORK_EFI_IFR_CHECKBOX_OP:
//
// A checkbox is a boolean, so 0 and 1 are valid
// Remember, QuestionId corresponds to the offset location of the data in the variable
//
- if (VariableData[((EFI_IFR_CHECKBOX *) &RawData[Index])->QuestionId] > 1) {
+ if (VariableData[((FRAMEWORK_EFI_IFR_CHECKBOX *) &RawData[Index])->QuestionId] > 1) {
*Results = FALSE;
return EFI_SUCCESS;
}
break;
- case EFI_IFR_NUMERIC_OP:
- if ((VariableData[((EFI_IFR_NUMERIC *)&RawData[Index])->QuestionId] < ((EFI_IFR_NUMERIC *)&RawData[Index])->Minimum) ||
- (VariableData[((EFI_IFR_NUMERIC *)&RawData[Index])->QuestionId] > ((EFI_IFR_NUMERIC *)&RawData[Index])->Maximum)) {
+ case FRAMEWORK_EFI_IFR_NUMERIC_OP:
+ if ((VariableData[((FRAMEWORK_EFI_IFR_NUMERIC *)&RawData[Index])->QuestionId] < ((FRAMEWORK_EFI_IFR_NUMERIC *)&RawData[Index])->Minimum) ||
+ (VariableData[((FRAMEWORK_EFI_IFR_NUMERIC *)&RawData[Index])->QuestionId] > ((FRAMEWORK_EFI_IFR_NUMERIC *)&RawData[Index])->Maximum)) {
*Results = FALSE;
return EFI_SUCCESS;
}
@@ -1003,3 +1003,4 @@ Returns: return EFI_SUCCESS;
}
+
diff --git a/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrOnTheFly.c b/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrOnTheFly.c index e9ab48246c..04de7042ea 100644 --- a/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrOnTheFly.c +++ b/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrOnTheFly.c @@ -63,8 +63,8 @@ Returns: {
EFI_STATUS Status;
EFI_HII_IFR_PACK IfrPack;
- EFI_IFR_FORM_SET FormSet;
- EFI_IFR_END_FORM_SET EndFormSet;
+ FRAMEWORK_EFI_IFR_FORM_SET FormSet;
+ FRAMEWORK_EFI_IFR_END_FORM_SET EndFormSet;
UINT8 *Destination;
CHAR16 CurrentLanguage[4];
STRING_REF StringToken;
@@ -103,14 +103,14 @@ Returns: //
// Initialize the Ifr Package header data
//
- IfrPack.Header.Length = sizeof (EFI_HII_PACK_HEADER) + sizeof (EFI_IFR_FORM_SET) + sizeof (EFI_IFR_END_FORM_SET);
+ IfrPack.Header.Length = sizeof (EFI_HII_PACK_HEADER) + sizeof (FRAMEWORK_EFI_IFR_FORM_SET) + sizeof (FRAMEWORK_EFI_IFR_END_FORM_SET);
IfrPack.Header.Type = EFI_HII_IFR;
//
// Initialize FormSet with the appropriate information
//
- FormSet.Header.OpCode = EFI_IFR_FORM_SET_OP;
- FormSet.Header.Length = sizeof (EFI_IFR_FORM_SET);
+ FormSet.Header.OpCode = FRAMEWORK_EFI_IFR_FORM_SET_OP;
+ FormSet.Header.Length = sizeof (FRAMEWORK_EFI_IFR_FORM_SET);
FormSet.FormSetTitle = StringToken;
FormSet.Class = Class;
FormSet.SubClass = SubClass;
@@ -119,8 +119,8 @@ Returns: //
// Initialize the end formset data
//
- EndFormSet.Header.Length = sizeof (EFI_IFR_END_FORM_SET);
- EndFormSet.Header.OpCode = EFI_IFR_END_FORM_SET_OP;
+ EndFormSet.Header.Length = sizeof (FRAMEWORK_EFI_IFR_END_FORM_SET);
+ EndFormSet.Header.OpCode = FRAMEWORK_EFI_IFR_END_FORM_SET_OP;
Destination = (UINT8 *) *FormBuffer;
@@ -131,11 +131,11 @@ Returns: Destination = Destination + sizeof (EFI_HII_PACK_HEADER);
- CopyMem (Destination, &FormSet, sizeof (EFI_IFR_FORM_SET));
+ CopyMem (Destination, &FormSet, sizeof (FRAMEWORK_EFI_IFR_FORM_SET));
- Destination = Destination + sizeof (EFI_IFR_FORM_SET);
+ Destination = Destination + sizeof (FRAMEWORK_EFI_IFR_FORM_SET);
- CopyMem (Destination, &EndFormSet, sizeof (EFI_IFR_END_FORM_SET));
+ CopyMem (Destination, &EndFormSet, sizeof (FRAMEWORK_EFI_IFR_END_FORM_SET));
return EFI_SUCCESS;
}
@@ -170,8 +170,8 @@ Returns: --*/
{
EFI_STATUS Status;
- EFI_IFR_FORM Form;
- EFI_IFR_END_FORM EndForm;
+ FRAMEWORK_EFI_IFR_FORM Form;
+ FRAMEWORK_EFI_IFR_END_FORM EndForm;
CHAR16 CurrentLanguage[4];
STRING_REF StringToken;
@@ -186,8 +186,8 @@ Returns: return Status;
}
- Form.Header.OpCode = EFI_IFR_FORM_OP;
- Form.Header.Length = sizeof (EFI_IFR_FORM);
+ Form.Header.OpCode = FRAMEWORK_EFI_IFR_FORM_OP;
+ Form.Header.Length = sizeof (FRAMEWORK_EFI_IFR_FORM);
Form.FormId = FormId;
Form.FormTitle = StringToken;
@@ -197,8 +197,8 @@ Returns: return Status;
}
- EndForm.Header.OpCode = EFI_IFR_END_FORM_OP;
- EndForm.Header.Length = sizeof (EFI_IFR_END_FORM);
+ EndForm.Header.OpCode = FRAMEWORK_EFI_IFR_END_FORM_OP;
+ EndForm.Header.Length = sizeof (FRAMEWORK_EFI_IFR_END_FORM);
Status = AddOpCode (FormBuffer, &EndForm);
@@ -237,7 +237,7 @@ Returns: --*/
{
EFI_STATUS Status;
- EFI_IFR_SUBTITLE Subtitle;
+ FRAMEWORK_EFI_IFR_SUBTITLE Subtitle;
CHAR16 CurrentLanguage[4];
STRING_REF StringToken;
@@ -252,8 +252,8 @@ Returns: return Status;
}
- Subtitle.Header.OpCode = EFI_IFR_SUBTITLE_OP;
- Subtitle.Header.Length = sizeof (EFI_IFR_SUBTITLE);
+ Subtitle.Header.OpCode = FRAMEWORK_EFI_IFR_SUBTITLE_OP;
+ Subtitle.Header.Length = sizeof (FRAMEWORK_EFI_IFR_SUBTITLE);
Subtitle.SubTitle = StringToken;
Status = AddOpCode (FormBuffer, &Subtitle);
@@ -305,7 +305,7 @@ Returns: --*/
{
EFI_STATUS Status;
- EFI_IFR_TEXT Text;
+ FRAMEWORK_EFI_IFR_TEXT Text;
CHAR16 CurrentLanguage[4];
STRING_REF StringToken;
@@ -323,8 +323,8 @@ Returns: return Status;
}
- Text.Header.OpCode = EFI_IFR_TEXT_OP;
- Text.Header.Length = sizeof (EFI_IFR_TEXT);
+ Text.Header.OpCode = FRAMEWORK_EFI_IFR_TEXT_OP;
+ Text.Header.Length = sizeof (FRAMEWORK_EFI_IFR_TEXT);
Text.Text = StringToken;
//
@@ -338,7 +338,7 @@ Returns: Text.TextTwo = StringToken;
- Text.Flags = (UINT8) (Flags | EFI_IFR_FLAG_CREATED);
+ Text.Flags = (UINT8) (Flags | FRAMEWORK_EFI_IFR_FLAG_CREATED);
Text.Key = Key;
//
@@ -392,7 +392,7 @@ Returns: --*/
{
EFI_STATUS Status;
- EFI_IFR_REF Hyperlink;
+ FRAMEWORK_EFI_IFR_REF Hyperlink;
CHAR16 CurrentLanguage[4];
STRING_REF StringToken;
@@ -407,8 +407,8 @@ Returns: return Status;
}
- Hyperlink.Header.OpCode = EFI_IFR_REF_OP;
- Hyperlink.Header.Length = sizeof (EFI_IFR_REF);
+ Hyperlink.Header.OpCode = FRAMEWORK_EFI_IFR_REF_OP;
+ Hyperlink.Header.Length = sizeof (FRAMEWORK_EFI_IFR_REF);
Hyperlink.FormId = FormId;
Hyperlink.Prompt = StringToken;
@@ -468,9 +468,9 @@ Returns: {
EFI_STATUS Status;
UINTN Index;
- EFI_IFR_ONE_OF OneOf;
- EFI_IFR_ONE_OF_OPTION OneOfOption;
- EFI_IFR_END_ONE_OF EndOneOf;
+ FRAMEWORK_EFI_IFR_ONE_OF OneOf;
+ FRAMEWORK_EFI_IFR_ONE_OF_OPTION OneOfOption;
+ FRAMEWORK_EFI_IFR_END_ONE_OF EndOneOf;
CHAR16 CurrentLanguage[4];
STRING_REF StringToken;
@@ -495,8 +495,8 @@ Returns: return Status;
}
- OneOf.Header.OpCode = EFI_IFR_ONE_OF_OP;
- OneOf.Header.Length = sizeof (EFI_IFR_ONE_OF);
+ OneOf.Header.OpCode = FRAMEWORK_EFI_IFR_ONE_OF_OP;
+ OneOf.Header.Length = sizeof (FRAMEWORK_EFI_IFR_ONE_OF);
OneOf.QuestionId = QuestionId;
OneOf.Width = DataWidth;
OneOf.Prompt = StringToken;
@@ -519,8 +519,8 @@ Returns: }
for (Index = 0; Index < OptionCount; Index++) {
- OneOfOption.Header.OpCode = EFI_IFR_ONE_OF_OPTION_OP;
- OneOfOption.Header.Length = sizeof (EFI_IFR_ONE_OF_OPTION);
+ OneOfOption.Header.OpCode = FRAMEWORK_EFI_IFR_ONE_OF_OPTION_OP;
+ OneOfOption.Header.Length = sizeof (FRAMEWORK_EFI_IFR_ONE_OF_OPTION);
//
// Add string and get token back
@@ -529,7 +529,7 @@ Returns: OneOfOption.Option = StringToken;
OneOfOption.Value = OptionsList[Index].Value;
- OneOfOption.Flags = (UINT8) (OptionsList[Index].Flags | EFI_IFR_FLAG_CREATED);
+ OneOfOption.Flags = (UINT8) (OptionsList[Index].Flags | FRAMEWORK_EFI_IFR_FLAG_CREATED);
OneOfOption.Key = OptionsList[Index].Key;
Status = AddOpCode (FormBuffer, &OneOfOption);
@@ -539,8 +539,8 @@ Returns: }
}
- EndOneOf.Header.Length = sizeof (EFI_IFR_END_ONE_OF);
- EndOneOf.Header.OpCode = EFI_IFR_END_ONE_OF_OP;
+ EndOneOf.Header.Length = sizeof (FRAMEWORK_EFI_IFR_END_ONE_OF);
+ EndOneOf.Header.OpCode = FRAMEWORK_EFI_IFR_END_ONE_OF_OP;
Status = AddOpCode (FormBuffer, &EndOneOf);
@@ -595,9 +595,9 @@ Returns: {
EFI_STATUS Status;
UINTN Index;
- EFI_IFR_ORDERED_LIST OrderedList;
- EFI_IFR_ONE_OF_OPTION OrderedListOption;
- EFI_IFR_END_ONE_OF EndOrderedList;
+ FRAMEWORK_EFI_IFR_ORDERED_LIST OrderedList;
+ FRAMEWORK_EFI_IFR_ONE_OF_OPTION OrderedListOption;
+ FRAMEWORK_EFI_IFR_END_ONE_OF EndOrderedList;
CHAR16 CurrentLanguage[4];
STRING_REF StringToken;
@@ -615,8 +615,8 @@ Returns: return Status;
}
- OrderedList.Header.OpCode = EFI_IFR_ORDERED_LIST_OP;
- OrderedList.Header.Length = sizeof (EFI_IFR_ORDERED_LIST);
+ OrderedList.Header.OpCode = FRAMEWORK_EFI_IFR_ORDERED_LIST_OP;
+ OrderedList.Header.Length = sizeof (FRAMEWORK_EFI_IFR_ORDERED_LIST);
OrderedList.QuestionId = QuestionId;
OrderedList.MaxEntries = MaxEntries;
OrderedList.Prompt = StringToken;
@@ -639,8 +639,8 @@ Returns: }
for (Index = 0; Index < OptionCount; Index++) {
- OrderedListOption.Header.OpCode = EFI_IFR_ONE_OF_OPTION_OP;
- OrderedListOption.Header.Length = sizeof (EFI_IFR_ONE_OF_OPTION);
+ OrderedListOption.Header.OpCode = FRAMEWORK_EFI_IFR_ONE_OF_OPTION_OP;
+ OrderedListOption.Header.Length = sizeof (FRAMEWORK_EFI_IFR_ONE_OF_OPTION);
//
// Add string and get token back
@@ -649,7 +649,7 @@ Returns: OrderedListOption.Option = StringToken;
OrderedListOption.Value = OptionsList[Index].Value;
- OrderedListOption.Flags = (UINT8) (OptionsList[Index].Flags | EFI_IFR_FLAG_CREATED);
+ OrderedListOption.Flags = (UINT8) (OptionsList[Index].Flags | FRAMEWORK_EFI_IFR_FLAG_CREATED);
OrderedListOption.Key = OptionsList[Index].Key;
Status = AddOpCode (FormBuffer, &OrderedListOption);
@@ -659,8 +659,8 @@ Returns: }
}
- EndOrderedList.Header.Length = sizeof (EFI_IFR_END_ONE_OF);
- EndOrderedList.Header.OpCode = EFI_IFR_END_ONE_OF_OP;
+ EndOrderedList.Header.Length = sizeof (FRAMEWORK_EFI_IFR_END_ONE_OF);
+ EndOrderedList.Header.OpCode = FRAMEWORK_EFI_IFR_END_ONE_OF_OP;
Status = AddOpCode (FormBuffer, &EndOrderedList);
@@ -713,7 +713,7 @@ Returns: --*/
{
EFI_STATUS Status;
- EFI_IFR_CHECKBOX CheckBox;
+ FRAMEWORK_EFI_IFR_CHECKBOX CheckBox;
CHAR16 CurrentLanguage[4];
STRING_REF StringToken;
@@ -738,8 +738,8 @@ Returns: return Status;
}
- CheckBox.Header.OpCode = EFI_IFR_CHECKBOX_OP;
- CheckBox.Header.Length = sizeof (EFI_IFR_CHECKBOX);
+ CheckBox.Header.OpCode = FRAMEWORK_EFI_IFR_CHECKBOX_OP;
+ CheckBox.Header.Length = sizeof (FRAMEWORK_EFI_IFR_CHECKBOX);
CheckBox.QuestionId = QuestionId;
CheckBox.Width = DataWidth;
CheckBox.Prompt = StringToken;
@@ -754,7 +754,7 @@ Returns: }
CheckBox.Help = StringToken;
- CheckBox.Flags = (UINT8) (Flags | EFI_IFR_FLAG_CREATED);
+ CheckBox.Flags = (UINT8) (Flags | FRAMEWORK_EFI_IFR_FLAG_CREATED);
Status = AddOpCode (FormBuffer, &CheckBox);
@@ -822,7 +822,7 @@ Returns: --*/
{
EFI_STATUS Status;
- EFI_IFR_NUMERIC Numeric;
+ FRAMEWORK_EFI_IFR_NUMERIC Numeric;
CHAR16 CurrentLanguage[4];
STRING_REF StringToken;
@@ -847,8 +847,8 @@ Returns: return Status;
}
- Numeric.Header.OpCode = EFI_IFR_NUMERIC_OP;
- Numeric.Header.Length = sizeof (EFI_IFR_NUMERIC);
+ Numeric.Header.OpCode = FRAMEWORK_EFI_IFR_NUMERIC_OP;
+ Numeric.Header.Length = sizeof (FRAMEWORK_EFI_IFR_NUMERIC);
Numeric.QuestionId = QuestionId;
Numeric.Width = DataWidth;
Numeric.Prompt = StringToken;
@@ -867,7 +867,7 @@ Returns: Numeric.Maximum = Maximum;
Numeric.Step = Step;
Numeric.Default = Default;
- Numeric.Flags = (UINT8) (Flags | EFI_IFR_FLAG_CREATED);
+ Numeric.Flags = (UINT8) (Flags | FRAMEWORK_EFI_IFR_FLAG_CREATED);
Numeric.Key = Key;
Status = AddOpCode (FormBuffer, &Numeric);
@@ -928,7 +928,7 @@ Returns: --*/
{
EFI_STATUS Status;
- EFI_IFR_STRING String;
+ FRAMEWORK_EFI_IFR_STRING String;
CHAR16 CurrentLanguage[4];
STRING_REF StringToken;
@@ -946,8 +946,8 @@ Returns: return Status;
}
- String.Header.OpCode = EFI_IFR_STRING_OP;
- String.Header.Length = sizeof (EFI_IFR_STRING);
+ String.Header.OpCode = FRAMEWORK_EFI_IFR_STRING_OP;
+ String.Header.Length = sizeof (FRAMEWORK_EFI_IFR_STRING);
String.QuestionId = QuestionId;
String.Width = DataWidth;
String.Prompt = StringToken;
@@ -964,7 +964,7 @@ Returns: String.Help = StringToken;
String.MinSize = MinSize;
String.MaxSize = MaxSize;
- String.Flags = (UINT8) (Flags | EFI_IFR_FLAG_CREATED);
+ String.Flags = (UINT8) (Flags | FRAMEWORK_EFI_IFR_FLAG_CREATED);
String.Key = Key;
Status = AddOpCode (FormBuffer, &String);
diff --git a/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrOpCodeCreation.c b/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrOpCodeCreation.c index 05b123887c..0e24058081 100644 --- a/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrOpCodeCreation.c +++ b/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrOpCodeCreation.c @@ -51,13 +51,13 @@ Returns: --*/
{
- EFI_IFR_SUBTITLE Subtitle;
+ FRAMEWORK_EFI_IFR_SUBTITLE Subtitle;
- Subtitle.Header.OpCode = EFI_IFR_SUBTITLE_OP;
- Subtitle.Header.Length = sizeof (EFI_IFR_SUBTITLE);
+ Subtitle.Header.OpCode = FRAMEWORK_EFI_IFR_SUBTITLE_OP;
+ Subtitle.Header.Length = sizeof (FRAMEWORK_EFI_IFR_SUBTITLE);
Subtitle.SubTitle = StringToken;
- CopyMem (FormBuffer, &Subtitle, sizeof (EFI_IFR_SUBTITLE));
+ CopyMem (FormBuffer, &Subtitle, sizeof (FRAMEWORK_EFI_IFR_SUBTITLE));
return EFI_SUCCESS;
}
@@ -100,10 +100,10 @@ Returns: --*/
{
- EFI_IFR_TEXT Text;
+ FRAMEWORK_EFI_IFR_TEXT Text;
- Text.Header.OpCode = EFI_IFR_TEXT_OP;
- Text.Header.Length = sizeof (EFI_IFR_TEXT);
+ Text.Header.OpCode = FRAMEWORK_EFI_IFR_TEXT_OP;
+ Text.Header.Length = sizeof (FRAMEWORK_EFI_IFR_TEXT);
Text.Text = StringToken;
Text.TextTwo = StringTokenTwo;
@@ -111,7 +111,7 @@ Returns: Text.Flags = Flags;
Text.Key = Key;
- CopyMem (FormBuffer, &Text, sizeof (EFI_IFR_TEXT));
+ CopyMem (FormBuffer, &Text, sizeof (FRAMEWORK_EFI_IFR_TEXT));
return EFI_SUCCESS;
}
@@ -155,17 +155,17 @@ Returns: --*/
{
- EFI_IFR_REF Hyperlink;
+ FRAMEWORK_EFI_IFR_REF Hyperlink;
- Hyperlink.Header.OpCode = EFI_IFR_REF_OP;
- Hyperlink.Header.Length = sizeof (EFI_IFR_REF);
+ Hyperlink.Header.OpCode = FRAMEWORK_EFI_IFR_REF_OP;
+ Hyperlink.Header.Length = sizeof (FRAMEWORK_EFI_IFR_REF);
Hyperlink.FormId = FormId;
Hyperlink.Prompt = StringToken;
Hyperlink.Help = StringTokenTwo;
Hyperlink.Key = Key;
Hyperlink.Flags = Flags;
- CopyMem (FormBuffer, &Hyperlink, sizeof (EFI_IFR_REF));
+ CopyMem (FormBuffer, &Hyperlink, sizeof (FRAMEWORK_EFI_IFR_REF));
return EFI_SUCCESS;
}
@@ -218,9 +218,9 @@ Returns: --*/
{
UINTN Index;
- EFI_IFR_ONE_OF OneOf;
- EFI_IFR_ONE_OF_OPTION OneOfOption;
- EFI_IFR_END_ONE_OF EndOneOf;
+ FRAMEWORK_EFI_IFR_ONE_OF OneOf;
+ FRAMEWORK_EFI_IFR_ONE_OF_OPTION OneOfOption;
+ FRAMEWORK_EFI_IFR_END_ONE_OF EndOneOf;
UINT8 *LocalBuffer;
//
@@ -230,8 +230,8 @@ Returns: return EFI_DEVICE_ERROR;
}
- OneOf.Header.OpCode = EFI_IFR_ONE_OF_OP;
- OneOf.Header.Length = sizeof (EFI_IFR_ONE_OF);
+ OneOf.Header.OpCode = FRAMEWORK_EFI_IFR_ONE_OF_OP;
+ OneOf.Header.Length = sizeof (FRAMEWORK_EFI_IFR_ONE_OF);
OneOf.QuestionId = QuestionId;
OneOf.Width = DataWidth;
OneOf.Prompt = PromptToken;
@@ -240,30 +240,30 @@ Returns: LocalBuffer = (UINT8 *) FormBuffer;
- CopyMem (LocalBuffer, &OneOf, sizeof (EFI_IFR_ONE_OF));
+ CopyMem (LocalBuffer, &OneOf, sizeof (FRAMEWORK_EFI_IFR_ONE_OF));
- LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (EFI_IFR_ONE_OF));
+ LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (FRAMEWORK_EFI_IFR_ONE_OF));
for (Index = 0; Index < OptionCount; Index++) {
- OneOfOption.Header.OpCode = EFI_IFR_ONE_OF_OPTION_OP;
- OneOfOption.Header.Length = sizeof (EFI_IFR_ONE_OF_OPTION);
+ OneOfOption.Header.OpCode = FRAMEWORK_EFI_IFR_ONE_OF_OPTION_OP;
+ OneOfOption.Header.Length = sizeof (FRAMEWORK_EFI_IFR_ONE_OF_OPTION);
OneOfOption.Option = OptionsList[Index].StringToken;
OneOfOption.Value = OptionsList[Index].Value;
OneOfOption.Flags = OptionsList[Index].Flags;
OneOfOption.Key = OptionsList[Index].Key;
- CopyMem (LocalBuffer, &OneOfOption, sizeof (EFI_IFR_ONE_OF_OPTION));
+ CopyMem (LocalBuffer, &OneOfOption, sizeof (FRAMEWORK_EFI_IFR_ONE_OF_OPTION));
- LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (EFI_IFR_ONE_OF_OPTION));
+ LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (FRAMEWORK_EFI_IFR_ONE_OF_OPTION));
}
- EndOneOf.Header.Length = sizeof (EFI_IFR_END_ONE_OF);
- EndOneOf.Header.OpCode = EFI_IFR_END_ONE_OF_OP;
+ EndOneOf.Header.Length = sizeof (FRAMEWORK_EFI_IFR_END_ONE_OF);
+ EndOneOf.Header.OpCode = FRAMEWORK_EFI_IFR_END_ONE_OF_OP;
- CopyMem (LocalBuffer, &EndOneOf, sizeof (EFI_IFR_END_ONE_OF));
+ CopyMem (LocalBuffer, &EndOneOf, sizeof (FRAMEWORK_EFI_IFR_END_ONE_OF));
- LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (EFI_IFR_END_ONE_OF));
+ LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (FRAMEWORK_EFI_IFR_END_ONE_OF));
return EFI_SUCCESS;
}
@@ -313,13 +313,13 @@ Returns: --*/
{
UINTN Index;
- EFI_IFR_ORDERED_LIST OrderedList;
- EFI_IFR_ONE_OF_OPTION OrderedListOption;
- EFI_IFR_END_ONE_OF EndOrderedList;
+ FRAMEWORK_EFI_IFR_ORDERED_LIST OrderedList;
+ FRAMEWORK_EFI_IFR_ONE_OF_OPTION OrderedListOption;
+ FRAMEWORK_EFI_IFR_END_ONE_OF EndOrderedList;
UINT8 *LocalBuffer;
- OrderedList.Header.OpCode = EFI_IFR_ORDERED_LIST_OP;
- OrderedList.Header.Length = sizeof (EFI_IFR_ORDERED_LIST);
+ OrderedList.Header.OpCode = FRAMEWORK_EFI_IFR_ORDERED_LIST_OP;
+ OrderedList.Header.Length = sizeof (FRAMEWORK_EFI_IFR_ORDERED_LIST);
OrderedList.QuestionId = QuestionId;
OrderedList.MaxEntries = MaxEntries;
OrderedList.Prompt = PromptToken;
@@ -328,30 +328,30 @@ Returns: LocalBuffer = (UINT8 *) FormBuffer;
- CopyMem (LocalBuffer, &OrderedList, sizeof (EFI_IFR_ORDERED_LIST));
+ CopyMem (LocalBuffer, &OrderedList, sizeof (FRAMEWORK_EFI_IFR_ORDERED_LIST));
- LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (EFI_IFR_ORDERED_LIST));
+ LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (FRAMEWORK_EFI_IFR_ORDERED_LIST));
for (Index = 0; Index < OptionCount; Index++) {
- OrderedListOption.Header.OpCode = EFI_IFR_ONE_OF_OPTION_OP;
- OrderedListOption.Header.Length = sizeof (EFI_IFR_ONE_OF_OPTION);
+ OrderedListOption.Header.OpCode = FRAMEWORK_EFI_IFR_ONE_OF_OPTION_OP;
+ OrderedListOption.Header.Length = sizeof (FRAMEWORK_EFI_IFR_ONE_OF_OPTION);
OrderedListOption.Option = OptionsList[Index].StringToken;
OrderedListOption.Value = OptionsList[Index].Value;
OrderedListOption.Flags = OptionsList[Index].Flags;
OrderedListOption.Key = OptionsList[Index].Key;
- CopyMem (LocalBuffer, &OrderedListOption, sizeof (EFI_IFR_ONE_OF_OPTION));
+ CopyMem (LocalBuffer, &OrderedListOption, sizeof (FRAMEWORK_EFI_IFR_ONE_OF_OPTION));
- LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (EFI_IFR_ONE_OF_OPTION));
+ LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (FRAMEWORK_EFI_IFR_ONE_OF_OPTION));
}
- EndOrderedList.Header.Length = sizeof (EFI_IFR_END_ONE_OF);
- EndOrderedList.Header.OpCode = EFI_IFR_END_ONE_OF_OP;
+ EndOrderedList.Header.Length = sizeof (FRAMEWORK_EFI_IFR_END_ONE_OF);
+ EndOrderedList.Header.OpCode = FRAMEWORK_EFI_IFR_END_ONE_OF_OP;
- CopyMem (LocalBuffer, &EndOrderedList, sizeof (EFI_IFR_END_ONE_OF));
+ CopyMem (LocalBuffer, &EndOrderedList, sizeof (FRAMEWORK_EFI_IFR_END_ONE_OF));
- LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (EFI_IFR_END_ONE_OF));
+ LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (FRAMEWORK_EFI_IFR_END_ONE_OF));
return EFI_SUCCESS;
}
@@ -399,7 +399,7 @@ Returns: --*/
{
- EFI_IFR_CHECKBOX CheckBox;
+ FRAMEWORK_EFI_IFR_CHECKBOX CheckBox;
//
// We do not create op-code storage widths for checkbox in excess of 8 bits for now
@@ -408,8 +408,8 @@ Returns: return EFI_DEVICE_ERROR;
}
- CheckBox.Header.OpCode = EFI_IFR_CHECKBOX_OP;
- CheckBox.Header.Length = sizeof (EFI_IFR_CHECKBOX);
+ CheckBox.Header.OpCode = FRAMEWORK_EFI_IFR_CHECKBOX_OP;
+ CheckBox.Header.Length = sizeof (FRAMEWORK_EFI_IFR_CHECKBOX);
CheckBox.QuestionId = QuestionId;
CheckBox.Width = DataWidth;
CheckBox.Prompt = PromptToken;
@@ -418,7 +418,7 @@ Returns: CheckBox.Flags = Flags;
CheckBox.Key = Key;
- CopyMem (FormBuffer, &CheckBox, sizeof (EFI_IFR_CHECKBOX));
+ CopyMem (FormBuffer, &CheckBox, sizeof (FRAMEWORK_EFI_IFR_CHECKBOX));
return EFI_SUCCESS;
}
@@ -479,7 +479,7 @@ Returns: --*/
{
- EFI_IFR_NUMERIC Numeric;
+ FRAMEWORK_EFI_IFR_NUMERIC Numeric;
//
// We do not create op-code storage widths for numerics in excess of 16 bits for now
@@ -488,8 +488,8 @@ Returns: return EFI_DEVICE_ERROR;
}
- Numeric.Header.OpCode = EFI_IFR_NUMERIC_OP;
- Numeric.Header.Length = sizeof (EFI_IFR_NUMERIC);
+ Numeric.Header.OpCode = FRAMEWORK_EFI_IFR_NUMERIC_OP;
+ Numeric.Header.Length = sizeof (FRAMEWORK_EFI_IFR_NUMERIC);
Numeric.QuestionId = QuestionId;
Numeric.Width = DataWidth;
Numeric.Prompt = PromptToken;
@@ -502,7 +502,7 @@ Returns: Numeric.Flags = Flags;
Numeric.Key = Key;
- CopyMem (FormBuffer, &Numeric, sizeof (EFI_IFR_NUMERIC));
+ CopyMem (FormBuffer, &Numeric, sizeof (FRAMEWORK_EFI_IFR_NUMERIC));
return EFI_SUCCESS;
}
@@ -555,10 +555,10 @@ Returns: --*/
{
- EFI_IFR_STRING String;
+ FRAMEWORK_EFI_IFR_STRING String;
- String.Header.OpCode = EFI_IFR_STRING_OP;
- String.Header.Length = sizeof (EFI_IFR_STRING);
+ String.Header.OpCode = FRAMEWORK_EFI_IFR_STRING_OP;
+ String.Header.Length = sizeof (FRAMEWORK_EFI_IFR_STRING);
String.QuestionId = QuestionId;
String.Width = DataWidth;
String.Prompt = PromptToken;
@@ -569,7 +569,7 @@ Returns: String.Flags = Flags;
String.Key = Key;
- CopyMem (FormBuffer, &String, sizeof (EFI_IFR_STRING));
+ CopyMem (FormBuffer, &String, sizeof (FRAMEWORK_EFI_IFR_STRING));
return EFI_SUCCESS;
}
@@ -604,15 +604,15 @@ Returns: --*/
{
- EFI_IFR_BANNER Banner;
+ FRAMEWORK_EFI_IFR_BANNER Banner;
- Banner.Header.OpCode = EFI_IFR_BANNER_OP;
- Banner.Header.Length = sizeof (EFI_IFR_BANNER);
+ Banner.Header.OpCode = FRAMEWORK_EFI_IFR_BANNER_OP;
+ Banner.Header.Length = sizeof (FRAMEWORK_EFI_IFR_BANNER);
CopyMem (&Banner.Title, &Title, sizeof (UINT16));
CopyMem (&Banner.LineNumber, &LineNumber, sizeof (UINT16));
Banner.Alignment = Alignment;
- CopyMem (FormBuffer, &Banner, sizeof (EFI_IFR_BANNER));
+ CopyMem (FormBuffer, &Banner, sizeof (FRAMEWORK_EFI_IFR_BANNER));
return EFI_SUCCESS;
}
diff --git a/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrSupportLibInternal.h b/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrSupportLibInternal.h index 033b3969da..8dce61bd9a 100644 --- a/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrSupportLibInternal.h +++ b/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrSupportLibInternal.h @@ -15,9 +15,7 @@ #ifndef __IFRSUPPORT_LIB_INTERNAL_H_
#define __IFRSUPPORT_LIB_INTERNAL_H_
-
-
-#include <PiDxe.h>
+#include <FrameworkDxe.h>
#include <Guid/GlobalVariable.h>
#include <Protocol/FrameworkHii.h>
|