ia64/xen-unstable

view extras/mini-os/include/sched.h @ 12526:82ba3c086e6c

Add example of keyboard layout

Signed-off-by: Takanori Kasai <Kasai.Takanori@jp.fujitsu.com>
author kasai.takanori@jp.fujitsu.com
date Tue Nov 21 09:26:43 2006 +0000 (2006-11-21)
parents 0839db0aa611
children a3c6479c87ef
line source
1 #ifndef __SCHED_H__
2 #define __SCHED_H__
4 #include <list.h>
5 #include <time.h>
7 struct thread
8 {
9 char *name;
10 char *stack;
11 unsigned long sp; /* Stack pointer */
12 unsigned long ip; /* Instruction pointer */
13 struct list_head thread_list;
14 u32 flags;
15 s_time_t wakeup_time;
16 };
20 void init_sched(void);
21 void run_idle_thread(void);
22 struct thread* create_thread(char *name, void (*function)(void *), void *data);
23 void schedule(void);
25 static inline struct thread* get_current(void)
26 {
27 struct thread **current;
28 #ifdef __i386__
29 __asm__("andl %%esp,%0; ":"=r" (current) : "r" (~8191UL));
30 #else
31 __asm__("andq %%rsp,%0; ":"=r" (current) : "r" (~8191UL));
32 #endif
33 return *current;
34 }
36 #define current get_current()
39 void wake(struct thread *thread);
40 void block(struct thread *thread);
41 void sleep(u32 millisecs);
43 #endif /* __SCHED_H__ */