iPXE
mlx_bitops.h File Reference

Mellanox bit operations. More...

Go to the source code of this file.

Macros

#define MLX_DECLARE_STRUCT(_structure)
 Wrapper structure for pseudo_bit_t structures.
#define MLX_PSEUDO_STRUCT(_ptr)
 Get pseudo_bit_t structure type from wrapper structure pointer.
#define MLX_BIT_OFFSET(_structure_st, _field)
 Bit offset of a field within a pseudo_bit_t structure.
#define MLX_DWORD_OFFSET(_structure_st, _field)
 Dword offset of a field within a pseudo_bit_t structure.
#define MLX_DWORD_BIT_OFFSET(_structure_st, _index, _field)
 Dword bit offset of a field within a pseudo_bit_t structure.
#define MLX_BIT_WIDTH(_structure_st, _field)
 Bit width of a field within a pseudo_bit_t structure.
#define MLX_BIT_MASK(_structure_st, _field)
 Bit mask for a field within a pseudo_bit_t structure.
#define MLX_ASSEMBLE_1(_structure_st, _index, _field, _value)
#define MLX_ASSEMBLE_2(_structure_st, _index, _field, _value, ...)
#define MLX_ASSEMBLE_3(_structure_st, _index, _field, _value, ...)
#define MLX_ASSEMBLE_4(_structure_st, _index, _field, _value, ...)
#define MLX_ASSEMBLE_5(_structure_st, _index, _field, _value, ...)
#define MLX_ASSEMBLE_6(_structure_st, _index, _field, _value, ...)
#define MLX_ASSEMBLE_7(_structure_st, _index, _field, _value, ...)
#define MLX_ASSEMBLE_8(_structure_st, _index, _field, _value, ...)
#define MLX_MASK_1(_structure_st, _index, _field)
#define MLX_MASK_2(_structure_st, _index, _field, ...)
#define MLX_MASK_3(_structure_st, _index, _field, ...)
#define MLX_MASK_4(_structure_st, _index, _field, ...)
#define MLX_MASK_5(_structure_st, _index, _field, ...)
#define MLX_MASK_6(_structure_st, _index, _field, ...)
#define MLX_MASK_7(_structure_st, _index, _field, ...)
#define MLX_MASK_8(_structure_st, _index, _field, ...)
#define MLX_FILL(_ptr, _index, _assembled)
#define MLX_FILL_1(_ptr, _index, ...)
#define MLX_FILL_2(_ptr, _index, ...)
#define MLX_FILL_3(_ptr, _index, ...)
#define MLX_FILL_4(_ptr, _index, ...)
#define MLX_FILL_5(_ptr, _index, ...)
#define MLX_FILL_6(_ptr, _index, ...)
#define MLX_FILL_7(_ptr, _index, ...)
#define MLX_FILL_8(_ptr, _index, ...)
#define MLX_SET(_ptr, _field, _value)
#define MLX_GET(_ptr, _field)
#define MLX_FILL_H(_structure_st, _index, _field, _address)

Functions

 FILE_LICENCE (GPL2_OR_LATER)

Detailed Description

Mellanox bit operations.

Definition in file mlx_bitops.h.

Macro Definition Documentation

◆ MLX_DECLARE_STRUCT

