summaryrefslogtreecommitdiff
path: root/Board/EM/Pfat/PfatCpuPolicyOverride/PfatCpuPolicyOverride.h
blob: c14735d655cb220d8d5f5af3161c6f60123f04b2 (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
129
130
131
132
133
//*************************************************************************
//*************************************************************************
//**                                                                     **
//**        (C)Copyright 1985-2012, American Megatrends, Inc.            **
//**                                                                     **
//**                       All Rights Reserved.                          **
//**                                                                     **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093           **
//**                                                                     **
//**                       Phone: (770)-246-8600                         **
//**                                                                     **
//*************************************************************************
//*************************************************************************
//*************************************************************************
//*************************************************************************
// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/IntelPfat/PfatCpuPolicyOverride/PfatCpuPolicyOverride.h 1     9/17/12 4:47p Fredericko $
//
// $Revision: 1 $
//
// $Date: 9/17/12 4:47p $
// 
//
//
//*************************************************************************
//<AMI_FHDR_START>
//
// Name:   PfatCpuPolicyOverride.h
//
// Description: Header file for PfatCpuPolicyOverride sub-component
//
//<AMI_FHDR_END>
//*************************************************************************

#ifndef _PFAT_CPU_POLICY_OVERRIDE_H_
#define _PFAT_CPU_POLICY_OVERRIDE_H_

#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000)
#include "EdkIIGluePeim.h"

#include <Token.h>
#include <SetupDataDefinition.h>
#include "PchRegs.h"
#include EFI_PPI_PRODUCER (CpuPlatformPolicy)
#endif

#define SYSTEM_CONFIGURATION_GUID { 0xEC87D643, 0xEBA4, 0x4BB5, 0xA1, 0xE5, 0x3F, 0x3E, 0x36, 0xB2, 0x0D, 0xA9 }

#define PFAT_PUB_KEY_FFS_FILE_RAW_GUID \
    {0x8e295870, 0xd377, 0x4b75, 0xbf, 0xdc, 0x9a, 0xe2, 0xf6, 0xdb, 0xde, 0x22}

#define  KBShift  10
#define  MBShift  20
#define  Disable  0
#define  Enable   1

#if defined(BUILD_WITH_GLUELIB)
#undef SetMem
VOID *
SetMem (
  OUT VOID *Buffer,
  IN UINTN Length,
  IN UINT8 Value
  )
{
  return GlueSetMem (Buffer, Length, Value);
}

#undef CopyMem
VOID *
EFIAPI
CopyMem (
  OUT VOID       *DestinationBuffer,
  IN CONST VOID  *SourceBuffer,
  IN UINTN       Length
  )
{
  return GlueCopyMem (DestinationBuffer, SourceBuffer, Length);
}
#endif

STATIC
EFI_STATUS
PfatCpuPolicyOverrideEndOfPeiCpuPlatformPolicy (
    IN      EFI_PEI_SERVICES          **PeiServices,
    IN      EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
    IN      VOID                      *Ppi
);

//
// Hash functions definitions for pfat
//
UINTN
EFIAPI
Sha256GetContextSize (
  VOID
  );

BOOLEAN
EFIAPI
Sha256Init (
  IN OUT  VOID  *Sha256Context
  );

BOOLEAN
EFIAPI
Sha256Update (
  IN OUT  VOID        *Sha256Context,
  IN      CONST VOID  *Data,
  IN      UINTN       DataLength
  );

BOOLEAN
EFIAPI
Sha256Final (
  IN OUT  VOID   *Sha256Context,
  OUT     UINT8  *HashValue
  );

#endif

//*************************************************************************
//*************************************************************************
//**                                                                     **
//**        (C)Copyright 1985-2012, American Megatrends, Inc.            **
//**                                                                     **
//**                       All Rights Reserved.                          **
//**                                                                     **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093           **
//**                                                                     **
//**                       Phone: (770)-246-8600                         **
//**                                                                     **
//*************************************************************************
//*************************************************************************