/** @file
Serial I/O Port library implementation for the HDMI I2C Debug Port
DXE Library implementation
Copyright (c) 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include
#include
#include
STATIC EFI_TPL mPreviousTpl = 0;
/**
For boot phases that utilize task priority levels (TPLs), this function raises
the TPL to the appriopriate level needed to execute I/O to the I2C Debug Port
**/
VOID
RaiseTplForI2cDebugPortAccess (
VOID
)
{
if (EfiGetCurrentTpl () < TPL_NOTIFY) {
mPreviousTpl = gBS->RaiseTPL (TPL_NOTIFY);
}
}
/**
For boot phases that utilize task priority levels (TPLs), this function
restores the TPL to the previous level after I/O to the I2C Debug Port is
complete
**/
VOID
RestoreTplAfterI2cDebugPortAccess (
VOID
)
{
if (mPreviousTpl > 0) {
gBS->RestoreTPL (mPreviousTpl);
mPreviousTpl = 0;
}
}