staticinline u64 _iba_get64(const __be64 *ptr)
{ /* * The mads are constructed so that 32 bit and smaller are naturally * aligned, everything larger has a max alignment of 4 bytes.
*/ return be64_to_cpu(get_unaligned(ptr));
}
/* FIXME: A set should always set the entire field, meaning we should zero the trailing bytes */ #define _IBA_SET_MEM(field_struct, field_offset, type, num_bits, ptr, in, \
bytes) \
({ \ const type *_in_ptr = in; \
WARN_ON(bytes * 8 > num_bits); \ if (in && bytes) \
memcpy(_IBA_GET_MEM_PTR(field_struct, field_offset, \
type, num_bits, ptr), \
_in_ptr, bytes); \
}) #define IBA_SET_MEM(field, ptr, in, bytes) _IBA_SET_MEM(field, ptr, in, bytes)
/* * The generated list becomes the parameters to the macros, the order is: * - struct this applies to * - starting offset of the max * - GENMASK or GENMASK_ULL in CPU order * - The width of data the mask operations should work on, in bits
*/
/* * Extraction using a tabular description like table 106. bit_offset is from * the Byte[Bit] notation.
*/ #define IBA_FIELD_BLOC(field_struct, byte_offset, bit_offset, num_bits) \
field_struct, byte_offset, \
GENMASK(7 - (bit_offset), 7 - (bit_offset) - (num_bits - 1)), \
8 #define IBA_FIELD8_LOC(field_struct, byte_offset, num_bits) \
IBA_FIELD_BLOC(field_struct, byte_offset, 0, num_bits)
#define IBA_FIELD64_LOC(field_struct, byte_offset) \
field_struct, byte_offset, GENMASK_ULL(63, 0), 64 /* * In IBTA spec, everything that is more than 64bits is multiple * of bytes without leftover bits.
*/ #define IBA_FIELD_MLOC(field_struct, byte_offset, num_bits, type) \
field_struct, byte_offset, type, num_bits
#endif/* _IBA_DEFS_H_ */
Messung V0.5
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.