msr/raplcap-msr-common.c
static uint64_t replace_bits(uint64_t msrval, uint64_t data, uint8_t first, uint8_t last) {
  assert(first <= last);
  assert(last < 64);
  const uint64_t mask = (((uint64_t) 1 << (last - first + 1)) - 1) << first;
  return (msrval & ~mask) | ((data << first) & mask);
}
// Replace the requested msrval bits with data the data in situ; first and last are inclusive
Replace the requested msrval bits with data the data in situ; first and last are inclusive
Replace the requested msrval bits with data the data in situ ; first and last are inclusive
static uint64_t replace_bits(uint64_t msrval, uint64_t data, uint8_t first, uint8_t last) {
  assert(first <= last);
  assert(last < 64);
  const uint64_t mask = (((uint64_t) 1 << (last - first + 1)) - 1) << first;
  return (msrval & ~mask) | ((data << first) & mask);
}
static uint64_t replace_bits ( uint64_t msrval , uint64_t data , uint8_t first , uint8_t last ) { assert ( first <= last ) ; assert ( last < 64 ) ; const uint64_t mask = ( ( ( uint64_t ) 1 << ( last - first + 1 ) ) - 1 ) << first ; return ( msrval & ~ mask ) | ( ( data << first ) & mask ) ; }
Replace the requested msrval bits with data the data in situ; first and last are inclusive
Replace the requested msrval bits with data the data in situ ; first and last are inclusive