ia64/xen-unstable

view extras/mini-os/include/sched.h @ 13096:ad886b6bdfd6

[IA64] Update sn_sal.h to 2.6.19

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
author awilliam@xenbuild2.aw
date Wed Dec 13 12:23:53 2006 -0700 (2006-12-13)
parents a3c6479c87ef
children e9e327c3e81b
line source
1 #ifndef __SCHED_H__
2 #define __SCHED_H__
4 #include <list.h>
5 #include <time.h>
6 #include <arch_sched.h>
8 struct thread
9 {
10 char *name;
11 char *stack;
12 #if !defined(__ia64__)
13 unsigned long sp; /* Stack pointer */
14 unsigned long ip; /* Instruction pointer */
15 #else /* !defined(__ia64__) */
16 thread_regs_t regs;
17 #endif /* !defined(__ia64__) */
18 struct list_head thread_list;
19 u32 flags;
20 s_time_t wakeup_time;
21 };
23 extern struct thread *idle_thread;
24 void idle_thread_fn(void *unused);
26 #define RUNNABLE_FLAG 0x00000001
28 #define is_runnable(_thread) (_thread->flags & RUNNABLE_FLAG)
29 #define set_runnable(_thread) (_thread->flags |= RUNNABLE_FLAG)
30 #define clear_runnable(_thread) (_thread->flags &= ~RUNNABLE_FLAG)
32 #define switch_threads(prev, next) arch_switch_threads(prev, next)
35 void init_sched(void);
36 void run_idle_thread(void);
37 struct thread* create_thread(char *name, void (*function)(void *), void *data);
38 void schedule(void);
40 #define current get_current()
43 void wake(struct thread *thread);
44 void block(struct thread *thread);
45 void sleep(u32 millisecs);
47 #endif /* __SCHED_H__ */