]>
Commit | Line | Data |
---|---|---|
3cbfba02 DW |
1 | /** @file\r |
2 | PCH Smm Library Services that implements both S/W SMI generation and detection.\r | |
3 | \r | |
4 | Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r | |
5 | \r\r | |
9dc8036d MK |
6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
7 | \r | |
3cbfba02 DW |
8 | \r\r |
9 | \r | |
10 | **/\r | |
11 | \r | |
12 | \r | |
13 | #include "CommonHeader.h"\r | |
14 | \r | |
15 | \r | |
16 | /**\r | |
17 | Triggers a run time or boot time SMI.\r | |
18 | \r | |
19 | This function triggers a software SMM interrupt and set the APMC status with an 8-bit Data.\r | |
20 | \r | |
21 | @param Data The value to set the APMC status.\r | |
22 | \r | |
23 | **/\r | |
24 | VOID\r | |
25 | InternalTriggerSmi (\r | |
26 | IN UINT8 Data\r | |
27 | )\r | |
28 | {\r | |
29 | ASSERT(FALSE);\r | |
30 | }\r | |
31 | \r | |
32 | \r | |
33 | /**\r | |
34 | Triggers an SMI at boot time.\r | |
35 | \r | |
36 | This function triggers a software SMM interrupt at boot time.\r | |
37 | \r | |
38 | **/\r | |
39 | VOID\r | |
40 | EFIAPI\r | |
41 | TriggerBootServiceSoftwareSmi (\r | |
42 | VOID\r | |
43 | )\r | |
44 | {\r | |
45 | ASSERT(FALSE);\r | |
46 | }\r | |
47 | \r | |
48 | \r | |
49 | /**\r | |
50 | Triggers an SMI at run time.\r | |
51 | \r | |
52 | This function triggers a software SMM interrupt at run time.\r | |
53 | \r | |
54 | **/\r | |
55 | VOID\r | |
56 | EFIAPI\r | |
57 | TriggerRuntimeSoftwareSmi (\r | |
58 | VOID\r | |
59 | )\r | |
60 | {\r | |
61 | ASSERT(FALSE);\r | |
62 | }\r | |
63 | \r | |
64 | \r | |
65 | /**\r | |
66 | Gets the software SMI data.\r | |
67 | \r | |
68 | This function tests if a software SMM interrupt happens. If a software SMI happens,\r | |
69 | it retrieves the SMM data and returns it as a non-negative value; otherwise a negative\r | |
70 | value is returned.\r | |
71 | \r | |
72 | @return Data The data retrieved from SMM data port in case of a software SMI;\r | |
73 | otherwise a negative value.\r | |
74 | \r | |
75 | **/\r | |
76 | INTN\r | |
77 | InternalGetSwSmiData (\r | |
78 | VOID\r | |
79 | )\r | |
80 | {\r | |
81 | ASSERT(FALSE);\r | |
82 | return -1;\r | |
83 | }\r | |
84 | \r | |
85 | \r | |
86 | /**\r | |
87 | Test if a boot time software SMI happened.\r | |
88 | \r | |
89 | This function tests if a software SMM interrupt happened. If a software SMM interrupt happened and\r | |
90 | it was triggered at boot time, it returns TRUE. Otherwise, it returns FALSE.\r | |
91 | \r | |
92 | @retval TRUE A software SMI triggered at boot time happened.\r | |
93 | @retval FLASE No software SMI happened or the software SMI was triggered at run time.\r | |
94 | \r | |
95 | **/\r | |
96 | BOOLEAN\r | |
97 | EFIAPI\r | |
98 | IsBootServiceSoftwareSmi (\r | |
99 | VOID\r | |
100 | )\r | |
101 | {\r | |
102 | ASSERT(FALSE);\r | |
103 | return FALSE;\r | |
104 | }\r | |
105 | \r | |
106 | \r | |
107 | /**\r | |
108 | Test if a run time software SMI happened.\r | |
109 | \r | |
110 | This function tests if a software SMM interrupt happened. If a software SMM interrupt happened and\r | |
111 | it was triggered at run time, it returns TRUE. Otherwise, it returns FALSE.\r | |
112 | \r | |
113 | @retval TRUE A software SMI triggered at run time happened.\r | |
114 | @retval FLASE No software SMI happened or the software SMI was triggered at boot time.\r | |
115 | \r | |
116 | **/\r | |
117 | BOOLEAN\r | |
118 | EFIAPI\r | |
119 | IsRuntimeSoftwareSmi (\r | |
120 | VOID\r | |
121 | )\r | |
122 | {\r | |
123 | ASSERT(FALSE);\r | |
124 | return FALSE;\r | |
125 | }\r | |
126 | \r | |
127 | \r | |
128 | /**\r | |
129 | \r | |
130 | Clear APM SMI Status Bit; Set the EOS bit.\r | |
131 | \r | |
132 | **/\r | |
133 | VOID\r | |
134 | EFIAPI\r | |
135 | ClearSmi (\r | |
136 | VOID\r | |
137 | )\r | |
138 | {\r | |
139 | \r | |
140 | UINT16 PmBase;\r | |
141 | \r | |
142 | //\r | |
143 | // Get PMBase\r | |
144 | //\r | |
145 | PmBase = PcdGet16 (PcdPchAcpiIoPortBaseAddress);\r | |
146 | \r | |
147 | //\r | |
148 | // Clear the APM SMI Status Bit\r | |
149 | //\r | |
150 | IoWrite16 (PmBase + R_PCH_ACPI_SMI_STS, B_PCH_ACPI_APM_STS);\r | |
151 | \r | |
152 | //\r | |
153 | // Set the EOS Bit\r | |
154 | //\r | |
155 | IoOr32 (PmBase + R_PCH_ACPI_SMI_EN, B_PCH_ACPI_EOS);\r | |
156 | }\r | |
157 | \r |