ia64/xen-unstable

annotate extras/mini-os/include/sched.h @ 6714:df1348e72390

Xenbus implementation ported from Linux to Mini-os, simple thread support introduced
to simplify the porting. 64 bit version of Mini-os now compiles, but does not work
because of the pagetables and some bits of scheduler not being written.

Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>
author kaf24@firebug.cl.cam.ac.uk
date Fri Sep 09 09:24:25 2005 +0000 (2005-09-09)
parents
children cdfa7dd00c44
rev   line source
kaf24@6714 1 #ifndef __SCHED_H__
kaf24@6714 2 #define __SCHED_H__
kaf24@6714 3
kaf24@6714 4 #include <list.h>
kaf24@6714 5
kaf24@6714 6 struct thread
kaf24@6714 7 {
kaf24@6714 8 char *name;
kaf24@6714 9 char *stack;
kaf24@6714 10 unsigned long eps;
kaf24@6714 11 unsigned long eip;
kaf24@6714 12 struct list_head thread_list;
kaf24@6714 13 u32 flags;
kaf24@6714 14 };
kaf24@6714 15
kaf24@6714 16
kaf24@6714 17
kaf24@6714 18 void init_sched(void);
kaf24@6714 19 void run_idle_thread(void);
kaf24@6714 20 struct thread* create_thread(char *name, void (*function)(void *), void *data);
kaf24@6714 21 void schedule(void);
kaf24@6714 22
kaf24@6714 23 static inline struct thread* get_current(void)
kaf24@6714 24 {
kaf24@6714 25 struct thread **current;
kaf24@6714 26 #ifdef __i386__
kaf24@6714 27 __asm__("andl %%esp,%0; ":"=r" (current) : "r" (~8191UL));
kaf24@6714 28 #endif
kaf24@6714 29 return *current;
kaf24@6714 30 }
kaf24@6714 31
kaf24@6714 32 #define current get_current()
kaf24@6714 33
kaf24@6714 34
kaf24@6714 35 void wake(struct thread *thread);
kaf24@6714 36 void block(struct thread *thread);
kaf24@6714 37
kaf24@6714 38 #endif /* __SCHED_H__ */