diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-07-12 23:37:54 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-07-12 23:37:54 +0000 |
commit | 47a16b84f23e83c49d0fa0c5f9ae507df4b5c986 (patch) | |
tree | f182e881abe098d53da4c68b20d46597d696d3db /EdkModulePkg/Universal/UserInterface | |
parent | 2a7b1e115dbb01cc5ad2dccde4608afefb8203a2 (diff) | |
download | edk2-47a16b84f23e83c49d0fa0c5f9ae507df4b5c986.zip edk2-47a16b84f23e83c49d0fa0c5f9ae507df4b5c986.tar.gz edk2-47a16b84f23e83c49d0fa0c5f9ae507df4b5c986.tar.bz2 |
Add missing files in msa file and add module description in msa file, and reorganize DriverSample and DxeIplX64 module directory.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@926 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg/Universal/UserInterface')
11 files changed, 1625 insertions, 6 deletions
diff --git a/EdkModulePkg/Universal/UserInterface/DriverSample/DriverSample.c b/EdkModulePkg/Universal/UserInterface/DriverSample/DriverSample.c new file mode 100644 index 0000000..5f3823c --- /dev/null +++ b/EdkModulePkg/Universal/UserInterface/DriverSample/DriverSample.c @@ -0,0 +1,631 @@ +/*++
+Copyright (c) 2006, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+Module Name:
+ DriverSample.c
+
+Abstract:
+
+ This is an example of how a driver might export data to the HII protocol to be
+ later utilized by the Setup Protocol
+
+--*/
+
+#include "DriverSample.h"
+
+#define DISPLAY_ONLY_MY_ITEM 0x0001
+
+#define STRING_PACK_GUID \
+ { \
+ 0x8160a85f, 0x934d, 0x468b, { 0xa2, 0x35, 0x72, 0x89, 0x59, 0x14, 0xf6, 0xfc } \
+ }
+
+EFI_GUID mFormSetGuid = FORMSET_GUID;
+EFI_GUID mStringPackGuid = STRING_PACK_GUID;
+
+EFI_STATUS
+EFIAPI
+DriverCallback (
+ IN EFI_FORM_CALLBACK_PROTOCOL *This,
+ IN UINT16 KeyValue,
+ IN EFI_IFR_DATA_ARRAY *Data,
+ OUT EFI_HII_CALLBACK_PACKET **Packet
+ )
+/*++
+
+Routine Description:
+
+ This is the function that is called to provide results data to the driver. This data
+ consists of a unique key which is used to identify what data is either being passed back
+ or being asked for.
+
+Arguments:
+
+ KeyValue - A unique value which is sent to the original exporting driver so that it
+ can identify the type of data to expect. The format of the data tends to
+ vary based on the op-code that geerated the callback.
+
+ Data - A pointer to the data being sent to the original exporting driver.
+
+Returns:
+
+--*/
+{
+ EFI_CALLBACK_INFO *Private;
+ EFI_HII_UPDATE_DATA *UpdateData;
+ EFI_STATUS Status;
+ UINT8 *Location;
+ EFI_HII_CALLBACK_PACKET *DataPacket;
+ UINT16 Value;
+ CHAR16 VariableName[40];
+ STATIC UINT16 QuestionId = 0;
+ IFR_OPTION *OptionList;
+ UINTN Index;
+ MyIfrNVData NVStruc;
+
+ Private = EFI_CALLBACK_INFO_FROM_THIS (This);
+
+ //
+ // This should tell me the first offset AFTER the end of the compiled NV map
+ // If op-code results are not going to be saved to NV locations ensure the QuestionId
+ // is beyond the end of the NVRAM mapping.
+ //
+ if (QuestionId == 0) {
+ QuestionId = sizeof (MyIfrNVData);
+ }
+
+ ZeroMem (VariableName, (sizeof (CHAR16) * 40));
+
+ switch (KeyValue) {
+ case 0x0001:
+ //
+ // Create a small boot order list
+ //
+ QuestionId = (UINT16) ((UINTN) (&NVStruc.BootOrder) - (UINTN) (&NVStruc));
+
+ //
+ // Need some memory for OptionList. Allow for up to 8 options.
+ //
+ OptionList = AllocateZeroPool (sizeof (IFR_OPTION) * 8);
+
+ //
+ // Allocate space for creation of Buffer
+ //
+ UpdateData = AllocateZeroPool (0x1000);
+
+ //
+ // Remove all the op-codes starting with Label 0x2222 to next Label (second label is for convenience
+ // so we don't have to keep track of how many op-codes we added or subtracted. The rules for removal
+ // of op-codes are simply that the removal will always stop as soon as a label or the end of a form is
+ // encountered. Therefore, giving a large obnoxious count such as below takes care of other complexities.
+ //
+ UpdateData->DataCount = 0xFF;
+
+ //
+ // Delete set of op-codes
+ //
+ Private->Hii->UpdateForm (
+ Private->Hii,
+ Private->RegisteredHandle,
+ (EFI_FORM_LABEL) 0x2222,
+ FALSE, // If we aren't adding, we are deleting
+ UpdateData
+ );
+
+ //
+ // Create 3 options
+ //
+ for (Index = 0; Index < 3; Index++) {
+ OptionList[Index].StringToken = (UINT16) (STR_BOOT_OPTION1 + Index);
+ OptionList[Index].Value = (UINT16) (Index + 1);
+ OptionList[Index].Flags = RESET_REQUIRED;
+ }
+
+ CreateOrderedListOpCode (
+ QuestionId, // Question ID
+ 8, // Max Entries
+ (UINT16) STRING_TOKEN (STR_BOOT_OPTIONS), // Token value for the Prompt
+ (UINT16) STRING_TOKEN (STR_NULL_STRING), // Token value for the Help
+ OptionList,
+ 3,
+ &UpdateData->Data // Buffer location to place op-codes
+ );
+
+ //
+ // For one-of/ordered lists commands, they really consist of 2 op-codes (a header and a footer)
+ // Each option within a one-of/ordered list is also an op-code
+ // So this example has 5 op-codes it is adding since we have a one-of header + 3 options + one-of footer
+ //
+ UpdateData->DataCount = 0x5;
+
+ //
+ // Add one op-code
+ //
+ Private->Hii->UpdateForm (
+ Private->Hii,
+ Private->RegisteredHandle,
+ (EFI_FORM_LABEL) 0x2222,
+ TRUE,
+ UpdateData
+ );
+
+ gBS->FreePool (UpdateData);
+ gBS->FreePool (OptionList);
+ break;
+
+ case 0x0002:
+ //
+ // Create a large boot order list
+ //
+ QuestionId = (UINT16) ((UINTN) (&NVStruc.BootOrder) - (UINTN) (&NVStruc));
+
+ //
+ // Need some memory for OptionList. Allow for up to 8 options.
+ //
+ OptionList = AllocateZeroPool (sizeof (IFR_OPTION) * 8);
+
+ //
+ // Allocate space for creation of Buffer
+ //
+ UpdateData = AllocateZeroPool (0x1000);
+
+ //
+ // Remove all the op-codes starting with Label 0x2222 to next Label (second label is for convenience
+ // so we don't have to keep track of how many op-codes we added or subtracted
+ //
+ UpdateData->DataCount = 0xFF;
+
+ //
+ // Delete one op-code
+ //
+ Private->Hii->UpdateForm (
+ Private->Hii,
+ Private->RegisteredHandle,
+ (EFI_FORM_LABEL) 0x2222,
+ FALSE,
+ UpdateData
+ );
+
+ //
+ // Create 4 options
+ //
+ for (Index = 0; Index < 4; Index++) {
+ OptionList[Index].StringToken = (UINT16) (STR_BOOT_OPTION1 + Index);
+ OptionList[Index].Value = (UINT16) (Index + 1);
+ OptionList[Index].Flags = RESET_REQUIRED;
+ }
+
+ CreateOrderedListOpCode (
+ QuestionId, // Question ID
+ 8, // Max Entries
+ (UINT16) STRING_TOKEN (STR_BOOT_OPTIONS), // Token value for the Prompt
+ (UINT16) STRING_TOKEN (STR_NULL_STRING), // Token value for the Help
+ OptionList,
+ 4,
+ &UpdateData->Data // Buffer location to place op-codes
+ );
+
+ //
+ // For one-of commands, they really consist of 2 op-codes (a header and a footer)
+ // Each option within a one-of is also an op-code
+ // So this example has 6 op-codes it is adding since we have a one-of header + 4 options + one-of footer
+ //
+ UpdateData->DataCount = 0x6;
+
+ //
+ // Add one op-code
+ //
+ Private->Hii->UpdateForm (
+ Private->Hii,
+ Private->RegisteredHandle,
+ (EFI_FORM_LABEL) 0x2222,
+ TRUE,
+ UpdateData
+ );
+
+ gBS->FreePool (UpdateData);
+ gBS->FreePool (OptionList);
+ break;
+
+ case 0x1234:
+ //
+ // Allocate space for creation of Buffer
+ //
+ QuestionId = (UINT16) ((UINTN) (&NVStruc.DynamicCheck));
+ Status = gBS->AllocatePool (
+ EfiBootServicesData,
+ 0x1000,
+ (VOID **) &UpdateData
+ );
+
+ ZeroMem (UpdateData, 0x1000);
+
+ Location = (UINT8 *) &UpdateData->Data;
+
+ UpdateData->FormSetUpdate = TRUE;
+ UpdateData->FormCallbackHandle = (EFI_PHYSICAL_ADDRESS) (UINTN) Private->CallbackHandle;
+ UpdateData->FormUpdate = FALSE;
+ UpdateData->FormTitle = 0;
+ UpdateData->DataCount = 2;
+
+ CreateGotoOpCode (
+ 1,
+ STR_GOTO_FORM1, // Token value for the Prompt
+ 0, // Goto Help
+ 0, // Flags
+ 0, // Key
+ &UpdateData->Data // Buffer location to place op-codes
+ );
+
+ Location = Location + ((EFI_IFR_OP_HEADER *) &UpdateData->Data)->Length;
+
+ CreateCheckBoxOpCode (
+ QuestionId, // Question ID
+ 1, // Data width (BOOLEAN = 1)
+ (UINT16) STRING_TOKEN (STR_CHECK_DYNAMIC_PROMPT), // Token value for the Prompt
+ (UINT16) STRING_TOKEN (STR_CHECK_DYNAMIC_HELP), // Token value for the Help
+ EFI_IFR_FLAG_INTERACTIVE, // Flags
+ 0x1236, // Key
+ Location // Buffer location to place op-codes
+ );
+
+ Private->Hii->UpdateForm (
+ Private->Hii,
+ Private->RegisteredHandle,
+ (EFI_FORM_LABEL) 0x1234,
+ TRUE,
+ UpdateData
+ );
+
+ gBS->FreePool (UpdateData);
+ QuestionId++;
+ break;
+
+ case 0x1235:
+ //
+ // Allocate space for creation of Buffer
+ //
+ Status = gBS->AllocatePool (
+ EfiBootServicesData,
+ 0x1000,
+ (VOID **)&UpdateData
+ );
+
+ ZeroMem (UpdateData, 0x1000);
+
+ //
+ // Initialize DataPacket with information intended to remove all
+ // previously created op-codes in the dynamic page
+ //
+ UpdateData->FormSetUpdate = FALSE;
+ UpdateData->FormCallbackHandle = 0;
+ UpdateData->FormUpdate = FALSE;
+ UpdateData->FormTitle = 0;
+ //
+ // Unlikely to be more than 0xff op-codes in the dynamic page to remove
+ //
+ UpdateData->DataCount = 0xff;
+ UpdateData->Data = NULL;
+
+ //
+ // Remove all op-codes from dynamic page
+ //
+ Private->Hii->UpdateForm (
+ Private->Hii,
+ Private->RegisteredHandle,
+ (EFI_FORM_LABEL) 0x1234, // Label 0x1234
+ FALSE, // Remove Op-codes (will never remove form/endform)
+ UpdateData // Significant value is UpdateData->DataCount
+ );
+
+ UpdateData->FormSetUpdate = FALSE;
+ UpdateData->FormCallbackHandle = 0;
+ UpdateData->FormUpdate = FALSE;
+ UpdateData->FormTitle = 0;
+ UpdateData->DataCount = 1;
+
+ CreateGotoOpCode (
+ 1,
+ STR_GOTO_FORM1, // Token value for the Prompt
+ 0, // Goto Help
+ 0, // Flags
+ 0, // Key
+ &UpdateData->Data // Buffer location to place op-codes
+ );
+
+ Private->Hii->UpdateForm (
+ Private->Hii,
+ Private->RegisteredHandle,
+ (EFI_FORM_LABEL) 0x1234,
+ TRUE,
+ UpdateData
+ );
+
+ gBS->FreePool (UpdateData);
+ break;
+
+ case 0x1236:
+ //
+ // If I hit the checkbox, I enter this case statement...
+ //
+ //
+ // Since I am returning an error (for test purposes) I need to pass in the string for the error
+ // I will allocate space for the return value. If an error occurs (which is the case) I can simply return
+ // an error and fill in the string parameter, otherwise, I will return information in the DataArray structure.
+ // The browser will free this packet structure
+ //
+ Status = gBS->AllocatePool (
+ EfiBootServicesData,
+ sizeof (EFI_HII_CALLBACK_PACKET) + sizeof (SAMPLE_STRING) + 2,
+ (VOID **) Packet
+ );
+
+ ZeroMem (*Packet, sizeof (EFI_HII_CALLBACK_PACKET) + sizeof (SAMPLE_STRING) + 2);
+
+ //
+ // Assign the buffer address to DataPacket
+ //
+ DataPacket = *Packet;
+
+ StrCpy (DataPacket->String, (CHAR16 *) SAMPLE_STRING);
+ return EFI_DEVICE_ERROR;
+
+ case 0x1237:
+
+ Status = gBS->AllocatePool (
+ EfiBootServicesData,
+ sizeof (EFI_HII_CALLBACK_PACKET) + 2,
+ (VOID **) Packet
+ );
+
+ ZeroMem (*Packet, sizeof (EFI_HII_CALLBACK_PACKET) + 2);
+
+ //
+ // Assign the buffer address to DataPacket
+ //
+ DataPacket = *Packet;
+
+ DataPacket->DataArray.EntryCount = 1;
+ DataPacket->DataArray.NvRamMap = NULL;
+ ((EFI_IFR_DATA_ENTRY *) (&DataPacket->DataArray + 1))->Flags = EXIT_REQUIRED;
+ break;
+
+ case 0x1555:
+ Value = 0x0001;
+ UnicodeSPrint (VariableName, 0x80, (CHAR16 *) L"%d", VAR_EQ_TEST_NAME);
+
+ Status = gRT->SetVariable (
+ VariableName,
+ &mFormSetGuid,
+ EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
+ 2,
+ (VOID *) &Value
+ );
+ break;
+
+ case 0x1556:
+ Value = 0x1000;
+ UnicodeSPrint (VariableName, 0x80, (CHAR16 *) L"%d", VAR_EQ_TEST_NAME);
+
+ Status = gRT->SetVariable (
+ VariableName,
+ &mFormSetGuid,
+ EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
+ 2,
+ (VOID *) &Value
+ );
+ break;
+
+ case 0x1557:
+ Value = 0x0000;
+ UnicodeSPrint (VariableName, 0x80, (CHAR16 *) L"%d", VAR_EQ_TEST_NAME);
+
+ Status = gRT->SetVariable (
+ VariableName,
+ &mFormSetGuid,
+ EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
+ 2,
+ (VOID *) &Value
+ );
+ break;
+
+ default:
+ break;
+ }
+
+ return EFI_SUCCESS;
+}
+
+EFI_STATUS
+EFIAPI
+DriverSampleInit (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
+{
+ EFI_STATUS Status;
+ EFI_HII_PROTOCOL *Hii;
+ //
+ // EFI_FORM_BROWSER_PROTOCOL *FormConfig;
+ //
+ EFI_HII_PACKAGES *PackageList;
+ EFI_HII_HANDLE HiiHandle;
+ STRING_REF TokenToUpdate;
+ STRING_REF TokenToUpdate2;
+ STRING_REF TokenToUpdate3;
+ CHAR16 *NewString;
+ EFI_HII_UPDATE_DATA *UpdateData;
+ EFI_CALLBACK_INFO *CallbackInfo;
+ EFI_HANDLE Handle;
+ EFI_SCREEN_DESCRIPTOR Screen;
+
+ ZeroMem (&Screen, sizeof (EFI_SCREEN_DESCRIPTOR));
+
+ gST->ConOut->QueryMode (gST->ConOut, gST->ConOut->Mode->Mode, &Screen.RightColumn, &Screen.BottomRow);
+
+ //
+ // Remove 3 characters from top and bottom
+ //
+ Screen.TopRow = 3;
+ Screen.BottomRow = Screen.BottomRow - 3;
+
+ //
+ // There should only be one HII protocol
+ //
+ Status = gBS->LocateProtocol (
+ &gEfiHiiProtocolGuid,
+ NULL,
+ (VOID **) &Hii
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;;
+ }
+
+ /*
+ //
+ // There should only be one Form Configuration protocol
+ //
+ Status = gBS->LocateProtocol (
+ &gEfiFormBrowserProtocolGuid,
+ NULL,
+ &FormConfig
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;;
+ }
+*/
+ Status = gBS->AllocatePool (
+ EfiBootServicesData,
+ sizeof (EFI_CALLBACK_INFO),
+ (VOID **) &CallbackInfo
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
+ CallbackInfo->Signature = EFI_CALLBACK_INFO_SIGNATURE;
+ CallbackInfo->Hii = Hii;
+
+ //
+ // This example does not implement worker functions for the NV accessor functions. Only a callback evaluator
+ //
+ CallbackInfo->DriverCallback.NvRead = NULL;
+ CallbackInfo->DriverCallback.NvWrite = NULL;
+ CallbackInfo->DriverCallback.Callback = DriverCallback;
+
+ //
+ // Install protocol interface
+ //
+ Handle = NULL;
+ Status = gBS->InstallProtocolInterface (
+ &Handle,
+ &gEfiFormCallbackProtocolGuid,
+ EFI_NATIVE_INTERFACE,
+ &CallbackInfo->DriverCallback
+ );
+
+ ASSERT_EFI_ERROR (Status);
+
+ CallbackInfo->CallbackHandle = Handle;
+
+ PackageList = PreparePackages (1, &mStringPackGuid, DriverSampleStrings);
+ Status = Hii->NewPack (Hii, PackageList, &HiiHandle);
+ gBS->FreePool (PackageList);
+
+ PackageList = PreparePackages (1, &mStringPackGuid, InventoryBin);
+ Status = Hii->NewPack (Hii, PackageList, &HiiHandle);
+ gBS->FreePool (PackageList);
+
+ PackageList = PreparePackages (1, &mStringPackGuid, VfrBin);
+ Status = Hii->NewPack (Hii, PackageList, &HiiHandle);
+ gBS->FreePool (PackageList);
+
+ CallbackInfo->RegisteredHandle = HiiHandle;
+
+ //
+ // Very simple example of how one would update a string that is already
+ // in the HII database
+ //
+ TokenToUpdate = (STRING_REF) STR_CPU_STRING2;
+ NewString = (CHAR16 *) L"700 Mhz";
+
+ Hii->NewString (Hii, NULL, HiiHandle, &TokenToUpdate, NewString);
+
+ //
+ // Add a string - if 0 will be updated with new Token number
+ //
+ TokenToUpdate = (STRING_REF) 0;
+
+ //
+ // Add a string - if 0 will be updated with new Token number
+ //
+ TokenToUpdate2 = (STRING_REF) 0;
+
+ //
+ // Add a string - if 0 will be updated with new Token number
+ //
+ TokenToUpdate3 = (STRING_REF) 0;
+
+ Hii->NewString (Hii, NULL, HiiHandle, &TokenToUpdate, (CHAR16 *) L"Desired Speed");
+ Hii->NewString (Hii, NULL, HiiHandle, &TokenToUpdate2, (CHAR16 *) L"5 Thz");
+ Hii->NewString (Hii, NULL, HiiHandle, &TokenToUpdate3, (CHAR16 *) L"This is next year's desired speed - right?");
+
+ //
+ // Allocate space for creation of Buffer
+ //
+ Status = gBS->AllocatePool (
+ EfiBootServicesData,
+ 0x1000,
+ (VOID **) &UpdateData
+ );
+
+ ZeroMem (UpdateData, 0x1000);
+
+ //
+ // Flag update pending in FormSet
+ //
+ UpdateData->FormSetUpdate = TRUE;
+ //
+ // Register CallbackHandle data for FormSet
+ //
+ UpdateData->FormCallbackHandle = (EFI_PHYSICAL_ADDRESS) (UINTN) CallbackInfo->CallbackHandle;
+ UpdateData->FormUpdate = FALSE;
+ UpdateData->FormTitle = 0;
+ UpdateData->DataCount = 1;
+
+ CreateTextOpCode (TokenToUpdate, TokenToUpdate2, TokenToUpdate3, 0, 0, &UpdateData->Data);
+
+ Hii->UpdateForm (Hii, HiiHandle, (EFI_FORM_LABEL) 100, TRUE, UpdateData);
+
+ gBS->FreePool (UpdateData);
+
+ //
+ // Example of how to display only the item we sent to HII
+ //
+ if (DISPLAY_ONLY_MY_ITEM == 0x0001) {
+ //
+ // Have the browser pull out our copy of the data, and only display our data
+ //
+ // Status = FormConfig->SendForm (FormConfig, TRUE, HiiHandle, NULL, NULL, NULL, &Screen, NULL);
+ //
+ } else {
+ //
+ // Have the browser pull out all the data in the HII Database and display it.
+ //
+ // Status = FormConfig->SendForm (FormConfig, TRUE, 0, NULL, NULL, NULL, NULL, NULL);
+ //
+ }
+
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
+ return EFI_SUCCESS;
+}
diff --git a/EdkModulePkg/Universal/UserInterface/DriverSample/DriverSample.h b/EdkModulePkg/Universal/UserInterface/DriverSample/DriverSample.h new file mode 100644 index 0000000..b1534e8 --- /dev/null +++ b/EdkModulePkg/Universal/UserInterface/DriverSample/DriverSample.h @@ -0,0 +1,60 @@ +/*++
+
+Copyright (c) 2006, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+Module Name:
+
+ DriverSample.h
+
+Abstract:
+
+
+Revision History
+
+--*/
+
+#ifndef _DRIVER_SAMPLE_H
+#define _DRIVER_SAMPLE_H
+
+
+#include "NVDataStruc.h"
+
+//
+// This is the generated header file which includes whatever needs to be exported (strings + IFR)
+//
+#include "DriverSampleStrDefs.h"
+
+extern UINT8 VfrBin[];
+//
+// extern UINT8 VfrStringsStr[];
+//
+extern UINT8 InventoryBin[];
+//
+// extern UINT8 InventoryStringsStr[];
+//
+extern UINT8 DriverSampleStrings[];
+
+#define SAMPLE_STRING L"This is an error!"
+
+#define EFI_CALLBACK_INFO_SIGNATURE EFI_SIGNATURE_32 ('C', 'l', 'b', 'k')
+
+typedef struct {
+ UINTN Signature;
+ EFI_HANDLE CallbackHandle;
+ EFI_FORM_CALLBACK_PROTOCOL DriverCallback;
+ UINT16 *KeyList;
+ VOID *FormBuffer;
+ EFI_HII_HANDLE RegisteredHandle;
+ EFI_HII_PROTOCOL *Hii;
+} EFI_CALLBACK_INFO;
+
+#define EFI_CALLBACK_INFO_FROM_THIS(a) CR (a, EFI_CALLBACK_INFO, DriverCallback, EFI_CALLBACK_INFO_SIGNATURE)
+
+#endif
diff --git a/EdkModulePkg/Universal/UserInterface/DriverSample/DriverSample.msa b/EdkModulePkg/Universal/UserInterface/DriverSample/DriverSample.msa new file mode 100644 index 0000000..49a6282 --- /dev/null +++ b/EdkModulePkg/Universal/UserInterface/DriverSample/DriverSample.msa @@ -0,0 +1,121 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<!--Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->
+<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0">
+ <MsaHeader>
+ <ModuleName>DriverSample</ModuleName>
+ <ModuleType>DXE_DRIVER</ModuleType>
+ <GuidValue>FE3542FE-C1D3-4EF8-657C-8048606FF670</GuidValue>
+ <Version>1.0</Version>
+ <Abstract>Component description file for DriverSample module.</Abstract>
+ <Description>This is an example driver to introduce how to export data to the HII protocol to be later utilized by the Setup Protocol. </Description>
+ <Copyright>Copyright (c) 2006, Intel Corporation</Copyright>
+ <License>All rights reserved. This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>
+ <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
+ </MsaHeader>
+ <ModuleDefinitions>
+ <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
+ <BinaryModule>false</BinaryModule>
+ <OutputFileBasename>DriverSample</OutputFileBasename>
+ </ModuleDefinitions>
+ <LibraryClassDefinitions>
+ <LibraryClass Usage="ALWAYS_CONSUMED">
+ <Keyword>UefiBootServicesTableLib</Keyword>
+ </LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">
+ <Keyword>UefiRuntimeServicesTableLib</Keyword>
+ </LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">
+ <Keyword>DebugLib</Keyword>
+ </LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">
+ <Keyword>UefiDriverEntryPoint</Keyword>
+ </LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">
+ <Keyword>UefiLib</Keyword>
+ </LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">
+ <Keyword>BaseLib</Keyword>
+ </LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">
+ <Keyword>PrintLib</Keyword>
+ </LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">
+ <Keyword>EdkGraphicsLib</Keyword>
+ </LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">
+ <Keyword>EdkIfrSupportLib</Keyword>
+ </LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">
+ <Keyword>BaseMemoryLib</Keyword>
+ </LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">
+ <Keyword>MemoryAllocationLib</Keyword>
+ </LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">
+ <Keyword>HiiLib</Keyword>
+ </LibraryClass>
+ </LibraryClassDefinitions>
+ <SourceFiles>
+ <Filename>InventoryStrings.uni</Filename>
+ <Filename>Inventory.vfr</Filename>
+ <Filename>VfrStrings.uni</Filename>
+ <Filename>Vfr.vfr</Filename>
+ <Filename>DriverSample.c</Filename>
+ <Filename>NVDataStruc.h</Filename>
+ <Filename>DriverSample.h</Filename>
+ </SourceFiles>
+ <PackageDependencies>
+ <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Package PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>
+ </PackageDependencies>
+ <Protocols>
+ <Protocol Usage="ALWAYS_CONSUMED">
+ <ProtocolCName>gEfiHiiProtocolGuid</ProtocolCName>
+ </Protocol>
+ <Protocol Usage="ALWAYS_CONSUMED">
+ <ProtocolCName>gEfiUgaDrawProtocolGuid</ProtocolCName>
+ </Protocol>
+ <Protocol Usage="ALWAYS_CONSUMED">
+ <ProtocolCName>gEfiOEMBadgingProtocolGuid</ProtocolCName>
+ </Protocol>
+ <Protocol Usage="ALWAYS_CONSUMED">
+ <ProtocolCName>gEfiFirmwareVolumeProtocolGuid</ProtocolCName>
+ </Protocol>
+ <Protocol Usage="ALWAYS_CONSUMED">
+ <ProtocolCName>gEfiConsoleControlProtocolGuid</ProtocolCName>
+ </Protocol>
+ <Protocol Usage="ALWAYS_PRODUCED">
+ <ProtocolCName>gEfiFormCallbackProtocolGuid</ProtocolCName>
+ </Protocol>
+ </Protocols>
+ <Variables>
+ <Variable Usage="ALWAYS_PRODUCED">
+ <VariableName>0x0032 0x0035</VariableName>
+ <GuidC_Name>g25Guid</GuidC_Name>
+ </Variable>
+ </Variables>
+ <Guids>
+ <GuidCNames Usage="ALWAYS_CONSUMED">
+ <GuidCName>gEfiGlobalVariableGuid</GuidCName>
+ </GuidCNames>
+ </Guids>
+ <Externs>
+ <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>
+ <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>
+ <Extern>
+ <ModuleEntryPoint>DriverSampleInit</ModuleEntryPoint>
+ </Extern>
+ </Externs>
+</ModuleSurfaceArea>
\ No newline at end of file diff --git a/EdkModulePkg/Universal/UserInterface/DriverSample/Inventory.vfr b/EdkModulePkg/Universal/UserInterface/DriverSample/Inventory.vfr new file mode 100644 index 0000000..ff8a6aa --- /dev/null +++ b/EdkModulePkg/Universal/UserInterface/DriverSample/Inventory.vfr @@ -0,0 +1,123 @@ +// *++
+//
+// Copyright (c) 2006, Intel Corporation
+// All rights reserved. This program and the accompanying materials
+// are licensed and made available under the terms and conditions of the BSD License
+// which accompanies this distribution. The full text of the license may be found at
+// http://opensource.org/licenses/bsd-license.php
+//
+// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+//
+// Module Name:
+//
+// Inventory.vfr
+//
+// Abstract:
+//
+// Sample Inventory Data.
+//
+// Revision History:
+//
+// --*/
+
+#include "DriverSampleStrDefs.h"
+
+#define INVENTORY_GUID { 0xb3f56470, 0x6141, 0x4621, { 0x8f, 0x19, 0x70, 0x4e, 0x57, 0x7a, 0xa9, 0xe8 } }
+
+formset
+ guid = INVENTORY_GUID,
+ title = STRING_TOKEN(STR_INV_FORM_SET_TITLE),
+ help = STRING_TOKEN(STR_INV_FORM_SET_HELP),
+ class = 0x04,
+ subclass = 0x03,
+
+ form formid = 1,
+ title = STRING_TOKEN(STR_INV_FORM1_TITLE); // note formid is a variable (for readability) (UINT16) - also added Form to the line to signify the Op-Code
+
+ text
+ help = STRING_TOKEN(STR_INV_VERSION_HELP),
+ text = STRING_TOKEN(STR_INV_VERSION_TEXT),
+ text = STRING_TOKEN(STR_INV_EMPTY_STRING),
+ flags = 0,
+ key = 0;
+
+ text
+ help = STRING_TOKEN(STR_INV_EMPTY_STRING),
+ text = STRING_TOKEN(STR_INV_VERSION_TEXT2),
+ text = STRING_TOKEN(STR_INV_EMPTY_STRING),
+ flags = 0,
+ key = 0;
+
+ text
+ help = STRING_TOKEN(STR_INV_EMPTY_STRING),
+ text = STRING_TOKEN(STR_INV_VERSION_TEXT3),
+ text = STRING_TOKEN(STR_INV_EMPTY_STRING),
+ flags = 0,
+ key = 0;
+
+ text
+ help = STRING_TOKEN(STR_INV_EMPTY_STRING),
+ text = STRING_TOKEN(STR_INV_VERSION_TEXT4),
+ text = STRING_TOKEN(STR_INV_EMPTY_STRING),
+ flags = 0,
+ key = 0;
+
+ subtitle text = STRING_TOKEN(STR_INV_EMPTY_STRING);
+
+ text
+ help = STRING_TOKEN(STR_INV_EMPTY_STRING),
+ text = STRING_TOKEN(STR_INV_VERSION_TEXT5),
+ text = STRING_TOKEN(STR_INV_EMPTY_STRING),
+ flags = 0,
+ key = 0;
+
+ text
+ help = STRING_TOKEN(STR_INV_EMPTY_STRING),
+ text = STRING_TOKEN(STR_INV_VERSION_TEXT6),
+ text = STRING_TOKEN(STR_INV_EMPTY_STRING),
+ flags = 0,
+ key = 0;
+
+ text
+ help = STRING_TOKEN(STR_INV_EMPTY_STRING),
+ text = STRING_TOKEN(STR_INV_VERSION_TEXT7),
+ text = STRING_TOKEN(STR_INV_EMPTY_STRING),
+ flags = 0,
+ key = 0;
+
+ text
+ help = STRING_TOKEN(STR_INV_EMPTY_STRING),
+ text = STRING_TOKEN(STR_INV_VERSION_TEXT8),
+ text = STRING_TOKEN(STR_INV_EMPTY_STRING),
+ flags = 0,
+ key = 0;
+
+ text
+ help = STRING_TOKEN(STR_INV_EMPTY_STRING),
+ text = STRING_TOKEN(STR_INV_VERSION_TEXT9),
+ text = STRING_TOKEN(STR_INV_EMPTY_STRING),
+ flags = 0,
+ key = 0;
+
+ text
+ help = STRING_TOKEN(STR_INV_EMPTY_STRING),
+ text = STRING_TOKEN(STR_INV_VERSION_TEXT10),
+ text = STRING_TOKEN(STR_INV_EMPTY_STRING),
+ flags = 0,
+ key = 0;
+
+ text
+ help = STRING_TOKEN(STR_INV_EMPTY_STRING),
+ text = STRING_TOKEN(STR_INV_VERSION_TEXT11),
+ text = STRING_TOKEN(STR_INV_EMPTY_STRING),
+ flags = 0,
+ key = 0;
+
+ subtitle text = STRING_TOKEN(STR_INV_EMPTY_STRING);
+
+ subtitle text = STRING_TOKEN(STR_INV_VERSION_TEXT12);
+
+ endform;
+
+endformset;
diff --git a/EdkModulePkg/Universal/UserInterface/DriverSample/InventoryStrings.uni b/EdkModulePkg/Universal/UserInterface/DriverSample/InventoryStrings.uni Binary files differnew file mode 100644 index 0000000..4946b4a --- /dev/null +++ b/EdkModulePkg/Universal/UserInterface/DriverSample/InventoryStrings.uni diff --git a/EdkModulePkg/Universal/UserInterface/DriverSample/NVDataStruc.h b/EdkModulePkg/Universal/UserInterface/DriverSample/NVDataStruc.h new file mode 100644 index 0000000..01369eb --- /dev/null +++ b/EdkModulePkg/Universal/UserInterface/DriverSample/NVDataStruc.h @@ -0,0 +1,62 @@ +/*++
+
+Copyright (c) 2006, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+Module Name:
+
+ NVDataStruc.h
+
+Abstract:
+
+ NVData structure used by the sample driver
+
+Revision History:
+
+--*/
+
+#ifndef _NVDATASTRUC_H
+#define _NVDATASTRUC_H
+
+#define FORMSET_GUID \
+ { \
+ 0xA04A27f4, 0xDF00, 0x4D42, { 0xB5, 0x52, 0x39, 0x51, 0x13, 0x02, 0x11, 0x3D } \
+ }
+
+#define INVENTORY_GUID \
+ { \
+ 0xb3f56470, 0x6141, 0x4621, { 0x8f, 0x19, 0x70, 0x4e, 0x57, 0x7a, 0xa9, 0xe8 } \
+ }
+
+#define VAR_EQ_TEST_NAME 0x100
+
+#pragma pack(1)
+typedef struct {
+ UINT16 WhatIsThePassword[20];
+ UINT16 WhatIsThePassword2[20];
+ UINT16 MyStringData[20];
+ UINT16 SomethingHiddenForHtml;
+ UINT8 HowOldAreYouInYearsManual;
+ UINT16 HowTallAreYouManual;
+ UINT8 HowOldAreYouInYears;
+ UINT16 HowTallAreYou;
+ UINT8 MyFavoriteNumber;
+ UINT8 TestLateCheck;
+ UINT8 TestLateCheck2;
+ UINT8 QuestionAboutTreeHugging;
+ UINT8 ChooseToActivateNuclearWeaponry;
+ UINT8 SuppressGrayOutSomething;
+ UINT8 OrderedList[8];
+ UINT8 BootOrder[8];
+ UINT8 BootOrderLarge;
+ UINT8 DynamicCheck;
+} MyIfrNVData;
+#pragma pack()
+
+#endif
diff --git a/EdkModulePkg/Universal/UserInterface/DriverSample/Vfr.vfr b/EdkModulePkg/Universal/UserInterface/DriverSample/Vfr.vfr new file mode 100644 index 0000000..6509a66 --- /dev/null +++ b/EdkModulePkg/Universal/UserInterface/DriverSample/Vfr.vfr @@ -0,0 +1,622 @@ +// *++
+//
+// Copyright (c) 2006, Intel Corporation
+// All rights reserved. This program and the accompanying materials
+// are licensed and made available under the terms and conditions of the BSD License
+// which accompanies this distribution. The full text of the license may be found at
+// http://opensource.org/licenses/bsd-license.php
+//
+// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+//
+// Module Name:
+//
+// Vfr.vfr
+//
+// Abstract:
+//
+// Sample Setup formset
+//
+// Revision History:
+//
+// --*/
+
+
+#include "DriverSampleStrDefs.h"
+
+#include "NVDataStruc.h"
+
+
+typedef struct {
+ UINT8 Field8;
+ UINT16 Field16;
+ UINT8 OrderedList[3];
+} MyIfrNVData2;
+
+typedef struct {
+ UINT8 Field8;
+ UINT16 Field16;
+ UINT8 OrderedList[3];
+} MyIfrNVData3;
+
+#define MY_TEXT_KEY 0x100
+
+#define LABEL_1_VALUE 0x01
+#define LABEL_2_VALUE 0x1000
+#define LABEL_UPDATE_BBS 0x2222
+#define LABEL_END_UPDATE_BBS 0x2223
+
+formset
+ guid = FORMSET_GUID,
+ title = STRING_TOKEN(STR_FORM_SET_TITLE),
+ help = STRING_TOKEN(STR_FORM_SET_TITLE_HELP),
+ class = 0x10,
+ subclass = 0,
+
+ varstore MyIfrNVData2, key = 0x1234, name = MY_DATA2, guid = FORMSET_GUID;
+
+
+ varstore MyIfrNVData3, key = 0x4321, name = MY_DATA3, guid = FORMSET_GUID;
+
+ form formid = 1,
+ title = STRING_TOKEN(STR_FORM1_TITLE); // note formid is a variable (for readability) (UINT16) - also added Form to the line to signify the Op-Code
+
+ subtitle text = STRING_TOKEN(STR_SUBTITLE_TEXT);
+
+ subtitle text = STRING_TOKEN(STR_SUBTITLE_TEXT2);
+
+ banner
+ title = STRING_TOKEN(STR_BANNER_TITLE),
+ line 1,
+ align center;
+
+ banner
+ title = STRING_TOKEN(STR_BANNER_TITLE),
+ line 2,
+ align left;
+
+ banner
+ title = STRING_TOKEN(STR_BANNER_TITLE),
+ line 2,
+ align right;
+
+ text
+ help = STRING_TOKEN(STR_TEXT_HELP),
+ text = STRING_TOKEN(STR_CPU_STRING),
+ text = STRING_TOKEN(STR_CPU_STRING2),
+ flags = 0,
+ key = 0;
+
+ text
+ help = STRING_TOKEN(STR_EXIT_TEXT),
+ text = STRING_TOKEN(STR_EXIT_TEXT),
+ text = STRING_TOKEN(STR_EXIT_TEXT),
+ flags = INTERACTIVE,
+ key = 0x1237;
+
+ oneof varid = MyIfrNVData.SuppressGrayOutSomething,
+ prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
+ help = STRING_TOKEN(STR_ONE_OF_HELP),
+ option text = STRING_TOKEN(STR_ONE_OF_TEXT4), value = 0x0, flags = 0;
+ option text = STRING_TOKEN(STR_ONE_OF_TEXT5), value = 0x1, flags = 0;
+ option text = STRING_TOKEN(STR_ONE_OF_TEXT6), value = 0x2, flags = DEFAULT;
+ endoneof;
+
+ oneof varid = MyIfrNVData.BootOrderLarge,
+ prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
+ help = STRING_TOKEN(STR_ONE_OF_HELP),
+ option text = STRING_TOKEN(STR_BOOT_ORDER1), value = 0x0, flags = INTERACTIVE, key = 1;
+ option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 0x1, flags = INTERACTIVE | DEFAULT, key = 2;
+ endoneof;
+
+ grayoutif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x1;
+ suppressif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x0;
+ label 0;
+ checkbox varid = MyIfrNVData.ChooseToActivateNuclearWeaponry,
+ prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT),
+ help = STRING_TOKEN(STR_CHECK_BOX_HELP),
+ flags = 1, // Flags behavior for checkbox is overloaded so that it equals a DEFAULT value. 1 = ON, 0 = off
+ key = 0,
+ endcheckbox;
+ endif;
+
+
+ //
+ // Ordered list:
+ // sizeof(MyIfrNVData) storage must be UINT8 array, and
+ // size written for the variable must be size of the entire
+ // variable.
+ //
+ //
+ suppressif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x0;
+ label LABEL_UPDATE_BBS;
+ orderedlist
+ varid = MyIfrNVData.BootOrder,
+ prompt = STRING_TOKEN(STR_BOOT_OPTIONS),
+ help = STRING_TOKEN(STR_NULL_STRING),
+ option text = STRING_TOKEN(STR_BOOT_OPTION2), value = 2, flags = RESET_REQUIRED;
+ option text = STRING_TOKEN(STR_BOOT_OPTION1), value = 1, flags = RESET_REQUIRED;
+ option text = STRING_TOKEN(STR_BOOT_OPTION3), value = 3, flags = RESET_REQUIRED;
+ option text = STRING_TOKEN(STR_BOOT_OPTION4), value = 4, flags = RESET_REQUIRED;
+ endlist;
+ label LABEL_END_UPDATE_BBS;
+ endif;
+
+ suppressif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x2;
+ orderedlist
+ varid = MyIfrNVData.OrderedList,
+ prompt = STRING_TOKEN(STR_TEST_OPCODE),
+ help = STRING_TOKEN(STR_TEXT_HELP),
+ option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 4, flags = RESET_REQUIRED;
+ option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 3, flags = RESET_REQUIRED;
+ option text = STRING_TOKEN(STR_ONE_OF_TEXT3), value = 2, flags = RESET_REQUIRED;
+ option text = STRING_TOKEN(STR_TEXT_HELP), value = 1, flags = RESET_REQUIRED;
+ endlist;
+ endif;
+
+ label 100;
+
+ goto 0x1234,
+ prompt = STRING_TOKEN(STR_GOTO_DYNAMIC),
+ help = STRING_TOKEN(STR_GOTO_HELP),
+ flags = INTERACTIVE,
+ key = 0x1234;
+
+ goto 0x1234,
+ prompt = STRING_TOKEN(STR_GOTO_DYNAMIC2),
+ help = STRING_TOKEN(STR_GOTO_HELP),
+ flags = INTERACTIVE,
+ key = 0x1235;
+
+ //
+ // VARSTORE tests
+ //
+ // Till now, been using variable NvData (must be reserved)
+ // now we do a varselect for variable NvData3
+ inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
+ ideqid MyIfrNVData3.Field16 == MyIfrNVData3.Field16
+ endif;
+ // now we do a varselect_pair for variable NvData2 and NvData3
+ inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
+ ideqid MyIfrNVData2.Field16 == MyIfrNVData3.Field16
+ endif;
+
+
+ // now we do a varselect_pair for variable NvData and NvData2
+// inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
+// ideqid MyIfrNVData2.Field16 == MyIfrNVData.TestLateCheck
+// endif;
+
+ inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
+ ideqid MyIfrNVData.TestLateCheck == MyIfrNVData.TestLateCheck2
+ endif;
+
+ oneof varid = MyIfrNVData.TestLateCheck,
+ prompt = STRING_TOKEN(STR_TEST_OPCODE),
+ help = STRING_TOKEN(STR_ONE_OF_HELP),
+ option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = LATE_CHECK | RESET_REQUIRED;
+ option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = LATE_CHECK | DEFAULT | RESET_REQUIRED;
+ endoneof;
+
+ oneof varid = MyIfrNVData.TestLateCheck2,
+ prompt = STRING_TOKEN(STR_TEST_OPCODE2),
+ help = STRING_TOKEN(STR_ONE_OF_HELP),
+ option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = LATE_CHECK | DEFAULT | RESET_REQUIRED;
+ option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = LATE_CHECK | RESET_REQUIRED;
+
+ endoneof;
+
+ oneof varid = MyIfrNVData.QuestionAboutTreeHugging,
+ prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
+ help = STRING_TOKEN(STR_ONE_OF_HELP),
+ option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = RESET_REQUIRED;
+ option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = DEFAULT | RESET_REQUIRED;
+ option text = STRING_TOKEN(STR_ONE_OF_TEXT3), value = 0x03, flags = RESET_REQUIRED;
+
+ endoneof;
+
+ string varid = MyIfrNVData.MyStringData,
+ prompt = STRING_TOKEN(STR_MY_STRING_PROMPT2),
+ help = STRING_TOKEN(STR_MY_STRING_HELP2),
+ flags = INTERACTIVE,
+ key = 0x1234,
+ minsize = 6,
+ maxsize = 0x14,
+ endstring;
+
+ text
+ help = STRING_TOKEN(STR_GRAYOUT_TEST),
+ text = STRING_TOKEN(STR_GRAYOUT_TEST),
+ text = STRING_TOKEN(STR_GRAYOUT_TEST),
+ flags = INTERACTIVE,
+ key = 0x1555;
+
+ text
+ help = STRING_TOKEN(STR_SUPPRESS_TEST),
+ text = STRING_TOKEN(STR_SUPPRESS_TEST),
+ text = STRING_TOKEN(STR_SUPPRESS_TEST),
+ flags = INTERACTIVE,
+ key = 0x1556;
+
+ text
+ help = STRING_TOKEN(STR_CLEAR_TEST),
+ text = STRING_TOKEN(STR_CLEAR_TEST),
+ text = STRING_TOKEN(STR_CLEAR_TEST),
+ flags = INTERACTIVE,
+ key = 0x1557;
+
+ grayoutif vareqval var(VAR_EQ_TEST_NAME) == 0x1;
+ suppressif vareqval var(VAR_EQ_TEST_NAME) == 0x1000;
+ label 30;
+ checkbox varid = MyIfrNVData.ChooseToActivateNuclearWeaponry,
+ prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT),
+ help = STRING_TOKEN(STR_CHECK_BOX_HELP),
+ flags = 1,
+ key = 0,
+ endcheckbox;
+ endif;
+
+
+ numeric varid = MyIfrNVData.HowOldAreYouInYearsManual,
+ prompt = STRING_TOKEN(STR_NUMERIC_MANUAL_PROMPT),
+ help = STRING_TOKEN(STR_NUMERIC_HELP0),
+ minimum = 0,
+ maximum = 0xf0, // 0xf0 = 240 in decimal
+ step = 0, // Stepping of 0 equates to a manual entering
+ // of a value, otherwise it will auto-increment
+ // with a left/right arrow
+ default = 21,
+
+ endnumeric;
+
+ numeric varid = MyIfrNVData.HowTallAreYouManual,
+ prompt = STRING_TOKEN(STR_TALL_MANUAL_PROMPT),
+ help = STRING_TOKEN(STR_NUMERIC_HELP1),
+ minimum = 0,
+ maximum = 300,
+ step = 0, // Stepping of 0 equates to a manual entering
+ // of a value, otherwise it will auto-increment
+ // with a left/right arrow
+ default = 175,
+
+ endnumeric;
+
+ inventory
+ help = STRING_TOKEN(STR_INVENTORY_HELP),
+ text = STRING_TOKEN(STR_INVENTORY_TEXT1),
+ text = STRING_TOKEN(STR_INVENTORY_TEXT2);
+
+
+ restore defaults,
+ formid = 4,
+ prompt = STRING_TOKEN(STR_RESTORE_DEFAULTS_PROMPT),
+ help = STRING_TOKEN(STR_RESTORE_DEFAULTS_HELP),
+ flags = 0,
+ key = 0;
+
+ save defaults,
+ formid = 4,
+ prompt = STRING_TOKEN(STR_SAVE_DEFAULTS_PROMPT),
+ help = STRING_TOKEN(STR_SAVE_DEFAULTS_HELP),
+ flags = 0,
+ key = 0;
+
+ //
+ // Case with no flags or key
+ //
+ save defaults,
+ formid = 4,
+ prompt = STRING_TOKEN(STR_SAVE_DEFAULTS_PROMPT),
+ help = STRING_TOKEN(STR_SAVE_DEFAULTS_HELP);
+ //
+ // Case with no key
+ //
+ save defaults,
+ formid = 4,
+ prompt = STRING_TOKEN(STR_SAVE_DEFAULTS_PROMPT),
+ help = STRING_TOKEN(STR_SAVE_DEFAULTS_HELP),
+ flags = 0;
+ //
+ // Case with no flags
+ //
+ save defaults,
+ formid = 4,
+ prompt = STRING_TOKEN(STR_SAVE_DEFAULTS_PROMPT),
+ help = STRING_TOKEN(STR_SAVE_DEFAULTS_HELP),
+ key = 0;
+
+ label LABEL_2_VALUE;
+
+ grayoutif ideqval MyIfrNVData.HowOldAreYouInYearsManual == 23 AND ideqval MyIfrNVData.SuppressGrayOutSomething == 0x1;
+ numeric varid = MyIfrNVData.HowOldAreYouInYears,
+ prompt = STRING_TOKEN(STR_NUMERIC_PROMPT),
+ help = STRING_TOKEN(STR_NUMERIC_HELP2),
+ minimum = 0,
+ maximum = 243,
+ step = 3,
+ default = 18,
+
+ endnumeric;
+
+ label LABEL_1_VALUE;
+
+ //
+ // Numeric with no step or default specified
+ //
+ numeric varid = MyIfrNVData.HowTallAreYou,
+ prompt = STRING_TOKEN(STR_NUMERIC_PROMPT1),
+ help = STRING_TOKEN(STR_NUMERIC_HELP3),
+ minimum = 0,
+ maximum = 190,
+ // step = 1, // Stepping of 1 if not specified
+ // default = minimum; // if not specified
+ endnumeric;
+ endif;
+
+ string varid = MyIfrNVData.MyStringData,
+ prompt = STRING_TOKEN(STR_MY_STRING_PROMPT),
+ help = STRING_TOKEN(STR_MY_STRING_HELP),
+ minsize = 6,
+ maxsize = 0x14,
+ endstring;
+
+ password varid = MyIfrNVData.WhatIsThePassword,
+ prompt = STRING_TOKEN(STR_PASSWORD_PROMPT),
+ help = STRING_TOKEN(STR_PASSWORD_HELP),
+ minsize = 6,
+ maxsize = 20, // new opcode
+ encoding = 1,
+ endpassword;
+ password varid = MyIfrNVData.WhatIsThePassword2,
+ prompt = STRING_TOKEN(STR_PASSWORD_PROMPT),
+ help = STRING_TOKEN(STR_PASSWORD_HELP),
+ minsize = 6,
+ maxsize = 20, // new opcode
+ encoding = 1,
+ endpassword;
+ //
+ // Test with flags and key fields
+ //
+ password varid = MyIfrNVData.WhatIsThePassword,
+ prompt = STRING_TOKEN(STR_PASSWORD_PROMPT),
+ help = STRING_TOKEN(STR_PASSWORD_HELP),
+ flags = INTERACTIVE,
+ key = 0x2000,
+ minsize = 6,
+ maxsize = 20, // new opcode
+ encoding = 1,
+ endpassword;
+
+ goto 2,
+ prompt = STRING_TOKEN(STR_GOTO_FORM2), //SecondSetupPage // this too has no end-op and basically it's a jump to a form ONLY
+ help = STRING_TOKEN(STR_GOTO_HELP);
+
+ goto 3,
+ prompt = STRING_TOKEN(STR_GOTO_FORM3), //ThirdSetupPage // this too has no end-op and basically it's a jump to a form ONLY
+ help = STRING_TOKEN(STR_GOTO_HELP);
+
+ endform;
+
+ form formid = 2, // SecondSetupPage,
+ title = STRING_TOKEN(STR_FORM2_TITLE); // note formid is a variable (for readability) (UINT16) - also added Form to the line to signify the Op-Code
+
+
+ date year varid = Date.Year, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
+ prompt = STRING_TOKEN(STR_DATE_PROMPT),
+ help = STRING_TOKEN(STR_DATE_YEAR_HELP),
+ minimum = 1998,
+ maximum = 2099,
+ step = 1,
+ default = 2004,
+
+ month varid = Date.Month, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
+ prompt = STRING_TOKEN(STR_DATE_PROMPT),
+ help = STRING_TOKEN(STR_DATE_MONTH_HELP),
+ minimum = 1,
+ maximum = 12,
+ step = 1,
+ default = 1,
+
+ day varid = Date.Day, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
+ prompt = STRING_TOKEN(STR_DATE_PROMPT),
+ help = STRING_TOKEN(STR_DATE_DAY_HELP),
+ minimum = 1,
+ maximum = 31,
+ step = 0x1,
+ default = 1,
+
+ enddate;
+
+ time hour varid = Time.Hours, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
+ prompt = STRING_TOKEN(STR_TIME_PROMPT),
+ help = STRING_TOKEN(STR_TIME_HOUR_HELP),
+ minimum = 0,
+ maximum = 23,
+ step = 1,
+ default = 0,
+
+ minute varid = Time.Minutes, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
+ prompt = STRING_TOKEN(STR_TIME_PROMPT),
+ help = STRING_TOKEN(STR_TIME_MINUTE_HELP),
+ minimum = 0,
+ maximum = 59,
+ step = 1,
+ default = 0,
+
+ second varid = Time.Seconds, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
+ prompt = STRING_TOKEN(STR_TIME_PROMPT),
+ help = STRING_TOKEN(STR_TIME_SECOND_HELP),
+ minimum = 0,
+ maximum = 59,
+ step = 1,
+ default = 0,
+
+ endtime;
+
+ date year varid = Date.Year, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
+ prompt = STRING_TOKEN(STR_DATE_PROMPT),
+ help = STRING_TOKEN(STR_DATE_YEAR_HELP),
+ minimum = 1939,
+ maximum = 2101,
+ step = 1,
+ default = 1964,
+
+ month varid = Date.Month, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
+ prompt = STRING_TOKEN(STR_DATE_PROMPT),
+ help = STRING_TOKEN(STR_DATE_MONTH_HELP),
+ minimum = 1,
+ maximum = 12,
+ step = 1,
+ default = 1,
+
+ day varid = Date.Day, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
+ prompt = STRING_TOKEN(STR_DATE_PROMPT),
+ help = STRING_TOKEN(STR_DATE_DAY_HELP),
+ minimum = 1,
+ maximum = 31,
+ step = 0x1,
+ default = 1,
+
+ enddate;
+
+ time hour varid = Time.Hours, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
+ prompt = STRING_TOKEN(STR_TIME_PROMPT),
+ help = STRING_TOKEN(STR_TIME_HOUR_HELP),
+ minimum = 0,
+ maximum = 23,
+ step = 1,
+ default = 0,
+
+ minute varid = Time.Minutes, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
+ prompt = STRING_TOKEN(STR_TIME_PROMPT),
+ help = STRING_TOKEN(STR_TIME_MINUTE_HELP),
+ minimum = 0,
+ maximum = 59,
+ step = 1,
+ default = 0,
+
+ second varid = Time.Seconds, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
+ prompt = STRING_TOKEN(STR_TIME_PROMPT),
+ help = STRING_TOKEN(STR_TIME_SECOND_HELP),
+ minimum = 0,
+ maximum = 59,
+ step = 1,
+ default = 0,
+
+ endtime;
+
+ grayoutif
+ ideqval Date.Day == 21
+ AND
+ ideqval Date.Month == 8;
+
+ hidden value = 32, key = 0x7777;
+
+ endif; // grayoutif
+
+ suppressif
+ ideqval Date.Day == 8
+ AND
+ ideqval Date.Month == 21;
+
+ hidden value = 32, key = 0x7777;
+
+ endif; // suppressif
+
+
+ hidden value = 32, key = 0x1234;
+
+ inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
+ ideqval MyIfrNVData.HowOldAreYouInYearsManual == 4
+ endif;
+
+ inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
+ ideqvallist MyIfrNVData.HowOldAreYouInYearsManual == 1 2 3 4
+ endif;
+
+ inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
+ ideqid MyIfrNVData.HowOldAreYouInYearsManual == MyIfrNVData.MyFavoriteNumber
+ endif;
+
+// grayoutif
+//
+// If the day is 31 AND months is any of the following 2, 4, 6, 9, 11
+//
+ inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
+ ideqval Date.Day == 31
+ AND
+ ideqvallist Date.Month == 2 4 6 9 11
+ endif;
+
+//
+// If the day is 30 AND month is 2
+//
+ inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
+ ideqval Date.Day == 30
+ AND
+ ideqval Date.Month == 2
+ endif;
+
+//
+// If the day is 29 AND month is 2 AND it year is NOT a leapyear
+//
+ inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
+ ideqval Date.Day == 0x1D
+ AND
+ ideqval Date.Month == 2
+ AND
+ NOT
+ ideqvallist Date.Year == 2004 2008 20012 20016 2020 2024 2028 2032 2036
+ endif;
+
+ checkbox varid = MyIfrNVData.ChooseToActivateNuclearWeaponry,
+ prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT),
+ help = STRING_TOKEN(STR_CHECK_BOX_HELP),
+ flags = 1,
+ key = 0,
+ endcheckbox;
+
+ text
+ help = STRING_TOKEN(STR_TEXT_HELP),
+ text = STRING_TOKEN(STR_TEXT_TEXT_1);
+
+ text
+ help = STRING_TOKEN(STR_TEXT_HELP),
+ text = STRING_TOKEN(STR_TEXT_TEXT_1),
+ text = STRING_TOKEN(STR_TEXT_TEXT_2),
+ flags = 0,
+ key = MY_TEXT_KEY;
+
+ goto 1,
+ prompt = STRING_TOKEN(STR_GOTO_FORM1), //MainSetupPage // this too has no end-op and basically it's a jump to a form ONLY
+ help = STRING_TOKEN(STR_GOTO_HELP);
+
+ endform;
+
+ form formid = 3, title = STRING_TOKEN(STR_FORM3_TITLE); // note formid is a variable (for readability) (UINT16) - also added Form to the line to signify the Op-Code
+
+ grayoutif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x1;
+ text
+ help = STRING_TOKEN(STR_TEXT_HELP),
+ text = STRING_TOKEN(STR_TEXT_TEXT_1);
+
+ endif; //end grayoutif
+
+ text
+ help = STRING_TOKEN(STR_TEXT_HELP),
+ text = STRING_TOKEN(STR_TEXT_TEXT_1);
+
+ endform;
+
+ form formid = 4, title = STRING_TOKEN(STR_FORM3_TITLE);
+
+ endform;
+
+ form formid = 0x1234, // Dynamically created page,
+ title = STRING_TOKEN(STR_DYNAMIC_TITLE); // note formid is a variable (for readability) (UINT16) - also added Form to the line to signify the Op-Code
+
+ label 0x1234;
+
+ endform;
+
+endformset;
diff --git a/EdkModulePkg/Universal/UserInterface/DriverSample/VfrStrings.uni b/EdkModulePkg/Universal/UserInterface/DriverSample/VfrStrings.uni Binary files differnew file mode 100644 index 0000000..9e9dbf5 --- /dev/null +++ b/EdkModulePkg/Universal/UserInterface/DriverSample/VfrStrings.uni diff --git a/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/HiiDatabase.msa b/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/HiiDatabase.msa index 65669af..60c4440 100644 --- a/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/HiiDatabase.msa +++ b/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/HiiDatabase.msa @@ -13,8 +13,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.--> <ModuleType>DXE_DRIVER</ModuleType>
<GuidValue>FCD337AB-B1D3-4EF8-957C-8048606FF670</GuidValue>
<Version>1.0</Version>
- <Abstract>Component description file for DiskIo module.</Abstract>
- <Description>FIX ME!</Description>
+ <Abstract>Component description file for HiiDatabase module.</Abstract>
+ <Description>This module inits HII database and installs HII protocol.</Description>
<Copyright>Copyright (c) 2006, Intel Corporation</Copyright>
<License>All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License diff --git a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/DriverSample/DriverSample.msa b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/DriverSample/DriverSample.msa index 1b99a17..49a6282 100644 --- a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/DriverSample/DriverSample.msa +++ b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/DriverSample/DriverSample.msa @@ -13,8 +13,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.--> <ModuleType>DXE_DRIVER</ModuleType>
<GuidValue>FE3542FE-C1D3-4EF8-657C-8048606FF670</GuidValue>
<Version>1.0</Version>
- <Abstract>Component description file for DiskIo module.</Abstract>
- <Description>FIX ME!</Description>
+ <Abstract>Component description file for DriverSample module.</Abstract>
+ <Description>This is an example driver to introduce how to export data to the HII protocol to be later utilized by the Setup Protocol. </Description>
<Copyright>Copyright (c) 2006, Intel Corporation</Copyright>
<License>All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License diff --git a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/SetupBrowser.msa b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/SetupBrowser.msa index beb4f81..6b91ca8 100644 --- a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/SetupBrowser.msa +++ b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/SetupBrowser.msa @@ -13,8 +13,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.--> <ModuleType>DXE_DRIVER</ModuleType>
<GuidValue>EBf342FE-B1D3-4EF8-957C-8048606FF670</GuidValue>
<Version>1.0</Version>
- <Abstract>Component description file for DiskIo module.</Abstract>
- <Description>FIX ME!</Description>
+ <Abstract>Component description file for SetupBrowser module.</Abstract>
+ <Description>This driver initializes Setup for the brower and installs FormBrowser protocol.</Description>
<Copyright>Copyright (c) 2006, Intel Corporation</Copyright>
<License>All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License |