svn commit: r220588 - head/sys/dev/ath/ath_hal
Adrian Chadd
adrian at FreeBSD.org
Wed Apr 13 03:05:15 UTC 2011
Author: adrian
Date: Wed Apr 13 03:05:15 2011
New Revision: 220588
URL: http://svn.freebsd.org/changeset/base/220588
Log:
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.
Modified:
head/sys/dev/ath/ath_hal/ah_internal.h
Modified: head/sys/dev/ath/ath_hal/ah_internal.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ah_internal.h Wed Apr 13 02:40:45 2011 (r220587)
+++ head/sys/dev/ath/ath_hal/ah_internal.h Wed Apr 13 03:05:15 2011 (r220588)
@@ -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)))
More information about the svn-src-all
mailing list