]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[hermon] Add missing __attribute__ (( packed ))
authorMichael Brown <mcb30@ipxe.org>
Wed, 16 Feb 2011 18:38:26 +0000 (18:38 +0000)
committerMichael Brown <mcb30@ipxe.org>
Thu, 17 Feb 2011 01:25:10 +0000 (01:25 +0000)
On 64-bit builds, MLX_DECLARE_STRUCT() produces a structure that is
always a multiple of 64 bits long, causing the HCR structure to be
over-length by one dword.  This in turn causes hermon_cmd() to write
beyond the end of the HCR, which causes commands to fail.

Reported-by: Itay Gazit <itayg@mellanox.co.il>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/infiniband/mlx_bitops.h

index 5215f9a8a022fac6f72c61d29f3a36476a425f71..0c3b54771ef3281b3e4eaab0e8afca34b98c7a7e 100644 (file)
@@ -46,8 +46,8 @@ typedef unsigned char pseudo_bit_t;
                uint8_t bytes[ sizeof ( struct _structure ## _st ) / 8 ];    \
                uint32_t dwords[ sizeof ( struct _structure ## _st ) / 32 ]; \
                struct _structure ## _st *dummy[0];                          \
-           } u;                                                             \
-       }
+           } __attribute__ (( packed )) u;                                  \
+       } __attribute__ (( packed ))
 
 /** Get pseudo_bit_t structure type from wrapper structure pointer */
 #define MLX_PSEUDO_STRUCT( _ptr )                                           \