FreeBSD/sys/arm/nvidia/tegra_soctherm.c
/* Extract signed integer bitfield from register */
Extract signed integer bitfield from register
Extract signed integer bitfield from register
static int
extract_signed(uint32_t reg, int shift, int bits)
{
	int32_t val;
	uint32_t mask;
	mask = (1 << bits) - 1;
	val = ((reg >> shift) & mask) << (32 - bits);
	val >>= 32 - bits;
	return ((int32_t)val);
}
static int extract_signed ( uint32_t reg , int shift , int bits ) { int32_t val ; uint32_t mask ; mask = ( 1 << bits ) - 1 ; val = ( ( reg >> shift ) & mask ) << ( 32 - bits ) ; val >>= 32 - bits ; return ( ( int32_t ) val ) ; }
Extract signed integer bitfield from register
Extract signed integer bitfield from register