#define MLX_DECLARE_STRUCT ( _structure)
Value:
_structure { \
union { \
uint8_t bytes[ sizeof ( struct _structure ## _st ) / 8 ]; \
uint32_t dwords[ sizeof ( struct _structure ## _st ) / 32 ]; \
struct _structure ## _st *dummy[0]; \
} __attribute__ (( packed )) u; \
} __attribute__ (( packed ))
unsigned int uint32_t
Definition stdint.h:12
unsigned char uint8_t
Definition stdint.h:10
union @104331263140136355135267063077374276003064103115 u
uint8_t bytes[64]
Definition ib_mad.h:5
#define __attribute__(x)
Definition compiler.h:10

Wrapper structure for pseudo_bit_t structures.

This structure provides a wrapper around the autogenerated pseudo_bit_t structures. It has the correct size, and also encapsulates type information about the underlying pseudo_bit_t structure, which allows the MLX_FILL etc. macros to work without requiring explicit type information.

Definition at line 44 of file mlx_bitops.h.

44#define MLX_DECLARE_STRUCT( _structure ) \
45 _structure { \
46 union { \
47 uint8_t bytes[ sizeof ( struct _structure ## _st ) / 8 ]; \
48 uint32_t dwords[ sizeof ( struct _structure ## _st ) / 32 ]; \
49 struct _structure ## _st *dummy[0]; \
50 } __attribute__ (( packed )) u; \
51 } __attribute__ (( packed ))

◆ MLX_PSEUDO_STRUCT

#define MLX_PSEUDO_STRUCT ( _ptr)
Value:
typeof ( *((_ptr)->u.dummy[0]) )
typeof(acpi_finder=acpi_find)
ACPI table finder.
Definition acpi.c:48

Get pseudo_bit_t structure type from wrapper structure pointer.

Definition at line 54 of file mlx_bitops.h.

54#define MLX_PSEUDO_STRUCT( _ptr ) \
55 typeof ( *((_ptr)->u.dummy[0]) )

◆ MLX_BIT_OFFSET

#define MLX_BIT_OFFSET ( _structure_st,
_field )
Value:
offsetof ( _structure_st, _field )
#define offsetof(type, field)
Get offset of a field within a structure.
Definition stddef.h:25

Bit offset of a field within a pseudo_bit_t structure.

Definition at line 58 of file mlx_bitops.h.

58#define MLX_BIT_OFFSET( _structure_st, _field ) \
59 offsetof ( _structure_st, _field )

◆ MLX_DWORD_OFFSET

#define MLX_DWORD_OFFSET ( _structure_st,
_field )
Value:
( MLX_BIT_OFFSET ( _structure_st, _field ) / 32 )
#define MLX_BIT_OFFSET(_structure_st, _field)
Bit offset of a field within a pseudo_bit_t structure.
Definition mlx_bitops.h:58

Dword offset of a field within a pseudo_bit_t structure.

Definition at line 62 of file mlx_bitops.h.

62#define MLX_DWORD_OFFSET( _structure_st, _field ) \
63 ( MLX_BIT_OFFSET ( _structure_st, _field ) / 32 )

◆ MLX_DWORD_BIT_OFFSET

#define MLX_DWORD_BIT_OFFSET ( _structure_st,
_index,
_field )
Value:
( MLX_BIT_OFFSET ( _structure_st, _field ) - ( 32 * (_index) ) )

Dword bit offset of a field within a pseudo_bit_t structure.

Yes, using mod-32 would work, but would lose the check for the error of specifying a mismatched field name and dword index.

Definition at line 70 of file mlx_bitops.h.

70#define MLX_DWORD_BIT_OFFSET( _structure_st, _index, _field ) \
71 ( MLX_BIT_OFFSET ( _structure_st, _field ) - ( 32 * (_index) ) )

◆ MLX_BIT_WIDTH

#define MLX_BIT_WIDTH ( _structure_st,
_field )
Value:
sizeof ( ( ( _structure_st * ) NULL )->_field )
#define NULL
NULL pointer (VOID *).
Definition Base.h:321

Bit width of a field within a pseudo_bit_t structure.

Definition at line 74 of file mlx_bitops.h.

74#define MLX_BIT_WIDTH( _structure_st, _field ) \
75 sizeof ( ( ( _structure_st * ) NULL )->_field )

◆ MLX_BIT_MASK

#define MLX_BIT_MASK ( _structure_st,
_field )
Value:
( ( ~( ( uint32_t ) 0 ) ) >> \
( 32 - MLX_BIT_WIDTH ( _structure_st, _field ) ) )
#define MLX_BIT_WIDTH(_structure_st, _field)
Bit width of a field within a pseudo_bit_t structure.
Definition mlx_bitops.h:74

Bit mask for a field within a pseudo_bit_t structure.

Definition at line 78 of file mlx_bitops.h.

78#define MLX_BIT_MASK( _structure_st, _field ) \
79 ( ( ~( ( uint32_t ) 0 ) ) >> \
80 ( 32 - MLX_BIT_WIDTH ( _structure_st, _field ) ) )

◆ MLX_ASSEMBLE_1

#define MLX_ASSEMBLE_1 ( _structure_st,
_index,
_field,
_value )
Value:
( ( ( unsigned int ) (_value) ) << \
MLX_DWORD_BIT_OFFSET ( _structure_st, _index, _field ) )

Definition at line 87 of file mlx_bitops.h.

87#define MLX_ASSEMBLE_1( _structure_st, _index, _field, _value ) \
88 ( ( ( unsigned int ) (_value) ) << \
89 MLX_DWORD_BIT_OFFSET ( _structure_st, _index, _field ) )

◆ MLX_ASSEMBLE_2

#define MLX_ASSEMBLE_2 ( _structure_st,
_index,
_field,
_value,
... )
Value:
( MLX_ASSEMBLE_1 ( _structure_st, _index, _field, _value ) | \
MLX_ASSEMBLE_1 ( _structure_st, _index, __VA_ARGS__ ) )
#define MLX_ASSEMBLE_1(_structure_st, _index, _field, _value)
Definition mlx_bitops.h:87

Definition at line 91 of file mlx_bitops.h.

91#define MLX_ASSEMBLE_2( _structure_st, _index, _field, _value, ... ) \
92 ( MLX_ASSEMBLE_1 ( _structure_st, _index, _field, _value ) | \
93 MLX_ASSEMBLE_1 ( _structure_st, _index, __VA_ARGS__ ) )

◆ MLX_ASSEMBLE_3

#define MLX_ASSEMBLE_3 ( _structure_st,
_index,
_field,
_value,
... )
Value:
( MLX_ASSEMBLE_1 ( _structure_st, _index, _field, _value ) | \
MLX_ASSEMBLE_2 ( _structure_st, _index, __VA_ARGS__ ) )

