]>
Commit | Line | Data |
---|---|---|
59336178 | 1 | /** @file\r |
2 | Header file for Function and Macro defintions for to extract default values from UEFI Form package.\r | |
3 | \r | |
4 | Copyright (c) 2008, Intel Corporation\r | |
5 | All rights reserved. This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #ifndef _HII_THUNK_UEFI_IFR_DEFAULT_\r | |
16 | #define _HII_THUNK_UEFI_IFR_DEFAULT_\r | |
17 | \r | |
5391c4f1 | 18 | //\r |
19 | // VARSTORE ID of 0 for Buffer Storage Type Storage is reserved in UEFI IFR form. But VARSTORE ID\r | |
20 | // 0 in Framework IFR is the default VarStore ID for storage without explicit declaration. So we have\r | |
0368663f | 21 | // to reseved 0x0001 in UEFI VARSTORE ID to represetn default storage id in Framework IFR.\r |
5391c4f1 | 22 | // Framework VFR has to be ported or pre-processed to change the default VARSTORE to a VARSTORE\r |
0368663f | 23 | // with ID equal to 0x0001.\r |
5391c4f1 | 24 | //\r |
0368663f | 25 | #define RESERVED_VARSTORE_ID 0x0001\r |
26 | #define RESERVED_QUESTION_ID 0xf000\r | |
59336178 | 27 | \r |
28 | #define UEFI_IFR_BUFFER_STORAGE_NODE_FROM_LIST(a) CR(a, UEFI_IFR_BUFFER_STORAGE_NODE, List, UEFI_IFR_BUFFER_STORAGE_NODE_SIGNATURE)\r | |
29 | #define UEFI_IFR_BUFFER_STORAGE_NODE_SIGNATURE EFI_SIGNATURE_32 ('I', 'b', 'S', 'n')\r | |
30 | typedef struct {\r | |
31 | LIST_ENTRY List;\r | |
32 | UINT32 Signature;\r | |
33 | \r | |
34 | EFI_GUID Guid;\r | |
35 | CHAR16 *Name;\r | |
36 | UINT16 DefaultId;\r | |
37 | UINT16 StoreId;\r | |
38 | UINTN Size;\r | |
39 | UINT8 *Buffer;\r | |
40 | \r | |
41 | } UEFI_IFR_BUFFER_STORAGE_NODE;\r | |
42 | \r | |
43 | /**\r | |
44 | Get the default value for Buffer Type storage from the first FormSet\r | |
45 | in the Package List specified by a EFI_HII_HANDLE.\r | |
46 | \r | |
47 | The results can be multiple instances of UEFI_IFR_BUFFER_STORAGE_NODE. \r | |
48 | They are inserted to the link list.\r | |
49 | \r | |
50 | @param UefiHiiHandle The handle for the package list.\r | |
51 | @param UefiDefaultsListHead The head of link list for the output.\r | |
52 | \r | |
53 | @retval EFI_SUCCESS Successful.\r | |
54 | \r | |
55 | **/\r | |
56 | EFI_STATUS\r | |
57 | UefiIfrGetBufferTypeDefaults (\r | |
58 | EFI_HII_HANDLE UefiHiiHandle,\r | |
59 | LIST_ENTRY **UefiDefaults\r | |
60 | );\r | |
61 | \r | |
62 | /**\r | |
63 | Convert the UEFI Buffer Type default values to a Framework HII default\r | |
64 | values specified by a EFI_HII_VARIABLE_PACK_LIST structure.\r | |
65 | \r | |
66 | @param ListHead The link list of UEFI_IFR_BUFFER_STORAGE_NODE\r | |
67 | which contains the default values retrived from\r | |
68 | a UEFI form set.\r | |
69 | @param DefaultMask The default mask.\r | |
70 | The valid values are FRAMEWORK_EFI_IFR_FLAG_DEFAULT\r | |
71 | and FRAMEWORK_EFI_IFR_FLAG_MANUFACTURING.\r | |
72 | UEFI spec only map FRAMEWORK_EFI_IFR_FLAG_DEFAULT and FRAMEWORK_EFI_IFR_FLAG_MANUFACTURING \r | |
73 | from specification to valid default class.\r | |
74 | @param VariablePackList The output default value in a format defined in Framework.\r | |
75 | \r | |
76 | \r | |
77 | @retval EFI_SUCCESS Successful.\r | |
78 | @retval EFI_INVALID_PARAMETER The default mask is not FRAMEWORK_EFI_IFR_FLAG_DEFAULT or \r | |
79 | FRAMEWORK_EFI_IFR_FLAG_MANUFACTURING.\r | |
80 | **/\r | |
81 | \r | |
82 | EFI_STATUS\r | |
0368663f | 83 | UefiDefaultsToFwDefaults (\r |
59336178 | 84 | IN LIST_ENTRY *UefiIfrDefaults,\r |
85 | IN UINTN DefaultMask,\r | |
86 | OUT EFI_HII_VARIABLE_PACK_LIST **VariablePackList\r | |
87 | )\r | |
88 | ;\r | |
89 | \r | |
90 | /**\r | |
91 | Free up all buffer allocated for the link list of UEFI_IFR_BUFFER_STORAGE_NODE.\r | |
92 | \r | |
93 | @param ListHead The link list of UEFI_IFR_BUFFER_STORAGE_NODE\r | |
94 | which contains the default values retrived from\r | |
95 | a UEFI form set.\r | |
96 | \r | |
97 | \r | |
98 | @retval EFI_SUCCESS Successful.\r | |
99 | @retval EFI_INVALID_PARAMETER The default mask is not FRAMEWORK_EFI_IFR_FLAG_DEFAULT or \r | |
100 | FRAMEWORK_EFI_IFR_FLAG_MANUFACTURING.\r | |
101 | **/\r | |
102 | VOID\r | |
103 | FreeDefaultList (\r | |
104 | IN LIST_ENTRY *UefiIfrDefaults\r | |
105 | )\r | |
106 | ;\r | |
107 | \r | |
108 | #endif\r | |
109 | \r | |
110 | \r |