hc
2024-03-25 edb30157bad0c0001c32b854271ace01d3b9a16a
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
/** @file
  Header file for CpuPlatform Lib.
 
  Copyright (c) 2019 Intel Corporation. All rights reserved. <BR>
 
  SPDX-License-Identifier: BSD-2-Clause-Patent
**/
 
#ifndef _CPU_PLATFORM_LIB_H_
#define _CPU_PLATFORM_LIB_H_
 
#include <CpuRegs.h>
#include <CpuDataStruct.h>
#include <CpuPowerMgmt.h>
 
/**
  Check CPU Type of the platform
 
  @retval CPU_FAMILY              CPU type
**/
CPU_FAMILY
EFIAPI
GetCpuFamily (
  VOID
  );
 
/**
  Return Cpu stepping type
 
  @retval CPU_STEPPING                   Cpu stepping type
**/
CPU_STEPPING
EFIAPI
GetCpuStepping (
  VOID
  );
 
/**
  Return CPU Sku
 
  @retval UINT8              CPU Sku
**/
UINT8
EFIAPI
GetCpuSku (
  VOID
  );
 
/**
  Returns the processor microcode revision of the processor installed in the system.
 
  @retval Processor Microcode Revision
**/
UINT32
GetCpuUcodeRevision (
  VOID
  );
 
/**
  Check if this microcode is correct one for processor
 
  @param[in] Cpuid               - processor CPUID
  @param[in] MicrocodeEntryPoint - entry point of microcode
  @param[in] Revision            - revision of microcode
 
  @retval CorrectMicrocode if this microcode is correct
**/
BOOLEAN
CheckMicrocode (
  IN UINT32               Cpuid,
  IN CPU_MICROCODE_HEADER *MicrocodeEntryPoint,
  IN UINT32               *Revision
  );
 
/**
  Check on the processor if SGX is supported.
 
  @retval True if SGX supported or FALSE if not
**/
BOOLEAN
IsSgxSupported (
  VOID
  );
 
/**
  Get processor generation
 
  @retval CPU_GENERATION  Returns the executing thread's processor generation.
**/
CPU_GENERATION
GetCpuGeneration (
  VOID
  );
 
/**
  Check if Disable CPU Debug (DCD) bit is set from FIT CPU Debugging [Disabled].
  If it is set, CPU probe mode is disabled.
 
  @retval TRUE    DCD is set
  @retval FALSE   DCD is clear
**/
BOOLEAN
IsCpuDebugDisabled (
  VOID
  );
 
/**
  Is Whiskey Lake CPU.
 
  @retval TRUE  The CPUID corresponds with a Whiskey Lake CPU
  @retval FALSE The CPUID does not correspond with a Whiskey Lake CPU
**/
BOOLEAN
IsWhlCpu (
  VOID
  );
 
#endif