2.3 VFR Data Struct Definition
1
vfrDataStructDefinition ::=
2
{ "typedef" } "struct"
3
{ StringIdentifier }
4
"{" vfrDataStructFields "}"
5
{ StringIdentifier } ";"
6
7
vfrDataStructDefinition ::=
8
{ "typedef" } "union"
9
{ StringIdentifier }
10
"{" vfrDataStructFields "}"
11
{ StringIdentifier } ";"
12
13
vfrDataStructFields ::=
14
(
15
dataStructField64
16
| dataStructField32
17
| dataStructField16
18
| dataStructField8
19
| dataStructFieldBool
20
| dataStructFieldString
21
| dataStructFieldDate
22
| dataStructFieldTime
23
| dataStructFieldRef
24
| dataStructFieldUser
25
| dataStructBitField64
26
| dataStructBitField32
27
| dataStructBitField16
28
| dataStructBitField8
29
)*
30
31
dataStructField64 ::=
32
"UINT64"
33
StringIdentifier { "[" Number "]" } ";"
34
35
dataStructField32 ::=
36
"UINT32"
37
StringIdentifier { "[" Number "]" } ";"
38
39
dataStructField16 ::=
40
"UINT16"
41
StringIdentifier { "[" Number "]" } ";"
42
43
dataStructField8 ::=
44
"UINT8"
45
StringIdentifier { "[" Number "]" } ";"
46
47
dataStructFieldBool ::=
48
"BOOLEAN"
49
StringIdentifier { "[" Number "]" } ";"
50
51
dataStructFieldString ::=
52
"EFI_STRING_ID"
53
StringIdentifier { "[" Number "]" } ";"
54
55
dataStructFieldDate ::=
56
"EFI_HII_DATE"
57
StringIdentifier { "[" Number "]" } ";"
58
59
dataStructFieldTime ::=
60
"EFI_HII_TIME"
61
StringIdentifier { "[" Number "]" } ";"
62
63
dataStructFieldRef ::=
64
"EFI_HII_REF"
65
StringIdentifier { "[" Number "]" } ";"
66
67
dataStructFieldUser ::=
68
StringIdentifier
69
StringIdentifier { "[" Number "]" } ";"
70
71
dataStructBitField64 ::=
72
"UINT64"
73
{ StringIdentifier } ":" Number ";"
74
75
dataStructBitField32 ::=
76
"UINT32"
77
{ StringIdentifier } ":" Number ";"
78
79
dataStructBitField16 ::=
80
"UINT16"
81
{ StringIdentifier } ":" Number ";"
82
83
dataStructBitField8 ::=
84
"UINT8"
85
{ StringIdentifier } ":" Number ";"
Copied!

BEHAVIORS AND RESTRICTIONS

The data structure definition is in C-style language. enum type is not supported. The keyword of the fields' type must be a user defined data structure or one of these types: UINT8, UINT16, UINT32, UINT64, BOOLEAN, EFI_STRING_ID, EFI_HII_DATA, EFI_HII_TIME EFI_HII_REF, and at most one-dimensional array is permitted. Note: for the bit field, the number of the bit width could not exceed 32.

Example

1
typedef struct {
2
UINT8 mU8;
3
UINT16 mU16;
4
UINT32 mU32[10];
5
UINT64 mU64;
6
} MyData;
7
8
typedef union {
9
UINT16 Field16;
10
UINT8 Field8;
11
} MyUnionData;
12
13
typedef struct {
14
UINT16 Field16;
15
UINT8 MyBits1 : 1;
16
UINT8 MyBits2 : 3;
17
UINT8 MyBits3 : 3;
18
UINT16 MyBits4 : 4;
19
} MyBitsData;
Copied!
Unsupported Example of enum type:
1
typedef enum {
2
MyEnumValue1,
3
MyEnumValue2,
4
MyEnumValueMax
5
} MyEnum;
Copied!
Unsupported Example of two dimensional arrays in data structure:
1
typedef struct {
2
UINT8 mU8;
3
UINT32 mU32[10][20];
4
} MyUnsupportedData;
Copied!