The Pedigree Project  0.1
StackFrame.h
1 /*
2  * Copyright (c) 2008-2014, Pedigree Developers
3  *
4  * Please see the CONTRIB file in the root of the source tree for a full
5  * list of contributors.
6  *
7  * Permission to use, copy, modify, and distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #ifndef KERNEL_PROCESSOR_STACKFRAME_H
21 #define KERNEL_PROCESSOR_STACKFRAME_H
22 
23 #include "pedigree/kernel/processor/StackFrameBase.h" // IWYU pragma: export
24 
25 #if defined(X86)
26 #include "pedigree/kernel/processor/x86/StackFrame.h" // IWYU pragma: export
27 #define PROCESSOR_SPECIFIC_NAME(x) X86##x
28 #elif defined(X64)
29 #include "pedigree/kernel/processor/x64/StackFrame.h" // IWYU pragma: export
30 #define PROCESSOR_SPECIFIC_NAME(x) X64##x
31 #elif defined(MIPS32)
32 #include "pedigree/kernel/processor/mips32/StackFrame.h" // IWYU pragma: export
33 #define PROCESSOR_SPECIFIC_NAME(x) MIPS32##x
34 #elif defined(MIPS64)
35 #include "pedigree/kernel/processor/mips64/StackFrame.h" // IWYU pragma: export
36 #define PROCESSOR_SPECIFIC_NAME(x) MIPS64##x
37 #elif defined(ARM926E)
38 #include "pedigree/kernel/processor/arm_926e/StackFrame.h" // IWYU pragma: export
39 #define PROCESSOR_SPECIFIC_NAME(x) ARM926E##x
40 #elif defined(PPC32)
41 #include "pedigree/kernel/processor/ppc32/StackFrame.h" // IWYU pragma: export
42 #define PROCESSOR_SPECIFIC_NAME(x) PPC32##x
43 #elif defined(ARMV7)
44 #include "pedigree/kernel/processor/armv7/StackFrame.h" // IWYU pragma: export
45 #define PROCESSOR_SPECIFIC_NAME(x) ARMV7##x
46 #elif defined(HOSTED)
47 #include "pedigree/kernel/processor/hosted/StackFrame.h" // IWYU pragma: export
48 #define PROCESSOR_SPECIFIC_NAME(x) Hosted##x
49 #endif
50 
51 // NOTE: This throws a compile-time error if this header is not adapted for
52 // the selected processor architecture
53 #if !defined(PROCESSOR_SPECIFIC_NAME)
54 #error Unknown processor architecture
55 #endif
56 
60 // NOTE: If a newly added processor architecture does not supply all the
61 // needed types, you will get an error here
62 
64 typedef PROCESSOR_SPECIFIC_NAME(StackFrame) StackFrame;
65 
68 #undef PROCESSOR_SPECIFIC_NAME
69 
70 #endif
typedef PROCESSOR_SPECIFIC_NAME(StackFrame) StackFrame