iPXE
|
NetXen bit operations. More...
Go to the source code of this file.
Macros | |
#define | NX_PSEUDO_BIT_STRUCT(_structure) |
Wrapper structure for pseudo_bit_t structures. More... | |
#define | NX_PSEUDO_STRUCT(_ptr) typeof ( *((_ptr)->u.dummy[0]) ) |
Get pseudo_bit_t structure type from wrapper structure pointer. More... | |
#define | NX_BIT_OFFSET(_ptr, _field) offsetof ( NX_PSEUDO_STRUCT ( _ptr ), _field ) |
Bit offset of a field within a pseudo_bit_t structure. More... | |
#define | NX_BIT_WIDTH(_ptr, _field) sizeof ( ( ( NX_PSEUDO_STRUCT ( _ptr ) * ) NULL )->_field ) |
Bit width of a field within a pseudo_bit_t structure. More... | |
#define | NX_QWORD_OFFSET(_ptr, _field) ( NX_BIT_OFFSET ( _ptr, _field ) / 64 ) |
Qword offset of a field within a pseudo_bit_t structure. More... | |
#define | NX_QWORD_BIT_OFFSET(_ptr, _index, _field) ( NX_BIT_OFFSET ( _ptr, _field ) - ( 64 * (_index) ) ) |
Qword bit offset of a field within a pseudo_bit_t structure. More... | |
#define | NX_BIT_MASK(_ptr, _field) |
Bit mask for a field within a pseudo_bit_t structure. More... | |
#define | NX_ASSEMBLE_1(_ptr, _index, _field, _value) |
#define | NX_ASSEMBLE_2(_ptr, _index, _field, _value, ...) |
#define | NX_ASSEMBLE_3(_ptr, _index, _field, _value, ...) |
#define | NX_ASSEMBLE_4(_ptr, _index, _field, _value, ...) |
#define | NX_ASSEMBLE_5(_ptr, _index, _field, _value, ...) |
#define | NX_ASSEMBLE_6(_ptr, _index, _field, _value, ...) |
#define | NX_ASSEMBLE_7(_ptr, _index, _field, _value, ...) |
#define | NX_MASK_1(_ptr, _index, _field) |
#define | NX_MASK_2(_ptr, _index, _field, ...) |
#define | NX_MASK_3(_ptr, _index, _field, ...) |
#define | NX_MASK_4(_ptr, _index, _field, ...) |
#define | NX_MASK_5(_ptr, _index, _field, ...) |
#define | NX_MASK_6(_ptr, _index, _field, ...) |
#define | NX_MASK_7(_ptr, _index, _field, ...) |
#define | NX_FILL(_ptr, _index, _assembled) |
#define | NX_FILL_1(_ptr, _index, ...) NX_FILL ( _ptr, _index, NX_ASSEMBLE_1 ( _ptr, _index, __VA_ARGS__ ) ) |
#define | NX_FILL_2(_ptr, _index, ...) NX_FILL ( _ptr, _index, NX_ASSEMBLE_2 ( _ptr, _index, __VA_ARGS__ ) ) |
#define | NX_FILL_3(_ptr, _index, ...) NX_FILL ( _ptr, _index, NX_ASSEMBLE_3 ( _ptr, _index, __VA_ARGS__ ) ) |
#define | NX_FILL_4(_ptr, _index, ...) NX_FILL ( _ptr, _index, NX_ASSEMBLE_4 ( _ptr, _index, __VA_ARGS__ ) ) |
#define | NX_FILL_5(_ptr, _index, ...) NX_FILL ( _ptr, _index, NX_ASSEMBLE_5 ( _ptr, _index, __VA_ARGS__ ) ) |
#define | NX_FILL_6(_ptr, _index, ...) NX_FILL ( _ptr, _index, NX_ASSEMBLE_6 ( _ptr, _index, __VA_ARGS__ ) ) |
#define | NX_FILL_7(_ptr, _index, ...) NX_FILL ( _ptr, _index, NX_ASSEMBLE_7 ( _ptr, _index, __VA_ARGS__ ) ) |
#define | NX_GET64(_ptr, _field) |
Extract value of named field. More... | |
#define | NX_GET(_ptr, _field) ( ( unsigned long ) NX_GET64 ( _ptr, _field ) ) |
Extract value of named field (for fields up to the size of a long) More... | |
Typedefs | |
typedef unsigned char | pseudo_bit_t |
Datatype used to represent a bit in the pseudo-structures. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
NetXen bit operations.
Definition in file nx_bitops.h.
#define NX_PSEUDO_BIT_STRUCT | ( | _structure | ) |
Wrapper structure for pseudo_bit_t structures.
This structure provides a wrapper around pseudo_bit_t structures. It has the correct size, and also encapsulates type information about the underlying pseudo_bit_t-based structure, which allows the NX_FILL etc. macros to work without requiring explicit type information.
Definition at line 48 of file nx_bitops.h.
#define NX_PSEUDO_STRUCT | ( | _ptr | ) | typeof ( *((_ptr)->u.dummy[0]) ) |
Get pseudo_bit_t structure type from wrapper structure pointer.
Definition at line 56 of file nx_bitops.h.
#define NX_BIT_OFFSET | ( | _ptr, | |
_field | |||
) | offsetof ( NX_PSEUDO_STRUCT ( _ptr ), _field ) |
Bit offset of a field within a pseudo_bit_t structure.
Definition at line 60 of file nx_bitops.h.
#define NX_BIT_WIDTH | ( | _ptr, | |
_field | |||
) | sizeof ( ( ( NX_PSEUDO_STRUCT ( _ptr ) * ) NULL )->_field ) |
Bit width of a field within a pseudo_bit_t structure.
Definition at line 64 of file nx_bitops.h.
#define NX_QWORD_OFFSET | ( | _ptr, | |
_field | |||
) | ( NX_BIT_OFFSET ( _ptr, _field ) / 64 ) |
Qword offset of a field within a pseudo_bit_t structure.
Definition at line 68 of file nx_bitops.h.
#define NX_QWORD_BIT_OFFSET | ( | _ptr, | |
_index, | |||
_field | |||
) | ( NX_BIT_OFFSET ( _ptr, _field ) - ( 64 * (_index) ) ) |
Qword bit offset of a field within a pseudo_bit_t structure.
Yes, using mod-64 would work, but would lose the check for the error of specifying a mismatched field name and qword index.
Definition at line 76 of file nx_bitops.h.
#define NX_BIT_MASK | ( | _ptr, | |
_field | |||
) |
Bit mask for a field within a pseudo_bit_t structure.
Definition at line 80 of file nx_bitops.h.
#define NX_ASSEMBLE_1 | ( | _ptr, | |
_index, | |||
_field, | |||
_value | |||
) |
Definition at line 89 of file nx_bitops.h.
#define NX_ASSEMBLE_2 | ( | _ptr, | |
_index, | |||
_field, | |||
_value, | |||
... | |||
) |
Definition at line 93 of file nx_bitops.h.
#define NX_ASSEMBLE_3 | ( | _ptr, | |
_index, | |||
_field, | |||
_value, | |||
... | |||
) |
Definition at line 97 of file nx_bitops.h.
#define NX_ASSEMBLE_4 | ( | _ptr, | |
_index, | |||
_field, | |||
_value, | |||
... | |||
) |
Definition at line 101 of file nx_bitops.h.
#define NX_ASSEMBLE_5 | ( | _ptr, | |
_index, | |||
_field, | |||
_value, | |||
... | |||
) |
Definition at line 105 of file nx_bitops.h.
#define NX_ASSEMBLE_6 | ( | _ptr, | |
_index, | |||
_field, | |||
_value, | |||
... | |||
) |
Definition at line 109 of file nx_bitops.h.
#define NX_ASSEMBLE_7 | ( | _ptr, | |
_index, | |||
_field, | |||
_value, | |||
... | |||
) |
Definition at line 113 of file nx_bitops.h.
#define NX_MASK_1 | ( | _ptr, | |
_index, | |||
_field | |||
) |
Definition at line 122 of file nx_bitops.h.
#define NX_MASK_2 | ( | _ptr, | |
_index, | |||
_field, | |||
... | |||
) |
Definition at line 126 of file nx_bitops.h.
#define NX_MASK_3 | ( | _ptr, | |
_index, | |||
_field, | |||
... | |||
) |
Definition at line 130 of file nx_bitops.h.
#define NX_MASK_4 | ( | _ptr, | |
_index, | |||
_field, | |||
... | |||
) |
Definition at line 134 of file nx_bitops.h.
#define NX_MASK_5 | ( | _ptr, | |
_index, | |||
_field, | |||
... | |||
) |
Definition at line 138 of file nx_bitops.h.
#define NX_MASK_6 | ( | _ptr, | |
_index, | |||
_field, | |||
... | |||
) |
Definition at line 142 of file nx_bitops.h.
#define NX_MASK_7 | ( | _ptr, | |
_index, | |||
_field, | |||
... | |||
) |
Definition at line 146 of file nx_bitops.h.
#define NX_FILL | ( | _ptr, | |
_index, | |||
_assembled | |||
) |
Definition at line 155 of file nx_bitops.h.
#define NX_FILL_1 | ( | _ptr, | |
_index, | |||
... | |||
) | NX_FILL ( _ptr, _index, NX_ASSEMBLE_1 ( _ptr, _index, __VA_ARGS__ ) ) |
Definition at line 162 of file nx_bitops.h.
#define NX_FILL_2 | ( | _ptr, | |
_index, | |||
... | |||
) | NX_FILL ( _ptr, _index, NX_ASSEMBLE_2 ( _ptr, _index, __VA_ARGS__ ) ) |
Definition at line 165 of file nx_bitops.h.
#define NX_FILL_3 | ( | _ptr, | |
_index, | |||
... | |||
) | NX_FILL ( _ptr, _index, NX_ASSEMBLE_3 ( _ptr, _index, __VA_ARGS__ ) ) |
Definition at line 168 of file nx_bitops.h.
#define NX_FILL_4 | ( | _ptr, | |
_index, | |||
... | |||
) | NX_FILL ( _ptr, _index, NX_ASSEMBLE_4 ( _ptr, _index, __VA_ARGS__ ) ) |
Definition at line 171 of file nx_bitops.h.
#define NX_FILL_5 | ( | _ptr, | |
_index, | |||
... | |||
) | NX_FILL ( _ptr, _index, NX_ASSEMBLE_5 ( _ptr, _index, __VA_ARGS__ ) ) |
Definition at line 174 of file nx_bitops.h.
#define NX_FILL_6 | ( | _ptr, | |
_index, | |||
... | |||
) | NX_FILL ( _ptr, _index, NX_ASSEMBLE_6 ( _ptr, _index, __VA_ARGS__ ) ) |
Definition at line 177 of file nx_bitops.h.
#define NX_FILL_7 | ( | _ptr, | |
_index, | |||
... | |||
) | NX_FILL ( _ptr, _index, NX_ASSEMBLE_7 ( _ptr, _index, __VA_ARGS__ ) ) |
Definition at line 180 of file nx_bitops.h.
#define NX_GET64 | ( | _ptr, | |
_field | |||
) |
Extract value of named field.
Definition at line 184 of file nx_bitops.h.
#define NX_GET | ( | _ptr, | |
_field | |||
) | ( ( unsigned long ) NX_GET64 ( _ptr, _field ) ) |
Extract value of named field (for fields up to the size of a long)
Definition at line 196 of file nx_bitops.h.
typedef unsigned char pseudo_bit_t |
Datatype used to represent a bit in the pseudo-structures.
Definition at line 37 of file nx_bitops.h.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |