Visual Forms Representation File Format

From PhoenixWiki

Jump to: navigation, search

The file is formatted as UTF-8 encoded text. Comments are C++ ('//') style and all text to the end of the line will be ignored.

Each file contains two parts. The first part, which is optional, contains data definitions and #pragma commands. The second part contains the form set definition. There is only one form set allowed.

vfr-syntax    := data-declarations formset

Contents

Syntax

action

Action buttons are buttons which cause a pre-defined configuration string to process immediately. There is no storage directly associated with the button.

Syntax

action
   [ name = identifier , ] 
   [ questionid = uint , ] 
   prompt = string , 
   help = string ,
   [ flags = action-flags , ] 
   config = string ,

  question-tag-list
endaction ; 
action-flags := action-flags | action-flag |
                action-flag |
                <nothing>
action-flag  := READ_ONLY |
                INTERACTIVE |
                OPTIONS_ONLY |
                RESET_REQUIRED

Attributes

Attribute Description
name
questionid A 16-bit unsigned integer which uniquely identifies the question within the form set in which it appears. The question identifier, along with the device path and form set identifier, uniquely identifies a question within a system.
prompt A string identifier that specifies the string for the question prompt.
help A string identifier that specifies the string for the question extended help text.
flags Zero or more keywords, separated by a | character.
  • READ_ONLY. The question is read-only. The value cannot be changed and cannot be selected.
  • INTERACTIVE. The callback associated with this form will be called.
  • OPTIONS_ONLY. Only the values specified by nested option operators can be selected by the user.
  • RESET_REQUIRED. A system reset is required in order for changes in this question's value to take effect.
config The string (in <ConfigResp> format) which will be processed using RoutConfig() when the button is pressed.

Description
This operator creates an action question. When the question is selected, the configuration string specified by config will be processed. If config is not specified, then no no configuration string will be processed. This is useful when using an action button only for the callback.

If the question is marked read-only then the action question cannot be selected.

This operator corresponds to the IFR EFI_IFR_ACTION operator.

Example

action 
  prompt = STRING_TOKEN(STR_ACTION_TEXT), 
  help = STRING_TOKEN(STR_ACTION_HELP), 
  flags = INTERACTIVE | 0x22 
 config = STRING_TOKEN(STR_ACTION_CONFIG), 
endaction;

banner

Syntax

banner 
   title = string , line uint16 , align align-flags ;
   title = string , timeout = uint16 ;
align-flags := left | center | right

Description
This operator does not correspond to any IFR operator and is ignored by the Forms Browser.

Example

banner 
  title = STRING_TOKEN(STR_BANNER_TEXT), 
  line 1, 
  align left; 
banner 
  timeout = 100;

bitwisenot

Bitwise NOT (~) operation on an unsigned integer expression.

Syntax

bitwisenot ( expression1 )


Parameters

Parameter Description
expression1 Expression which evaluates to an unsigned integer.


Description
This operator performs a bitwise NOT on an unsigned integer expression.

If the expression cannot be evaluated as an unsigned integer, return Undefined. Otherwise, zero-extend the unsigned integer to 64-bits, bitwise-NOT it and return it.

This operator corresponds to the IFR EFI_IFR_BITWISE_NOT operator.

boolval

Converts the unsigned integer, string or buffer expression to a boolean.

Syntax

boolval ( expression1 )


Parameters

Parameter Description
expression1 Expression to convert


Description
This operator converts expression1 to a boolean value. If expression1 evaluates as Undefined then it returns Undefined.

If converting from an unsigned integer expression, zero will be converted to FALSE and any other value will be converted to TRUE.

If converting from a string, if the string (case-insensitive) is "true" then return TRUE. If it (case-insensitive) is "false" then return FALSE. Otherwise return Undefined.

If converting from a buffer, if the buffer is all zeroes, then return FALSE. Otherwise return TRUE.

If converting from any other data type, return Undefined.

This operator corresponds to the IFR EFI_IFR_TO_BOOLEAN operator.


catenate

Syntax

catenate ( expression1 , expression2 )

Parameters

Parameter Description
expression1, expression2 String or buffer expression.


Description
If the first or second expression cannot be evaluated as a string or a buffer, return Undefined. If the first or second expressions are of different types, the return Undefined.

If the first and second expressions are strings, return a new string which contains the contents of the first string (without the NULL terminator) followed by the contents of the second string.

If the first and second expressions are buffers, return a new buffer which contains the contents of the first buffer followed by the contents of the second buffer.

This operator corresponds to the EFI_IFR_CATENATE operator.

checkbox

Boolean questions are those that allow a choice between true and false. The question’s value is Boolean. In general, construct questions so that the prompt text asks questions resulting in ‘yes/enabled/on’ is ‘true’ and ‘no/disabled/off’ is ‘false’.

Boolean questions may be displayed as a check box, two radio buttons, a selection list, a list box, or a drop list box.

Syntax

checkbox 
    [ name = identifier , ]
    [ varid = storage-id , ] 
    [ questionid = uint , ] 
    prompt = string , 
    help = string , 
    [ flags = check-box-flags , ] 
    [ key = uint , ]
 question-option-list 
endcheckbox ;
checkbox-flags := checkbox-flags | checkbox-flag | 
                  checkbox-flag |
                  <nothing>
checkbox-flag  := uint8 | 
                  CHECKBOX_DEFAULT | 
                  CHECKBOX_DEFAULT_MFG |
                  READ_ONLY | 
                  INTERACTIVE | 
                  OPTIONS_ONLY | 
                  RESET_REQUIRED


Attributes

Attribute Description
name
varid
questionid The unique value that uniquely identifies the question within the form set. The question identifier, along with the device path and form set identifier uniquely identify a question within the system. The value of zero is reserved.
prompt A string identifier that specifies the string for the question prompt.
help A string identifier that specifies the string for the question extended help text.
flags Zero or more keywords or integers, separated by the '|' character. The following keywords are supported:
  • CHECKBOX_DEFAULT. If specified, the standard default for the checkbox is TRUE. Otherwise, it is FALSE. If there is a nested option or default which specifies the standard default value for this checkbox question, then this flag is ignored.
  • CHECKBOX_DEFAULT_MFG. If specified, the manufacturing default for the checkbox is TRUE. Otherwise, it is false. If there is a nested option or default which specifies the manufacturing default value for this checkbox question, then this flag is ignored.
  • READ_ONLY. The question is read-only. The value cannot be changed and cannot be selected.
  • INTERACTIVE. The callback associated with this form will be called.
  • OPTIONS_ONLY. Only the values specified by nested option operators can be selected by the user.
  • RESET_REQUIRED. A system reset is required in order for changes in this question's value to take effect.
key

Description
Creates a boolean checkbox question and adds it to the current form. The checkbox has two values: FALSE if the box is not checked and TRUE if it is.

There are three ways to specify defaults for this question: the Flags field (lowest priority), one or more nested option operators or a nested default operator (highest priority).

An image may be associated with the question using a nested image operator.

This operator corresponds to the IFR EFI_IFR_CHECKBOX operator.

cond

Return one of two expressions, depending on the value of a third expression.


