1 // SPDX-License-Identifier: LGPL-2.1 1 2 // Definitions taken from glibc for use with o 3 #ifndef _CPU_SET_SCHED_PERF_H 4 #define _CPU_SET_SCHED_PERF_H 5 6 #include <features.h> 7 #include <sched.h> 8 9 #ifndef CPU_EQUAL 10 #ifndef __CPU_EQUAL_S 11 #if __GNUC_PREREQ (2, 91) 12 # define __CPU_EQUAL_S(setsize, cpusetp1, cpus 13 (__builtin_memcmp (cpusetp1, cpusetp2, setsi 14 #else 15 # define __CPU_EQUAL_S(setsize, cpusetp1, cpus 16 (__extension__ 17 ({ const __cpu_mask *__arr1 = (cpusetp1)->_ 18 const __cpu_mask *__arr2 = (cpusetp2)->_ 19 size_t __imax = (setsize) / sizeof (__cp 20 size_t __i; 21 for (__i = 0; __i < __imax; ++__i) 22 if (__arr1[__i] != __arr2[__i]) 23 break; 24 __i == __imax; })) 25 #endif 26 #endif // __CPU_EQUAL_S 27 28 #define CPU_EQUAL(cpusetp1, cpusetp2) \ 29 __CPU_EQUAL_S (sizeof (cpu_set_t), cpusetp1, 30 #endif // CPU_EQUAL 31 32 #ifndef CPU_OR 33 #ifndef __CPU_OP_S 34 #define __CPU_OP_S(setsize, destset, srcset1, 35 (__extension__ 36 ({ cpu_set_t *__dest = (destset); 37 const __cpu_mask *__arr1 = (srcset1)->__ 38 const __cpu_mask *__arr2 = (srcset2)->__ 39 size_t __imax = (setsize) / sizeof (__cp 40 size_t __i; 41 for (__i = 0; __i < __imax; ++__i) 42 ((__cpu_mask *) __dest->__bits)[__i] = 43 __dest; })) 44 #endif // __CPU_OP_S 45 46 #define CPU_OR(destset, srcset1, srcset2) \ 47 __CPU_OP_S (sizeof (cpu_set_t), destset, src 48 #endif // CPU_OR 49 50 #endif // _CPU_SET_SCHED_PERF_H 51
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.