]>
Commit | Line | Data |
---|---|---|
29930025 IM |
1 | #ifndef _LINUX_SCHED_TASK_H |
2 | #define _LINUX_SCHED_TASK_H | |
3 | ||
901b14bd IM |
4 | /* |
5 | * Interface between the scheduler and various task lifetime (fork()/exit()) | |
6 | * functionality: | |
7 | */ | |
8 | ||
29930025 IM |
9 | #include <linux/sched.h> |
10 | ||
901b14bd IM |
11 | /* |
12 | * This serializes "schedule()" and also protects | |
13 | * the run-queue from deletions/modifications (but | |
14 | * _adding_ to the beginning of the run-queue has | |
15 | * a separate lock). | |
16 | */ | |
17 | extern rwlock_t tasklist_lock; | |
18 | extern spinlock_t mmlist_lock; | |
19 | ||
20 | #ifdef CONFIG_PROVE_RCU | |
21 | extern int lockdep_tasklist_lock_is_held(void); | |
22 | #endif /* #ifdef CONFIG_PROVE_RCU */ | |
23 | ||
24 | extern asmlinkage void schedule_tail(struct task_struct *prev); | |
25 | extern void init_idle(struct task_struct *idle, int cpu); | |
26 | extern void init_idle_bootup_task(struct task_struct *idle); | |
27 | ||
901b14bd IM |
28 | extern int sched_fork(unsigned long clone_flags, struct task_struct *p); |
29 | extern void sched_dead(struct task_struct *p); | |
30 | ||
31 | void __noreturn do_task_dead(void); | |
32 | ||
33 | extern void proc_caches_init(void); | |
34 | ||
35 | extern void release_task(struct task_struct * p); | |
36 | ||
37 | #ifdef CONFIG_HAVE_COPY_THREAD_TLS | |
38 | extern int copy_thread_tls(unsigned long, unsigned long, unsigned long, | |
39 | struct task_struct *, unsigned long); | |
40 | #else | |
41 | extern int copy_thread(unsigned long, unsigned long, unsigned long, | |
42 | struct task_struct *); | |
43 | ||
44 | /* Architectures that haven't opted into copy_thread_tls get the tls argument | |
45 | * via pt_regs, so ignore the tls argument passed via C. */ | |
46 | static inline int copy_thread_tls( | |
47 | unsigned long clone_flags, unsigned long sp, unsigned long arg, | |
48 | struct task_struct *p, unsigned long tls) | |
49 | { | |
50 | return copy_thread(clone_flags, sp, arg, p); | |
51 | } | |
52 | #endif | |
53 | extern void flush_thread(void); | |
54 | ||
55 | #ifdef CONFIG_HAVE_EXIT_THREAD | |
56 | extern void exit_thread(struct task_struct *tsk); | |
57 | #else | |
58 | static inline void exit_thread(struct task_struct *tsk) | |
59 | { | |
60 | } | |
61 | #endif | |
62 | extern void do_group_exit(int); | |
63 | ||
64 | extern long _do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *, unsigned long); | |
65 | extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *); | |
66 | struct task_struct *fork_idle(int); | |
67 | extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); | |
68 | ||
69 | ||
70 | #ifdef CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT | |
71 | extern int arch_task_struct_size __read_mostly; | |
72 | #else | |
73 | # define arch_task_struct_size (sizeof(struct task_struct)) | |
74 | #endif | |
75 | ||
76 | #ifdef CONFIG_VMAP_STACK | |
77 | static inline struct vm_struct *task_stack_vm_area(const struct task_struct *t) | |
78 | { | |
79 | return t->stack_vm_area; | |
80 | } | |
81 | #else | |
82 | static inline struct vm_struct *task_stack_vm_area(const struct task_struct *t) | |
83 | { | |
84 | return NULL; | |
85 | } | |
86 | #endif | |
87 | ||
29930025 | 88 | #endif /* _LINUX_SCHED_TASK_H */ |