sched.h
来自「Linux Kernel 2.6.9 for OMAP1710」· C头文件 代码 · 共 1,036 行 · 第 1/3 页
H
1,036 行
unsigned long locked_shm; /* How many pages of mlocked shm ? */ /* Hash table maintenance information */ struct list_head uidhash_list; uid_t uid;};extern struct user_struct *find_user(uid_t);extern struct user_struct root_user;#define INIT_USER (&root_user)typedef struct prio_array prio_array_t;struct backing_dev_info;struct reclaim_state;/* POSIX.1b interval timer structure. */struct k_itimer { struct list_head list; /* free/ allocate list */ spinlock_t it_lock; clockid_t it_clock; /* which timer type */ timer_t it_id; /* timer id */ int it_overrun; /* overrun on pending signal */ int it_overrun_last; /* overrun on last delivered signal */ int it_requeue_pending; /* waiting to requeue this timer */ int it_sigev_notify; /* notify word of sigevent struct */ int it_sigev_signo; /* signo word of sigevent struct */ sigval_t it_sigev_value; /* value word of sigevent struct */ unsigned long it_incr; /* interval specified in jiffies */#ifdef CONFIG_HIGH_RES_TIMERS int it_sub_incr; /* sub jiffie part of interval */#endif struct task_struct *it_process; /* process to send signal to */ struct timer_list it_timer; struct sigqueue *sigq; /* signal queue entry. */ struct list_head abs_timer_entry; /* clock abs_timer_list */ struct timespec wall_to_prev; /* wall_to_monotonic used when set */};#ifdef CONFIG_SCHEDSTATSstruct sched_info { /* cumulative counters */ unsigned long cpu_time, /* time spent on the cpu */ run_delay, /* time spent waiting on a runqueue */ pcnt; /* # of timeslices run on this cpu */ /* timestamps */ unsigned long last_arrival, /* when we last ran on a cpu */ last_queued; /* when we were last queued to run */};extern struct file_operations proc_schedstat_operations;#endifstruct io_context; /* See blkdev.h */void exit_io_context(void);#define NGROUPS_SMALL 32#define NGROUPS_PER_BLOCK ((int)(PAGE_SIZE / sizeof(gid_t)))struct group_info { int ngroups; atomic_t usage; gid_t small_block[NGROUPS_SMALL]; int nblocks; gid_t *blocks[0];};/* * get_group_info() must be called with the owning task locked (via task_lock()) * when task != current. The reason being that the vast majority of callers are * looking at current->group_info, which can not be changed except by the * current task. Changing current->group_info requires the task lock, too. */#define get_group_info(group_info) do { \ atomic_inc(&(group_info)->usage); \} while (0)#define put_group_info(group_info) do { \ if (atomic_dec_and_test(&(group_info)->usage)) \ groups_free(group_info); \} while (0)struct group_info *groups_alloc(int gidsetsize);void groups_free(struct group_info *group_info);int set_current_groups(struct group_info *group_info);/* access the groups "array" with this macro */#define GROUP_AT(gi, i) \ ((gi)->blocks[(i)/NGROUPS_PER_BLOCK][(i)%NGROUPS_PER_BLOCK])struct audit_context; /* See audit.c */struct mempolicy;struct task_struct { volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ struct thread_info *thread_info; atomic_t usage; unsigned long flags; /* per process flags, defined below */ unsigned long ptrace; int lock_depth; /* Lock depth */ int prio, static_prio; struct list_head run_list; prio_array_t *array; unsigned long sleep_avg; long interactive_credit; unsigned long long timestamp, last_ran; int activated; unsigned long policy; cpumask_t cpus_allowed; unsigned int time_slice, first_time_slice;#ifdef CONFIG_SCHEDSTATS struct sched_info sched_info;#endif struct list_head tasks; /* * ptrace_list/ptrace_children forms the list of my children * that were stolen by a ptracer. */ struct list_head ptrace_children; struct list_head ptrace_list; struct mm_struct *mm, *active_mm;/* task state */ struct linux_binfmt *binfmt; int exit_code, exit_signal; int pdeath_signal; /* The signal sent when the parent dies */ /* ??? */ unsigned long personality; unsigned did_exec:1; pid_t pid; pid_t tgid; /* * pointers to (original) parent process, youngest child, younger sibling, * older sibling, respectively. (p->father can be replaced with * p->parent->pid) */ struct task_struct *real_parent; /* real parent process (when being debugged) */ struct task_struct *parent; /* parent process */ /* * children/sibling forms the list of my children plus the * tasks I'm ptracing. */ struct list_head children; /* list of my children */ struct list_head sibling; /* linkage in my parent's children list */ struct task_struct *group_leader; /* threadgroup leader */ /* PID/PID hash table linkage. */ struct pid pids[PIDTYPE_MAX]; wait_queue_head_t wait_chldexit; /* for wait4() */ struct completion *vfork_done; /* for vfork() */ int __user *set_child_tid; /* CLONE_CHILD_SETTID */ int __user *clear_child_tid; /* CLONE_CHILD_CLEARTID */ unsigned long rt_priority; unsigned long it_real_value, it_prof_value, it_virt_value; unsigned long it_real_incr, it_prof_incr, it_virt_incr; struct timer_list real_timer; unsigned long utime, stime; unsigned long nvcsw, nivcsw; /* context switch counts */ struct timespec start_time;/* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */ unsigned long min_flt, maj_flt;/* process credentials */ uid_t uid,euid,suid,fsuid; gid_t gid,egid,sgid,fsgid; struct group_info *group_info; kernel_cap_t cap_effective, cap_inheritable, cap_permitted; unsigned keep_capabilities:1; struct user_struct *user;/* limits */ struct rlimit rlim[RLIM_NLIMITS]; unsigned short used_math; char comm[16];/* file system info */ int link_count, total_link_count;/* ipc stuff */ struct sysv_sem sysvsem;/* CPU-specific state of this task */ struct thread_struct thread;/* filesystem information */ struct fs_struct *fs;/* open file information */ struct files_struct *files;/* namespace */ struct namespace *namespace;/* signal handlers */ struct signal_struct *signal; struct sighand_struct *sighand; sigset_t blocked, real_blocked; struct sigpending pending; unsigned long sas_ss_sp; size_t sas_ss_size; int (*notifier)(void *priv); void *notifier_data; sigset_t *notifier_mask; void *security; struct audit_context *audit_context;/* Thread group tracking */ u32 parent_exec_id; u32 self_exec_id;/* Protection of (de-)allocation: mm, files, fs, tty */ spinlock_t alloc_lock;/* Protection of proc_dentry: nesting proc_lock, dcache_lock, write_lock_irq(&tasklist_lock); */ spinlock_t proc_lock;/* context-switch lock */ spinlock_t switch_lock;/* journalling filesystem info */ void *journal_info;/* VM state */ struct reclaim_state *reclaim_state; struct dentry *proc_dentry; struct backing_dev_info *backing_dev_info; struct io_context *io_context; unsigned long ptrace_message; siginfo_t *last_siginfo; /* For ptrace use. *//* * current io wait handle: wait queue entry to use for io waits * If this thread is processing aio, this points at the waitqueue * inside the currently handled kiocb. It may be NULL (i.e. default * to a stack based synchronous wait) if its doing sync IO. */ wait_queue_t *io_wait;#ifdef CONFIG_NUMA struct mempolicy *mempolicy; short il_next; /* could be shared with used_math */#endif};static inline pid_t process_group(struct task_struct *tsk){ return tsk->signal->pgrp;}extern void free_task(struct task_struct *tsk);extern void __put_task_struct(struct task_struct *tsk);#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0)#define put_task_struct(tsk) \do { if (atomic_dec_and_test(&(tsk)->usage)) __put_task_struct(tsk); } while(0)/* * Per process flags */#define PF_ALIGNWARN 0x00000001 /* Print alignment warning msgs */ /* Not implemented yet, only for 486*/#define PF_STARTING 0x00000002 /* being created */#define PF_EXITING 0x00000004 /* getting shut down */#define PF_DEAD 0x00000008 /* Dead */#define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */#define PF_SUPERPRIV 0x00000100 /* used super-user privileges */#define PF_DUMPCORE 0x00000200 /* dumped core */#define PF_SIGNALED 0x00000400 /* killed by a signal */#define PF_MEMALLOC 0x00000800 /* Allocating memory */#define PF_MEMDIE 0x00001000 /* Killed for out-of-memory */#define PF_FLUSHER 0x00002000 /* responsible for disk writeback */#define PF_FREEZE 0x00004000 /* this task should be frozen for suspend */#define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */#define PF_FROZEN 0x00010000 /* frozen for system suspend */#define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */#define PF_KSWAPD 0x00040000 /* I am kswapd */#define PF_SWAPOFF 0x00080000 /* I am in swapoff */#define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */#define PF_SYNCWRITE 0x00200000 /* I am doing a sync write */#ifdef CONFIG_SMPextern int set_cpus_allowed(task_t *p, cpumask_t new_mask);#elsestatic inline int set_cpus_allowed(task_t *p, cpumask_t new_mask){ return 0;}#endifextern unsigned long long sched_clock(void);/* sched_exec is called by processes performing an exec */#ifdef CONFIG_SMPextern void sched_exec(void);#else#define sched_exec() {}#endifextern void sched_idle_next(void);extern void set_user_nice(task_t *p, long nice);extern int task_prio(const task_t *p);extern int task_nice(const task_t *p);extern int task_curr(const task_t *p);extern int idle_cpu(int cpu);void yield(void);/* * The default (Linux) execution domain. */extern struct exec_domain default_exec_domain;union thread_union { struct thread_info thread_info; unsigned long stack[THREAD_SIZE/sizeof(long)];};#ifndef __HAVE_ARCH_KSTACK_ENDstatic inline int kstack_end(void *addr){ /* Reliable end of stack detection: * Some APM bios versions misalign the stack */ return !(((unsigned long)addr+sizeof(void*)-1) & (THREAD_SIZE-sizeof(void*)));}#endifextern union thread_union init_thread_union;extern struct task_struct init_task;extern struct mm_struct init_mm;#define find_task_by_pid(nr) find_task_by_pid_type(PIDTYPE_PID, nr)extern struct task_struct *find_task_by_pid_type(int type, int pid);extern void set_special_pids(pid_t session, pid_t pgrp);extern void __set_special_pids(pid_t session, pid_t pgrp);/* per-UID process charging. */extern struct user_struct * alloc_uid(uid_t);static inline struct user_struct *get_uid(struct user_struct *u){ atomic_inc(&u->__count); return u;}extern void free_uid(struct user_struct *);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?