|
From: Peter K. <pk...@us...> - 2001-09-18 12:14:35
|
The following file was modified in linux/include/linux/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
btcommon.h 1.83 1.84=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Added GET_BITS() and SET_BITS() to get and set a number of bits
from a variable.
The diff of the modified file(s):
--- btcommon.h 2001/09/10 10:16:22 1.83
+++ btcommon.h 2001/09/18 12:14:35 1.84
@@ -85,12 +85,20 @@
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
=20
+#define GET_BITS(var, bit, bits) (((var) >> (bit)) & ((1UL << (bits)) - 1))
+#define SET_BITS(var, bit, bits, x) \
+ do { \
+ (var) =3D ((var) & ~(((1UL << (bits)) - 1) << (bit))) | \
+ (((x) & ((1UL << (bits)) - 1)) << (bit)); \
+ } while (0)
+
#define CHAR2INT10(c1,c0) (((u32)((c1) & 0x03) << 8) + (u32)((c0) & 0xff))
#define CHAR2INT12(c1,c0) (((u32)((c1) & 0x0f) << 8) + (u32)((c0) & 0xff))
#define CHAR2INT16(c1,c0) (((u32)((c1) & 0xff) << 8) + (u32)((c0) & 0xff))
#define CHAR2INT32(c3,c2,c1,c0) (((u32)((c3) & 0xff) << 24) + \
((u32)((c2) & 0xff) << 16) + \
((u32)((c1) & 0xff) << 8) + (u32)((c0) &0xff))
+
/* extract line number from tty */
#define GET_TTYLINE(tty) (MINOR(tty->device) - tty->driver.minor_start)
=20
|