Skip to content

Commit 50f06ca

Browse files
wuxyintellijinxia
authored andcommitted
HV:treewide: Rename bit operation function fls as fls32
Rename bit operation function fls as fls32, keep name style with other bit operation function. Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent 8afbe66 commit 50f06ca

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

hypervisor/arch/x86/guest/vlapic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ vlapic_process_eoi(struct vlapic *vlapic)
774774
tmrptr = &lapic->tmr[0];
775775

776776
for (i = 7; i >= 0; i--) {
777-
bitpos = fls(isrptr[i].val);
777+
bitpos = fls32(isrptr[i].val);
778778
if (bitpos != INVALID_BIT_INDEX) {
779779
if (vlapic->isrvec_stk_top <= 0) {
780780
panic("invalid vlapic isrvec_stk_top %d",
@@ -1145,7 +1145,7 @@ vlapic_pending_intr(struct vlapic *vlapic, uint32_t *vecptr)
11451145

11461146
for (i = 7; i >= 0; i--) {
11471147
val = atomic_load((int *)&irrptr[i].val);
1148-
bitpos = fls(val);
1148+
bitpos = fls32(val);
11491149
if (bitpos != INVALID_BIT_INDEX) {
11501150
vector = (uint32_t)(i * 32) + (uint32_t)bitpos;
11511151
if (PRIO(vector) > PRIO(lapic->ppr)) {

hypervisor/include/lib/bits.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,19 @@
4242

4343
/**
4444
*
45-
* fls - Find the Last (most significant) bit Set in value and
45+
* fls32 - Find the Last (most significant) bit Set in value and
4646
* return the bit index of that bit.
4747
*
4848
* Bits are numbered starting at 0,the least significant bit.
4949
* A return value of INVALID_BIT_INDEX means return value is
5050
* invalid bit index when the input argument was zero.
5151
*
5252
* Examples:
53-
* fls (0x0) = INVALID_BIT_INDEX
54-
* fls (0x01) = 0
55-
* fls (0x80) = 7
53+
* fls32 (0x0) = INVALID_BIT_INDEX
54+
* fls32 (0x01) = 0
55+
* fls32 (0x80) = 7
5656
* ...
57-
* fls (0x80000001) = 31
57+
* fls32 (0x80000001) = 31
5858
*
5959
* @param value: 'uint32_t' type value
6060
*
@@ -63,7 +63,7 @@
6363
* set and return the invalid bit index directly.
6464
*
6565
* **/
66-
static inline uint16_t fls(uint32_t value)
66+
static inline uint16_t fls32(uint32_t value)
6767
{
6868
uint32_t ret = 0U;
6969
if (value == 0U)
@@ -147,7 +147,7 @@ static inline uint16_t clz(uint32_t value)
147147
if (value == 0U)
148148
return 32U;
149149
else{
150-
return (31U - fls(value));
150+
return (31U - fls32(value));
151151
}
152152
}
153153

0 commit comments

Comments
 (0)