diff options
Diffstat (limited to 'MdeModulePkg/Universal/DriverSampleDxe')
5 files changed, 50 insertions, 78 deletions
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c index 1484404687..b6621a93e2 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c +++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c @@ -18,10 +18,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #define DISPLAY_ONLY_MY_ITEM 0x0002
-EFI_GUID mFormSetGuid = FORMSET_GUID;
-EFI_GUID mInventoryGuid = INVENTORY_GUID;
-EFI_GUID MyEventGroupGuid = EFI_IFR_REFRESH_ID_OP_GUID;
-
CHAR16 VariableName[] = L"MyIfrNVData";
CHAR16 MyEfiVar[] = L"MyEfiVar";
EFI_HANDLE DriverHandle[2] = {NULL, NULL};
@@ -38,10 +34,7 @@ HII_VENDOR_DEVICE_PATH mHiiVendorDevicePath0 = { (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
}
},
- //
- // {C153B68D-EBFC-488e-B110-662867745B87}
- //
- { 0xc153b68d, 0xebfc, 0x488e, { 0xb1, 0x10, 0x66, 0x28, 0x67, 0x74, 0x5b, 0x87 } }
+ DRIVER_SAMPLE_FORMSET_GUID
},
{
END_DEVICE_PATH_TYPE,
@@ -63,10 +56,7 @@ HII_VENDOR_DEVICE_PATH mHiiVendorDevicePath1 = { (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
}
},
- //
- // {06F37F07-0C48-40e9-8436-0A08A0BB76B0}
- //
- { 0x6f37f07, 0xc48, 0x40e9, { 0x84, 0x36, 0xa, 0x8, 0xa0, 0xbb, 0x76, 0xb0 } }
+ DRIVER_SAMPLE_INVENTORY_GUID
},
{
END_DEVICE_PATH_TYPE,
@@ -293,7 +283,7 @@ ValidatePassword ( BufferSize = sizeof (DRIVER_SAMPLE_CONFIGURATION);
Status = gRT->GetVariable (
VariableName,
- &mFormSetGuid,
+ &gDriverSampleFormSetGuid,
NULL,
&BufferSize,
&PrivateData->Configuration
@@ -386,7 +376,7 @@ SetPassword ( BufferSize = sizeof (DRIVER_SAMPLE_CONFIGURATION);
Status = gRT->GetVariable (
VariableName,
- &mFormSetGuid,
+ &gDriverSampleFormSetGuid,
NULL,
&BufferSize,
&PrivateData->Configuration
@@ -418,7 +408,7 @@ SetPassword ( //
Configuration = AllocateZeroPool (sizeof (DRIVER_SAMPLE_CONFIGURATION));
ASSERT (Configuration != NULL);
- if (HiiGetBrowserData (&mFormSetGuid, VariableName, sizeof (DRIVER_SAMPLE_CONFIGURATION), (UINT8 *) Configuration)) {
+ if (HiiGetBrowserData (&gDriverSampleFormSetGuid, VariableName, sizeof (DRIVER_SAMPLE_CONFIGURATION), (UINT8 *) Configuration)) {
//
// Update password's clear text in the screen
//
@@ -428,7 +418,7 @@ SetPassword ( // Update uncommitted data of Browser
//
HiiSetBrowserData (
- &mFormSetGuid,
+ &gDriverSampleFormSetGuid,
VariableName,
sizeof (DRIVER_SAMPLE_CONFIGURATION),
(UINT8 *) Configuration,
@@ -448,7 +438,7 @@ SetPassword ( EncodePassword (Password, StrLen (Password) * 2);
Status = gRT->SetVariable(
VariableName,
- &mFormSetGuid,
+ &gDriverSampleFormSetGuid,
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
sizeof (DRIVER_SAMPLE_CONFIGURATION),
&PrivateData->Configuration
@@ -834,7 +824,7 @@ ExtractConfig ( BufferSize = sizeof (DRIVER_SAMPLE_CONFIGURATION);
Status = gRT->GetVariable (
VariableName,
- &mFormSetGuid,
+ &gDriverSampleFormSetGuid,
NULL,
&BufferSize,
&PrivateData->Configuration
@@ -852,7 +842,7 @@ ExtractConfig ( // Allocate and fill a buffer large enough to hold the <ConfigHdr> template
// followed by "&OFFSET=0&WIDTH=WWWWWWWWWWWWWWWW" followed by a Null-terminator
//
- ConfigRequestHdr = HiiConstructConfigHdr (&mFormSetGuid, VariableName, PrivateData->DriverHandle[0]);
+ ConfigRequestHdr = HiiConstructConfigHdr (&gDriverSampleFormSetGuid, VariableName, PrivateData->DriverHandle[0]);
Size = (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16);
ConfigRequest = AllocateZeroPool (Size);
ASSERT (ConfigRequest != NULL);
@@ -865,14 +855,14 @@ ExtractConfig ( // Check routing data in <ConfigHdr>.
// Note: if only one Storage is used, then this checking could be skipped.
//
- if (!HiiIsConfigHdrMatch (Request, &mFormSetGuid, NULL)) {
+ if (!HiiIsConfigHdrMatch (Request, &gDriverSampleFormSetGuid, NULL)) {
return EFI_NOT_FOUND;
}
//
// Check whether request for EFI Varstore. EFI varstore get data
// through hii database, not support in this path.
//
- if (HiiIsConfigHdrMatch(Request, &mFormSetGuid, MyEfiVar)) {
+ if (HiiIsConfigHdrMatch(Request, &gDriverSampleFormSetGuid, MyEfiVar)) {
return EFI_UNSUPPORTED;
}
//
@@ -996,7 +986,7 @@ ExtractConfig ( Progress
);
if (!EFI_ERROR (Status)) {
- ConfigRequestHdr = HiiConstructConfigHdr (&mFormSetGuid, VariableName, PrivateData->DriverHandle[0]);
+ ConfigRequestHdr = HiiConstructConfigHdr (&gDriverSampleFormSetGuid, VariableName, PrivateData->DriverHandle[0]);
AppendAltCfgString(Results, ConfigRequestHdr);
}
}
@@ -1074,7 +1064,7 @@ RouteConfig ( // Check routing data in <ConfigHdr>.
// Note: if only one Storage is used, then this checking could be skipped.
//
- if (!HiiIsConfigHdrMatch (Configuration, &mFormSetGuid, NULL)) {
+ if (!HiiIsConfigHdrMatch (Configuration, &gDriverSampleFormSetGuid, NULL)) {
return EFI_NOT_FOUND;
}
@@ -1082,7 +1072,7 @@ RouteConfig ( // Check whether request for EFI Varstore. EFI varstore get data
// through hii database, not support in this path.
//
- if (HiiIsConfigHdrMatch(Configuration, &mFormSetGuid, MyEfiVar)) {
+ if (HiiIsConfigHdrMatch(Configuration, &gDriverSampleFormSetGuid, MyEfiVar)) {
return EFI_UNSUPPORTED;
}
@@ -1092,7 +1082,7 @@ RouteConfig ( BufferSize = sizeof (DRIVER_SAMPLE_CONFIGURATION);
Status = gRT->GetVariable (
VariableName,
- &mFormSetGuid,
+ &gDriverSampleFormSetGuid,
NULL,
&BufferSize,
&PrivateData->Configuration
@@ -1211,7 +1201,7 @@ RouteConfig ( //
Status = gRT->SetVariable(
VariableName,
- &mFormSetGuid,
+ &gDriverSampleFormSetGuid,
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
sizeof (DRIVER_SAMPLE_CONFIGURATION),
&PrivateData->Configuration
@@ -1240,7 +1230,7 @@ RouteConfig ( //
Status = gRT->SetVariable(
VariableName,
- &mFormSetGuid,
+ &gDriverSampleFormSetGuid,
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
sizeof (DRIVER_SAMPLE_CONFIGURATION),
&PrivateData->Configuration
@@ -1340,7 +1330,7 @@ DriverCallback ( HiiUpdateForm (
PrivateData->HiiHandle[0], // HII handle
- &mFormSetGuid, // Formset GUID
+ &gDriverSampleFormSetGuid, // Formset GUID
0x3, // Form ID
StartOpCodeHandle, // Label for where to insert opcodes
NULL // Insert data
@@ -1498,7 +1488,7 @@ DriverCallback ( PrivateData->Configuration.DynamicOneof = 2;
Status = gRT->SetVariable(
VariableName,
- &mFormSetGuid,
+ &gDriverSampleFormSetGuid,
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
sizeof (DRIVER_SAMPLE_CONFIGURATION),
&PrivateData->Configuration
@@ -1509,14 +1499,14 @@ DriverCallback ( //
Configuration = AllocateZeroPool (sizeof (DRIVER_SAMPLE_CONFIGURATION));
ASSERT (Configuration != NULL);
- if (HiiGetBrowserData (&mFormSetGuid, VariableName, sizeof (DRIVER_SAMPLE_CONFIGURATION), (UINT8 *) Configuration)) {
+ if (HiiGetBrowserData (&gDriverSampleFormSetGuid, VariableName, sizeof (DRIVER_SAMPLE_CONFIGURATION), (UINT8 *) Configuration)) {
Configuration->DynamicOneof = 2;
//
// Update uncommitted data of Browser
//
HiiSetBrowserData (
- &mFormSetGuid,
+ &gDriverSampleFormSetGuid,
VariableName,
sizeof (DRIVER_SAMPLE_CONFIGURATION),
(UINT8 *) Configuration,
@@ -1595,7 +1585,7 @@ DriverCallback ( HiiUpdateForm (
PrivateData->HiiHandle[0], // HII handle
- &mFormSetGuid, // Formset GUID
+ &gDriverSampleFormSetGuid, // Formset GUID
0x1234, // Form ID
StartOpCodeHandle, // Label for where to insert opcodes
EndOpCodeHandle // Replace data
@@ -1644,7 +1634,7 @@ DriverCallback ( HiiUpdateForm (
PrivateData->HiiHandle[0], // HII handle
- &mFormSetGuid, // Formset GUID
+ &gDriverSampleFormSetGuid, // Formset GUID
FormId, // Form ID
StartOpCodeHandle, // Label for where to insert opcodes
NULL // Insert data
@@ -1657,7 +1647,7 @@ DriverCallback ( //
Status = gRT->SetVariable(
VariableName,
- &mFormSetGuid,
+ &gDriverSampleFormSetGuid,
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
sizeof (DRIVER_SAMPLE_CONFIGURATION),
&PrivateData->Configuration
@@ -1669,10 +1659,10 @@ DriverCallback ( //
EfiData = AllocateZeroPool (sizeof (MY_EFI_VARSTORE_DATA));
ASSERT (EfiData != NULL);
- if (HiiGetBrowserData (&mFormSetGuid, MyEfiVar, sizeof (MY_EFI_VARSTORE_DATA), (UINT8 *) EfiData)) {
+ if (HiiGetBrowserData (&gDriverSampleFormSetGuid, MyEfiVar, sizeof (MY_EFI_VARSTORE_DATA), (UINT8 *) EfiData)) {
EfiData->Field8 = 111;
HiiSetBrowserData (
- &mFormSetGuid,
+ &gDriverSampleFormSetGuid,
MyEfiVar,
sizeof (MY_EFI_VARSTORE_DATA),
(UINT8 *) EfiData,
@@ -1886,7 +1876,7 @@ DriverSampleInit ( // Publish our HII data
//
HiiHandle[0] = HiiAddPackages (
- &mFormSetGuid,
+ &gDriverSampleFormSetGuid,
DriverHandle[0],
DriverSampleStrings,
VfrBin,
@@ -1912,7 +1902,7 @@ DriverSampleInit ( PrivateData->DriverHandle[1] = DriverHandle[1];
HiiHandle[1] = HiiAddPackages (
- &mInventoryGuid,
+ &gDriverSampleInventoryGuid,
DriverHandle[1],
DriverSampleStrings,
InventoryBin,
@@ -1954,18 +1944,18 @@ DriverSampleInit ( //
// Try to read NV config EFI variable first
//
- ConfigRequestHdr = HiiConstructConfigHdr (&mFormSetGuid, VariableName, DriverHandle[0]);
+ ConfigRequestHdr = HiiConstructConfigHdr (&gDriverSampleFormSetGuid, VariableName, DriverHandle[0]);
ASSERT (ConfigRequestHdr != NULL);
BufferSize = sizeof (DRIVER_SAMPLE_CONFIGURATION);
- Status = gRT->GetVariable (VariableName, &mFormSetGuid, NULL, &BufferSize, Configuration);
+ Status = gRT->GetVariable (VariableName, &gDriverSampleFormSetGuid, NULL, &BufferSize, Configuration);
if (EFI_ERROR (Status)) {
//
// Store zero data Buffer Storage to EFI variable
//
Status = gRT->SetVariable(
VariableName,
- &mFormSetGuid,
+ &gDriverSampleFormSetGuid,
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
sizeof (DRIVER_SAMPLE_CONFIGURATION),
Configuration
@@ -1992,18 +1982,18 @@ DriverSampleInit ( VarStoreConfig = &PrivateData->VarStoreConfig;
ZeroMem (VarStoreConfig, sizeof (MY_EFI_VARSTORE_DATA));
- ConfigRequestHdr = HiiConstructConfigHdr (&mFormSetGuid, MyEfiVar, DriverHandle[0]);
+ ConfigRequestHdr = HiiConstructConfigHdr (&gDriverSampleFormSetGuid, MyEfiVar, DriverHandle[0]);
ASSERT (ConfigRequestHdr != NULL);
BufferSize = sizeof (MY_EFI_VARSTORE_DATA);
- Status = gRT->GetVariable (MyEfiVar, &mFormSetGuid, NULL, &BufferSize, VarStoreConfig);
+ Status = gRT->GetVariable (MyEfiVar, &gDriverSampleFormSetGuid, NULL, &BufferSize, VarStoreConfig);
if (EFI_ERROR (Status)) {
//
// Store zero data to EFI variable Storage.
//
Status = gRT->SetVariable(
MyEfiVar,
- &mFormSetGuid,
+ &gDriverSampleFormSetGuid,
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
sizeof (MY_EFI_VARSTORE_DATA),
VarStoreConfig
@@ -2029,7 +2019,7 @@ DriverSampleInit ( TPL_NOTIFY,
DriverSampleInternalEmptyFunction,
NULL,
- &MyEventGroupGuid,
+ &gEfiIfrRefreshIdOpGuid,
&mEvent
);
ASSERT_EFI_ERROR (Status);
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf b/MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf index 81a5186414..cffd2f351c 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf +++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf @@ -58,6 +58,9 @@ [Guids]
gEfiIfrTianoGuid ## CONSUMES ## Guid
+ gDriverSampleFormSetGuid ## PRODUCES ## Guid
+ gDriverSampleInventoryGuid ## PRODUCES ## Guid
+ gEfiIfrRefreshIdOpGuid ## SOMETIMES_PRODUCES ## EventGuid
[Protocols]
gEfiHiiStringProtocolGuid ## CONSUMES
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/Inventory.vfr b/MdeModulePkg/Universal/DriverSampleDxe/Inventory.vfr index 6aa7b46014..b835dfc392 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/Inventory.vfr +++ b/MdeModulePkg/Universal/DriverSampleDxe/Inventory.vfr @@ -2,7 +2,7 @@ //
// Sample Inventory Data
//
-// Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
+// Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
// 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
@@ -13,10 +13,10 @@ //
//**/
-#define INVENTORY_GUID { 0xb3f56470, 0x6141, 0x4621, 0x8f, 0x19, 0x70, 0x4e, 0x57, 0x7a, 0xa9, 0xe8 }
+#include "NVDataStruc.h"
formset
- guid = INVENTORY_GUID,
+ guid = DRIVER_SAMPLE_INVENTORY_GUID,
title = STRING_TOKEN(STR_INV_FORM_SET_TITLE),
help = STRING_TOKEN(STR_INV_FORM_SET_HELP),
class = 0x04,
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h b/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h index 06953ca6cb..3c317cdb7b 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h +++ b/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h @@ -1,6 +1,6 @@ /** @file
-Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
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
@@ -27,29 +27,8 @@ Revision History: #include <Guid/HiiPlatformSetupFormset.h>
#include <Guid/HiiFormMapMethodGuid.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 EFI_USER_INFO_ACCESS_SETUP_ADMIN_GUID \
- { 0x85b75607, 0xf7ce, 0x471e, { 0xb7, 0xe4, 0x2a, 0xea, 0x5f, 0x72, 0x32, 0xee } }
-
-#define EFI_IFR_REFRESH_ID_OP_GUID \
- { \
- 0xF5E655D9, 0x02A6, 0x46f2, {0x9E, 0x76, 0xB8, 0xBE, 0x8E, 0x60, 0xAB, 0x22} \
- }
-
-#define ZERO_GUID \
- { \
- 0x0, 0x0, 0x0, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0} \
- }
+#include <Guid/DriverSampleHii.h>
+#include <Guid/ZeroGuid.h>
#define CONFIGURATION_VARSTORE_ID 0x1234
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr b/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr index d316511133..78c93d0ebf 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr +++ b/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr @@ -51,7 +51,7 @@ #define LABEL_UPDATE_BBS 0x2222
formset
- guid = FORMSET_GUID,
+ guid = DRIVER_SAMPLE_FORMSET_GUID,
title = STRING_TOKEN(STR_FORM_SET_TITLE),
help = STRING_TOKEN(STR_FORM_SET_TITLE_HELP),
classguid = EFI_HII_PLATFORM_SETUP_FORMSET_GUID,
@@ -71,7 +71,7 @@ formset varstore DRIVER_SAMPLE_CONFIGURATION, // This is the data structure type
varid = CONFIGURATION_VARSTORE_ID, // Optional VarStore ID
name = MyIfrNVData, // Define referenced name in vfr
- guid = FORMSET_GUID; // GUID of this buffer storage
+ guid = DRIVER_SAMPLE_FORMSET_GUID; // GUID of this buffer storage
//
// Define a EFI variable Storage (EFI_IFR_VARSTORE_EFI)
@@ -79,7 +79,7 @@ formset efivarstore MY_EFI_VARSTORE_DATA,
attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE, // EFI variable attribures
name = MyEfiVar,
- guid = FORMSET_GUID;
+ guid = DRIVER_SAMPLE_FORMSET_GUID;
//
// Define a Name/Value Storage (EFI_IFR_VARSTORE_NAME_VALUE)
@@ -88,7 +88,7 @@ formset name = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME0), // Define Name list of this storage, refer it by MyNameValueVar[0]
name = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME1), // Define Name list of this storage, refer it by MyNameValueVar[1]
name = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME2), // Define Name list of this storage, refer it by MyNameValueVar[2]
- guid = FORMSET_GUID; // GUID of this Name/Value storage
+ guid = DRIVER_SAMPLE_FORMSET_GUID; // GUID of this Name/Value storage
defaultstore MyStandardDefault,
prompt = STRING_TOKEN(STR_STANDARD_DEFAULT_PROMPT),
@@ -492,7 +492,7 @@ formset help = STRING_TOKEN(STR_GOTO_HELP);
guidop
- guid = FORMSET_GUID,
+ guid = DRIVER_SAMPLE_FORMSET_GUID,
datatype = MY_EFI_VARSTORE_DATA,
data.Field8 = 0x21,
data.Field16 = 0x2121,
@@ -680,7 +680,7 @@ formset formmap formid = 4,
maptitle = STRING_TOKEN(STR_SAMPL_MAP_METHOD);
- mapguid = FORMSET_GUID;
+ mapguid = DRIVER_SAMPLE_FORMSET_GUID;
maptitle = STRING_TOKEN(STR_STANDARD_MAP_METHOD);
mapguid = EFI_HII_STANDARD_FORM_GUID;
|