diff options
author | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2005-09-09 09:24:25 +0000 |
---|---|---|
committer | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2005-09-09 09:24:25 +0000 |
commit | cdb8b09f6b67b270b1c21f1a7f42d5e8a604caa8 (patch) | |
tree | 414d05b171df34e0125f29731a8ba12e280297d9 /extras/mini-os/include/sched.h | |
parent | c125eb9c047b908b2bb18e5cf4a88355a1526a25 (diff) | |
download | xen-cdb8b09f6b67b270b1c21f1a7f42d5e8a604caa8.tar.gz xen-cdb8b09f6b67b270b1c21f1a7f42d5e8a604caa8.tar.bz2 xen-cdb8b09f6b67b270b1c21f1a7f42d5e8a604caa8.zip |
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>
Diffstat (limited to 'extras/mini-os/include/sched.h')
-rw-r--r-- | extras/mini-os/include/sched.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/extras/mini-os/include/sched.h b/extras/mini-os/include/sched.h new file mode 100644 index 0000000000..d7b26289ff --- /dev/null +++ b/extras/mini-os/include/sched.h @@ -0,0 +1,38 @@ +#ifndef __SCHED_H__ +#define __SCHED_H__ + +#include <list.h> + +struct thread +{ + char *name; + char *stack; + unsigned long eps; + unsigned long eip; + struct list_head thread_list; + u32 flags; +}; + + + +void init_sched(void); +void run_idle_thread(void); +struct thread* create_thread(char *name, void (*function)(void *), void *data); +void schedule(void); + +static inline struct thread* get_current(void) +{ + struct thread **current; +#ifdef __i386__ + __asm__("andl %%esp,%0; ":"=r" (current) : "r" (~8191UL)); +#endif + return *current; +} + +#define current get_current() + + +void wake(struct thread *thread); +void block(struct thread *thread); + +#endif /* __SCHED_H__ */ |