Add Example for EFI_BROWSER_ACTION_RETRIEVE callback

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9426 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4 2009-11-13 07:13:11 +00:00
parent eccfeab1ca
commit 16019c8582
2 changed files with 23 additions and 6 deletions

View File

@ -556,6 +556,7 @@ DriverCallback (
EFI_IFR_GUID_LABEL *EndLabel;
EFI_INPUT_KEY Key;
DRIVER_SAMPLE_CONFIGURATION *Configuration;
UINTN MyVarSize;
if (Action == EFI_BROWSER_ACTION_FORM_OPEN) {
//
@ -624,7 +625,6 @@ DriverCallback (
return EFI_INVALID_PARAMETER;
}
Status = EFI_SUCCESS;
PrivateData = DRIVER_SAMPLE_PRIVATE_FROM_THIS (This);
@ -821,12 +821,13 @@ DriverCallback (
// Change an EFI Variable storage (MyEfiVar) asynchronous, this will cause
// the first statement in Form 3 be suppressed
//
MyVarSize = 1;
MyVar = 111;
Status = gRT->SetVariable(
L"MyVar",
&mFormSetGuid,
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
1,
MyVarSize,
&MyVar
);
break;
@ -870,6 +871,21 @@ DriverCallback (
break;
case 0x1111:
//
// EfiVarstore question takes sample action (print value as debug information)
// after read/write question.
//
MyVarSize = 1;
Status = gRT->GetVariable(
L"MyVar",
&mFormSetGuid,
NULL,
&MyVarSize,
&MyVar
);
ASSERT_EFI_ERROR (Status);
DEBUG ((DEBUG_INFO, "EfiVarstore question: Tall value is %d with value width %d\n", MyVar, MyVarSize));
default:
break;
}

View File

@ -84,7 +84,7 @@ formset
// Define a EFI variable Storage (EFI_IFR_VARSTORE_EFI)
//
efivarstore MyEfiVar, // Define referenced name in vfr
attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS, // EFI variable attribures
attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE, // EFI variable attribures
name = STRING_TOKEN(STR_VAR_NAME), // EFI variable name
varsize = 1, // Size of the EFI variable
guid = FORMSET_GUID; // EFI variable GUID
@ -153,9 +153,9 @@ formset
oneof varid = MyIfrNVData.BootOrderLarge,
prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
help = STRING_TOKEN(STR_ONE_OF_HELP),
default value = cond (questionref(MyOneOf) == 0x0 ? 0 : 1),
default value = cond (pushthis == 0 ? 0 : cond ((questionref(MyOneOf) >> 0x4 & 0xF00) == 0x0 + 0x2 ? 0 : 1)),
option text = STRING_TOKEN(STR_BOOT_ORDER1), value = 0x0, flags = 0;
option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 0x1, flags = DEFAULT;
option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 0x1, flags = 0;
endoneof;
grayoutif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x1;
@ -313,9 +313,10 @@ formset
endnumeric;
numeric varid = MyEfiVar, // Reference of EFI variable storage
questionid = 0x1111,
prompt = STRING_TOKEN(STR_TALL_HEX_PROMPT),
help = STRING_TOKEN(STR_NUMERIC_HELP1),
flags = DISPLAY_UINT_HEX, // Display in HEX format (if not specified, default is in decimal format)
flags = DISPLAY_UINT_HEX | INTERACTIVE, // Display in HEX format (if not specified, default is in decimal format)
minimum = 0,
maximum = 250,
default = 175,