Definition at line 95 of file mlx_bitops.h.

95#define MLX_ASSEMBLE_3( _structure_st, _index, _field, _value, ... ) \
96 ( MLX_ASSEMBLE_1 ( _structure_st, _index, _field, _value ) | \
97 MLX_ASSEMBLE_2 ( _structure_st, _index, __VA_ARGS__ ) )

◆ MLX_ASSEMBLE_4

#define MLX_ASSEMBLE_4 ( _structure_st,
_index,
_field,
_value,
... )
Value:
( MLX_ASSEMBLE_1 ( _structure_st, _index, _field, _value ) | \
MLX_ASSEMBLE_3 ( _structure_st, _index, __VA_ARGS__ ) )

Definition at line 99 of file mlx_bitops.h.

99#define MLX_ASSEMBLE_4( _structure_st, _index, _field, _value, ... ) \
100 ( MLX_ASSEMBLE_1 ( _structure_st, _index, _field, _value ) | \
101 MLX_ASSEMBLE_3 ( _structure_st, _index, __VA_ARGS__ ) )

◆ MLX_ASSEMBLE_5

#define MLX_ASSEMBLE_5 ( _structure_st,
_index,
_field,
_value,
... )
Value:
( MLX_ASSEMBLE_1 ( _structure_st, _index, _field, _value ) | \
MLX_ASSEMBLE_4 ( _structure_st, _index, __VA_ARGS__ ) )

Definition at line 103 of file mlx_bitops.h.

103#define MLX_ASSEMBLE_5( _structure_st, _index, _field, _value, ... ) \
104 ( MLX_ASSEMBLE_1 ( _structure_st, _index, _field, _value ) | \
105 MLX_ASSEMBLE_4 ( _structure_st, _index, __VA_ARGS__ ) )

◆ MLX_ASSEMBLE_6

#define MLX_ASSEMBLE_6 ( _structure_st,
_index,
_field,
_value,
... )
Value:
( MLX_ASSEMBLE_1 ( _structure_st, _index, _field, _value ) | \
MLX_ASSEMBLE_5 ( _structure_st, _index, __VA_ARGS__ ) )

Definition at line 107 of file mlx_bitops.h.

107#define MLX_ASSEMBLE_6( _structure_st, _index, _field, _value, ... ) \
108 ( MLX_ASSEMBLE_1 ( _structure_st, _index, _field, _value ) | \
109 MLX_ASSEMBLE_5 ( _structure_st, _index, __VA_ARGS__ ) )

◆ MLX_ASSEMBLE_7

#define MLX_ASSEMBLE_7 ( _structure_st,
_index,
_field,
_value,
... )
Value:
( MLX_ASSEMBLE_1 ( _structure_st, _index, _field, _value ) | \
MLX_ASSEMBLE_6 ( _structure_st, _index, __VA_ARGS__ ) )

Definition at line 111 of file mlx_bitops.h.

111#define MLX_ASSEMBLE_7( _structure_st, _index, _field, _value, ... ) \
112 ( MLX_ASSEMBLE_1 ( _structure_st, _index, _field, _value ) | \
113 MLX_ASSEMBLE_6 ( _structure_st, _index, __VA_ARGS__ ) )

◆ MLX_ASSEMBLE_8

#define MLX_ASSEMBLE_8 ( _structure_st,
_index,
_field,
_value,
... )
Value:
( MLX_ASSEMBLE_1 ( _structure_st, _index, _field, _value ) | \
MLX_ASSEMBLE_7 ( _structure_st, _index, __VA_ARGS__ ) )

Definition at line 115 of file mlx_bitops.h.

115#define MLX_ASSEMBLE_8( _structure_st, _index, _field, _value, ... ) \
116 ( MLX_ASSEMBLE_1 ( _structure_st, _index, _field, _value ) | \
117 MLX_ASSEMBLE_7 ( _structure_st, _index, __VA_ARGS__ ) )

◆ MLX_MASK_1

#define MLX_MASK_1 ( _structure_st,
_index,
_field )
Value:
( MLX_BIT_MASK ( _structure_st, _field ) << \
MLX_DWORD_BIT_OFFSET ( _structure_st, _index, _field ) )
#define MLX_BIT_MASK(_structure_st, _field)
Bit mask for a field within a pseudo_bit_t structure.
Definition mlx_bitops.h:78

Definition at line 124 of file mlx_bitops.h.

124#define MLX_MASK_1( _structure_st, _index, _field ) \
125 ( MLX_BIT_MASK ( _structure_st, _field ) << \
126 MLX_DWORD_BIT_OFFSET ( _structure_st, _index, _field ) )

◆ MLX_MASK_2

#define MLX_MASK_2 ( _structure_st,
_index,
_field,
... )
Value:
( MLX_MASK_1 ( _structure_st, _index, _field ) | \
MLX_MASK_1 ( _structure_st, _index, __VA_ARGS__ ) )
#define MLX_MASK_1(_structure_st, _index, _field)
Definition mlx_bitops.h:124

Definition at line 128 of file mlx_bitops.h.

128#define MLX_MASK_2( _structure_st, _index, _field, ... ) \
129 ( MLX_MASK_1 ( _structure_st, _index, _field ) | \
130 MLX_MASK_1 ( _structure_st, _index, __VA_ARGS__ ) )

◆ MLX_MASK_3

#define MLX_MASK_3 ( _structure_st,
_index,
_field,
... )
Value:
( MLX_MASK_1 ( _structure_st, _index, _field ) | \
MLX_MASK_2 ( _structure_st, _index, __VA_ARGS__ ) )

Definition at line 132 of file mlx_bitops.h.

132#define MLX_MASK_3( _structure_st, _index, _field, ... ) \
133 ( MLX_MASK_1 ( _structure_st, _index, _field ) | \
134 MLX_MASK_2 ( _structure_st, _index, __VA_ARGS__ ) )

◆ MLX_MASK_4

#define MLX_MASK_4 ( _structure_st,
_index,
_field,
... )
Value:
( MLX_MASK_1 ( _structure_st, _index, _field ) | \
MLX_MASK_3 ( _structure_st, _index, __VA_ARGS__ ) )

Definition at line 136 of file mlx_bitops.h.

136#define MLX_MASK_4( _structure_st, _index, _field, ... ) \
137 ( MLX_MASK_1 ( _structure_st, _index, _field ) | \
138 MLX_MASK_3 ( _structure_st, _index, __VA_ARGS__ ) )

◆ MLX_MASK_5

#define MLX_MASK_5 ( _structure_st,
_index,
_field,
... )
Value:
( MLX_MASK_1 ( _structure_st, _index, _field ) | \
MLX_MASK_4 ( _structure_st, _index, __VA_ARGS__ ) )

Definition at line 140 of file mlx_bitops.h.

140#define MLX_MASK_5( _structure_st, _index, _field, ... ) \
141 ( MLX_MASK_1 ( _structure_st, _index, _field ) | \
142 MLX_MASK_4 ( _structure_st, _index, __VA_ARGS__ ) )

