summaryrefslogtreecommitdiff
path: root/Board/EM/MeWrapper/AmtWrapper/AmtSetup/AmtSMIFlashElink.c
blob: 0716540279aa907f2f397e45bc367b9fc88dc75e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
//*************************************************************************
//*************************************************************************
//**                                                                     **
//**        (C)Copyright 1985-2010, American Megatrends, Inc.            **
//**                                                                     **
//**                       All Rights Reserved.                          **
//**                                                                     **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093           **
//**                                                                     **
//**                       Phone: (770)-246-8600                         **
//**                                                                     **
//*************************************************************************
//*************************************************************************

//**********************************************************************
// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/AmtWrapper/AmtSetup/AmtSMIFlashElink.c 3     5/14/14 9:48p Tristinchou $
//
// $Revision: 3 $
//
// $Date: 5/14/14 9:48p $
//**********************************************************************
// Revision History
// ----------------
// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/AmtWrapper/AmtSetup/AmtSMIFlashElink.c $
// 
// 3     5/14/14 9:48p Tristinchou
// [TAG]  		EIP167030
// [Category]  	Improvement
// [Description]  	Remove the variable runtime attribute and keep original
// attributes.
// 
// 2     9/19/12 6:38a Klzhan
// Check MebxVariable exist or not before restore.
// 
// 1     4/24/12 12:38a Klzhan
// Update modulepart to latest
// 
// 1     2/16/12 9:01a Klzhan
// [TAG]  		EIP83223
// [Category]  	Improvement
// [Description]  	Restore MEBiosExtensionSetup when NVRam updated by AFU.
//
//**********************************************************************

//<AMI_FHDR_START>
//---------------------------------------------------------------------------
// Name:        AMTSMIFlashElink.c
//
// Description:	AMT TSE Functions.
//
//---------------------------------------------------------------------------
//<AMI_FHDR_END>
#include <AmiDxeLib.h>
#include "MeBiosExtensionSetup\MeBiosExtensionSetup.h"

ME_BIOS_EXTENSION_SETUP     BiosExtensionSetup;
UINT32                      mMebxSetupVariableDataAttr;
UINTN                       mMebxSetupVariableDataSize;
//<AMI_PHDR_START>
//----------------------------------------------------------------------
// Procedure:   PreserveMEBXSyncData
//
// Description: Restore the MEBiosExtensionSetup variable
//
// Input:       NONE
//
// Output:      NONE
//
// Returns:     NONE
//
//----------------------------------------------------------------------
//<AMI_PHDR_END>
VOID PreserveMEBXSyncData (VOID)
{

    EFI_STATUS  Status;

    mMebxSetupVariableDataSize = sizeof(ME_BIOS_EXTENSION_SETUP);
    Status = pRS->GetVariable ( gEfiMeBiosExtensionSetupName,
                                &gEfiMeBiosExtensionSetupGuid,
                                &mMebxSetupVariableDataAttr,
                                &mMebxSetupVariableDataSize,
                                &BiosExtensionSetup);

   if(EFI_ERROR(Status))
      mMebxSetupVariableDataSize = 0;
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------
// Procedure:   RestoreMEBXSyncData
//
// Description: Restore the MEBiosExtensionSetup variable
//
// Input:       NONE
//
// Output:      NONE
//
// Returns:     NONE
//
//----------------------------------------------------------------------
//<AMI_PHDR_END>
VOID RestoreMEBXSyncData (VOID)
{
    EFI_STATUS  Status;

    if(mMebxSetupVariableDataSize == 0)
        return;

    Status = pRS->SetVariable (  gEfiMeBiosExtensionSetupName,
                                 &gEfiMeBiosExtensionSetupGuid,
                                 mMebxSetupVariableDataAttr,
                                 mMebxSetupVariableDataSize,
                                 &BiosExtensionSetup );
}
//*************************************************************************
//*************************************************************************
//**                                                                     **
//**        (C)Copyright 1985-2010, American Megatrends, Inc.            **
//**                                                                     **
//**                       All Rights Reserved.                          **
//**                                                                     **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093           **
//**                                                                     **
//**                       Phone: (770)-246-8600                         **
//**                                                                     **
//*************************************************************************
//*************************************************************************