• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===-- Definition of macros from sched.h ---------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_LIBC_MACROS_LINUX_SCHED_MACROS_H
10 #define LLVM_LIBC_MACROS_LINUX_SCHED_MACROS_H
11 
12 // Definitions of SCHED_* macros must match was linux as at:
13 // https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/sched.h
14 
15 // Posix required
16 #define SCHED_OTHER 0
17 #define SCHED_FIFO 1
18 #define SCHED_RR 2
19 
20 // Linux extentions
21 #define SCHED_BATCH 3
22 #define SCHED_ISO 4 // Not yet implemented, reserved.
23 #define SCHED_IDLE 5
24 #define SCHED_DEADLINE 6
25 
26 #define CPU_SETSIZE __CPU_SETSIZE
27 #define NCPUBITS __NCPUBITS
28 #define CPU_COUNT_S(setsize, set) __sched_getcpucount(setsize, set)
29 #define CPU_COUNT(set) CPU_COUNT_S(sizeof(cpu_set_t), set)
30 #define CPU_ZERO_S(setsize, set) __sched_setcpuzero(setsize, set)
31 #define CPU_ZERO(set) CPU_ZERO_S(sizeof(cpu_set_t), set)
32 #define CPU_SET_S(cpu, setsize, set) __sched_setcpuset(cpu, setsize, set)
33 #define CPU_SET(cpu, setsize, set) CPU_SET_S(cpu, sizeof(cpt_set_t), set)
34 #define CPU_ISSET_S(cpu, setsize, set) __sched_getcpuisset(cpu, setsize, set)
35 #define CPU_ISSET(cpu, setsize, set) CPU_ISSET_S(cpu, sizeof(cpt_set_t), set)
36 
37 #endif // LLVM_LIBC_MACROS_LINUX_SCHED_MACROS_H
38