Files
xen/extras/mini-os/include/sched.h
T
kaf24@firebug.cl.cam.ac.uk f08246e197 Fix x86/64 version of Mini-OS. It encompasses the following:
a) 64-bit switch_to scheduler macro (by Aravindh Puthiyaparambil)
b) implements 64-bit hypervisor_callback
c) fixes thread creation issues (thread_starter used to perform 
initialisation)

Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>
2006-05-02 09:12:39 +01:00

41 lines
808 B
C

#ifndef __SCHED_H__
#define __SCHED_H__
#include <list.h>
struct thread
{
char *name;
char *stack;
unsigned long sp; /* Stack pointer */
unsigned long ip; /* Instruction pointer */
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));
#else
__asm__("andq %%rsp,%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__ */