XenevaOS
Loading...
Searching...
No Matches
Macros
wordpart.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define upper_32_bits(n)   ((u32)(((n) >> 16) >> 16))
 
#define lower_32_bits(n)   ((u32)((n) & 0xffffffff))
 
#define upper_16_bits(n)   ((u16)((n) >> 16))
 
#define lower_16_bits(n)   ((u16)((n) & 0xffff))
 
#define REPEAT_BYTE(x)   ((~0ul / 0xff) * (x))
 
#define REPEAT_BYTE_U32(x)   lower_32_bits(REPEAT_BYTE(x))
 
#define aligned_byte_mask(n)   (~0xffUL << (BITS_PER_LONG - 8 - 8*(n)))
 

Macro Definition Documentation

◆ aligned_byte_mask

#define aligned_byte_mask (   n)    (~0xffUL << (BITS_PER_LONG - 8 - 8*(n)))

◆ lower_16_bits

#define lower_16_bits (   n)    ((u16)((n) & 0xffff))

lower_16_bits - return bits 0-15 of a number
: the number we're accessing

◆ lower_32_bits

#define lower_32_bits (   n)    ((u32)((n) & 0xffffffff))

lower_32_bits - return bits 0-31 of a number
: the number we're accessing

◆ REPEAT_BYTE

#define REPEAT_BYTE (   x)    ((~0ul / 0xff) * (x))

REPEAT_BYTE - repeat the value @x multiple times as an unsigned long value @x: value to repeat

NOTE: @x is not checked for > 0xff; larger values produce odd results.

◆ REPEAT_BYTE_U32

#define REPEAT_BYTE_U32 (   x)    lower_32_bits(REPEAT_BYTE(x))

REPEAT_BYTE_U32 - repeat the value @x multiple times as a u32 value @x: value to repeat

NOTE: @x is not checked for > 0xff; larger values produce odd results.

◆ upper_16_bits

#define upper_16_bits (   n)    ((u16)((n) >> 16))

upper_16_bits - return bits 16-31 of a number
: the number we're accessing

◆ upper_32_bits

#define upper_32_bits (   n)    ((u32)(((n) >> 16) >> 16))

upper_32_bits - return bits 32-63 of a number
: the number we're accessing

A basic shift-right of a 64- or 32-bit quantity. Use this to suppress the "right shift count >= width of type" warning when that quantity is 32-bits.