Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107108235
D44976.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D44976.diff
View Options
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -635,6 +635,8 @@
bitset.9 BIT_CMP.9 \
bitset.9 BIT_OR.9 \
bitset.9 BIT_OR2.9 \
+ bitset.9 BIT_ORNOT.9 \
+ bitset.9 BIT_ORNOT2.9 \
bitset.9 BIT_AND.9 \
bitset.9 BIT_AND2.9 \
bitset.9 BIT_ANDNOT.9 \
@@ -924,6 +926,7 @@
cpuset.9 CPU_OVERLAP.9 \
cpuset.9 CPU_CMP.9 \
cpuset.9 CPU_OR.9 \
+ cpuset.9 CPU_ORNOT.9 \
cpuset.9 CPU_AND.9 \
cpuset.9 CPU_ANDNOT.9 \
cpuset.9 CPU_CLR_ATOMIC.9 \
diff --git a/share/man/man9/bitset.9 b/share/man/man9/bitset.9
--- a/share/man/man9/bitset.9
+++ b/share/man/man9/bitset.9
@@ -51,6 +51,8 @@
.Nm BIT_CMP ,
.Nm BIT_OR ,
.Nm BIT_OR2 ,
+.Nm BIT_ORNOT ,
+.Nm BIT_ORNOT2 ,
.Nm BIT_AND ,
.Nm BIT_AND2 ,
.Nm BIT_ANDNOT ,
@@ -123,6 +125,13 @@
.Fa "struct STRUCTNAME *src1"
.Fa "struct STRUCTNAME *src2"
.Fc
+.Fn BIT_ORNOT "const SETSIZE" "struct STRUCTNAME *dst" "struct STRUCTNAME *src"
+.Fo BIT_ORNOT2
+.Fa "const SETSIZE"
+.Fa "struct STRUCTNAME *dst"
+.Fa "struct STRUCTNAME *src1"
+.Fa "struct STRUCTNAME *src2"
+.Fc
.Fn BIT_AND "const SETSIZE" "struct STRUCTNAME *dst" "struct STRUCTNAME *src"
.Fo BIT_AND2
.Fa "const SETSIZE"
@@ -459,6 +468,36 @@
.Fa src2 . )
.Pp
The
+.Fn BIT_ORNOT
+macro sets bits not in
+.Fa src
+in
+.Fa dst .
+(It is the
+.Nm
+equivalent of the scalar:
+.Fa dst
+|=
+.Fa ~ src . )
+.Pp
+The
+.Fn BIT_ORNOT2
+macro computes
+.Fa src1
+bitwise or not
+.Fa src2
+and assigns the result to
+.Fa dst .
+(It is the
+.Nm
+equivalent of the scalar:
+.Fa dst
+=
+.Fa src1
+| ~
+.Fa src2 . )
+.Pp
+The
.Fn BIT_AND
macro clears bits absent from
.Fa src
diff --git a/share/man/man9/cpuset.9 b/share/man/man9/cpuset.9
--- a/share/man/man9/cpuset.9
+++ b/share/man/man9/cpuset.9
@@ -45,6 +45,7 @@
.Nm CPU_OVERLAP ,
.Nm CPU_CMP ,
.Nm CPU_OR ,
+.Nm CPU_ORNOT ,
.Nm CPU_AND ,
.Nm CPU_ANDNOT ,
.Nm CPU_XOR ,
@@ -86,6 +87,7 @@
.Ft bool
.Fn CPU_CMP "cpuset_t *cpuset1" "cpuset_t *cpuset2"
.Fn CPU_OR "cpuset_t *dst" "cpuset_t *src1" "cpuset_t *src2"
+.Fn CPU_ORNOT "cpuset_t *dst" "cpuset_t *src1" "cpuset_t *src2"
.Fn CPU_AND "cpuset_t *dst" "cpuset_t *src1" "cpuset_t *src2"
.Fn CPU_ANDNOT "cpuset_t *dst" "cpuset_t *src1" "cpuset_t *src2"
.Fn CPU_XOR "cpuset_t *dst" "cpuset_t *src1" "cpuset_t *src2"
@@ -296,6 +298,19 @@
performs multiple individually atomic operations.)
.Pp
The
+.Fn CPU_ORNOT
+macro add CPUs not in
+.Fa src
+to
+.Fa dst .
+(It is the
+.Nm
+equivalent of the scalar:
+.Fa dst
+|=
+.Fa ~ src . )
+.Pp
+The
.Fn CPU_AND
macro removes CPUs absent from
.Fa src
diff --git a/sys/sys/bitset.h b/sys/sys/bitset.h
--- a/sys/sys/bitset.h
+++ b/sys/sys/bitset.h
@@ -135,6 +135,18 @@
(d)->__bits[__i] = (s1)->__bits[__i] | (s2)->__bits[__i];\
} while (0)
+#define __BIT_ORNOT(_s, d, s) do { \
+ __size_t __i; \
+ for (__i = 0; __i < __bitset_words((_s)); __i++) \
+ (d)->__bits[__i] |= ~(s)->__bits[__i]; \
+} while (0)
+
+#define __BIT_ORNOT2(_s, d, s1, s2) do { \
+ __size_t __i; \
+ for (__i = 0; __i < __bitset_words((_s)); __i++) \
+ (d)->__bits[__i] = (s1)->__bits[__i] | ~(s2)->__bits[__i];\
+} while (0)
+
#define __BIT_AND(_s, d, s) do { \
__size_t __i; \
for (__i = 0; __i < __bitset_words((_s)); __i++) \
@@ -330,6 +342,8 @@
#define BIT_ISSET(_s, n, p) __BIT_ISSET(_s, n, p)
#define BIT_OR(_s, d, s) __BIT_OR(_s, d, s)
#define BIT_OR2(_s, d, s1, s2) __BIT_OR2(_s, d, s1, s2)
+#define BIT_ORNOT(_s, d, s) __BIT_ORNOT(_s, d, s)
+#define BIT_ORNOT2(_s, d, s1, s2) __BIT_ORNOT2(_s, d, s1, s2)
#define BIT_OR_ATOMIC(_s, d, s) __BIT_OR_ATOMIC(_s, d, s)
#define BIT_OVERLAP(_s, p, c) __BIT_OVERLAP(_s, p, c)
#define BIT_SET(_s, n, p) __BIT_SET(_s, n, p)
diff --git a/sys/sys/cpuset.h b/sys/sys/cpuset.h
--- a/sys/sys/cpuset.h
+++ b/sys/sys/cpuset.h
@@ -56,6 +56,7 @@
#define CPU_OVERLAP(p, c) __BIT_OVERLAP(CPU_SETSIZE, p, c)
#define CPU_CMP(p, c) __BIT_CMP(CPU_SETSIZE, p, c)
#define CPU_OR(d, s1, s2) __BIT_OR2(CPU_SETSIZE, d, s1, s2)
+#define CPU_ORNOT(d, s1, s2) __BIT_ORNOT2(CPU_SETSIZE, d, s1, s2)
#define CPU_AND(d, s1, s2) __BIT_AND2(CPU_SETSIZE, d, s1, s2)
#define CPU_ANDNOT(d, s1, s2) __BIT_ANDNOT2(CPU_SETSIZE, d, s1, s2)
#define CPU_XOR(d, s1, s2) __BIT_XOR2(CPU_SETSIZE, d, s1, s2)
diff --git a/sys/sys/domainset.h b/sys/sys/domainset.h
--- a/sys/sys/domainset.h
+++ b/sys/sys/domainset.h
@@ -54,6 +54,7 @@
#define DOMAINSET_OVERLAP(p, c) __BIT_OVERLAP(DOMAINSET_SETSIZE, p, c)
#define DOMAINSET_CMP(p, c) __BIT_CMP(DOMAINSET_SETSIZE, p, c)
#define DOMAINSET_OR(d, s) __BIT_OR(DOMAINSET_SETSIZE, d, s)
+#define DOMAINSET_ORNOT(d, s) __BIT_ORNOT(DOMAINSET_SETSIZE, d, s)
#define DOMAINSET_AND(d, s) __BIT_AND(DOMAINSET_SETSIZE, d, s)
#define DOMAINSET_ANDNOT(d, s) __BIT_ANDNOT(DOMAINSET_SETSIZE, d, s)
#define DOMAINSET_CLR_ATOMIC(n, p) __BIT_CLR_ATOMIC(DOMAINSET_SETSIZE, n, p)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 11, 5:51 AM (18 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15751020
Default Alt Text
D44976.diff (4 KB)
Attached To
Mode
D44976: bitset: Add ORNOT macros
Attached
Detach File
Event Timeline
Log In to Comment