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