Syntax

cond ( expression1 ? expression2 : expression3 )


Parameters

Parameter Description
expression1 Expression which evaluates to a boolean.
expression2, expression3 Normal expressions


Description
If the first expression cannot be evaluated as a boolean, return Undefined.

If the first expression evaluates to TRUE, return the third expression. Otherwise, return the second expression.

This operator corresponds to the IFR EFI_IFR_CONDITIONAL operator.

constant-value

Represents a constant value of integer or string, a constant value field can a one of the following.

Syntax

constant-value := uint | 
                  TRUE | 
                  FALSE | 
                  ONE | 
                  ONES | 
                  ZERO | 
                  uint : uint : uint | 
                  uint / uint / uint |
                  string

Description
This operator will generate the EFI_IFR_UINT8, EFI_IFR_UINT16, EFI_IFR_UINT32 or EFI_IFR_UINT64 operators for unsigned integers.

This operator will generate the EFI_IFR_ZERO, EFI_IFR_ONE or EFI_IFR_ONES operators for constants.

data-declarations

Declare data structures and data types.

Syntax

data-declarations     := data-declarations data-declaration |
                         data-declaration | 
                         <nothing>
data-declaration      := pragma
                         struct
guid                  := { uint32 , uint16 , uint16 , [ { ] uint8, uint8, uint8, uint8, 
                         uint8, uint8, uint8, uint8 [ } ] }
optional-array-suffix := [ size ] | <nothing>

Description
This section declares zero or more data types to be used later with the form sets. For the most part, these are used for declaring data storage.

data-type

Syntax

data-type          := BOOLEAN | 
                      CHAR16 | 
                      EFI_HII_DATE | 
                      EFI_HII_TIME | 
                      EFI_STRING_ID | 
                      UINT8 | 
                      UINT16 | 
                      UINT32 | 
                      UINT64 | 
                      identifier


date

Date questions allow modification of part or all of a standard calendar date. The format of the date display depends on the Forms Browser and any localization.

Syntax

date
   [ name = identifier , ]
   [ varid = storage-id , ] 
   [ questionid = uint , ] 
   prompt = string , 
   help = string ,
   [ flags = date-flags , ]
  question-option-list 
enddate ;
date-flags := date-flags | date-flag |
              date-flag |
              <nothing>
date-flag  := YEAR_SUPPRESS |
              MONTH_SUPPRESS |
              DAY_SUPPRESS |
              STORAGE_NORMAL |
              STORAGE_TIME |
              STORAGE_WAKEUP |
              uint8

Attributes

Attribute Description
prompt A string identifier that specifies the string for the question prompt.
help A string identifier that specifies the string for the question extended help text.
flags Zero or more keywords separated by the | character.
  • YEAR_SUPPRESS. The year is not displayed (or optionally, not editable)
  • MONTH_SUPPRESS. The month is not displayed (or optionally, not editable)
  • DAY_SUPPRESS. The day is not displayed (or optionally, not editable)
  • STORAGE_NORMAL. The date is stored using the EFI_HII_DATE format. May not be combined with STORAGE_TIME or STORAGE_WAKEUP.
  • STORAGE_TIME. The date is stored using SetTime(). May not be combined with STORAGE_NORMAL or STORAGE_WAKEUP.
  • STORAGE_WAKEUP. The date is stored using SetWakeupTime(). May not be combined with STORAGE_NORMAL or STORAGE_TIME.

Description
This operator corresponds to the IFR EFI_IFR_DATE operator.

default

Provides a default value for the current question.

Syntax

default value = expression ,  [defaultstore = identifier ,] 
default = constant-value , [defaultstore = identifier ,] 

Attributes

Attribute Description
value An expression that provides the default value for the current question.
constant-value A constant value that provides the default value for the current question.
defaultstore A default store identifier that corresponds to a previously defined defaultstore. If none is specified, then 0 is used.

Description
This operator specifies a default value for the current question. The default value is either provided in the opcode itself (Value) or using a nested value operator.

This operator corresponds to the IFR EFI_IFR_DEFAULT operator.

defaultstore

Default stores group together different types of default settings (normal, manufacturing, etc.) and give them a name.

Syntax

defaultstore identifier , 
   prompt = string 
   [ , attribute = uint16 ] ;

Attributes

Attribute Description
identifier A C-style identifier which can used to refer to this default store.
prompt A string identifier that specifies the string for the user-readable name of the default store.
attribute An optional default store identifier. If none is specified, then EFI_HII_DEFAULT_CLASS_STANDARD is used.

Description
This operator declares a class of defaults, which can then have question default values associated with.

This operator corresponds to the IFR EFI_IFR_DEFAULTSTORE operator.

#define

Assigns a meaningful name to a constant.

Syntax

#define identifier value...

Description
Similar to the C preprocessor operator of the same name, this operator can only handle simple substitution.

disableif

Disable all nested forms or questions if the expression evaluates to TRUE.

Syntax

disableif expression ;
  forms/questions/statements
endif ;

Description
All nested statements, questions, options or expressions will not be processed if the expression appearing as the first nested object evaluates to TRUE.

When this opcode appears under a form, the expression may rely on question values in the same form which are not inside of a disableif expression.

This operator corresponds to the IFR EFI_IFR_DISABLE_IF operator.

dup

Duplicate the top value on the expression stack.

Syntax

dup

Description
This operator corresponds to the IFR EFI_IFR_DUP operator.

efivarstore

Creates a variable storage short-cut for EFI variable storage.

Syntax

efivarstore identifier , 
   attribute = uint32 , 
   name      = string , 
   varsize   = uint32 , 
   guid      = guid ;

Attributes

Attribute Description
attribute EFI variable attribute. Can be zero or more numbers, separated by a | character.
name The string identifier of the string for the EFI variable name of the EFI variable which will hold question values.
varsize An unsigned integer that specifies the maximum size of the EFI variable which will hold question values.
guid The GUID of the EFI variable name of the EFI variable which will hold question values.

Description
This operator describes an EFI Variable Variable Store within a form set. The Guid specified here and the name specified by VariableName in the question’s header will be used with GetVariable() and SetVariable(). A question can select this variable store by setting the VarStoreId field in its question header.

This operator corresponds to the IFR EFI_IFR_VARSTORE_EFI operator.

Example

efivarstore EfiVarStore,
  attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS,
  name = STRING_TOKEN(STR_TOKEN_NULL),
  varsize = 1,
  guid = GUID;

expression

Combinations of build-in functions and arithmetic, logic, shift, comparison, cast operators. Supported operators are: +, -, *, /, %, |, &, and, or, not, ==, !=, <, <=, >, >=, <<, >>, (TYPECAST).

expression  := expr1 
expr1       := expr2 or expr1
               expr2 || expr1
expr2       := expr3 and expr2
               expr3 && expr2
expr3       := expr4 | expr3
expr4       := expr5 & expr4
expr5       := expr6 == expr5
               expr6 != expr5
expr6       := expr7 < expr6
               expr7 > expr6
               expr7 <= expr6
               expr7 >= expr6
expr7       := expr8 << expr7
               expr8 >> expr7