◆ MLX_MASK_6

#define MLX_MASK_6 ( _structure_st,
_index,
_field,
... )
Value:
( MLX_MASK_1 ( _structure_st, _index, _field ) | \
MLX_MASK_5 ( _structure_st, _index, __VA_ARGS__ ) )

Definition at line 144 of file mlx_bitops.h.

144#define MLX_MASK_6( _structure_st, _index, _field, ... ) \
145 ( MLX_MASK_1 ( _structure_st, _index, _field ) | \
146 MLX_MASK_5 ( _structure_st, _index, __VA_ARGS__ ) )

◆ MLX_MASK_7

#define MLX_MASK_7 ( _structure_st,
_index,
_field,
... )
Value:
( MLX_MASK_1 ( _structure_st, _index, _field ) | \
MLX_MASK_6 ( _structure_st, _index, __VA_ARGS__ ) )

Definition at line 148 of file mlx_bitops.h.

148#define MLX_MASK_7( _structure_st, _index, _field, ... ) \
149 ( MLX_MASK_1 ( _structure_st, _index, _field ) | \
150 MLX_MASK_6 ( _structure_st, _index, __VA_ARGS__ ) )

◆ MLX_MASK_8

#define MLX_MASK_8 ( _structure_st,
_index,
_field,
... )
Value:
( MLX_MASK_1 ( _structure_st, _index, _field ) | \
MLX_MASK_7 ( _structure_st, _index, __VA_ARGS__ ) )

Definition at line 152 of file mlx_bitops.h.

152#define MLX_MASK_8( _structure_st, _index, _field, ... ) \
153 ( MLX_MASK_1 ( _structure_st, _index, _field ) | \
154 MLX_MASK_7 ( _structure_st, _index, __VA_ARGS__ ) )

◆ MLX_FILL

#define MLX_FILL ( _ptr,
_index,
_assembled )
Value:
do { \
uint32_t *__ptr = &(_ptr)->u.dwords[(_index)]; \
uint32_t __assembled = (_assembled); \
*__ptr = cpu_to_be32 ( __assembled ); \
} while ( 0 )
#define cpu_to_be32(value)
Definition byteswap.h:111

Definition at line 161 of file mlx_bitops.h.

161#define MLX_FILL( _ptr, _index, _assembled ) \
162 do { \
163 uint32_t *__ptr = &(_ptr)->u.dwords[(_index)]; \
164 uint32_t __assembled = (_assembled); \
165 *__ptr = cpu_to_be32 ( __assembled ); \
166 } while ( 0 )

◆ MLX_FILL_1

#define MLX_FILL_1 ( _ptr,
_index,
... )
Value:
MLX_FILL ( _ptr, _index, MLX_ASSEMBLE_1 ( MLX_PSEUDO_STRUCT ( _ptr ),\
_index, __VA_ARGS__ ) )
#define MLX_PSEUDO_STRUCT(_ptr)
Get pseudo_bit_t structure type from wrapper structure pointer.
Definition mlx_bitops.h:54
#define MLX_FILL(_ptr, _index, _assembled)
Definition mlx_bitops.h:161

Definition at line 168 of file mlx_bitops.h.

168#define MLX_FILL_1( _ptr, _index, ... ) \
169 MLX_FILL ( _ptr, _index, MLX_ASSEMBLE_1 ( MLX_PSEUDO_STRUCT ( _ptr ),\
170 _index, __VA_ARGS__ ) )

Referenced by arbel_alloc_icm(), arbel_cmd(), arbel_complete(), arbel_create_cq(), arbel_create_eq(), arbel_create_qp(), arbel_create_recv_wq(), arbel_create_send_wq(), arbel_destroy_cq(), arbel_destroy_eq(), arbel_destroy_qp(), arbel_fill_mlx_send_wqe(), arbel_fill_rc_send_wqe(), arbel_fill_ud_send_wqe(), arbel_free_icm(), arbel_ib_open(), arbel_map_vpm(), arbel_modify_qp(), arbel_poll_cq(), arbel_poll_eq(), arbel_post_recv(), arbel_post_send(), arbel_setup_mpt(), flexboot_nodnic_post_recv(), hermon_alloc_mtt(), hermon_bofm_update(), hermon_cmd(), hermon_create_cq(), hermon_create_eq(), hermon_create_qp(), hermon_eth_open(), hermon_fill_eth_send_wqe(), hermon_fill_mlx_send_wqe(), hermon_fill_nop_send_wqe(), hermon_fill_rc_send_wqe(), hermon_fill_ud_send_wqe(), hermon_ib_open(), hermon_map_icm(), hermon_map_vpm(), hermon_mcast_attach(), hermon_modify_qp(), hermon_poll_cq(), hermon_poll_eq(), hermon_post_recv(), hermon_post_send(), hermon_setup_mpt(), hermon_start(), hermon_unmap_icm(), shomron_cqe_set_owner(), and shomron_fill_eth_send_wqe().

