Home | History | Annotate | Download | only in PlatformVarCleanupLib
      1 /** @file
      2   Include file for platform variable cleanup.
      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 _PLAT_VAR_CLEANUP_
     16 #define _PLAT_VAR_CLEANUP_
     17 
     18 #include <Library/UefiBootServicesTableLib.h>
     19 #include <Library/UefiRuntimeServicesTableLib.h>
     20 #include <Library/BaseLib.h>
     21 #include <Library/DebugLib.h>
     22 #include <Library/BaseMemoryLib.h>
     23 #include <Library/PrintLib.h>
     24 #include <Library/MemoryAllocationLib.h>
     25 #include <Library/HiiLib.h>
     26 #include <Library/PlatformVarCleanupLib.h>
     27 
     28 #include <Protocol/Variable.h>
     29 #include <Protocol/VarCheck.h>
     30 #include <Protocol/FormBrowser2.h>
     31 #include <Protocol/HiiConfigAccess.h>
     32 #include <Protocol/HiiConfigRouting.h>
     33 #include <Protocol/DevicePath.h>
     34 
     35 #include <Guid/EventGroup.h>
     36 #include <Guid/MdeModuleHii.h>
     37 #include <Guid/ImageAuthentication.h>
     38 #include <Guid/VarErrorFlag.h>
     39 
     40 #include "PlatVarCleanupHii.h"
     41 
     42 //
     43 // This is the generated IFR binary data for each formset defined in VFR.
     44 // This data array is ready to be used as input of HiiAddPackages() to
     45 // create a packagelist (which contains Form packages, String packages, etc).
     46 //
     47 extern UINT8 PlatVarCleanupBin[];
     48 
     49 //
     50 // This is the generated String package data for all .UNI files.
     51 // This data array is ready to be used as input of HiiAddPackages() to
     52 // create a packagelist (which contains Form packages, String packages, etc).
     53 //
     54 extern UINT8 PlatformVarCleanupLibStrings[];
     55 
     56 #define USER_VARIABLE_NODE_SIGNATURE SIGNATURE_32 ('U', 'V', 'N', 'S')
     57 
     58 typedef struct {
     59   UINTN             Signature;
     60   LIST_ENTRY        Link;
     61   EFI_GUID          Guid;
     62   CHAR16            *PromptString;
     63   LIST_ENTRY        NameLink;
     64 } USER_VARIABLE_NODE;
     65 
     66 #define USER_VARIABLE_FROM_LINK(a) CR (a, USER_VARIABLE_NODE, Link, USER_VARIABLE_NODE_SIGNATURE)
     67 
     68 #define USER_VARIABLE_NAME_NODE_SIGNATURE SIGNATURE_32 ('U', 'V', 'N', 'N')
     69 
     70 typedef struct {
     71   UINTN             Signature;
     72   LIST_ENTRY        Link;
     73   CHAR16            *Name;
     74   UINTN             DataSize;
     75   UINT32            Attributes;
     76   UINT16            Index;
     77   EFI_QUESTION_ID   QuestionId;
     78   CHAR16            *PromptString;
     79   CHAR16            *HelpString;
     80   BOOLEAN           Deleted;
     81 } USER_VARIABLE_NAME_NODE;
     82 
     83 #define USER_VARIABLE_NAME_FROM_LINK(a) CR (a, USER_VARIABLE_NAME_NODE, Link, USER_VARIABLE_NAME_NODE_SIGNATURE)
     84 
     85 #pragma pack(1)
     86 //
     87 // HII specific Vendor Device Path definition.
     88 //
     89 typedef struct {
     90   VENDOR_DEVICE_PATH            VendorDevicePath;
     91   EFI_DEVICE_PATH_PROTOCOL      End;
     92 } HII_VENDOR_DEVICE_PATH;
     93 #pragma pack()
     94 
     95 #define VARIABLE_CLEANUP_HII_PRIVATE_SIGNATURE SIGNATURE_32 ('V', 'C', 'H', 'P')
     96 
     97 typedef struct {
     98   UINTN                             Signature;
     99   EFI_HANDLE                        DriverHandle;
    100   EFI_HII_HANDLE                    HiiHandle;
    101   EFI_HII_CONFIG_ACCESS_PROTOCOL    ConfigAccess;
    102   EFI_HII_CONFIG_ROUTING_PROTOCOL   *ConfigRouting;
    103   VARIABLE_CLEANUP_DATA             VariableCleanupData;
    104 } VARIABLE_CLEANUP_HII_PRIVATE_DATA;
    105 
    106 #define VARIABLE_CLEANUP_HII_PRIVATE_FROM_THIS(a) CR (a, VARIABLE_CLEANUP_HII_PRIVATE_DATA, ConfigAccess, VARIABLE_CLEANUP_HII_PRIVATE_SIGNATURE)
    107 
    108 #endif
    109