#include <linux/tasks.h>#include <asm/system.h>#include <linux/head.h>#include <linux/fs.h>#include <linux/mm.h>#include <linux/signal.h>#include <linux/time.h>#include <linux/param.h>#include <linux/resource.h>#include <linux/vm86.h>#include <linux/math_emu.h>Go to the source code of this file.
Data Structures | |
| struct | i387_hard_struct |
| struct | i387_soft_struct |
| union | i387_union |
| struct | tss_struct |
| struct | task_struct |
Defines | |
| #define | NEW_SWAP |
| #define | HZ 100 |
| #define | MCA_bus 0 |
| #define | TASK_SIZE 0xc0000000 |
| #define | IO_BITMAP_SIZE 32 |
| #define | FSHIFT 11 |
| nr of bits of precision | |
| #define | FIXED_1 (1<<FSHIFT) |
| 1.0 as fixed-point | |
| #define | LOAD_FREQ (5*HZ) |
| 5 sec intervals | |
| #define | EXP_1 1884 |
| 1/exp(5sec/1min) as fixed-point | |
| #define | EXP_5 2014 |
| 1/exp(5sec/5min) | |
| #define | EXP_15 2037 |
| 1/exp(5sec/15min) | |
| #define | CALC_LOAD(load, exp, n) |
| #define | CT_TO_SECS(x) ((x) / HZ) |
| #define | CT_TO_USECS(x) (((x) % HZ) * 1000000/HZ) |
| #define | FIRST_TASK task[0] |
| #define | LAST_TASK task[NR_TASKS-1] |
| #define | TASK_RUNNING 0 |
| #define | TASK_INTERRUPTIBLE 1 |
| #define | TASK_UNINTERRUPTIBLE 2 |
| #define | TASK_ZOMBIE 3 |
| #define | TASK_STOPPED 4 |
| #define | TASK_SWAPPING 5 |
| #define | PF_ALIGNWARN 0x00000001 |
| #define | PF_PTRACED 0x00000010 |
| Not implemented yet, only for 486 set if ptrace (0) has been called. | |
| #define | PF_TRACESYS 0x00000020 |
| tracing system calls | |
| #define | CSIGNAL 0x000000ff |
| signal mask to be sent at exit | |
| #define | COPYVM 0x00000100 |
| set if VM copy desired (like normal fork()) | |
| #define | COPYFD 0x00000200 |
| set if fd's should be copied, not shared (NI) | |
| #define | INIT_TASK |
| #define | CURRENT_TIME (xtime.tv_sec) |
| #define | FIRST_TSS_ENTRY 8 |
| #define | FIRST_LDT_ENTRY (FIRST_TSS_ENTRY+1) |
| #define | _TSS(n) ((((unsigned long) n)<<4)+(FIRST_TSS_ENTRY<<3)) |
| #define | _LDT(n) ((((unsigned long) n)<<4)+(FIRST_LDT_ENTRY<<3)) |
| #define | store_TR(n) |
| #define | switch_to(tsk) |
| #define | _set_base(addr, base) |
| #define | _set_limit(addr, limit) |
| #define | set_base(ldt, base) _set_base( ((char *)&(ldt)) , base ) |
| #define | set_limit(ldt, limit) _set_limit( ((char *)&(ldt)) , (limit-1)>>12 ) |
| #define | get_base(ldt) _get_base( ((char *)&(ldt)) ) |
| #define | REMOVE_LINKS(p) |
| #define | SET_LINKS(p) |
| #define | for_each_task(p) for (p = &init_task ; (p = p->next_task) != &init_task ; ) |
| #define | loaddebug(register) |
| This special macro can be used to load a debugging register. | |
Functions | |
| void | sleep_on (struct wait_queue **p) |
| void | interruptible_sleep_on (struct wait_queue **p) |
| void | wake_up (struct wait_queue **p) |
| void | wake_up_interruptible (struct wait_queue **p) |
| void | notify_parent (struct task_struct *tsk) |
| int | send_sig (unsigned long sig, struct task_struct *p, int priv) |
| int | in_group_p (gid_t grp) |
| int | request_irq (unsigned int irq, void(*handler)(int)) |
| void | free_irq (unsigned int irq) |
| int | irqaction (unsigned int irq, struct sigaction *sa) |
| c (tsk) | |
| void | remove_wait_queue (struct wait_queue **p, struct wait_queue *wait) |
| void | select_wait (struct wait_queue **wait_address, select_table *p) |
| void | __down (struct semaphore *sem) |
| void | down (struct semaphore *sem) |
| void | up (struct semaphore *sem) |
| static unsigned long | _get_base (char *addr) |
| static unsigned long | get_limit (unsigned long segment) |
Variables | |
| int | hard_math |
| int | x86 |
| int | ignore_irq13 |
| int | wp_works_ok |
| int | EISA_bus |
| unsigned long | avenrun [] |
| Load averages. | |
| task_struct * | task [NR_TASKS] |
| task_struct * | last_task_used_math |
| task_struct * | current |
| unsigned long volatile | jiffies |
| unsigned long | itimer_ticks |
| unsigned long | itimer_next |
| timeval | xtime |
| int | need_resched |
| desc_struct | default_ldt |
| #define _set_base | ( | addr, | |||
| base | ) |
Value:
__asm__("movw %%dx,%0\n\t" \ "rorl $16,%%edx\n\t" \ "movb %%dl,%1\n\t" \ "movb %%dh,%2" \
| #define _set_limit | ( | addr, | |||
| limit | ) |
Value:
__asm__("movw %%dx,%0\n\t" \ "rorl $16,%%edx\n\t" \ "movb %1,%%dh\n\t" \ "andb $0xf0,%%dh\n\t" \ "orb %%dh,%%dl\n\t" \ "movb %%dl,%1" \
Referenced by c().
| #define CALC_LOAD | ( | load, | |||
| exp, | |||||
| n | ) |
| #define COPYFD 0x00000200 |
| #define COPYVM 0x00000100 |
| #define CSIGNAL 0x000000ff |
| #define FIRST_TSS_ENTRY 8 |
| #define for_each_task | ( | p | ) | for (p = &init_task ; (p = p->next_task) != &init_task ; ) |
| #define HZ 100 |
| #define INIT_TASK |
| #define IO_BITMAP_SIZE 32 |
| #define loaddebug | ( | register | ) |
| #define PF_ALIGNWARN 0x00000001 |
| #define PF_PTRACED 0x00000010 |
| #define REMOVE_LINKS | ( | p | ) |
Value:
do { unsigned long flags; \ save_flags(flags) ; cli(); \ (p)->next_task->prev_task = (p)->prev_task; \ (p)->prev_task->next_task = (p)->next_task; \ restore_flags(flags); \ if ((p)->p_osptr) \ (p)->p_osptr->p_ysptr = (p)->p_ysptr; \ if ((p)->p_ysptr) \ (p)->p_ysptr->p_osptr = (p)->p_osptr; \ else \ (p)->p_pptr->p_cptr = (p)->p_osptr; \ } while (0)
| #define set_base | ( | ldt, | |||
| base | ) | _set_base( ((char *)&(ldt)) , base ) |
| #define set_limit | ( | ldt, | |||
| limit | ) | _set_limit( ((char *)&(ldt)) , (limit-1)>>12 ) |
| #define SET_LINKS | ( | p | ) |
Value:
do { unsigned long flags; \ save_flags(flags); cli(); \ (p)->next_task = &init_task; \ (p)->prev_task = init_task.prev_task; \ init_task.prev_task->next_task = (p); \ init_task.prev_task = (p); \ restore_flags(flags); \ (p)->p_ysptr = NULL; \ if (((p)->p_osptr = (p)->p_pptr->p_cptr) != NULL) \ (p)->p_osptr->p_ysptr = p; \ (p)->p_pptr->p_cptr = p; \ } while (0)
| #define store_TR | ( | n | ) |
Value:
__asm__("str %%ax\n\t" \ "subl %2,%%eax\n\t" \ "shrl $4,%%eax" \ :"=a" (n) \ :"0" (0),"i" (FIRST_TSS_ENTRY<<3))
| #define switch_to | ( | tsk | ) |
Value:
__asm__("cmpl %%ecx,_current\n\t" \ "je 1f\n\t" \ "cli\n\t" \ "xchgl %%ecx,_current\n\t" \ "ljmp %0\n\t" \ "sti\n\t" \ "cmpl %%ecx,_last_task_used_math\n\t" \ "jne 1f\n\t" \ "clts\n" \ "1:" \
| #define TASK_SIZE 0xc0000000 |
User space process size: 3GB. This is hardcoded into a few places, so don't change it unless you know what you are doing.
Definition at line 54 of file sched.h.
Referenced by verify_area().
| static unsigned long _get_base | ( | char * | addr | ) | [inline, static] |
| c | ( | tsk | ) |
The wait-queues are circular lists, and you have to be *very* sure to keep them correct. Use only these two functions to add/remove entries in the queues.
Definition at line 480 of file sched.h.
References _set_limit, cli, wait_queue::next, restore_flags, and save_flags.
| void down | ( | struct semaphore * | sem | ) | [inline] |
| void free_irq | ( | unsigned int | irq | ) |
| static unsigned long get_limit | ( | unsigned long | segment | ) | [inline, static] |
| int in_group_p | ( | gid_t | grp | ) |
| void interruptible_sleep_on | ( | struct wait_queue ** | p | ) |
| int irqaction | ( | unsigned int | irq, | |
| struct sigaction * | sa | |||
| ) |
| void notify_parent | ( | struct task_struct * | tsk | ) |
| void remove_wait_queue | ( | struct wait_queue ** | p, | |
| struct wait_queue * | wait | |||
| ) | [inline] |
Definition at line 548 of file sched.h.
References cli, wait_queue::next, NULL, restore_flags, and save_flags.
| int request_irq | ( | unsigned int | irq, | |
| void(*)(int) | handler | |||
| ) |
| void select_wait | ( | struct wait_queue ** | wait_address, | |
| select_table * | p | |||
| ) | [inline] |
Definition at line 587 of file sched.h.
References __MAX_SELECT_TABLE_ENTRIES, select_table_struct::entry, wait_queue::next, select_table_struct::nr, NULL, wait_queue::task, select_table_entry::wait, and select_table_entry::wait_address.
| int send_sig | ( | unsigned long | sig, | |
| struct task_struct * | p, | |||
| int | priv | |||
| ) |
| void sleep_on | ( | struct wait_queue ** | p | ) |
| void up | ( | struct semaphore * | sem | ) | [inline] |
Definition at line 612 of file sched.h.
References semaphore::count, semaphore::wait, and wake_up().
| void wake_up | ( | struct wait_queue ** | p | ) |
Referenced by coh_unlock_inode(), unlock_buffer(), unlock_super(), and up().
| void wake_up_interruptible | ( | struct wait_queue ** | p | ) |
| unsigned long avenrun[] |
Load averages.
These are the constant used to fake the fixed-point load-average counting. Some notes:
| struct task_struct* current |
| struct desc_struct default_ldt |
This is the ldt that every process will get unless we need something other than this.
| int EISA_bus |
Bus types (default is ISA, but people can check others with these..) MCA_bus hardcoded to 0 for now.
| int hard_math |
System setup flags..
| int ignore_irq13 |
| unsigned long itimer_next |
| unsigned long itimer_ticks |
| unsigned long volatile jiffies |
| struct task_struct* last_task_used_math |
| int need_resched |
| struct task_struct* task[NR_TASKS] |
| int wp_works_ok |
Referenced by verify_area().
| int x86 |
1.4.6-5