aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h28
1 files changed, 20 insertions, 8 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 9d4aa7f95bc8..7ef899c47c29 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -148,6 +148,7 @@ extern unsigned long weighted_cpuload(const int cpu);
148#define EXIT_DEAD 32 148#define EXIT_DEAD 32
149/* in tsk->state again */ 149/* in tsk->state again */
150#define TASK_NONINTERACTIVE 64 150#define TASK_NONINTERACTIVE 64
151#define TASK_DEAD 128
151 152
152#define __set_task_state(tsk, state_value) \ 153#define __set_task_state(tsk, state_value) \
153 do { (tsk)->state = (state_value); } while (0) 154 do { (tsk)->state = (state_value); } while (0)
@@ -504,8 +505,8 @@ struct signal_struct {
504#define rt_prio(prio) unlikely((prio) < MAX_RT_PRIO) 505#define rt_prio(prio) unlikely((prio) < MAX_RT_PRIO)
505#define rt_task(p) rt_prio((p)->prio) 506#define rt_task(p) rt_prio((p)->prio)
506#define batch_task(p) (unlikely((p)->policy == SCHED_BATCH)) 507#define batch_task(p) (unlikely((p)->policy == SCHED_BATCH))
507#define has_rt_policy(p) \ 508#define is_rt_policy(p) ((p) != SCHED_NORMAL && (p) != SCHED_BATCH)
508 unlikely((p)->policy != SCHED_NORMAL && (p)->policy != SCHED_BATCH) 509#define has_rt_policy(p) unlikely(is_rt_policy((p)->policy))
509 510
510/* 511/*
511 * Some day this will be a full-fledged user tracking system.. 512 * Some day this will be a full-fledged user tracking system..
@@ -709,7 +710,6 @@ extern unsigned int max_cache_size;
709 710
710 711
711struct io_context; /* See blkdev.h */ 712struct io_context; /* See blkdev.h */
712void exit_io_context(void);
713struct cpuset; 713struct cpuset;
714 714
715#define NGROUPS_SMALL 32 715#define NGROUPS_SMALL 32
@@ -784,8 +784,9 @@ struct task_struct {
784 struct prio_array *array; 784 struct prio_array *array;
785 785
786 unsigned short ioprio; 786 unsigned short ioprio;
787#ifdef CONFIG_BLK_DEV_IO_TRACE
787 unsigned int btrace_seq; 788 unsigned int btrace_seq;
788 789#endif
789 unsigned long sleep_avg; 790 unsigned long sleep_avg;
790 unsigned long long timestamp, last_ran; 791 unsigned long long timestamp, last_ran;
791 unsigned long long sched_time; /* sched_clock time spent running */ 792 unsigned long long sched_time; /* sched_clock time spent running */
@@ -886,8 +887,10 @@ struct task_struct {
886 - initialized normally by flush_old_exec */ 887 - initialized normally by flush_old_exec */
887/* file system info */ 888/* file system info */
888 int link_count, total_link_count; 889 int link_count, total_link_count;
890#ifdef CONFIG_SYSVIPC
889/* ipc stuff */ 891/* ipc stuff */
890 struct sysv_sem sysvsem; 892 struct sysv_sem sysvsem;
893#endif
891/* CPU-specific state of this task */ 894/* CPU-specific state of this task */
892 struct thread_struct thread; 895 struct thread_struct thread;
893/* filesystem information */ 896/* filesystem information */
@@ -978,10 +981,10 @@ struct task_struct {
978 wait_queue_t *io_wait; 981 wait_queue_t *io_wait;
979/* i/o counters(bytes read/written, #syscalls */ 982/* i/o counters(bytes read/written, #syscalls */
980 u64 rchar, wchar, syscr, syscw; 983 u64 rchar, wchar, syscr, syscw;
981#if defined(CONFIG_BSD_PROCESS_ACCT) 984#if defined(CONFIG_TASK_XACCT)
982 u64 acct_rss_mem1; /* accumulated rss usage */ 985 u64 acct_rss_mem1; /* accumulated rss usage */
983 u64 acct_vm_mem1; /* accumulated virtual memory usage */ 986 u64 acct_vm_mem1; /* accumulated virtual memory usage */
984 clock_t acct_stimexpd; /* clock_t-converted stime since last update */ 987 cputime_t acct_stimexpd;/* stime since last update */
985#endif 988#endif
986#ifdef CONFIG_NUMA 989#ifdef CONFIG_NUMA
987 struct mempolicy *mempolicy; 990 struct mempolicy *mempolicy;
@@ -1030,6 +1033,16 @@ static inline int pid_alive(struct task_struct *p)
1030 return p->pids[PIDTYPE_PID].pid != NULL; 1033 return p->pids[PIDTYPE_PID].pid != NULL;
1031} 1034}
1032 1035
1036/**
1037 * is_init - check if a task structure is the first user space
1038 * task the kernel created.
1039 * @p: Task structure to be checked.
1040 */
1041static inline int is_init(struct task_struct *tsk)
1042{
1043 return tsk->pid == 1;
1044}
1045
1033extern void free_task(struct task_struct *tsk); 1046extern void free_task(struct task_struct *tsk);
1034#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) 1047#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0)
1035 1048
@@ -1048,7 +1061,6 @@ static inline void put_task_struct(struct task_struct *t)
1048 /* Not implemented yet, only for 486*/ 1061 /* Not implemented yet, only for 486*/
1049#define PF_STARTING 0x00000002 /* being created */ 1062#define PF_STARTING 0x00000002 /* being created */
1050#define PF_EXITING 0x00000004 /* getting shut down */ 1063#define PF_EXITING 0x00000004 /* getting shut down */
1051#define PF_DEAD 0x00000008 /* Dead */
1052#define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ 1064#define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */
1053#define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ 1065#define PF_SUPERPRIV 0x00000100 /* used super-user privileges */
1054#define PF_DUMPCORE 0x00000200 /* dumped core */ 1066#define PF_DUMPCORE 0x00000200 /* dumped core */
@@ -1193,7 +1205,7 @@ extern void switch_uid(struct user_struct *);
1193 1205
1194#include <asm/current.h> 1206#include <asm/current.h>
1195 1207
1196extern void do_timer(struct pt_regs *); 1208extern void do_timer(unsigned long ticks);
1197 1209
1198extern int FASTCALL(wake_up_state(struct task_struct * tsk, unsigned int state)); 1210extern int FASTCALL(wake_up_state(struct task_struct * tsk, unsigned int state));
1199extern int FASTCALL(wake_up_process(struct task_struct * tsk)); 1211extern int FASTCALL(wake_up_process(struct task_struct * tsk));