Add OS_REG_RMW, which mirrors ath9k's REG_RMW.

This macro does a read-modify-write pass with register bits to set and clear.
This commit is contained in:
Adrian Chadd 2011-04-13 03:05:15 +00:00
parent 1c554472de
commit 132163b12f

View File

@ -468,6 +468,8 @@ isBigEndian(void)
*/
#define SM(_v, _f) (((_v) << _f##_S) & (_f))
#define MS(_v, _f) (((_v) & (_f)) >> _f##_S)
#define OS_REG_RMW(_a, _r, _set, _clr) \
OS_REG_WRITE(_a, _r, (OS_REG_READ(_a, _r) & ~(_clr)) | (_set))
#define OS_REG_RMW_FIELD(_a, _r, _f, _v) \
OS_REG_WRITE(_a, _r, \
(OS_REG_READ(_a, _r) &~ (_f)) | (((_v) << _f##_S) & (_f)))