iPXE
strings.h File Reference

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
static __attribute__ ((always_inline)) int __ffsl(long value)
 Find first (i.e.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ __attribute__()

__attribute__ ( (always_inline) )
inlinestatic

Find first (i.e.

Find last (i.e.

least significant) set bit

Parameters
valueValue
Return values
lsbLeast significant bit set in value (LSB=1), or zero

most significant) set bit

Parameters
valueValue
Return values
msbMost significant bit set in value (LSB=1), or zero

Definition at line 12 of file strings.h.

12 {
13 long lsb_minus_one;
14
15 /* If the input value is zero, the BSF instruction returns
16 * ZF=0 and leaves an undefined value in the output register.
17 * Perform this check in C rather than asm so that it can be
18 * omitted in cases where the compiler is able to prove that
19 * the input is non-zero.
20 */
21 if ( value ) {
22 __asm__ ( "bsfl %1, %0"
23 : "=r" ( lsb_minus_one )
24 : "rm" ( value ) );
25 return ( lsb_minus_one + 1 );
26 } else {
27 return 0;
28 }
29}
pseudo_bit_t value[0x00020]
Definition arbel.h:2
__asm__(".section \".rodata\", \"a\", " PROGBITS "\n\t" "\nprivate_key_data:\n\t" ".size private_key_data, ( . - private_key_data )\n\t" ".equ private_key_len, ( . - private_key_data )\n\t" ".previous\n\t")

References __asm__(), and value.