# HG changeset patch # User hahn@xxxxxxxxxxxxxxxx # Date 1161349699 -7200 # Node ID a0b9dba41e690bfa237e65405f0efedbfa9776b1 # Parent bceae1ee499a3ce613d825165c825999f373bf73 The x86 special parts are separated in include/sched.h and moved to the new file include/x86/arch_sched.h. Signed-off-by: Dietmar Hahn diff -r bceae1ee499a -r a0b9dba41e69 extras/mini-os/include/sched.h --- a/extras/mini-os/include/sched.h Thu Oct 19 14:14:25 2006 +0200 +++ b/extras/mini-os/include/sched.h Fri Oct 20 15:08:19 2006 +0200 @@ -2,13 +2,18 @@ #define __SCHED_H__ #include +#include struct thread { char *name; char *stack; +#if !defined(__ia64__) unsigned long sp; /* Stack pointer */ unsigned long ip; /* Instruction pointer */ +#else /* !defined(__ia64__) */ + thread_regs_t regs; +#endif /* !defined(__ia64__) */ struct list_head thread_list; u32 flags; }; @@ -20,18 +25,6 @@ struct thread* create_thread(char *name, 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)); -#elif __ia64__ - __asm ("mov %0=r13" : "=r" (current)); -#else - __asm__("andq %%rsp,%0; ":"=r" (current) : "r" (~8191UL)); -#endif - return *current; -} #define current get_current() diff -r bceae1ee499a -r a0b9dba41e69 extras/mini-os/include/x86/arch_sched.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/extras/mini-os/include/x86/arch_sched.h Fri Oct 20 15:08:19 2006 +0200 @@ -0,0 +1,16 @@ +#ifndef __ARCH_SCHED_H__ +#define __ARCH_SCHED_H__ + + +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; +} + +#endif /* __ARCH_SCHED_H__ */