Files
slimbootloader/MdePkg/Library/BaseLib/UnitTestHost.c
Guo Dong 416f2d95da Sync edk2 basetool mdepkg (#2121)
* Sync BaseTools to align with edk2-stable202311

Keep the SBL specific change (e.g. Lz4).

Signed-off-by: Guo Dong <guo.dong@intel.com>

* feat: Sync MdePkg from EDK2 edk2-stable202311 branch

Only sync required file without any changes to EDK2 files.

Signed-off-by: Guo Dong <guo.dong@intel.com>

* feat: Update MdePkg for SBL after sync from EDK2

Signed-off-by: Guo Dong <guo.dong@intel.com>

* Update SBL after updating Basetool and MdePkg

After Sync BaseTool and MdePkg to edk2-stable202311,
Need update SBL code to align with this change.

Signed-off-by: Guo Dong <guo.dong@intel.com>

* feat: rollback some changes after mdepkg sync

New change from MdePkg requires new NASM version.
To make sure NASM 2.14.02 still works, just rollback
few changes.

Signed-off-by: Guo Dong <guo.dong@intel.com>

* feat: Update component size to fix build failure

After syncing BaseTool and MdePkg, some components would
have a little bigger size. So update the config to fix the
build failure.

Signed-off-by: Guo Dong <guo.dong@intel.com>

* feat: Remove unused asl code

Some ASL files don't exist but they are included in other asl files.
It would cause build failure with new build BaseTool. So just remove
them to fix the build failure.

Signed-off-by: Guo Dong <guo.dong@intel.com>

---------

Signed-off-by: Guo Dong <guo.dong@intel.com>
2024-03-08 13:43:46 -05:00

141 lines
2.4 KiB
C

/** @file
Common Unit Test Host functions.
Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include "UnitTestHost.h"
///
/// Module global variable for simple system emulation of interrupt state
///
STATIC BOOLEAN mUnitTestHostBaseLibInterruptState;
/**
Enables CPU interrupts.
**/
VOID
EFIAPI
UnitTestHostBaseLibEnableInterrupts (
VOID
)
{
mUnitTestHostBaseLibInterruptState = TRUE;
}
/**
Disables CPU interrupts.
**/
VOID
EFIAPI
UnitTestHostBaseLibDisableInterrupts (
VOID
)
{
mUnitTestHostBaseLibInterruptState = FALSE;
}
/**
Enables CPU interrupts for the smallest window required to capture any
pending interrupts.
**/
VOID
EFIAPI
UnitTestHostBaseLibEnableDisableInterrupts (
VOID
)
{
mUnitTestHostBaseLibInterruptState = FALSE;
}
/**
Set the current CPU interrupt state.
Sets the current CPU interrupt state to the state specified by
InterruptState. If InterruptState is TRUE, then interrupts are enabled. If
InterruptState is FALSE, then interrupts are disabled. InterruptState is
returned.
@param InterruptState TRUE if interrupts should enabled. FALSE if
interrupts should be disabled.
@return InterruptState
**/
BOOLEAN
EFIAPI
UnitTestHostBaseLibGetInterruptState (
VOID
)
{
return mUnitTestHostBaseLibInterruptState;
}
/**
Enables CPU interrupts.
**/
VOID
EFIAPI
EnableInterrupts (
VOID
)
{
gUnitTestHostBaseLib.Common->EnableInterrupts ();
}
/**
Disables CPU interrupts.
**/
VOID
EFIAPI
DisableInterrupts (
VOID
)
{
gUnitTestHostBaseLib.Common->DisableInterrupts ();
}
/**
Enables CPU interrupts for the smallest window required to capture any
pending interrupts.
**/
VOID
EFIAPI
EnableDisableInterrupts (
VOID
)
{
gUnitTestHostBaseLib.Common->EnableDisableInterrupts ();
}
/**
Set the current CPU interrupt state.
Sets the current CPU interrupt state to the state specified by
InterruptState. If InterruptState is TRUE, then interrupts are enabled. If
InterruptState is FALSE, then interrupts are disabled. InterruptState is
returned.
@param InterruptState TRUE if interrupts should enabled. FALSE if
interrupts should be disabled.
@return InterruptState
**/
BOOLEAN
EFIAPI
GetInterruptState (
VOID
)
{
return gUnitTestHostBaseLib.Common->GetInterruptState ();
}