object.c
/*
 *  extractSubfield - extract a subfield of bits from a word
 */
extract a subfield of bits from a word
extract a subfield of bits from a word
static u64 extractSubfield(u64 word, int fieldStartingBitPos, int len) {
    u64 mask;
    int shiftCount;
    if (len >= 64) return word;
    mask = ~((~(u64)0 >> len) << len);
    shiftCount = 64 - (fieldStartingBitPos + len);
    return (word >> shiftCount) & mask;
}
static u64 extractSubfield ( u64 word , int fieldStartingBitPos , int len ) { u64 mask ; int shiftCount ; if ( len >= 64 ) return word ; mask = ~ ( ( ~ ( u64 ) 0 >> len ) << len ) ; shiftCount = 64 - ( fieldStartingBitPos + len ) ; return ( word >> shiftCount ) & mask ; }
extractSubfield - extract a subfield of bits from a word
extractSubfield - extract a subfield of bits from a word