◆ MLX_FILL_2

#define MLX_FILL_2 ( _ptr,
_index,
... )
Value:
MLX_FILL ( _ptr, _index, MLX_ASSEMBLE_2 ( MLX_PSEUDO_STRUCT ( _ptr ),\
_index, __VA_ARGS__ ) )
#define MLX_ASSEMBLE_2(_structure_st, _index, _field, _value,...)
Definition mlx_bitops.h:91

Definition at line 172 of file mlx_bitops.h.

172#define MLX_FILL_2( _ptr, _index, ... ) \
173 MLX_FILL ( _ptr, _index, MLX_ASSEMBLE_2 ( MLX_PSEUDO_STRUCT ( _ptr ),\
174 _index, __VA_ARGS__ ) )

Referenced by arbel_alloc_icm(), arbel_create_cq(), arbel_create_qp(), arbel_fill_ud_send_wqe(), arbel_map_vpm(), arbel_mcast_attach(), arbel_modify_qp(), arbel_post_send(), arbel_setup_mpt(), hermon_alloc_mtt(), hermon_bofm_update(), hermon_create_cq(), hermon_create_eq(), hermon_create_qp(), hermon_eth_open(), hermon_fill_eth_send_wqe(), hermon_fill_ud_send_wqe(), hermon_ib_open(), hermon_map_icm(), hermon_map_vpm(), hermon_mod_stat_cfg(), hermon_modify_qp(), hermon_post_send(), and shomron_fill_eth_send_wqe().

◆ MLX_FILL_3

#define MLX_FILL_3 ( _ptr,
_index,
... )
Value:
MLX_FILL ( _ptr, _index, MLX_ASSEMBLE_3 ( MLX_PSEUDO_STRUCT ( _ptr ),\
_index, __VA_ARGS__ ) )
#define MLX_ASSEMBLE_3(_structure_st, _index, _field, _value,...)
Definition mlx_bitops.h:95

Definition at line 176 of file mlx_bitops.h.

176#define MLX_FILL_3( _ptr, _index, ... ) \
177 MLX_FILL ( _ptr, _index, MLX_ASSEMBLE_3 ( MLX_PSEUDO_STRUCT ( _ptr ),\
178 _index, __VA_ARGS__ ) )

Referenced by arbel_cmd(), arbel_create_qp(), arbel_ib_open(), arbel_post_send(), and hermon_eth_open().

◆ MLX_FILL_4

#define MLX_FILL_4 ( _ptr,
_index,
... )
Value:
MLX_FILL ( _ptr, _index, MLX_ASSEMBLE_4 ( MLX_PSEUDO_STRUCT ( _ptr ),\
_index, __VA_ARGS__ ) )
#define MLX_ASSEMBLE_4(_structure_st, _index, _field, _value,...)
Definition mlx_bitops.h:99

Definition at line 180 of file mlx_bitops.h.

180#define MLX_FILL_4( _ptr, _index, ... ) \
181 MLX_FILL ( _ptr, _index, MLX_ASSEMBLE_4 ( MLX_PSEUDO_STRUCT ( _ptr ),\
182 _index, __VA_ARGS__ ) )

Referenced by arbel_create_qp(), arbel_post_send(), hermon_cmd(), and hermon_create_qp().

◆ MLX_FILL_5

#define MLX_FILL_5 ( _ptr,
_index,
... )
Value:
MLX_FILL ( _ptr, _index, MLX_ASSEMBLE_5 ( MLX_PSEUDO_STRUCT ( _ptr ),\
_index, __VA_ARGS__ ) )
#define MLX_ASSEMBLE_5(_structure_st, _index, _field, _value,...)
Definition mlx_bitops.h:103

