ia64/xen-unstable

view extras/mini-os/include/x86/arch_sched.h @ 16838:945820bfedb6

minios: POSIX fixes
Fixes some functions which are POSIX. Also make them ifndef HAVE_LIBC.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jan 22 14:20:22 2008 +0000 (2008-01-22)
parents d5e22e766d1f
children a905c582a406
line source
2 #ifndef __ARCH_SCHED_H__
3 #define __ARCH_SCHED_H__
5 #include <arch_mm.h>
7 static inline struct thread* get_current(void)
8 {
9 struct thread **current;
10 #ifdef __i386__
11 register unsigned long sp asm("esp");
12 #else
13 register unsigned long sp asm("rsp");
14 #endif
15 current = (void *)(unsigned long)(sp & ~(STACK_SIZE-1));
16 return *current;
17 }
19 extern void __arch_switch_threads(unsigned long *prevctx, unsigned long *nextctx);
21 #define arch_switch_threads(prev,next) __arch_switch_threads(&(prev)->sp, &(next)->sp)
25 #endif /* __ARCH_SCHED_H__ */