]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.h
BaseTools/BinToPcd: Fix Python 2.7.x compatibility issue
[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
529a5a86
MK
20//\r
21// External functions\r
22//\r
23\r
24/**\r
25 Initialize processor environment for SMM profile.\r
26\r
27 @param CpuIndex The index of the processor.\r
28\r
29**/\r
30VOID\r
31ActivateSmmProfile (\r
32 IN UINTN CpuIndex\r
33 );\r
34\r
35/**\r
36 Initialize SMM profile in SMM CPU entry point.\r
37\r
38 @param[in] Cr3 The base address of the page tables to use in SMM.\r
39\r
40**/\r
41VOID\r
42InitSmmProfile (\r
43 UINT32 Cr3\r
44 );\r
45\r
46/**\r
47 Increase SMI number in each SMI entry.\r
48\r
49**/\r
50VOID\r
51SmmProfileRecordSmiNum (\r
52 VOID\r
53 );\r
54\r
55/**\r
56 The Page fault handler to save SMM profile data.\r
57\r
58 @param Rip The RIP when exception happens.\r
59 @param ErrorCode The Error code of exception.\r
60\r
61**/\r
62VOID\r
63SmmProfilePFHandler (\r
64 UINTN Rip,\r
65 UINTN ErrorCode\r
66 );\r
67\r
68/**\r
69 Updates page table to make some memory ranges (like system memory) absent\r
70 and make some memory ranges (like MMIO) present and execute disable. It also\r
71 update 2MB-page to 4KB-page for some memory ranges.\r
72\r
73**/\r
74VOID\r
75SmmProfileStart (\r
76 VOID\r
77 );\r
78\r
79/**\r
80 Page fault IDT handler for SMM Profile.\r
81\r
82**/\r
83VOID\r
84EFIAPI\r
85PageFaultIdtHandlerSmmProfile (\r
86 VOID\r
87 );\r
88\r
89\r
90/**\r
91 Check if XD feature is supported by a processor.\r
92\r
93**/\r
94VOID\r
95CheckFeatureSupported (\r
51773d49 96 VOID\r
529a5a86
MK
97 );\r
98\r
529a5a86
MK
99/**\r
100 Update page table according to protected memory ranges and the 4KB-page mapped memory ranges.\r
101\r
102**/\r
103VOID\r
104InitPaging (\r
105 VOID\r
106 );\r
107\r
7fa1376c
JY
108/**\r
109 Get CPU Index from APIC ID.\r
110\r
111**/\r
112UINTN\r
113GetCpuIndex (\r
114 VOID\r
115 );\r
116\r
717fb604
JY
117//\r
118// The flag indicates if execute-disable is supported by processor.\r
119//\r
529a5a86 120extern BOOLEAN mXdSupported;\r
717fb604
JY
121//\r
122// The flag indicates if execute-disable is enabled on processor.\r
123//\r
529a5a86
MK
124extern BOOLEAN mXdEnabled;\r
125\r
126#endif // _SMM_PROFILE_H_\r