X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdePkg%2FLibrary%2FUefiLib%2FUefiLib.c;h=765235c51519f3c80bbf66c693a2e353582bb4eb;hp=a2dd6a8c1259aeadf5fd6946523cd9d224b0ebca;hb=d958721a06dce3aa0fc941c115db86e3f91254f7;hpb=582510249f2fb1334e507b99421b9485f6b89159 diff --git a/MdePkg/Library/UefiLib/UefiLib.c b/MdePkg/Library/UefiLib/UefiLib.c index a2dd6a8c12..765235c515 100644 --- a/MdePkg/Library/UefiLib/UefiLib.c +++ b/MdePkg/Library/UefiLib/UefiLib.c @@ -243,6 +243,34 @@ EfiNamedEventSignal ( return EFI_SUCCESS; } +/** + Returns the current TPL. + + This function returns the current TPL. There is no EFI service to directly + retrieve the current TPL. Instead, the RaiseTPL() function is used to raise + the TPL to TPL_HIGH_LEVEL. This will return the current TPL. The TPL level + can then immediately be restored back to the current TPL level with a call + to RestoreTPL(). + + @param VOID + + @retvale EFI_TPL The current TPL. + +**/ +EFI_TPL +EFIAPI +EfiGetCurrentTpl ( + VOID + ) +{ + EFI_TPL Tpl; + + Tpl = gBS->RaiseTPL (EFI_TPL_HIGH_LEVEL); + gBS->RestoreTPL (Tpl); + + return Tpl; +} + /** This function initializes a basic mutual exclusion lock to the released state @@ -779,3 +807,4 @@ FreeUnicodeStringTable ( return EFI_SUCCESS; } +