GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / toolchains / hndtools-arm-linux-2.6.36-uclibc-4.5.3 / arm-brcm-linux-uclibcgnueabi / sysroot / usr / include / bits / sched.h
blobdcfa6eab62d66eba97dd0ee5e03ee2948204a019
1 /* Definitions of constants and data structure for POSIX 1003.1b-1993
2 scheduling interface.
3 Copyright (C) 1996-1999,2001-2003,2005,2006 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, write to the Free
18 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA. */
21 #ifndef __need_schedparam
23 #ifndef _SCHED_H
24 # error "Never include <bits/sched.h> directly; use <sched.h> instead."
25 #endif
28 /* Scheduling algorithms. */
29 #define SCHED_OTHER 0
30 #define SCHED_FIFO 1
31 #define SCHED_RR 2
32 #ifdef __USE_GNU
33 # define SCHED_BATCH 3
34 #endif
36 #ifdef __USE_MISC
37 /* Cloning flags. */
38 # define CSIGNAL 0x000000ff /* Signal mask to be sent at exit. */
39 # define CLONE_VM 0x00000100 /* Set if VM shared between processes. */
40 # define CLONE_FS 0x00000200 /* Set if fs info shared between processes. */
41 # define CLONE_FILES 0x00000400 /* Set if open files shared between processes. */
42 # define CLONE_SIGHAND 0x00000800 /* Set if signal handlers shared. */
43 # define CLONE_PTRACE 0x00002000 /* Set if tracing continues on the child. */
44 # define CLONE_VFORK 0x00004000 /* Set if the parent wants the child to
45 wake it up on mm_release. */
46 # define CLONE_PARENT 0x00008000 /* Set if we want to have the same
47 parent as the cloner. */
48 # define CLONE_THREAD 0x00010000 /* Set to add to same thread group. */
49 # define CLONE_NEWNS 0x00020000 /* Set to create new namespace. */
50 # define CLONE_SYSVSEM 0x00040000 /* Set to shared SVID SEM_UNDO semantics. */
51 # define CLONE_SETTLS 0x00080000 /* Set TLS info. */
52 # define CLONE_PARENT_SETTID 0x00100000 /* Store TID in userlevel buffer
53 before MM copy. */
54 # define CLONE_CHILD_CLEARTID 0x00200000 /* Register exit futex and memory
55 location to clear. */
56 # define CLONE_DETACHED 0x00400000 /* Create clone detached. */
57 # define CLONE_UNTRACED 0x00800000 /* Set if the tracing process can't
58 force CLONE_PTRACE on this clone. */
59 # define CLONE_CHILD_SETTID 0x01000000 /* Store TID in userlevel buffer in
60 the child. */
61 # define CLONE_STOPPED 0x02000000 /* Start in stopped state. */
62 # define CLONE_NEWUTS 0x04000000 /* New utsname group. */
63 # define CLONE_NEWIPC 0x08000000 /* New ipcs. */
64 # define CLONE_NEWUSER 0x10000000 /* New user namespace. */
65 # define CLONE_NEWPID 0x20000000 /* New pid namespace. */
66 # define CLONE_NEWNET 0x40000000 /* New network namespace. */
67 # define CLONE_IO 0x80000000 /* Clone I/O context. */
68 #endif
70 /* The official definition. */
71 struct sched_param
73 int __sched_priority;
76 __BEGIN_DECLS
78 #ifdef __USE_MISC
79 /* Clone current process. */
80 extern int clone (int (*__fn) (void *__arg), void *__child_stack,
81 int __flags, void *__arg, ...) __THROW;
83 /* Unshare the specified resources. */
84 extern int unshare (int __flags) __THROW;
85 #endif
87 __END_DECLS
89 #endif /* need schedparam */
91 #if !defined __defined_schedparam \
92 && (defined __need_schedparam || defined _SCHED_H)
93 # define __defined_schedparam 1
94 /* Data structure to describe a process' schedulability. */
95 struct __sched_param
97 int __sched_priority;
99 # undef __need_schedparam
100 #endif
103 #if defined _SCHED_H && !defined __cpu_set_t_defined
104 # define __cpu_set_t_defined
105 /* Size definition for CPU sets. */
106 # define __CPU_SETSIZE 1024
107 # define __NCPUBITS (8 * sizeof (__cpu_mask))
109 /* Type for array elements in 'cpu_set'. */
110 typedef unsigned long int __cpu_mask;
112 /* Basic access functions. */
113 # define __CPUELT(cpu) ((cpu) / __NCPUBITS)
114 # define __CPUMASK(cpu) ((__cpu_mask) 1 << ((cpu) % __NCPUBITS))
116 /* Data structure to describe CPU mask. */
117 typedef struct
119 __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS];
120 } cpu_set_t;
122 /* Access functions for CPU masks. */
123 # define __CPU_ZERO(cpusetp) \
124 do { \
125 unsigned int __i; \
126 cpu_set_t *__arr = (cpusetp); \
127 for (__i = 0; __i < sizeof (cpu_set_t) / sizeof (__cpu_mask); ++__i) \
128 __arr->__bits[__i] = 0; \
129 } while (0)
130 # define __CPU_SET(cpu, cpusetp) \
131 ((cpusetp)->__bits[__CPUELT (cpu)] |= __CPUMASK (cpu))
132 # define __CPU_CLR(cpu, cpusetp) \
133 ((cpusetp)->__bits[__CPUELT (cpu)] &= ~__CPUMASK (cpu))
134 # define __CPU_ISSET(cpu, cpusetp) \
135 (((cpusetp)->__bits[__CPUELT (cpu)] & __CPUMASK (cpu)) != 0)
136 #endif