expr8       := expr9 + expr8
               expr9 - expr8
expr9       := expr10 * expr9
               expr10 / expr9
               expr10 % expr9
expr10      := (typecast) expr10
               expr1
expr11      := not expr11
               ! expr11
               expr12
expr12      := ( expression ) |
               bitwisenot |
               boolval |
               catenate |
               cond |
               constant-value |
               dup |
               find |
               ideqid   |
               ideqval |
               ideqvallist |
               length |
               match |
               mid |
               questionref |
               questionrefval |
               pushthis |
               ruleref |
               security |
               span |
               stringref |
               stringrefval |
               stringval |
               tok |
               tolower |
               toupper |
               unintval
typecast    :=  BOOLEAN |
                UINT64 |
                UINT32 |
                UINT16 |
                UINT8

Description
The expression is a C-style expression, with C-style operator precedence. The following table describes each of the C-style operators:

Operator Operation Description
or Logical OR Corresponds to the IFR EFI_IFR_OR operator.
and Logical AND Corresponds to the IFR EFI_IFR_AND operator. In C/C++ the right-side operand will not be evaluated if the left-side operand evaluates to FALSE. However, in VFR, both sides will be evaluated in all cases.
Bitwise OR Corresponds to the IFR EFI_IFR_BITWISE_OR operator.
& Bitwise AND Corresponds to the IFR EFI_IFR_BITWISE_AND operator.
== Equal Corresponds to the IFR EFI_IFR_EQUAL operator.
!= Not Equal Corresponds to the IFR EFI_IFR_NOT_EQUAL operator.
> Greater Than Corresponds to the IFR EFI_IFR_GREATER_THAN operator.
>= Greater Than or Equal Corresponds to the IFR EFI_IFR_GREATER_EQUAL operator.
< Less Than Corresponds to the IFR EFI_IFR_LESS_THAN operator.
<= Less Than or Equal Corresponds to the IFR EFI_IFR_LESS_EQUAL operator.
<< Shift Left Corresponds to the IFR EFI_IFR_SHIFT_LEFT operator.
>> Shift Right Corresponds to the IFR EFI_IFR_SHIFT_RIGHT operator.
+ Add Corresponds to the IFR EFI_IFR_ADD operator.
- Subtract Corresponds to the IFR EFI_IFR_SUBTRACT operator.
* Multiply Corresponds to the IFR EFI_IFR_MULTIPLY operator.
/ Divide Corresponds to the IFR EFI_IFR_DIVIDE operator.
% Modulo Corresponds to the IFR EFI_IFR_MODULO operator.

find

Syntax

find ( find-flags, expression , expression , expression )

find-flags := find-flags | find-flag |
              find-flag |
              <nothing>
find-flag  := SENSITIVE |
              INSENSITIVE

Parameters

Parameter Description
expression1 A string identifier that specifies the string to search.
expression2 A string identifier that specifies the string to compare with.
expression3 A zero-based index into the string returned by expression1 which specifies the character from which to begin the search.
flags A keyword which specifies whether the search is case-sensitive (SENSITIVE) or case-insensitive (INSENSITIVE).

Description
This operator returns the zero-based index of a found sub-string within a string, starting at the specified character.

If expression1 and expression2 cannot be evaluated as a string, return Undefined. If the expression3 cannot be evaluated as an unsigned integer, return Undefined.

If the string specified by expression2 is found within expression1 at a character index greater than or equal to expression3, return the zero-based index of the found string. If the string is not found or expression3 specifies a value which is greater-than or equal to the length of the expression1, return 0xFFFFFFFFFFFFFFFF.

This operator corresponds to the IFR EFI_IFR_FIND operator.

form

Definition of a single form. Forms are logically-related groups of statements and questions designed to be displayed together.

Syntax

form 
   formid = uint16, 
   title = STRING_TOKEN(uint16) ;

  image
  locked
  rules
  default
  subtitle
  text
  resetbutton
  checkbox
  action
  goto
  date
  numeric
  oneof
  string
  password
  orderedlist
  time
  disableif
  suppressif
  grayoutif 
  label
  banner
endform;

Attributes

Attribute Description
formid A 16-bit unsigned integer which acts as the unique identifier for this form within the form set.
title A string identifier that specifies the form's title.

Description
This operator creates a form. A form is the encapsulation of a browser page.

It correponds to the IFR EFI_IFR_FORM operator.

formset

Declares the one and only form set in the file.

Syntax

formset 
  guid     = guid, 
  title    = STRING_TOKEN(uint16), 
  help     = STRING_TOKEN(uint16), 
  class    = class-keywords, OPTIONAL
  subclass = subclass-keyword
  form
  image
  varstore
  efivarstore
  namevaluevarstore
  defaultstore
  disableif
  label
endformset ;

class-keywords   := class-keywords | class-keyword |
                    class-keyword |
                    <nothing>
class-keyword    := NON_DEVICE  | DISK_DEVICE  | VIDEO_DEVICE  |
                    NETWORK_DEVICE | INPUT_DEVICE  | ONBOARD_DEVICE  |
                    OTHER_DEVICE | uint16
subclass-keyword := SETUP_APPLICATION | GENERAL_APPLICATION | FRONT_PAGE |
                    SINGLE_USE | uint16
Attributes Description
guid A GUID which uniquely identifies this form set.
title The string which specifies the user-readable title for this form set.
help The string which specifies the user-readable extended description of this form set.
class Zero or more keywords which identify the classification of this form. These can be used by a Forms Browser to organize the forms for user browsing.
subclass Zero or one keywords which identify the sub-classification fo this form. This can be used by a Forms Browser to organize the forms for user browsing.

Description
This operator declares the one and only form set.

It corresponds to the IFR operator EFI_IFR_FORM_SET.

goto

Redirect the execution to another formset, or any form inside the current formset. Since it supports many target types, there are 4 kinds statements to describe the target. All of them share the same attribute statements.

