VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/BaseLib/LowBitSet32.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
檔案大小: 873 位元組
 
1/** @file
2 Math worker functions.
3
4 Copyright (c) 2006 - 2008, 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 bit position of the lowest bit set in a 32-bit value.
16
17 This function computes the bit position of the lowest bit set in the 32-bit
18 value specified by Operand. If Operand is zero, then -1 is returned.
19 Otherwise, a value between 0 and 31 is returned.
20
21 @param Operand The 32-bit operand to evaluate.
22
23 @retval 0..31 The lowest bit set in Operand was found.
24 @retval -1 Operand is zero.
25
26**/
27INTN
28EFIAPI
29LowBitSet32 (
30 IN UINT32 Operand
31 )
32{
33 INTN BitIndex;
34
35 if (Operand == 0) {
36 return -1;
37 }
38
39 for (BitIndex = 0; 0 == (Operand & 1); BitIndex++, Operand >>= 1);
40 return BitIndex;
41}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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