VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/BaseLib/GetPowerOfTwo64.c@ 99404

最後變更 在這個檔案從99404是 99404,由 vboxsync 提交於 2 年 前

Devices/EFI/FirmwareNew: Update to edk2-stable202302 and make it build, bugref:4643

  • 屬性 svn:eol-style 設為 native
檔案大小: 720 位元組
 
1/** @file
2 Math worker functions.
3
4 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7**/
8
9#include "BaseLibInternals.h"
10
11/**
12 Returns the value of the highest bit set in a 64-bit value. Equivalent to
13 1 << log2(x).
14
15 This function computes the value of the highest bit set in the 64-bit value
16 specified by Operand. If Operand is zero, then zero is returned.
17
18 @param Operand The 64-bit operand to evaluate.
19
20 @return 1 << HighBitSet64(Operand)
21 @retval 0 Operand is zero.
22
23**/
24UINT64
25EFIAPI
26GetPowerOfTwo64 (
27 IN UINT64 Operand
28 )
29{
30 if (Operand == 0) {
31 return 0;
32 }
33
34 return LShiftU64 (1, (UINTN)HighBitSet64 (Operand));
35}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette