]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/blame - include/linux/sched/task.h
sched/headers, RCU: Move rcu_copy_process() from <linux/sched/task.h> to kernel/fork.c
[mirror_ubuntu-disco-kernel.git] / include / linux / sched / task.h
CommitLineData
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 */
17extern rwlock_t tasklist_lock;
18extern spinlock_t mmlist_lock;
19
20#ifdef CONFIG_PROVE_RCU
21extern int lockdep_tasklist_lock_is_held(void);
22#endif /* #ifdef CONFIG_PROVE_RCU */
23
24extern asmlinkage void schedule_tail(struct task_struct *prev);
25extern void init_idle(struct task_struct *idle, int cpu);
26extern void init_idle_bootup_task(struct task_struct *idle);
27
901b14bd
IM
28extern int sched_fork(unsigned long clone_flags, struct task_struct *p);
29extern void sched_dead(struct task_struct *p);
30
31void __noreturn do_task_dead(void);
32
33extern void proc_caches_init(void);
34
35extern void release_task(struct task_struct * p);
36
37#ifdef CONFIG_HAVE_COPY_THREAD_TLS
38extern int copy_thread_tls(unsigned long, unsigned long, unsigned long,
39 struct task_struct *, unsigned long);
40#else
41extern 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. */
46static 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
53extern void flush_thread(void);
54
55#ifdef CONFIG_HAVE_EXIT_THREAD
56extern void exit_thread(struct task_struct *tsk);
57#else
58static inline void exit_thread(struct task_struct *tsk)
59{
60}
61#endif
62extern void do_group_exit(int);
63
64extern long _do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *, unsigned long);
65extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *);
66struct task_struct *fork_idle(int);
67extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
68
69
70#ifdef CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT
71extern 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
77static inline struct vm_struct *task_stack_vm_area(const struct task_struct *t)
78{
79 return t->stack_vm_area;
80}
81#else
82static 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 */