2 PCH Smm Library Services that implements both S/W SMI generation and detection.
4 Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials are licensed and made available under
7 the terms and conditions of the BSD License that accompanies this distribution.
8 The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 #include "CommonHeader.h"
22 Triggers a run time or boot time SMI.
24 This function triggers a software SMM interrupt and set the APMC status with an 8-bit Data.
26 @param Data The value to set the APMC status.
39 Triggers an SMI at boot time.
41 This function triggers a software SMM interrupt at boot time.
46 TriggerBootServiceSoftwareSmi (
55 Triggers an SMI at run time.
57 This function triggers a software SMM interrupt at run time.
62 TriggerRuntimeSoftwareSmi (
71 Gets the software SMI data.
73 This function tests if a software SMM interrupt happens. If a software SMI happens,
74 it retrieves the SMM data and returns it as a non-negative value; otherwise a negative
77 @return Data The data retrieved from SMM data port in case of a software SMI;
78 otherwise a negative value.
82 InternalGetSwSmiData (
92 Test if a boot time software SMI happened.
94 This function tests if a software SMM interrupt happened. If a software SMM interrupt happened and
95 it was triggered at boot time, it returns TRUE. Otherwise, it returns FALSE.
97 @retval TRUE A software SMI triggered at boot time happened.
98 @retval FLASE No software SMI happened or the software SMI was triggered at run time.
103 IsBootServiceSoftwareSmi (
113 Test if a run time software SMI happened.
115 This function tests if a software SMM interrupt happened. If a software SMM interrupt happened and
116 it was triggered at run time, it returns TRUE. Otherwise, it returns FALSE.
118 @retval TRUE A software SMI triggered at run time happened.
119 @retval FLASE No software SMI happened or the software SMI was triggered at boot time.
124 IsRuntimeSoftwareSmi (
135 Clear APM SMI Status Bit; Set the EOS bit.
150 PmBase
= PcdGet16 (PcdPchAcpiIoPortBaseAddress
);
153 // Clear the APM SMI Status Bit
155 IoWrite16 (PmBase
+ R_PCH_ACPI_SMI_STS
, B_PCH_ACPI_APM_STS
);
160 IoOr32 (PmBase
+ R_PCH_ACPI_SMI_EN
, B_PCH_ACPI_EOS
);