1/* 2 * Copyright 2005-2006, Haiku Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Axel Dörfler <axeld@pinc-software.de> 7 * Ingo Weinhold <bonefish@cs.tu-berlin.de> 8 */ 9#ifndef _KERNEL_ARCH_PPC_INT_H 10#define _KERNEL_ARCH_PPC_INT_H 11 12#include <SupportDefs.h> 13 14#define NUM_IO_VECTORS 256 15 16/* The sprg0 register of each CPU points to the physical address of such 17 a structure. So it is at hand in the early exception handling code. 18*/ 19struct ppc_cpu_exception_context { 20 void *kernel_handle_exception; // exception handler routine in the 21 // kernel 22 void *exception_context; // the virtual address of this 23 // structure 24 void *kernel_stack; // kernel stack for the current thread 25 26 uint32 scratch[8]; // scratch memory for free use in the 27 // early exception handling code 28}; 29 30#ifdef __cplusplus 31extern "C" { 32#endif 33 34 35struct ppc_cpu_exception_context *ppc_get_cpu_exception_context(int cpu); 36 37void ppc_set_current_cpu_exception_context( 38 struct ppc_cpu_exception_context *context); 39 // only called once per CPU 40 41 42#ifdef __cplusplus 43} 44#endif 45 46#endif /* _KERNEL_ARCH_PPC_INT_H */ 47