ia64/xen-unstable

view extras/mini-os/include/sched.h @ 14038:4314691c70a2

[HVM] Fix MMIO LODS emulation
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
author Tim Deegan <Tim.Deegan@xensource.com>
date Tue Feb 20 20:02:49 2007 +0000 (2007-02-20)
parents e9e327c3e81b
children d46265d21dc5
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)
34 /* Architecture specific setup of thread creation. */
35 struct thread* arch_create_thread(char *name, void (*function)(void *),
36 void *data);
38 void init_sched(void);
39 void run_idle_thread(void);
40 struct thread* create_thread(char *name, void (*function)(void *), void *data);
41 void schedule(void);
43 #define current get_current()
46 void wake(struct thread *thread);
47 void block(struct thread *thread);
48 void sleep(u32 millisecs);
50 #endif /* __SCHED_H__ */