Definition at line 184 of file mlx_bitops.h.

184#define MLX_FILL_5( _ptr, _index, ... ) \
185 MLX_FILL ( _ptr, _index, MLX_ASSEMBLE_5 ( MLX_PSEUDO_STRUCT ( _ptr ),\
186 _index, __VA_ARGS__ ) )

Referenced by arbel_fill_mlx_send_wqe(), and hermon_fill_mlx_send_wqe().

◆ MLX_FILL_6

#define MLX_FILL_6 ( _ptr,
_index,
... )
Value:
MLX_FILL ( _ptr, _index, MLX_ASSEMBLE_6 ( MLX_PSEUDO_STRUCT ( _ptr ),\
_index, __VA_ARGS__ ) )
#define MLX_ASSEMBLE_6(_structure_st, _index, _field, _value,...)
Definition mlx_bitops.h:107

Definition at line 188 of file mlx_bitops.h.

188#define MLX_FILL_6( _ptr, _index, ... ) \
189 MLX_FILL ( _ptr, _index, MLX_ASSEMBLE_6 ( MLX_PSEUDO_STRUCT ( _ptr ),\
190 _index, __VA_ARGS__ ) )

◆ MLX_FILL_7

#define MLX_FILL_7 ( _ptr,
_index,
... )
Value:
MLX_FILL ( _ptr, _index, MLX_ASSEMBLE_7 ( MLX_PSEUDO_STRUCT ( _ptr ),\
_index, __VA_ARGS__ ) )
#define MLX_ASSEMBLE_7(_structure_st, _index, _field, _value,...)
Definition mlx_bitops.h:111

Definition at line 192 of file mlx_bitops.h.

192#define MLX_FILL_7( _ptr, _index, ... ) \
193 MLX_FILL ( _ptr, _index, MLX_ASSEMBLE_7 ( MLX_PSEUDO_STRUCT ( _ptr ),\
194 _index, __VA_ARGS__ ) )

Referenced by arbel_setup_mpt(), and hermon_setup_mpt().

◆ MLX_FILL_8

#define MLX_FILL_8 ( _ptr,
_index,
... )
Value:
MLX_FILL ( _ptr, _index, MLX_ASSEMBLE_8 ( MLX_PSEUDO_STRUCT ( _ptr ),\
_index, __VA_ARGS__ ) )
#define MLX_ASSEMBLE_8(_structure_st, _index, _field, _value,...)
Definition mlx_bitops.h:115

Definition at line 196 of file mlx_bitops.h.

196#define MLX_FILL_8( _ptr, _index, ... ) \
197 MLX_FILL ( _ptr, _index, MLX_ASSEMBLE_8 ( MLX_PSEUDO_STRUCT ( _ptr ),\
198 _index, __VA_ARGS__ ) )

Referenced by hermon_ib_open().

◆ MLX_SET

#define MLX_SET ( _ptr,
_field,
_value )
Value:
do { \
unsigned int __index = \
MLX_DWORD_OFFSET ( MLX_PSEUDO_STRUCT ( _ptr ), _field ); \
uint32_t *__ptr = &(_ptr)->u.dwords[__index]; \
uint32_t __value = be32_to_cpu ( *__ptr ); \
__value &= ~( MLX_MASK_1 ( MLX_PSEUDO_STRUCT ( _ptr ), \
__index, _field ) ); \
__value |= MLX_ASSEMBLE_1 ( MLX_PSEUDO_STRUCT ( _ptr ), \
__index, _field, _value ); \
*__ptr = cpu_to_be32 ( __value ); \
} while ( 0 )
#define be32_to_cpu(value)
Definition byteswap.h:117

Definition at line 205 of file mlx_bitops.h.

205#define MLX_SET( _ptr, _field, _value ) \
206 do { \
207 unsigned int __index = \
208 MLX_DWORD_OFFSET ( MLX_PSEUDO_STRUCT ( _ptr ), _field ); \
209 uint32_t *__ptr = &(_ptr)->u.dwords[__index]; \
210 uint32_t __value = be32_to_cpu ( *__ptr ); \
211 __value &= ~( MLX_MASK_1 ( MLX_PSEUDO_STRUCT ( _ptr ), \
212 __index, _field ) ); \
213 __value |= MLX_ASSEMBLE_1 ( MLX_PSEUDO_STRUCT ( _ptr ), \
214 __index, _field, _value ); \
215 *__ptr = cpu_to_be32 ( __value ); \
216 } while ( 0 )

