diff options
| author | Michael Brown | 2007-09-14 11:17:29 +0200 |
|---|---|---|
| committer | Michael Brown | 2007-09-14 11:17:29 +0200 |
| commit | e9df4f691e8c3fce1a39464c0612ee627e545087 (patch) | |
| tree | e2799f16a228f22c3ac331be45b4fa954b3935e1 /src/drivers/net | |
| parent | Start constructing a generic poll() routine. (diff) | |
| download | ipxe-e9df4f691e8c3fce1a39464c0612ee627e545087.tar.gz ipxe-e9df4f691e8c3fce1a39464c0612ee627e545087.tar.xz ipxe-e9df4f691e8c3fce1a39464c0612ee627e545087.zip | |
Add EX_FLD_BE()
Diffstat (limited to 'src/drivers/net')
| -rw-r--r-- | src/drivers/net/mlx_ipoib/bit_ops.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/drivers/net/mlx_ipoib/bit_ops.h b/src/drivers/net/mlx_ipoib/bit_ops.h index e3fb4331f..b67f92ce9 100644 --- a/src/drivers/net/mlx_ipoib/bit_ops.h +++ b/src/drivers/net/mlx_ipoib/bit_ops.h @@ -81,6 +81,14 @@ struct addr_64_st { #define MT_EXTRACT_ARRAY32(A,O,S) MT_EXTRACT32(((__u32*)A)[O >> 5],(O & MASK32(5)),S) /* + * MT_EXTRACT_ARRAY32_BE macro is similar to EXTRACT but works on an array of (__u32), + * thus offset may be larger than 32 (but not size). + * + * (added by mcb30) + */ +#define MT_EXTRACT_ARRAY32_BE(A,O,S) MT_EXTRACT32(be32_to_cpu(((__u32*)A)[O >> 5]),(O & MASK32(5)),S) + +/* * MT_INSERT_ARRAY32 macro is similar to INSERT but works on an array of (__u32), * thus offset may be larger than 32 (but not size). */ @@ -90,6 +98,8 @@ struct addr_64_st { #define EX_FLD(a, st, fld) MT_EXTRACT_ARRAY32(a, MT_BIT_OFFSET(st, fld), MT_BIT_SIZE(st, fld)) +#define EX_FLD_BE(a, st, fld) MT_EXTRACT_ARRAY32_BE(a, MT_BIT_OFFSET(st, fld), MT_BIT_SIZE(st, fld)) + /* return the address of the dword holding the field buf = pointer to buffer where to place the value |
