VirtualBox

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

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

Devices/EFI/FirmwareNew: Start upgrade process to edk2-stable201908 (compiles on Windows and works to some extent), bugref:4643

  • 屬性 svn:eol-style 設為 native
檔案大小: 742 位元組
 
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
10
11
12#include "BaseLibInternals.h"
13
14/**
15 Returns the value of the highest bit set in a 64-bit value. Equivalent to
16 1 << log2(x).
17
18 This function computes the value of the highest bit set in the 64-bit value
19 specified by Operand. If Operand is zero, then zero is returned.
20
21 @param Operand The 64-bit operand to evaluate.
22
23 @return 1 << HighBitSet64(Operand)
24 @retval 0 Operand is zero.
25
26**/
27UINT64
28EFIAPI
29GetPowerOfTwo64 (
30 IN UINT64 Operand
31 )
32{
33 if (Operand == 0) {
34 return 0;
35 }
36
37 return LShiftU64 (1, (UINTN) HighBitSet64 (Operand));
38}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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