]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.h
UefiCpuPkg/PiSmmCpuDxeSmm: Add EFIAPI to CheckFeatureSupported()
[mirror_edk2.git] / UefiCpuPkg / PiSmmCpuDxeSmm / SmmProfile.h
CommitLineData
529a5a86
MK
1/** @file\r
2SMM profile header file.\r
3\r
d691abec 4Copyright (c) 2012 - 2016, Intel Corporation. All rights reserved.<BR>\r
529a5a86
MK
5This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef _SMM_PROFILE_H_\r
16#define _SMM_PROFILE_H_\r
17\r
18#include "SmmProfileInternal.h"\r
19\r
20///\r
21/// MSR Register Index\r
22///\r
23#define MSR_IA32_MISC_ENABLE 0x1A0\r
24\r
25//\r
26// External functions\r
27//\r
28\r
29/**\r
30 Initialize processor environment for SMM profile.\r
31\r
32 @param CpuIndex The index of the processor.\r
33\r
34**/\r
35VOID\r
36ActivateSmmProfile (\r
37 IN UINTN CpuIndex\r
38 );\r
39\r
40/**\r
41 Initialize SMM profile in SMM CPU entry point.\r
42\r
43 @param[in] Cr3 The base address of the page tables to use in SMM.\r
44\r
45**/\r
46VOID\r
47InitSmmProfile (\r
48 UINT32 Cr3\r
49 );\r
50\r
51/**\r
52 Increase SMI number in each SMI entry.\r
53\r
54**/\r
55VOID\r
56SmmProfileRecordSmiNum (\r
57 VOID\r
58 );\r
59\r
60/**\r
61 The Page fault handler to save SMM profile data.\r
62\r
63 @param Rip The RIP when exception happens.\r
64 @param ErrorCode The Error code of exception.\r
65\r
66**/\r
67VOID\r
68SmmProfilePFHandler (\r
69 UINTN Rip,\r
70 UINTN ErrorCode\r
71 );\r
72\r
73/**\r
74 Updates page table to make some memory ranges (like system memory) absent\r
75 and make some memory ranges (like MMIO) present and execute disable. It also\r
76 update 2MB-page to 4KB-page for some memory ranges.\r
77\r
78**/\r
79VOID\r
80SmmProfileStart (\r
81 VOID\r
82 );\r
83\r
84/**\r
85 Page fault IDT handler for SMM Profile.\r
86\r
87**/\r
88VOID\r
89EFIAPI\r
90PageFaultIdtHandlerSmmProfile (\r
91 VOID\r
92 );\r
93\r
94\r
95/**\r
96 Check if XD feature is supported by a processor.\r
97\r
d691abec
MK
98 @param[in,out] Buffer The pointer to private data buffer.\r
99\r
529a5a86
MK
100**/\r
101VOID\r
d691abec 102EFIAPI\r
529a5a86 103CheckFeatureSupported (\r
d691abec 104 IN OUT VOID *Buffer\r
529a5a86
MK
105 );\r
106\r
107/**\r
108 Enable XD feature.\r
109\r
110**/\r
111VOID\r
112ActivateXd (\r
113 VOID\r
114 );\r
115\r
116/**\r
117 Update page table according to protected memory ranges and the 4KB-page mapped memory ranges.\r
118\r
119**/\r
120VOID\r
121InitPaging (\r
122 VOID\r
123 );\r
124\r
125/**\r
126 Check if XD and BTS features are supported by all processors.\r
127\r
128**/\r
129VOID\r
130CheckProcessorFeature (\r
131 VOID\r
132 );\r
133\r
134extern BOOLEAN mXdSupported;\r
135extern BOOLEAN mXdEnabled;\r
136\r
137#endif // _SMM_PROFILE_H_\r