Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145139165
D33451.id100035.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D33451.id100035.diff
View Options
diff --git a/sys/sys/bitset.h b/sys/sys/bitset.h
--- a/sys/sys/bitset.h
+++ b/sys/sys/bitset.h
@@ -312,7 +312,13 @@
/*
* Dynamically allocate a bitset.
*/
-#define __BITSET_ALLOC(_s, mt, mf) malloc(__BITSET_SIZE((_s)), mt, (mf))
+#if defined(_KERNEL)
+#define __BITSET_ALLOC(_s, mt, mf) malloc(__BITSET_SIZE((_s)), mt, (mf))
+#define __BITSET_FREE(p, mt) free(p, mt)
+#else /* _KERNEL */
+#define __BITSET_ALLOC(_s) malloc(__BITSET_SIZE((_s)))
+#define __BITSET_FREE(p) free(p)
+#endif /* _KERNEL */
#define BIT_AND(_s, d, s) __BIT_AND(_s, d, s)
#define BIT_AND2(_s, d, s1, s2) __BIT_AND2(_s, d, s1, s2)
@@ -351,7 +357,8 @@
#define BIT_XOR2(_s, d, s1, s2) __BIT_XOR2(_s, d, s1, s2)
#define BIT_ZERO(_s, p) __BIT_ZERO(_s, p)
-#define BITSET_ALLOC(_s, mt, mf) __BITSET_ALLOC(_s, mt, mf)
+#define BITSET_ALLOC(_s, mt, mf) __BITSET_ALLOC(_s, mt, mf)
+#define BITSET_FREE(p) __BITSET_FREE(p)
#define BITSET_FSET(n) __BITSET_FSET(n)
#define BITSET_SIZE(_s) __BITSET_SIZE(_s)
#define BITSET_T_INITIALIZER(x) __BITSET_T_INITIALIZER(x)
diff --git a/sys/sys/cpuset.h b/sys/sys/cpuset.h
--- a/sys/sys/cpuset.h
+++ b/sys/sys/cpuset.h
@@ -36,6 +36,7 @@
#include <sys/_cpuset.h>
+#include <sys/_bitset.h>
#include <sys/bitset.h>
#define _NCPUBITS _BITSET_BITS
@@ -73,6 +74,23 @@
#define CPUSET_FSET __BITSET_FSET(_NCPUWORDS)
#define CPUSET_T_INITIALIZER(x) __BITSET_T_INITIALIZER(x)
+//#if defined(_WANT_FREEBSD_BITSET)
+#include <stdlib.h>
+#define CPU_ALLOC_SIZE(_s) __BITSET_SIZE(_s)
+static inline void* CPU_ALLOC(size_t _s) { return (malloc(CPU_ALLOC_SIZE(_s))); }
+//#define CPU_ALLOC(_s) malloc(__CPU_ALLOC_SIZE(_s))
+//#define CPU_FREE(p) free(p)
+//#endif
+
+#define CPU_CLR_S(n, _s, p) __BIT_CLR(_s, n, p)
+#define CPU_ISSET_S(n, _s, p) __BIT_ISSET(_s, n, p)
+#define CPU_SET_S(n, _s, p) __BIT_SET(_s, n, p)
+#define CPU_ZERO_S(_s, p) __BIT_ZERO(_s, p)
+#define CPU_EQUAL_S(_s, p, s) (__BIT_CMP(_s, p, c) == 0)
+#define CPU_OR_S(_s, d, s1, s2) __BIT_OR2(_s, d, s1, s2)
+#define CPU_AND_S(_s, d, s1, s2) __BIT_AND2(_s, d, s1, s2)
+#define CPU_XOR_S(_s, d, s1, s2) __BIT_XOR2(_s, d, s1, s2)
+
/*
* Valid cpulevel_t values.
*/
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Feb 17, 9:09 AM (8 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28800611
Default Alt Text
D33451.id100035.diff (2 KB)
Attached To
Mode
D33451: WIP Changes to sys/cpuset.h
Attached
Detach File
Event Timeline
Log In to Comment