direct-io.hg

view extras/mini-os/include/sched.h @ 10690:77fe42f6442b

[IA64] Fix the ia64 build.
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
author kfraser@localhost.localdomain
date Fri Jul 14 10:49:05 2006 +0100 (2006-07-14)
parents f6507937cb7c
children 0839db0aa611
line source
1 #ifndef __SCHED_H__
2 #define __SCHED_H__
4 #include <list.h>
6 struct thread
7 {
8 char *name;
9 char *stack;
10 unsigned long sp; /* Stack pointer */
11 unsigned long ip; /* Instruction pointer */
12 struct list_head thread_list;
13 u32 flags;
14 };
18 void init_sched(void);
19 void run_idle_thread(void);
20 struct thread* create_thread(char *name, void (*function)(void *), void *data);
21 void schedule(void);
23 static inline struct thread* get_current(void)
24 {
25 struct thread **current;
26 #ifdef __i386__
27 __asm__("andl %%esp,%0; ":"=r" (current) : "r" (~8191UL));
28 #else
29 __asm__("andq %%rsp,%0; ":"=r" (current) : "r" (~8191UL));
30 #endif
31 return *current;
32 }
34 #define current get_current()
37 void wake(struct thread *thread);
38 void block(struct thread *thread);
40 #endif /* __SCHED_H__ */