From e676c4d0c6d21d1ac277598c7f56102c9bc00375 Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Wed, 17 Sep 2008 13:35:14 +0000 Subject: Apply HighBitSet() in MDE baseLib to retire the internal function CoreHighestSetBit(). git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5920 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Core/Dxe/Event.h | 14 -------------- MdeModulePkg/Core/Dxe/Event/Tpl.c | 34 ++-------------------------------- 2 files changed, 2 insertions(+), 46 deletions(-) (limited to 'MdeModulePkg') diff --git a/MdeModulePkg/Core/Dxe/Event.h b/MdeModulePkg/Core/Dxe/Event.h index a3b0d67ff7..1709290a9f 100644 --- a/MdeModulePkg/Core/Dxe/Event.h +++ b/MdeModulePkg/Core/Dxe/Event.h @@ -84,20 +84,6 @@ CoreDispatchEventNotifies ( -/** - Return the highest set bit. - - @param Number The value to check - - @return Bit position of the highest set bit - -**/ -UINTN -CoreHighestSetBit ( - IN UINTN Number - ); - - // // Exported functions // diff --git a/MdeModulePkg/Core/Dxe/Event/Tpl.c b/MdeModulePkg/Core/Dxe/Event/Tpl.c index 5eb4628cb1..43bc8add36 100644 --- a/MdeModulePkg/Core/Dxe/Event/Tpl.c +++ b/MdeModulePkg/Core/Dxe/Event/Tpl.c @@ -35,35 +35,6 @@ CoreSetInterruptState ( } } -// -// Return the highest set bit -// - -/** - Return the highest set bit. - - @param Number The value to check - - @return Bit position of the highest set bit - -**/ -UINTN -CoreHighestSetBit ( - IN UINTN Number - ) -{ - UINTN Msb; - - Msb = 31; - while ((Msb > 0) && ((Number & (UINTN)(1 << Msb)) == 0)) { - Msb--; - } - - return Msb; -} - - - /** Raise the task priority level to the new level. @@ -135,9 +106,8 @@ CoreRestoreTpl ( // // Dispatch any pending events // - - while ((-2 << NewTpl) & gEventPending) { - gEfiCurrentTpl = CoreHighestSetBit (gEventPending); + while (((-2 << NewTpl) & gEventPending) != 0) { + gEfiCurrentTpl = HighBitSet64 (gEventPending); if (gEfiCurrentTpl < TPL_HIGH_LEVEL) { CoreSetInterruptState (TRUE); } -- cgit v1.2.3