]>
Commit | Line | Data |
---|---|---|
529a5a86 MK |
1 | /** @file\r |
2 | SMM profile header file.\r | |
3 | \r | |
d691abec | 4 | Copyright (c) 2012 - 2016, Intel Corporation. All rights reserved.<BR>\r |
529a5a86 MK |
5 | This program and the accompanying materials\r |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT 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 | |
30 | VOID\r | |
31 | ActivateSmmProfile (\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 | |
41 | VOID\r | |
42 | InitSmmProfile (\r | |
43 | UINT32 Cr3\r | |
44 | );\r | |
45 | \r | |
46 | /**\r | |
47 | Increase SMI number in each SMI entry.\r | |
48 | \r | |
49 | **/\r | |
50 | VOID\r | |
51 | SmmProfileRecordSmiNum (\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 | |
62 | VOID\r | |
63 | SmmProfilePFHandler (\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 | |
74 | VOID\r | |
75 | SmmProfileStart (\r | |
76 | VOID\r | |
77 | );\r | |
78 | \r | |
79 | /**\r | |
80 | Page fault IDT handler for SMM Profile.\r | |
81 | \r | |
82 | **/\r | |
83 | VOID\r | |
84 | EFIAPI\r | |
85 | PageFaultIdtHandlerSmmProfile (\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 | |
d691abec MK |
93 | @param[in,out] Buffer The pointer to private data buffer.\r |
94 | \r | |
529a5a86 MK |
95 | **/\r |
96 | VOID\r | |
d691abec | 97 | EFIAPI\r |
529a5a86 | 98 | CheckFeatureSupported (\r |
d691abec | 99 | IN OUT VOID *Buffer\r |
529a5a86 MK |
100 | );\r |
101 | \r | |
102 | /**\r | |
103 | Enable XD feature.\r | |
104 | \r | |
105 | **/\r | |
106 | VOID\r | |
107 | ActivateXd (\r | |
108 | VOID\r | |
109 | );\r | |
110 | \r | |
111 | /**\r | |
112 | Update page table according to protected memory ranges and the 4KB-page mapped memory ranges.\r | |
113 | \r | |
114 | **/\r | |
115 | VOID\r | |
116 | InitPaging (\r | |
117 | VOID\r | |
118 | );\r | |
119 | \r | |
120 | /**\r | |
121 | Check if XD and BTS features are supported by all processors.\r | |
122 | \r | |
123 | **/\r | |
124 | VOID\r | |
125 | CheckProcessorFeature (\r | |
126 | VOID\r | |
127 | );\r | |
128 | \r | |
129 | extern BOOLEAN mXdSupported;\r | |
130 | extern BOOLEAN mXdEnabled;\r | |
131 | \r | |
132 | #endif // _SMM_PROFILE_H_\r |