source: GPL/trunk/include/linux/sched.h

Last change on this file was 679, checked in by David Azarewicz, 4 years ago

Merge changes from Paul's uniaud32next branch.

File size: 2.4 KB
Line 
1#ifndef _LINUX_SCHED_H
2#define _LINUX_SCHED_H
3
4#include <dbgos2.h>
5
6#include <asm/param.h> /* for HZ */
7#include <asm/atomic.h>
8#include <linux/pid.h>
9
10#define MAX_SCHEDULE_TIMEOUT INT_MAX
11
12#define TASK_RUNNING 0
13#define TASK_INTERRUPTIBLE 1
14#define TASK_UNINTERRUPTIBLE 2
15#define TASK_ZOMBIE 4
16#define TASK_STOPPED 8
17#define TASK_SWAPPING 16
18#define TASK_EXCLUSIVE 32
19
20#define set_current_state(a)
21
22struct task_struct {
23/* these are hardcoded - don't touch */
24 long state; /* -1 unrunnable, 0 runnable, >0 stopped */
25 unsigned long flags; /* per process flags, defined below */
26 int sigpending;
27 unsigned long pid;
28 char comm[16];
29/* open file information */
30 struct files_struct *files;
31};
32
33#include <asm\current.h>
34#include <linux\wait.h>
35
36extern void __wake_up(wait_queue_head_t *q, unsigned int mode);
37extern void sleep_on(wait_queue_head_t *q);
38extern long sleep_on_timeout(wait_queue_head_t *q,
39 signed long timeout);
40extern void interruptible_sleep_on(wait_queue_head_t *q);
41extern long interruptible_sleep_on_timeout(wait_queue_head_t *q,
42 signed long timeout);
43extern void wake_up_process(struct task_struct * tsk);
44
45#define wake_up(x) __wake_up((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE)
46#define wake_up_interruptible(x) __wake_up((x),TASK_INTERRUPTIBLE)
47
48void schedule(void);
49
50#define cond_resched() \
51 do { \
52 if (1) { \
53 set_current_state(TASK_RUNNING); \
54 schedule(); \
55 } \
56 } while (0)
57
58// 12 Jun 07 SHL Drop superfluous near
59#if 0
60extern int request_irq(unsigned int,
61 int (*handler)(int, void *, struct pt_regs *),
62 unsigned long, const char *, void *);
63#endif
64extern void free_irq(unsigned int, void *);
65extern void eoi_irq(unsigned int);
66
67extern unsigned long volatile jiffies;
68
69extern signed long schedule_timeout(signed long timeout);
70
71static inline int signal_pending(struct task_struct *p)
72{
73#ifdef DEBUG
74 dprintf(("signal_pending always returns 0"));
75#endif /* DEBUG */
76 return 0;
77}
78
79#define flush_scheduled_work()
80
81#define schedule_timeout_interruptible(x) \
82 set_current_state(TASK_INTERRUPTIBLE); \
83 schedule_timeout(x);
84
85#define schedule_timeout_uninterruptible(x) \
86 set_current_state(TASK_UNINTERRUPTIBLE); \
87 schedule_timeout(x);
88#define TASK_NORMAL (TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE)
89
90#endif /* _LINUX_SCHED_H */
Note: See TracBrowser for help on using the repository browser.