* The exception vector offset is now also part of the iframe.

* 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
This commit is contained in:
Ingo Weinhold
2006-01-10 03:00:33 +00:00
parent 1777154c14
commit 6c678c57c7
10 changed files with 424 additions and 42 deletions
@@ -13,6 +13,7 @@
#define PAGE_SIZE 4096
struct iframe {
uint32 vector;
uint32 srr0;
uint32 srr1;
uint32 dar;
+39 -3
View File
@@ -1,8 +1,44 @@
/*
** Copyright 2003, Axel Dörfler, [email protected]. All rights reserved.
** Distributed under the terms of the OpenBeOS License.
*/
* Copyright 2003-2006, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Axel Dörfler <[email protected]>
* Ingo Weinhold <[email protected]>
*/
#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 */
@@ -5,17 +5,34 @@
#ifndef KERNEL_ARCH_PPC_THREAD_TYPES_H
#define KERNEL_ARCH_PPC_THREAD_TYPES_H
#define IFRAME_TRACE_DEPTH 4
struct iframe_stack {
struct iframe *frames[IFRAME_TRACE_DEPTH];
int32 index;
};
// architecture specific thread info
struct arch_thread {
void *sp; // stack pointer
void *sp; // stack pointer
void *interrupt_stack;
// used to track interrupts on this thread
struct iframe_stack iframes;
};
struct arch_team {
// nothing here
// gcc treats empty structures as zero-length in C, but as if they contain
// a char in C++. So we have to put a dummy in to be able to use the struct
// from both in a consistent way.
char dummy;
};
struct arch_fork_arg {
// nothing here yet
// gcc treats empty structures as zero-length in C, but as if they contain
// a char in C++. So we have to put a dummy in to be able to use the struct
// from both in a consistent way.
char dummy;
};
#endif /* KERNEL_ARCH_PPC_THREAD_TYPES_H */