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