goto 
   devicepath    = string , 
   formsetguid   = guid  , 
   formid        = uint , 
   question      = uint , 
   [ name     = identifier ,]
   [ questionid = uint ,] 
   prompt = string , 
   help = string 
   [, image = image ]
   [, locked ]
   [, flags' = goto-flags]
   [, key = uint] ;
goto 
   formsetguid = guid , 
   formid = uint, 
   question = uint 
   [ name = identifier ,]
   [ questionid = uint ,] 
   prompt = string , 
   help = string 
   [, image = image ]
   [, locked ]
   [, flags = goto-flags]
   [, key = uint] ;
goto 
   formid = uint, 
   question = uint 
   [ name = identifier ,]
   [ questionid = uint ,] 
   prompt = string , 
   help = string 
   [, image = image ]
   [, locked ]
   [, flags = goto-flags]
   [, key = uint] ;
goto uint 
   [ name = identifier ,]
   [ questionid = uint ,] 
   prompt = string , 
   help = string 
   [, image = image ]
   [, locked ]
   [, flags = goto-flags]
   [, key = uint] ;
 
goto-flags := goto-flags goto-flag |
              goto-flag |
              <nothing>
goto-flag  := READ_ONLY | 
              INTERACTIVE | 
              OPTIONS_ONLY | 
              RESET_REQUIRED | 
              uint8


Attributes

Attribute Description
formsetguid The form set to which this link is referring. If this attribute is not present or nil, then the link is in the current form set.
formid The form to which this link is referring. If this attribute is not present or zero, then the link is on the current form.
questionid The question on the form to which this link is referring. If this attribute field is not present or the value is zero, then the link refers to the top of the form.
prompt A string identifier that specifies the string for the question prompt.
help A string identifier that specifies the string for the question extended help text.
flags Zero or more flags, separated by |
  • READ_ONLY. The question is read-only. The value cannot be changed and cannot be selected.
  • INTERACTIVE. The callback associated with this form will be called.
  • OPTIONS_ONLY. Only the values specified by nested option operators can be selected by the user.
  • RESET_REQUIRED. A system reset is required in order for changes in this question's value to take effect.

Description
Creates a user-selectable link to a form or a question on a form. There are several forms of this operator.

If the question is marked read-only then the action question cannot be selected.

This operator corresponds to the IFR EFI_IFR_REF operator.

Examples

goto 1, 
   prompt = STRING_TOKEN(STR_GOTO_FORM1), 
   help = STRING_TOKEN(STR_GOTO_HELP); 
goto 0x1234, 
   prompt = STRING_TOKEN(STR_GOTO_DYNAMIC2), 
   help = STRING_TOKEN(STR_GOTO_HELP), 
   flags = INTERACTIVE | LATE_CHECK, 
   key = 0x1235;

grayoutif

Creates a group of statements which are conditionally grayed-out.

Syntax

grayoutif expression
   statements/questions/options
endif ;

Description
This operator causes nested statements or questions to be grayed out (not selectable and visually distinct) if the expression appearing as the first nested object evaluates to TRUE.

Different browsers may support this option to varying degrees. For example, HTML has no similar construct so it may not support this facility.

This operator corresponds tothe IFR EFI_IFR_GRAY_OUT_IF operator.

ideqid

Returns TRUE if two questions have the same value or FALSE if their values differ.

Syntax

ideqid data-field-name1 == data-field-name2 

Description
This operator evaluates whether the two questions specified by data-field-name1 and data-field-name2 are equal and, if so, return TRUE. Otherwise, return FALSE. If the two question values cannot be converted to compatibile types, then return Undefined.

This operator corresponds to the IFR EFI_IFR_EQ_ID_ID operator.

ideqval

Return TRUE if a question’s value is equal to a 16-bit unsigned integer, otherwise FALSE.

Syntax

ideqval data-field-name == uint16

Description
This operator evaluates the value of the specified question (data-field-name). If the specified question cannot be evaluated as an unsigned integer, then return Undefined. If they are equal, return TRUE. Otherwise return FALSE.

This operator corresponds to the IFR EFI_IFR_EQ_ID_VAL operator.

ideqvallist

Return TRUE if the question’s value appears in a list of unsigned integers.

Syntax

ideqvallist data-field-name == uint16 [ uint16... ]

Attributes

Attribute Description
data-field-name Name of the question
uint16 One or more 16-bit unsigned integers to compare against.

Description
This operator evaluates the value of the specified question (data-field-name). If the specified question cannot be evaluated as an unsigned integer, then return Undefined. If the value is equal to one of the uint16 values, , then return TRUE. Otherwise return FALSE.

This operator corresponds to the IFR EFI_IFR_EQ_ID_LIST operator.

image

An image, usually used to create an image for a statement or question.

Syntax

image = image 

Attributes

Attribute Description
image An image identifier that specifies the image to associate with the parent statement, question, form or option.

Description
This operator may be nested within question, statement, form or option in order to associate an image with them.

This operator corresponds to the IFR EFI_IFR_IMAGE operator.

#include

Includes the specified file at the current location in the translation unit.

Syntax

#include string-literal

Example

#include “C:\Source\ DriverSampleStrDefs.h”

inconsistentif

Creates a validation expression and error message for a question.

Syntax

inconsistentif
   prompt = string  ,
   expression ,
   statements
endif

Attributes

Attribute Description
prompt A string identifier that specifies the error message text to display when expression evaluates to TRUE.
expression The expression to evaluate after a question value is changed.

Description
This operator specifies an expression to use when validating new question values. If the expression evaluates to TRUE, then the prompt string may be displayed and the new value is disallowed. If the expression evaluates to FALSE, then the new value is allowed. This does not replace other error checking (such as minimum and maximum for numeric).

The user should not be allowed to submit the results of a form with inconsistent values.

This operator corresponds to the IFR EFI_IFR_INCONSISTENT_IF operator.

label

Creates a label which can be used for building IFR forms at run-time.

Syntax

label uint16 ;

length

Returns the length of a string (in characters) or a buffer (in bytes).

Syntax

length ( expression1 )


Parameters

Parameter Description
expression1 Expression which evaluates to a string or buffer


Description
If the expression cannot be evaluated as a buffer or string, then return Undefined. If the expression can be evaluated as a buffer, return the length of the buffer, in bytes. If the expression can be evaluated as a string, return the length of the string, in characters.

This operator corresponds to the IFR EFI_IFR_LENGTH operator.

match

Returns whether a string matches a pattern.

Syntax

match ( expression1 , expression2 )

Parameters

Parameter Description
expression1 Evaluates to the string to search
expression2 Evaluates to the pattern. The format of the pattern is specified in MetaiMatch()

Description
If expression1 or expression2 cannot be evaluated as a string, then return Undefined.

The two strings are processed using MetaiMatch(). If the result is TRUE, then TRUE is returned. If the result is FALSE, then FALSE is returned.

This operator corresponds to the IFR EFI_IFR_MATCH operator.

mid

Extract a portion of a buffer or a string.

Syntax

mid ( expression1 , expression2 , expression3 )

Parameters

Parameter Description
expression1 Evaluates as the string or buffer to extract from.
expression2 Zero-based index of the first character in the string or first byute in the buffer to extract.
expression3 Number of characters in the string or number of bytes in the buffer to extract.


Description
If expression1 cannot be evaluated as a string or a buffer, return Undefined. If expression2 or expression3 cannot be evaluated as unsigned integers, return Undefined.

If expression1 is a string, then expression2 is the 0-based index of the first character in the string to extract and expression3 is the length of the string to extract. If expression3 is zero or expression2 is greater than or equal the string’s length, then return an empty string. Return the extracted string . If expression3 would cause extraction to extend beyond the end of the string, then only the characters up to and include the last character of the string are returned.

If expression1 is a buffer, then expression2 is the 0-based index of the first byte in the buffer to extract and expression3 is the length of the buffer to extract. If expression3 is zero or the second expression is greater than the buffer’s length, then return an empty buffer. Return the extracted buffer . If expression3 would cause extraction to extend beyond the end of the buffer, then only the bytes up to and include the last byte of the buffer are returned.

This operator corresponds to the IFR EFI_IFR_MID operator.

namevaluevarstore

Create a variable storage short-cut for name/value storage.

Syntax

namevaluevarstore identifier , 
   name = string , [ name = string , ...]
   guid = guid ;


Description
This operator corresponds to the IFR EFI_IFR_VARSTORE_NAME_VALUE operator.

Example

namevaluevarstore NameValueVarStore,
  name = STRING_TOKEN(STR_NAMEVALUE_TABLE_ITEM1),
  name = STRING_TOKEN(STR_NAMEVALUE_TABLE_ITEM2),
  name = STRING_TOKEN(STR_NAMEVALUE_TABLE_ITEM3),
  guid = GUID;

nosubmitif

Creates a validation expression and error message for a question.

Syntax

nosubmitif
   prompt = string ,
   expression,
   statements/questions
endif   

Attributes

Attribute Description
prompt The string identifier that specifies the error message to display if the expression is TRUE.
expression Expression to evaluate prior to submitting the values when the form is closed.

Description
This operator creates a conditional expression which will be evaluated when the form is submitted. If the conditional evaluates to TRUE, then the error message will be displayed to the user and the user will be prevented from submitting the form.

This operator corresponds to the IFR EFI_IFR_NO_SUBMIT_IF operator.

numeric

Number questions allow modification of an integer value up to 64-bits. Number questions can also specified pre-defined options.

Syntax

numeric 
   [ name = identifier, ]
   [ varid = storage-id, ]
   [ questionid = uint, ] 
   prompt = string , 
   help = string , 
   [ flags = numeric-flags , ] 
   [ key = uint , ]
   [ minimum = uint , maximum = uint , [ step = uint , ]]
 question-option-list
endnumeric ;
numeric-flags := numeric-flags | numeric-flag |
                 numeric-flag |
                 <nothing>
numeric-flag  := DISPLAY_INT_DEC |
                 DISPLAY_UINT_DEC | 
                 DISPLAY_UINT_HEX |
                 NUMERIC_SIZE_1 |
                 NUMERIC_SIZE_2 |
                 NUMERIC_SIZE_4 |
                 NUMERIC_SIZE_8 |
                 READ_ONLY |
                 INTERACTIVE | 
                 OPTIONS_ONLY |
                 RESET_REQUIRED |
                 uint8

Attributes

Attribute Description
prompt A string identifier that specifies the string for the question prompt.
help A string identifier that specifies the string for the question extended help text.
flags Zero or more keywords, separated by the | character.
  • DISPLAY_INT_DEC. The question's value is displayed as a signed decimal value.
  • DISPLAY_UINT_DEC. The question's value is displayed as an unsigned decimal value.
  • DISPLAY_UINT_HEX. The question's value is displayed as an unsigned hexadecimal value.
  • NUMERIC_SIZE_1. The question's storage is forced to an unsigned 8-bit integer. Used with Name/Value variable stores, since the variable sizes are not specified.
  • NUMERIC_SIZE_2. The question's storage is forced to an unsigned 16-bit integer. Used with Name/Value variable stores, since the variable sizes are not specified.
  • NUMERIC_SIZE_4. The question's storage is forced to an unsigned 32-bit integer. Used with Name/Value variable stores, since the variable sizes are not specified.
  • NUMERIC_SIZE_8. The question's storage is forced to an unsigned 64-bit integer. Used with Name/Value variable stores, since the variable sizes are not specified.
  • READ_ONLY. The question is read-only. The value cannot be changed and cannot be selected.
  • INTERACTIVE. The callback associated with this form will be called.
  • OPTIONS_ONLY. Only the values specified by nested option operators can be selected by the user.
  • RESET_REQUIRED. A system reset is required in order for changes in this question's value to take effect.

Description
This operator creates a numeric question, where the user must select a value or one of the nested options. This is identical to numeric. There are two ways to specify defaults for this question: one or more nested options (lowest priority) or a nested default (highest priority).

An image may be associated with the option using a nested image operator.

This operator corresponds to the IFR EFI_IFR_NUMERIC operator.

Example

numeric varid = MyIfrNVData.Field16, prompt = STRING_TOKEN(STR_NUMERIC_PROMPT), 
  help = STRING_TOKEN(STR_NUMERIC_HELP0), flags = INTERACTIVE, 
  minimum = 0, maximum = 0x99, step = 0, default = 20,

    inconsistent if prompt = STRING_TOKEN(STR_ERROR_POPUP), 
       ideqval MyIfrNVData.Field16 == 99 ideqvallist MyIfrNVData.Field16 == 1 3 5 6 
    endif 
endnumeric;

oneof

Makes a one-of choice from a list. Syntax

oneof 
   [ name = identifier, ]
   [ varid = storage-id, ]
   [ questionid = uint, ] 
   prompt = string , 
   help = string , 
   [ flags = oneof-flags , ] 
   [ key = uint , ]
   [ minimum = uint , maximum = uint , [ step = uint , ]]
 question-option-list
endoneof ;
oneof-flags   := numeric-flags | numeric-flag |
                 numeric-flag |
                 <nothing>
oneof-flag    := DISPLAY_INT_DEC |
                 DISPLAY_UINT_DEC | 
                 DISPLAY_UINT_HEX |
                 READ_ONLY |
                 INTERACTIVE | 
                 OPTIONS_ONLY |
                 RESET_REQUIRED |
                 uint8

Attributes

Attribute Description
prompt A string identifier that specifies the string for the question prompt.
help A string identifier that specifies the string for the question extended help text.
flags Zero or more keywords, separated by the | character.
  • DISPLAY_INT_DEC. The question's value is displayed as a signed decimal value.
  • DISPLAY_UINT_DEC. The question's value is displayed as an unsigned decimal value.
  • DISPLAY_UINT_HEX. The question's value is displayed as an unsigned hexadecimal value.
  • READ_ONLY. The question is read-only. The value cannot be changed and cannot be selected.
  • INTERACTIVE. The callback associated with this form will be called.
  • OPTIONS_ONLY. Only the values specified by nested option operators can be selected by the user.
  • RESET_REQUIRED. A system reset is required in order for changes in this question's value to take effect.

Description
This operator creates a select-on-of object, where the user must select from one of the nested options. This is identical to numeric. There are two ways to specify defaults for this question: one or more nested options (lowest priority) or a nested default (highest priority).

An image may be associated with the option using a nested image operator.

This operator corresponds to the IFR EFI_IFR_ONE_OF operator.

Example

 oneof 
    varid  = MyIfrNVData.Test 
    prompt = STRING_TOKEN(STR_TEST_OPCODE), 
    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; 
 endoneof;

option

Also known as a one-of option, this operator creates a pre-defined option for a question.

Syntax

option
   text = string ,
   value = constant-value ,
   flags = one-of-option-flags
   [ , image = image ] ;
one-of-option-flags := one-of-option-flags | one-of-option-flag |
                       one-of-option-flag |
                       <nothing>
one-of-option-flag  := OPTION_DEFAULT |
                       OPTION_DEFAULT_MFG |
                       INTERACTIVE |
                       MANUFACTURING |
                       DEFAULT |
                       RESET_REQUIRED |
                       LATE_CHECK |
                       uint8

Description
This operator corresponds to the IFR EFI_IFR_ONE_OF_OPTION operator.

orderedlist

Creates a set question using an ordered list.

Syntax

orderedlist 
   [ name = identifier , ]
   [ varid = storage-id , ] 
   [ questionid = uint , ] 
   prompt = string , 
   help = string , 
   [ maxcontainers = uint8 ]
   [ flags = ordered-list-flags ,]
 question-option-list
endlist ;
ordered-list-flags := ordered-list-flags | ordered-list-flag |
                      ordered-list-flag |
                      <nothing>
ordered-list-flag  := UNIQUE |
                      NOEMPTY |
                      READ_ONLY |
                      INTERACTIVE |
                      OPTIONS_ONLY |
                      RESET_REQUIRED |
                      uint
Attribute Description
prompt A string identifier that specifies the string for the question prompt.
help A string identifier that specifies the string for the question extended help text.
flags Zero or more keywords, separated by the | character.
  • UNIQUE. All entries in the ordered list must be unique.
  • NOEMPTY. There can be no empty items in the ordered list.
  • READ_ONLY. The question is read-only. The value cannot be changed and cannot be selected.
  • INTERACTIVE. The callback associated with this form will be called.
  • OPTIONS_ONLY. Only the values specified by nested option operators can be selected by the user.
  • RESET_REQUIRED. A system reset is required in order for changes in this question's value to take effect.

Description
This operator creates an ordered list question in the current form. The valid values for the options in ordered lists should never include a 0. The value of 0 is used to determine if a particular "slot" in the array is empty.

This operator corresponds to the IFR EFI_IFR_ORDERED_LIST operator.

Example

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 = 3, flags = RESET_REQUIRED; 
 option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 2, flags = RESET_REQUIRED; 
 option text = STRING_TOKEN(STR_ONE_OF_TEXT3), value = 1, flags = RESET_REQUIRED; 
endlist;

password

Syntax

password
   [ name = identifier, ]
   [ varid = storage-id , ] 
   [ questionid = uint, ] 
   prompt = string ,
   help = string , 
   [ flags = password-flags , ]
   [ key = uint , ]
   minsize = uint16, 
   maxsize = uint16,

 question-option-list
endpassword ;
password-flags := password-flags | password-flag |
                  password-flag |
                  <nothing>
password-flag  := READ_ONLY |
                  INTERACTIVE |
                  OPTIONS_ONLY |
                  LATE_CHECK |
                  uint8

Attributes

Attribute Description
prompt A string identifier that specifies the string for the question prompt.
help A string identifier that specifies the string for the question extended help text.
flags Zero or more keywords, separated by the | character.
  • READ_ONLY. The question is read-only. The value cannot be changed and cannot be selected.
  • INTERACTIVE. The callback associated with this form will be called.
  • OPTIONS_ONLY. Only the values specified by nested option operators can be selected by the user.
  • RESET_REQUIRED. A system reset is required in order for changes in this question's value to take effect.

Description
This operator corresponds to the IFR operator EFI_IFR_PASSWORD.

Example

password 
  varid = MyIfrNVData.Password, 
  prompt = STRING_TOKEN(STR_PASSWORD_PROMPT), 
  help = STRING_TOKEN(STR_PASSWORD_HELP), 
  minsize = 6, 
  maxsize = 20, 
endpassword;

pragma

Declare the packing for subsequent structs.

Syntax

#pragma pack ( [ show ] | [ push | pop ] [ , identifier:string ] [ , number:integer ] | number:integer )

Description
Changes the packing of structures to either a previously defined value or to the value specified by number.

pushthis

Retrieves the working value of the current question.

Syntax

pushthis

Description
This operator returns the current question's value. It is only valid when evaluating inconsistentif or nosubmitif expressions.

This operator corresponds to the IFR EFI_IFR_THIS operator.

question-option-list

Syntax

question-option-list := question-option-list , question-option |
                        question-tag-list , question-option |
                        question-option | 
                        <nothing>
question-option      := suppressif |
                        value |
                        default |
                        option

question-tag-list

Syntax

question-tag-list := question-tag-list , question-tag |
                     question-tag |
                     <nothing>
question-tag := image |
                locked |
                inconsistentif |
                nosubmitif |
                disableif |
                refresh |
                varstoredevice |

questionref

Return a question's value.

Syntax

questionref [ path = string ][ guid = guid ] ( identifier | uint )

Description
Returns the value of the question specified by the identifier. If the question’s value cannot be determined or the question does not exist, then return Undefined.

This operator corresponds to the IFR EFI_IFR_QUESTION_REF1 or EFI_IFR_QUESTION_REF3 operators, depending on whether path and guid are present.

Example

questionref (MyCheckBox) // generates EFI_IFR_QUESTION_REF1
questionref path = STRING_TOKEN (STR_DEVICE_PATH) (MyCheckBox) // generates EFI_IFR_QUESTION_REF3

questionrefval

Returns a question's value.

Syntax

questionrefval ( expression1 )

Attributes

Attribute Description
expression1 An expression that evaluates to a question identifier.

Description
If the expression cannot be evaluated as an unsigned integer or the value of the unsigned integer is greater than 0xFFFF, return Undefined. If the value of the question specified by the unsigned integer (converted to a question id) cannot be determined or the question does not exist, return Undefined. Otherwise, return the questions’ value.

This operator corresponds to the IFR EFI_IFR_QUESTION_REF2 operator.

refresh

Mark a question for periodic refresh.

Syntax

refresh interval = uint8 

Attributes

Attribute Description
interval Specifies the minimum number of seconds before the question's value is refresh.


Description
This operator causes the question's value to be refreshed at least every interval sections. The value may be refreshed less often, depending on browser policy or capabilities.

This operator corresponds to the IFR EFI_IFR_REFRESH operator.

resetbutton

Create a reset button on the current form.

Syntax

resetbutton 
   defaultstore = identifier , 
   prompt = string , 
   help = string ,
   [ , image = image ]
   [ , locked ]
endresetbutton;

Attributes

Attribute Description
defaultstore An identifier that specifies the defaultstore containing the default values.
prompt A string identifier that specifies the string for the question prompt.
help A string identifier that specifies the string for the question extended help text.
image An optional image identifier that specifies the image to display with the question.
locked An optional indicator that a Forms Editor should not permit the question to be edited.

Description
This opcode creates a user-selectable button that resets the question values for all questions on the current form to the default values associated with the defaultstore associated with defaultstore.

If EFI_IFR_FLAGS_CALLBACK is set in the question header, then the callback associated with the form set will be called. An image may be associated with the statement using a nested image operator.

This operator corresponds to the IFR EFI_IFR_RESET_BUTTON operator.


rule

Rules are pre-defined expressions attached to the form. These rules may be used in any expression within the form’s scope.

Syntax

rule identifier ,
  expression 
endrule ;

Description
This operator creates a rule, which associates an expression with an identifier and attaches it to the currently opened form. These rules allow common sub-expressions to be re-used within a form.

This operator corresponds to the IFR EFI_IFR_RULE operator.

Example

rule RULE_1, MYIfrNVData.Field8 >= 0x05 endrule;

ruleref

Evaluate a form rule and return its result.

Syntax

ruleref ( identifier )

Description
This operator looks up the rule specified by identifier and returns the evaluated result. If the rule specified by identifier does not exist, return Undefined.

This operator corresponds to the IFR EFI_IFR_RULE_REF operator.

security

Returns whether the current user profile contains specified setup access privileges.

Syntax

security ( permissions-guid )
Parameters Description
permissions-guid A GUID that uniquely identifies the security permissions being queried.

Description
This operator returns whether or not the current user profile contains the specified setup access permissions. If the current user profile contains the specified setup access permissions, then return true. Otherwise, return false.
This operator can be used in expressions to disable, suppress or gray-out forms, statements and questions. It can also be used in checking question values to disallow or allow certain values. This operator corresponds to the IFR EFI_IFR_SECURITY opcode.

span

Return the index of first character in string that follows certain characters.

Syntax

span ( flags = span-flags , expression1  , expression2  , expression3 )
span-flags := span-flags | span-flag |
              span-flag |
              <nothing>
span-flag  := FIRST_NON_MATCH |
              LAST_NON_MATCH |
              uint
Parameters Description
flags Zero or more keywords, separated by the | character.
expression1 An expression that evaluates to the string to scan.
expression2 An expression that evaluates to the string containing character pairs representing the low-end and high-end of a range of character values. For example "AZ" would represent all characters starting with the character value for "A" up to and including the character value for "Z"
expression3 An expression that evaluates to an unsigned integer that specifies the first character to be scanned.


Description
This operator will returns the zero-based index of the first character in the string specified by expression1 after the index specified by expression3 that falls within any one of the ranges (FIRST_NON_MATCH) or falls within none of the ranges (LAST_NON_MATCH) specified by expression2.

This operator corresponds to the IFR EFI_IFR_SPAN operator.

If expression1 or expression2 cannot be evaluated as a string, return Undefined. If expression3 cannot be evaluated as an unsigned integer, return Undefined.

storage-id

An identifer representing a variable storage space.

Syntax

identifier [ uint ] 
identifier [ . identifier [ [ uint ] ] ]

Example

TEST_DATA.Member
TEST_DATA.Set[5]

string

Creates a string question.

Syntax

string
   [ name = identifier, ]
   [ varid = storage-id, ] 
   [ questionid = uint, ] 
   prompt = string ,
   help = string , 
   [ flags = string-flags , ]
   [ key = uint , ]
   minsize = uint8, 
   maxsize = uint8,

 question-option-list
endstring ;
string-flags := string-flags | string-flag |
                string-flag |
                <nothing>
string-flag  := MULTI_LINE |
                READ_ONLY |
                INTERACTIVE |
                OPTIONS_ONLY |
                LATE_CHECK |
                uint8

Attributes

Attribute Description
prompt A string identifier that specifies the string for the question prompt.
help A string identifier that specifies the string for the question extended help text.
flags Zero or more keywords, separated by the | character. If not specified, zero is assumed.
  • MULTI_LINE. Multi-line editing is allowed.
  • READ_ONLY. The question is read-only. The value cannot be changed and cannot be selected.
  • INTERACTIVE. The callback associated with this form will be called.
  • OPTIONS_ONLY. Only the values specified by nested option operators can be selected by the user.
  • RESET_REQUIRED. A system reset is required in order for changes in this question's value to take effect.
minsize An unsigned integer (0-255) that specifies the minimum number of the user-editable characters in the string. If not specified, zero is assumed.
maxsize An unsigned integer (0-255) that specifies the maximum number of the user-editable characters in the string. If not specified, 255 is assumed.

Description
This operator creates a string question.

An image may be associated with the question using a nested image operator.

There are two ways to specify defaults for this question: one or more nested option operators (lowest priority) or a nested default operator (highest priority).

If EFI_IFR_STRING_MULTI_LINE is set, it is a hint to the Forms Browser that multi-line text can be allowed. If it is clear, then multi-line editing should not be allowed.

This operator corresponds to the IFR operator EFI_IFR_STRING.

Example

string 
  varid = MyIfrNVData.StringData, 
  prompt = STRING_TOKEN(STR_STRING_PROMPT), 
  help = STRING_TOKEN(STR_STRING_HELP2), 
  flags = INTERACTIVE, 
  key = 0x1234, 
  minsize = 6, 
  maxsize = 20, 
endstring;

stringref

Return a string associated with a string identifier.

Syntax

stringref ( uint16 )

Parameters

Parameter Description
uint16 The string identifier.

Description
This operator returns the string assocated with the unsigned integer. If there is no string associated with the string identifier, then return an empty string.

This operator corresponds to the IFR EFI_IFR_STRING_REF1 operator.

stringrefval

Return a string associated with a calculated string identifier.

Syntax

stringrefval ( expression1 )

Parameters

Parameter Description
expression1 Expression evaluate as a a string identifier.

Description
This operator returns the string associated with the string identifier calculated by expression.

If the expression cannot be evaluated as an unsigned integer or the value of the unsigned integer is greater than 0xFFFF, return Undefined. If the string specified by the unsigned integer (converted to a string identifier) cannot be determined or the string does not exist, return an empty string. Otherwise, return the string.

This operator corresponds to the IFR EFI_IFR_STRING_REF2 operator.

stringval

Convert the expression to a string.

Syntax

 stringval [ format = uint , ] ( expression1 )

Attributes

Attribute Description
format When converting from unsigned integers, these flags control the format: 0 = unsigned decimal, 1 = signed decimal, 2 = hexadecimal (lower-case alpha), 3 = hexadecimal (upper-case alpha)

When converting from a buffer, these flags control the format: 0 = ASCII, 8 = Unicode

Parameters

Parameter Description
expression1 Expression to convert.

Description
If the expression is Undefined or cannot be evaluated as a string, return Undefined.

When converting from an unsigned integer, the number will be converted to a unsigned decimal string (format = 0), signed decimal string (format = 1) or a hexadecimal string (format = 2 or 3).

When converting from a boolean, the boolean will be converted to “True” (True) or “False” (False).

When converting from a buffer, each 8-bit (Format = 0) or 16-bit (Format = 8) value will be converted into a character and appended to the string, up until the end of the buffer or a NULL character.

This operator corresponds to the IFR EFI_IFR_TO_STRING operator.

struct

Declare zero or more structure members.

Syntax

[ typedef ] struct [ _NON_NV_DATA_MAP ] {
  struct-member-statements
} [ identifier ] ;
struct-member-statements   := struct-member-statements struct-member-statement |
                              struct-member-statement |
                              <nothing>
struct-member-statement    := data-type identifier [ [ uint ] ] ;

Description
This operator creates a new data structure with the name identifier, along with the structure members. Each structure member consists of a data type, an identifier and, optionally, an array suffix.

subtitle

Creates a sub-title in the current form.

Syntax

subtitle 
   text = string
   [, flags = subtitle-flags ]
   [, image = image ]
   [, locked ] ;
subtitle-flags := subtitle-flags | subtitle-flag | 
                  subtitle-flag |
                  <nothing>
subtitle-flag  := HORIZONTAL |
                  uint8

Attributes

Attribute Description
text A string identifier that specifies the string which will be displayed with the subtitle.
flags Zero or more keywords, separated by the | character.
  • HORIZONTAL. Hint that the nested statements and questions should be organized horizontally.


Description
This operator creates a sub-title. Subtitle strings are intended to be used by authors to separate sections of questions into semantic groups. If there are nested statements and questions, then the Forms Browser may further distinguish the end of the semantic group as including only those statements and questions which are nested.

If EFI_IFR_FLAGS_HORIZONTAL is set, then this provides a hint that the nested statements or questions should be horizontally arranged. Otherwise, they are assumed to be vertically arranged.

An image may be associated with the statement using a nested image.

This operator corresponds to the IFR EFI_IFR_SUBTITLE operator.

Example

subtitle text = STRING_TOKEN(STR_SUBTITLE_STRING_1);

text

Creates a static text and image.

Syntax

text
   help = string ,
   text = string 
   [ , text = string ] 
   [ , flags = static-text-flags ]
   [ , key   = uint ]
   [ , image = image ]
   [ , locked ] ;
static-text-flags := static-text-flags | static-text-flag |
                     static-text-flag |
                     <nothing>
static-text-flag  := READ_ONLY |
                     INTERACTIVE |
                     OPTIONS_ONLY |
                     LATE_CHECK |
                     uint8

Attributes

Attribute Description
help
text
flags
key

Description
This operator corresponds to the IFR EFI_IFR_TEXT operator (if CALLBACK is not specified) or the EFI_IFR_ACTION operator (if CALLBACK is specified).

Example

text help = STRING_TOKEN(STR_TEXT_HELP), text = STRING_TOKEN(STR_TEXT_TEXT_1), text = STRING_TOKEN(STR_TEXT_TEXT_2), 
     image = IMAGE_TOKEN(IMAGE_TEXT);

time

Create a Time question.

Syntax

time
   [ name = identifier, ]
   [ varid = storage-id, ]
   [ questionid = uint , ] 
   prompt = string , 
   help = string ,
   [ flags = time-flags , ]
 question-option-list 
endtime ;
time-flags := time-flags | time-flag |
              time-flag |
              <nothing>
time-flag  := HOUR_SUPPRESS |
              MINUTE_SUPPRESS |
              SECOND_SUPPRESS |
              STORAGE_NORMAL |
              STORAGE_TIME |
              STORAGE_WAKEUP |
              uint8

Attributes

Attribute Description
prompt A string identifier that specifies the string for the question prompt.
help A string identifier that specifies the string for the question extended help text.
flags Zero or more keywords, separated by the | character.
  • HOUR_SUPPRESS. The year is not displayed (or optionally, not editable)
  • MINUTE_SUPPRESS. The month is not displayed (or optionally, not editable)
  • SECOND_SUPPRESS. The day is not displayed (or optionally, not editable)
  • STORAGE_NORMAL. The date is stored using the EFI_HII_DATE format. May not be combined with STORAGE_TIME or STORAGE_WAKEUP.
  • STORAGE_TIME. The date is stored using SetTime(). May not be combined with STORAGE_NORMAL or STORAGE_WAKEUP.
  • STORAGE_WAKEUP. The date is stored using SetTime(). May not be combined with STORAGE_NORMAL or STORAGE_TIME.

Description
This operator creates a time question and adds it to the current form. An image may be associated with this question by nesting an image operator.

This operator corresponds to the IFR EFI_IFR_TIME operator.

tolower

Convert a string to lower case.

Syntax

tolower ( expression )

Description
If the expression is Undefined or cannot be evaluated as a string, return Undefined. Otherwise, convert the string to all lower case using StrLwr and return the string.

This operator corresponds to the IFR EFI_IFR_TO_LOWER operator.

tok

Syntax

tok ( expression1 , expression2 , expression3 )

Parameters

Parameter Description
expression1 A string to tokenize.
expression2 A string containing the valid delimiting characters.
expression3 An unsigned integer which specifies the zero-based sub-string index.

Description
If expression1 or expression2 cannot be evaluated as a string, return Undefined. If the expression3 cannot be evaluated as an unsigned integer, return Undefined.

This operator returns the nth delimited sub-string (0 = left of the first delimiter). The end of the string always acts a the final delimiter. The no such string exists, an empty string is returned.

This operator corresponds to the IFR EFI_IFR_TOKEN operator.

toupper

Convert a string to upper case.

Syntax

toupper ( expression1 )

Parameters

Parameter Description
expression1 Expression which evaluates to a string.

Description
If the expression is Undefined or cannot be evaluated as a string, return Undefined. Otherwise, convert the string to all upper case using StrUpr and reutrn the string .

This operator corresponds to the IFR EFI_IFR_TO_UPPER operator.

uintval

Convert an expression to an unsigned integer.

Syntax

uintval ( expression )

Description
This operator converts the specified expression to an unsigned integer. If the expression is Undefined or cannot be evaluated as an unsigned integer, return Undefined. Otherwise return the unsigned integer.

When converting from a boolean, if True, return 1 and if False, return 0.

When converting from a string, whitespace is skipped. The prefix ‘0x’ or ‘0X’ indicates to convert from a hexadecimal string while the prefix ‘-‘ indicates conversion from a signed integer string.

When converting from a buffer, if the buffer is greater than 8 bytes in length, return Undefined. Otherwise, zero-extend the contents of the buffer to 64-bits and return the unsigned integer.

This operator corresponds to the IFR EFI_IFR_TO_UINT operator.

value

Provides a value for the current question or default.

Syntax

value = expression

Description
This operator specifies a value for the current question or default, with no storage. The value is the result of the expression.

If used for a question, then the question will be read-only.

This operator corresponds to the IFR EFI_IFR_VALUE operator.

Example

value = 5 
value = 0x12

varstore

Creates a variable storage short-cut for linear buffer storage.

Syntax

varstore 
   data-type , 
   [ varid = uint16 , ] 
   name = identifier , 
   guid = guid
   [, exportdefaults] 
   ;

Description
This operator corresponds to the IFR EFI_IFR_VARSTORE operator.

Parameters

Parameter Description
data-type Indicates the C-style data type used to describe the contents of the buffer-style variable store.
varid An unsigned integer that specifies the identifier for this variable store. The value must be unique among all variable stores in the current from set. The value must be between 1 and 65535. If no number is specified, then an unused value will be assigned.
name A C-style identifier that specifies the name of the variable store. Within the form set, the combination of GUID and name must be unique.
guid A GUID (in registry format) that specifies the identifier of the variable store. Within the form set, the combination of GUID and name must be unique.
exportdefaults If present, this flag indicates that the default values specified by the IFR for the various fields within the variable store will be exported a .evi file so that the EFI variable named by name and guid will exist on first boot.

Example

varstore MyData , name = RefName , guid = FORMSET_GUID, exportdefaults;

varstoredevice

Syntax

varstoredevice = string 

Description This operator corresponds to the IFR EFI_IFR_VARSTORE_DEVICE operator.


Copyright (C) 2008-2010 Phoenix Technologies Ltd. All Rights Reserved. Portions copyright (C) 2008 Intel Corporation. Used with permission.

Personal tools