Files
xen/extras/mini-os/include/arm/arch_sched.h
T
Karim Raslan abc465b15c mini-os: arm: add header files
Adds header files for future ARM support.
Based on work by Karim Allah Ahmed.

Signed-off-by: Karim Allah Ahmed <karim.allah.ahmed@gmail.com>
Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2014-09-08 12:15:49 +01:00

20 lines
509 B
C

#ifndef __ARCH_SCHED_H__
#define __ARCH_SCHED_H__
#include "arch_limits.h"
static inline struct thread* get_current(void)
{
struct thread **current;
unsigned long sp;
__asm__ __volatile__ ("mov %0, sp":"=r"(sp));
current = (void *)(unsigned long)(sp & ~(__STACK_SIZE-1));
return *current;
}
void __arch_switch_threads(unsigned long *prevctx, unsigned long *nextctx);
#define arch_switch_threads(prev,next) __arch_switch_threads(&(prev)->sp, &(next)->sp)
#endif /* __ARCH_SCHED_H__ */