6c678c57c7
* Cloned iframe stack management from x86. * Reimplemented arch_thread_{get,set}_current_thread(). The thread structure is stored in SPRG2. It is set to NULL in arch_cpu_preboot_init(), now. A non-null current thread causes all kinds of undesired behavior in early boot code. * We establish the address space mappings we know from the Open Firmware as areas. At least those in kernel address space. The ones in userland address space are tougher. Fortunately on my Mac mini there aren't any save the boot_loader stack, which is not needed any longer anyway. * Added stack trace support to the kernel debugger. Mostly cloned and adjusted the x86 code. Some bits are still missing, like stack traces for other threads. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15890 a95241bf-73f2-0310-859d-f6bbb57e9c96
45 lines
853 B
C
45 lines
853 B
C
/*
|
|
* Copyright 2003-2006, Haiku Inc. All rights reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*
|
|
* Authors:
|
|
* Axel Dörfler <axeld@pinc-software.de>
|
|
* Ingo Weinhold <bonefish@cs.tu-berlin.de>
|
|
*/
|
|
#ifndef _KERNEL_ARCH_PPC_THREAD_H
|
|
#define _KERNEL_ARCH_PPC_THREAD_H
|
|
|
|
#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);
|
|
|
|
|
|
extern inline struct thread *
|
|
arch_thread_get_current_thread(void)
|
|
{
|
|
struct thread *t;
|
|
asm volatile("mfsprg2 %0" : "=r"(t));
|
|
return t;
|
|
}
|
|
|
|
|
|
extern inline void
|
|
arch_thread_set_current_thread(struct thread *t)
|
|
{
|
|
asm volatile("mtsprg2 %0" : : "r"(t));
|
|
}
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
|
|
#endif /* _KERNEL_ARCH_PPC_THREAD_H */
|