511 #define CPUSET_ONLY(set, cpu) ((void)((set) = CPUSET(cpu)))
512 #define CPU_IN_SET(set, cpu) ((set) & CPUSET(cpu))
513 #define CPUSET_ADD(set, cpu) ((void)((set) |= CPUSET(cpu)))
514 #define CPUSET_DEL(set, cpu) ((void)((set) &= ~CPUSET(cpu)))
515 #define CPUSET_ISNULL(set) ((set) == 0)
516 #define CPUSET_ISEQUAL(set1, set2) ((set1) == (set2))
517 #define CPUSET_OR(set1, set2) ((void)((set1) |= (set2)))
518 #define CPUSET_XOR(set1, set2) ((void)((set1) ^= (set2)))
519 #define CPUSET_AND(set1, set2) ((void)((set1) &= (set2)))
520 #define CPUSET_ZERO(set) ((void)((set) = 0))
521
522 #define CPUSET_FIND(set, cpu) { \
523 cpu = (uint_t)(lowbit(set) - 1); \
524 }
525
526 #define CPUSET_BOUNDS(set, smallest, largest) { \
527 smallest = (uint_t)(lowbit(set) - 1); \
528 largest = (uint_t)(highbit(set) - 1); \
529 }
530
531 #define CPUSET_ATOMIC_DEL(set, cpu) atomic_and_long(&(set), ~CPUSET(cpu))
532 #define CPUSET_ATOMIC_ADD(set, cpu) atomic_or_long(&(set), CPUSET(cpu))
533
534 #define CPUSET_ATOMIC_XADD(set, cpu, result) \
535 { result = atomic_set_long_excl(&(set), (cpu)); }
536
537 #define CPUSET_ATOMIC_XDEL(set, cpu, result) \
538 { result = atomic_clear_long_excl(&(set), (cpu)); }
539
540 #else /* CPUSET_WORDS <= 0 */
541
542 #error NCPU is undefined or invalid
543
544 #endif /* CPUSET_WORDS */
545
546 extern cpuset_t cpu_seqid_inuse;
547
548 #endif /* (_KERNEL || _KMEMUSER) && _MACHDEP */
549
550 #define CPU_CPR_OFFLINE 0x0
551 #define CPU_CPR_ONLINE 0x1
552 #define CPU_CPR_IS_OFFLINE(cpu) (((cpu)->cpu_cpr_flags & CPU_CPR_ONLINE) == 0)
|
511 #define CPUSET_ONLY(set, cpu) ((void)((set) = CPUSET(cpu)))
512 #define CPU_IN_SET(set, cpu) ((set) & CPUSET(cpu))
513 #define CPUSET_ADD(set, cpu) ((void)((set) |= CPUSET(cpu)))
514 #define CPUSET_DEL(set, cpu) ((void)((set) &= ~CPUSET(cpu)))
515 #define CPUSET_ISNULL(set) ((set) == 0)
516 #define CPUSET_ISEQUAL(set1, set2) ((set1) == (set2))
517 #define CPUSET_OR(set1, set2) ((void)((set1) |= (set2)))
518 #define CPUSET_XOR(set1, set2) ((void)((set1) ^= (set2)))
519 #define CPUSET_AND(set1, set2) ((void)((set1) &= (set2)))
520 #define CPUSET_ZERO(set) ((void)((set) = 0))
521
522 #define CPUSET_FIND(set, cpu) { \
523 cpu = (uint_t)(lowbit(set) - 1); \
524 }
525
526 #define CPUSET_BOUNDS(set, smallest, largest) { \
527 smallest = (uint_t)(lowbit(set) - 1); \
528 largest = (uint_t)(highbit(set) - 1); \
529 }
530
531 #define CPUSET_ATOMIC_DEL(set, cpu) atomic_and_ulong(&(set), ~CPUSET(cpu))
532 #define CPUSET_ATOMIC_ADD(set, cpu) atomic_or_ulong(&(set), CPUSET(cpu))
533
534 #define CPUSET_ATOMIC_XADD(set, cpu, result) \
535 { result = atomic_set_long_excl(&(set), (cpu)); }
536
537 #define CPUSET_ATOMIC_XDEL(set, cpu, result) \
538 { result = atomic_clear_long_excl(&(set), (cpu)); }
539
540 #else /* CPUSET_WORDS <= 0 */
541
542 #error NCPU is undefined or invalid
543
544 #endif /* CPUSET_WORDS */
545
546 extern cpuset_t cpu_seqid_inuse;
547
548 #endif /* (_KERNEL || _KMEMUSER) && _MACHDEP */
549
550 #define CPU_CPR_OFFLINE 0x0
551 #define CPU_CPR_ONLINE 0x1
552 #define CPU_CPR_IS_OFFLINE(cpu) (((cpu)->cpu_cpr_flags & CPU_CPR_ONLINE) == 0)
|