2003-05-03 16:49:57 +04:00
|
|
|
/*
|
2011-01-11 00:54:38 +03:00
|
|
|
* Copyright 2003-2011, Haiku Inc. All rights reserved.
|
2006-01-10 06:00:33 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Axel Dörfler <axeld@pinc-software.de>
|
|
|
|
* Ingo Weinhold <bonefish@cs.tu-berlin.de>
|
|
|
|
*/
|
2003-05-03 16:49:57 +04:00
|
|
|
#ifndef _KERNEL_ARCH_PPC_THREAD_H
|
|
|
|
#define _KERNEL_ARCH_PPC_THREAD_H
|
|
|
|
|
2006-01-10 06:00:33 +03:00
|
|
|
#include <arch/cpu.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void ppc_push_iframe(struct iframe_stack *stack, struct iframe *frame);
|
|
|
|
void ppc_pop_iframe(struct iframe_stack *stack);
|
|
|
|
struct iframe *ppc_get_user_iframe(void);
|
|
|
|
|
|
|
|
|
2011-01-11 00:54:38 +03:00
|
|
|
static inline Thread *
|
2006-01-10 06:00:33 +03:00
|
|
|
arch_thread_get_current_thread(void)
|
|
|
|
{
|
2011-01-11 00:54:38 +03:00
|
|
|
Thread *t;
|
2006-01-10 06:00:33 +03:00
|
|
|
asm volatile("mfsprg2 %0" : "=r"(t));
|
|
|
|
return t;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-03-30 19:00:10 +04:00
|
|
|
static inline void
|
2011-01-11 00:54:38 +03:00
|
|
|
arch_thread_set_current_thread(Thread *t)
|
2006-01-10 06:00:33 +03:00
|
|
|
{
|
|
|
|
asm volatile("mtsprg2 %0" : : "r"(t));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2003-05-03 16:49:57 +04:00
|
|
|
#endif /* _KERNEL_ARCH_PPC_THREAD_H */
|