]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.h
UefiCpuPkg: Add PiSmmCpuDxeSmm module no IA32/X64 files
[mirror_edk2.git] / UefiCpuPkg / PiSmmCpuDxeSmm / SmmProfile.h
CommitLineData
529a5a86
MK
1/** @file\r
2SMM profile header file.\r
3\r
4Copyright (c) 2012 - 2015, Intel Corporation. All rights reserved.<BR>\r
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
98**/\r
99VOID\r
100CheckFeatureSupported (\r
101 VOID\r
102 );\r
103\r
104/**\r
105 Enable XD feature.\r
106\r
107**/\r
108VOID\r
109ActivateXd (\r
110 VOID\r
111 );\r
112\r
113/**\r
114 Update page table according to protected memory ranges and the 4KB-page mapped memory ranges.\r
115\r
116**/\r
117VOID\r
118InitPaging (\r
119 VOID\r
120 );\r
121\r
122/**\r
123 Check if XD and BTS features are supported by all processors.\r
124\r
125**/\r
126VOID\r
127CheckProcessorFeature (\r
128 VOID\r
129 );\r
130\r
131extern BOOLEAN mXdSupported;\r
132extern BOOLEAN mXdEnabled;\r
133\r
134#endif // _SMM_PROFILE_H_\r