2015-08-13 10:24:17 +02:00
|
|
|
/** @file
|
|
|
|
The header file for Tcg2 SMM driver.
|
2018-06-27 15:13:09 +02:00
|
|
|
|
2018-01-08 03:13:54 +01:00
|
|
|
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
|
2021-03-05 05:14:13 +01:00
|
|
|
Copyright (c) Microsoft Corporation.
|
2019-04-04 01:06:56 +02:00
|
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
2015-08-13 10:24:17 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef __TCG2_SMM_H__
|
|
|
|
#define __TCG2_SMM_H__
|
|
|
|
|
2021-03-05 05:14:13 +01:00
|
|
|
#include <PiMm.h>
|
2015-08-13 10:24:17 +02:00
|
|
|
|
|
|
|
#include <Guid/MemoryOverwriteControl.h>
|
|
|
|
#include <Guid/TpmInstance.h>
|
2021-03-05 05:14:13 +01:00
|
|
|
#include <Guid/TpmNvsMm.h>
|
2015-08-13 10:24:17 +02:00
|
|
|
|
2021-03-05 05:14:13 +01:00
|
|
|
#include <Protocol/MmReadyToLock.h>
|
2015-08-13 10:24:17 +02:00
|
|
|
#include <Protocol/SmmSwDispatch2.h>
|
|
|
|
#include <Protocol/AcpiTable.h>
|
|
|
|
#include <Protocol/SmmVariable.h>
|
|
|
|
#include <Protocol/Tcg2Protocol.h>
|
|
|
|
|
|
|
|
#include <Library/BaseLib.h>
|
|
|
|
#include <Library/BaseMemoryLib.h>
|
|
|
|
#include <Library/DebugLib.h>
|
2021-03-05 05:14:12 +01:00
|
|
|
#include <Library/MmServicesTableLib.h>
|
2016-12-21 07:31:47 +01:00
|
|
|
#include <Library/Tpm2CommandLib.h>
|
2015-08-13 10:24:17 +02:00
|
|
|
#include <Library/Tcg2PhysicalPresenceLib.h>
|
2016-01-26 02:30:17 +01:00
|
|
|
#include <Library/IoLib.h>
|
2018-01-08 03:13:54 +01:00
|
|
|
#include <Library/PcdLib.h>
|
2018-05-08 08:51:57 +02:00
|
|
|
#include <Library/Tpm2DeviceLib.h>
|
2016-01-26 02:30:17 +01:00
|
|
|
|
|
|
|
#include <IndustryStandard/TpmPtp.h>
|
2015-08-13 10:24:17 +02:00
|
|
|
|
|
|
|
//
|
|
|
|
// The definition for TCG MOR
|
|
|
|
//
|
2021-12-05 23:54:12 +01:00
|
|
|
#define ACPI_FUNCTION_DSM_MEMORY_CLEAR_INTERFACE 1
|
|
|
|
#define ACPI_FUNCTION_PTS_CLEAR_MOR_BIT 2
|
2015-08-13 10:24:17 +02:00
|
|
|
|
|
|
|
//
|
|
|
|
// The return code for Memory Clear Interface Functions
|
|
|
|
//
|
2021-12-05 23:54:12 +01:00
|
|
|
#define MOR_REQUEST_SUCCESS 0
|
|
|
|
#define MOR_REQUEST_GENERAL_FAILURE 1
|
2015-08-13 10:24:17 +02:00
|
|
|
|
2021-03-05 05:14:13 +01:00
|
|
|
/**
|
|
|
|
Notify the system that the SMM variable driver is ready.
|
|
|
|
**/
|
|
|
|
VOID
|
|
|
|
Tcg2NotifyMmReady (
|
|
|
|
VOID
|
|
|
|
);
|
2016-06-08 09:35:16 +02:00
|
|
|
|
2021-03-05 05:14:13 +01:00
|
|
|
/**
|
|
|
|
This function is an abstraction layer for implementation specific Mm buffer validation routine.
|
2016-12-21 07:31:47 +01:00
|
|
|
|
2021-03-05 05:14:13 +01:00
|
|
|
@param Buffer The buffer start address to be checked.
|
|
|
|
@param Length The buffer length to be checked.
|
|
|
|
|
|
|
|
@retval TRUE This buffer is valid per processor architecture and not overlap with SMRAM.
|
|
|
|
@retval FALSE This buffer is not valid per processor architecture or overlap with SMRAM.
|
|
|
|
**/
|
|
|
|
BOOLEAN
|
|
|
|
IsBufferOutsideMmValid (
|
|
|
|
IN EFI_PHYSICAL_ADDRESS Buffer,
|
|
|
|
IN UINT64 Length
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
The driver's common initialization routine.
|
|
|
|
|
|
|
|
It install callbacks for TPM physical presence and MemoryClear, and locate
|
|
|
|
SMM variable to be used in the callback function.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The entry point is executed successfully.
|
|
|
|
@retval Others Some error occurs when executing this entry point.
|
|
|
|
|
|
|
|
**/
|
|
|
|
EFI_STATUS
|
|
|
|
InitializeTcgCommon (
|
|
|
|
VOID
|
|
|
|
);
|
2018-01-08 03:13:54 +01:00
|
|
|
|
2021-12-05 23:54:12 +01:00
|
|
|
#endif // __TCG_SMM_H__
|