1 /** @file
2   Include file for Var Check Hii bin generation.
3 
4 Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution.  The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9 
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 
13 **/
14 
15 #ifndef _VAR_CHECK_HII_GEN_H_
16 #define _VAR_CHECK_HII_GEN_H_
17 
18 #include "VarCheckHii.h"
19 
20 /**
21   Dump Hii Package.
22 
23   @param[in] HiiPackage         Pointer to Hii Package.
24 
25 **/
26 VOID
27 DumpHiiPackage (
28   IN VOID       *HiiPackage
29   );
30 
31 /**
32   Dump Hii Database.
33 
34   @param[in] HiiDatabase        Pointer to Hii Database.
35   @param[in] HiiDatabaseSize    Hii Database size.
36 
37 **/
38 VOID
39 DumpHiiDatabase (
40   IN VOID       *HiiDatabase,
41   IN UINTN      HiiDatabaseSize
42   );
43 
44 /**
45   Allocates and zeros a buffer of type EfiBootServicesData.
46 
47   Allocates the number bytes specified by AllocationSize of type EfiBootServicesData, clears the
48   buffer with zeros, and returns a pointer to the allocated buffer.  If AllocationSize is 0, then a
49   valid buffer of 0 size is returned.  If there is not enough memory remaining to satisfy the
50   request, then NULL is returned.
51 
52   @param  AllocationSize        The number of bytes to allocate and zero.
53 
54   @return A pointer to the allocated buffer or NULL if allocation fails.
55 
56 **/
57 VOID *
58 InternalVarCheckAllocateZeroPool (
59   IN UINTN            AllocationSize
60   );
61 
62 /**
63   Frees a buffer that was previously allocated with one of the pool allocation functions in the
64   Memory Allocation Library.
65 
66   Frees the buffer specified by Buffer.  Buffer must have been allocated on a previous call to the
67   pool allocation services of the Memory Allocation Library.  If it is not possible to free pool
68   resources, then this function will perform no actions.
69 
70   If Buffer was not allocated with a pool allocation function in the Memory Allocation Library,
71   then ASSERT().
72 
73   @param  Buffer                The pointer to the buffer to free.
74 
75 **/
76 VOID
77 EFIAPI
78 InternalVarCheckFreePool (
79   IN VOID   *Buffer
80   );
81 
82 /**
83   Var Check Parse Hii Package.
84 
85   @param[in] HiiPackage         Pointer to Hii Package.
86   @param[in] FromFv             Hii Package from FV.
87 
88 **/
89 VOID
90 VarCheckParseHiiPackage (
91   IN VOID       *HiiPackage,
92   IN BOOLEAN    FromFv
93   );
94 
95 /**
96   Var Check Parse Hii Database.
97 
98   @param[in] HiiDatabase        Pointer to Hii Database.
99   @param[in] HiiDatabaseSize    Hii Database size.
100 
101 **/
102 VOID
103 VarCheckParseHiiDatabase (
104   IN VOID       *HiiDatabase,
105   IN UINTN      HiiDatabaseSize
106   );
107 
108 /**
109   Generate from FV.
110 
111 **/
112 VOID
113 VarCheckHiiGenFromFv (
114   VOID
115   );
116 
117 /**
118   Generate from Hii Database.
119 
120 **/
121 VOID
122 VarCheckHiiGenFromHiiDatabase (
123   VOID
124   );
125 
126 /**
127   Generate VarCheckHiiBin from Hii Database and FV.
128 
129 **/
130 VOID
131 EFIAPI
132 VarCheckHiiGen (
133   VOID
134   );
135 
136 #endif
137