david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

Add EX_FLD_BE()

This commit is contained in:
Michael Brown 2007-09-14 10:17:29 +01:00
parent da23e8d287
commit e9df4f691e
1 changed files with 10 additions and 0 deletions

View File

@ -80,6 +80,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