diff options
-rw-r--r-- | posix/sched.h | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/posix/sched.h b/posix/sched.h index 62cca85..c9a0840 100644 --- a/posix/sched.h +++ b/posix/sched.h @@ -69,11 +69,41 @@ extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __THROW; #ifdef __USE_GNU /* Access macros for `cpu_set'. */ # define CPU_SETSIZE __CPU_SETSIZE -# define CPU_SET(cpu, cpusetp) __CPU_SET (cpu, cpusetp) -# define CPU_CLR(cpu, cpusetp) __CPU_CLR (cpu, cpusetp) -# define CPU_ISSET(cpu, cpusetp) __CPU_ISSET (cpu, cpusetp) -# define CPU_ZERO(cpusetp) __CPU_ZERO (cpusetp) -# define CPU_COUNT(cpusetp) __CPU_COUNT (cpusetp) +# define CPU_SET(cpu, cpusetp) __CPU_SET_S (cpu, sizeof (cpu_set_t), cpusetp) +# define CPU_CLR(cpu, cpusetp) __CPU_CLR_S (cpu, sizeof (cpu_set_t), cpusetp) +# define CPU_ISSET(cpu, cpusetp) __CPU_ISSET_S (cpu, sizeof (cpu_set_t), \ + cpusetp) +# define CPU_ZERO(cpusetp) __CPU_ZERO_S (sizeof (cpu_set_t), cpusetp) +# define CPU_COUNT(cpusetp) __CPU_COUNT_S (sizeof (cpu_set_t), cpusetp) + +# define CPU_SET_S(cpu, setsize, cpusetp) __CPU_SET_S (cpu, setsize, cpusetp) +# define CPU_CLR_S(cpu, setsize, cpusetp) __CPU_CLR_S (cpu, setsize, cpusetp) +# define CPU_ISSET_S(cpu, setsize, cpusetp) __CPU_ISSET_S (cpu, setsize, \ + cpusetp) +# define CPU_ZERO_S(setsize, cpusetp) __CPU_ZERO_S (setsize, cpusetp) +# define CPU_COUNT_S(setsize, cpusetp) __CPU_COUNT_S (setsize, cpusetp) + +# define CPU_EQUAL(cpusetp1, cpusetp2) \ + __CPU_EQUAL_S (sizeof (cpu_set_t), cpusetp1, cpusetp2) +# define CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \ + __CPU_EQUAL_S (setsize, cpusetp1, cpusetp2) + +# define CPU_AND(destset, srcset1, srcset2) \ + __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, &) +# define CPU_OR(destset, srcset1, srcset2) \ + __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, |) +# define CPU_XOR(destset, srcset1, srcset2) \ + __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, ^) +# define CPU_AND_S(setsize, destset, srcset1, srcset2) \ + __CPU_OP_S (setsize, destset, srcset1, srcset2, &) +# define CPU_OR_S(setsize, destset, srcset1, srcset2) \ + __CPU_OP_S (setsize, destset, srcset1, srcset2, |) +# define CPU_XOR_S(setsize, destset, srcset1, srcset2) \ + __CPU_OP_S (setsize, destset, srcset1, srcset2, ^) + +# define CPU_ALLOC_SIZE(count) __CPU_ALLOC_SIZE (count) +# define CPU_ALLOC(count) __CPU_ALLOC (count) +# define CPU_FREE(count) __CPU_FREE (count) /* Set the CPU affinity for a task */ |