Referenced by arbel_post_send().

◆ MLX_GET

#define MLX_GET ( _ptr,
_field )
Value:
( { \
unsigned int __index = \
MLX_DWORD_OFFSET ( MLX_PSEUDO_STRUCT ( _ptr ), _field ); \
uint32_t *__ptr = &(_ptr)->u.dwords[__index]; \
uint32_t __value = be32_to_cpu ( *__ptr ); \
__value >>= \
MLX_DWORD_BIT_OFFSET ( MLX_PSEUDO_STRUCT ( _ptr ), \
__index, _field ); \
__value &= \
MLX_BIT_MASK ( MLX_PSEUDO_STRUCT ( _ptr ), _field ); \
__value; \
} )

Definition at line 223 of file mlx_bitops.h.

223#define MLX_GET( _ptr, _field ) \
224 ( { \
225 unsigned int __index = \
226 MLX_DWORD_OFFSET ( MLX_PSEUDO_STRUCT ( _ptr ), _field ); \
227 uint32_t *__ptr = &(_ptr)->u.dwords[__index]; \
228 uint32_t __value = be32_to_cpu ( *__ptr ); \
229 __value >>= \
230 MLX_DWORD_BIT_OFFSET ( MLX_PSEUDO_STRUCT ( _ptr ), \
231 __index, _field ); \
232 __value &= \
233 MLX_BIT_MASK ( MLX_PSEUDO_STRUCT ( _ptr ), _field ); \
234 __value; \
235 } )

Referenced by arbel_alloc_icm(), arbel_cmd(), arbel_cmd_wait(), arbel_complete(), arbel_event_port_state_change(), arbel_get_limits(), arbel_mcast_attach(), arbel_mcast_detach(), arbel_poll_cq(), arbel_poll_eq(), arbel_start_firmware(), hermon_bofm_harvest(), hermon_cmd(), hermon_cmd_wait(), hermon_complete(), hermon_dump_eqes(), hermon_dump_qpctx(), hermon_event_port_mgmnt_change(), hermon_event_port_state_change(), hermon_get_cap(), hermon_map_icm(), hermon_mcast_attach(), hermon_mcast_detach(), hermon_poll_cq(), hermon_poll_eq(), hermon_sense_port_type(), hermon_set_port_type(), hermon_start_firmware(), shomron_fill_completion(), and shomron_tx_uar_send_db().

◆ MLX_FILL_H

#define MLX_FILL_H ( _structure_st,
_index,
_field,
_address )
Value:
do { \
if ( sizeof ( physaddr_t ) > sizeof ( uint32_t ) ) { \
MLX_FILL_1 ( _structure_st, _index, _field, \
( ( ( uint64_t ) (_address) ) >> 32 ) ); \
} } while ( 0 )
unsigned long physaddr_t
Definition stdint.h:20
unsigned long long uint64_t
Definition stdint.h:13

Definition at line 241 of file mlx_bitops.h.

241#define MLX_FILL_H( _structure_st, _index, _field, _address ) do { \
242 if ( sizeof ( physaddr_t ) > sizeof ( uint32_t ) ) { \
243 MLX_FILL_1 ( _structure_st, _index, _field, \
244 ( ( ( uint64_t ) (_address) ) >> 32 ) ); \
245 } } while ( 0 )

Referenced by arbel_cmd(), arbel_create_cq(), arbel_create_eq(), arbel_create_qp(), arbel_fill_mlx_send_wqe(), arbel_fill_rc_send_wqe(), arbel_fill_ud_send_wqe(), arbel_map_vpm(), arbel_post_recv(), flexboot_nodnic_post_recv(), hermon_alloc_mtt(), hermon_cmd(), hermon_create_cq(), hermon_create_eq(), hermon_create_qp(), hermon_fill_eth_send_wqe(), hermon_fill_mlx_send_wqe(), hermon_fill_rc_send_wqe(), hermon_fill_ud_send_wqe(), hermon_map_vpm(), hermon_post_recv(), and shomron_fill_eth_send_wqe().

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER )