Upload BSD-licensed Vlv2TbltDevicePkg and Vlv2DeviceRefCodePkg to
https://svn.code.sf.net/p/edk2/code/trunk/edk2/, which are for MinnowBoard MAX open source project. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: David Wei <david.wei@intel.com> Reviewed-by: Mike Wu <mike.wu@intel.com> Reviewed-by: Hot Tian <hot.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16599 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
162
Vlv2TbltDevicePkg/Library/PchSmmLib/PchSmmLib.c
Normal file
162
Vlv2TbltDevicePkg/Library/PchSmmLib/PchSmmLib.c
Normal file
@@ -0,0 +1,162 @@
|
||||
/** @file
|
||||
PCH Smm Library Services that implements both S/W SMI generation and detection.
|
||||
|
||||
Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
|
||||
This program and the accompanying materials are licensed and made available under
|
||||
|
||||
the terms and conditions of the BSD License that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
**/
|
||||
|
||||
|
||||
#include "CommonHeader.h"
|
||||
|
||||
|
||||
/**
|
||||
Triggers a run time or boot time SMI.
|
||||
|
||||
This function triggers a software SMM interrupt and set the APMC status with an 8-bit Data.
|
||||
|
||||
@param Data The value to set the APMC status.
|
||||
|
||||
**/
|
||||
VOID
|
||||
InternalTriggerSmi (
|
||||
IN UINT8 Data
|
||||
)
|
||||
{
|
||||
ASSERT(FALSE);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Triggers an SMI at boot time.
|
||||
|
||||
This function triggers a software SMM interrupt at boot time.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
TriggerBootServiceSoftwareSmi (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
ASSERT(FALSE);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Triggers an SMI at run time.
|
||||
|
||||
This function triggers a software SMM interrupt at run time.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
TriggerRuntimeSoftwareSmi (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
ASSERT(FALSE);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Gets the software SMI data.
|
||||
|
||||
This function tests if a software SMM interrupt happens. If a software SMI happens,
|
||||
it retrieves the SMM data and returns it as a non-negative value; otherwise a negative
|
||||
value is returned.
|
||||
|
||||
@return Data The data retrieved from SMM data port in case of a software SMI;
|
||||
otherwise a negative value.
|
||||
|
||||
**/
|
||||
INTN
|
||||
InternalGetSwSmiData (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
ASSERT(FALSE);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Test if a boot time software SMI happened.
|
||||
|
||||
This function tests if a software SMM interrupt happened. If a software SMM interrupt happened and
|
||||
it was triggered at boot time, it returns TRUE. Otherwise, it returns FALSE.
|
||||
|
||||
@retval TRUE A software SMI triggered at boot time happened.
|
||||
@retval FLASE No software SMI happened or the software SMI was triggered at run time.
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
IsBootServiceSoftwareSmi (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
ASSERT(FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Test if a run time software SMI happened.
|
||||
|
||||
This function tests if a software SMM interrupt happened. If a software SMM interrupt happened and
|
||||
it was triggered at run time, it returns TRUE. Otherwise, it returns FALSE.
|
||||
|
||||
@retval TRUE A software SMI triggered at run time happened.
|
||||
@retval FLASE No software SMI happened or the software SMI was triggered at boot time.
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
IsRuntimeSoftwareSmi (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
ASSERT(FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Clear APM SMI Status Bit; Set the EOS bit.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
ClearSmi (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
|
||||
UINT16 PmBase;
|
||||
|
||||
//
|
||||
// Get PMBase
|
||||
//
|
||||
PmBase = PcdGet16 (PcdPchAcpiIoPortBaseAddress);
|
||||
|
||||
//
|
||||
// Clear the APM SMI Status Bit
|
Reference in New Issue
Block a user