The Pedigree Project  0.1
state_forward.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_STATE_FORWARD_H
21 #define KERNEL_PROCESSOR_STATE_FORWARD_H
22 
23 #if defined(X86)
24 #define PROCESSOR_SPECIFIC_NAME(x) X86##x
25 #elif defined(X64)
26 #define PROCESSOR_SPECIFIC_NAME(x) X64##x
27 #elif defined(MIPS32)
28 #define PROCESSOR_SPECIFIC_NAME(x) MIPS32##x
29 #elif defined(MIPS64)
30 #define PROCESSOR_SPECIFIC_NAME(x) MIPS64##x
31 #elif defined(ARM926E)
32 #define PROCESSOR_SPECIFIC_NAME(x) ARM926E##x
33 #elif defined(PPC32)
34 #define PROCESSOR_SPECIFIC_NAME(x) PPC32##x
35 #elif defined(ARMV7)
36 #define PROCESSOR_SPECIFIC_NAME(x) ARMV7##x
37 #elif defined(HOSTED)
38 #define PROCESSOR_SPECIFIC_NAME(x) Hosted##x
39 #endif
40 
41 // NOTE: This throws a compile-time error if this header is not adapted for
42 // the selected processor architecture
43 #if !defined(PROCESSOR_SPECIFIC_NAME)
44 #error Unknown processor architecture
45 #endif
46 
50 // NOTE: If a newly added processor architecture does not supply all the
51 // needed types, you will get an error here
52 
53 // Forward-declare all source classes.
54 class PROCESSOR_SPECIFIC_NAME(InterruptState);
55 class PROCESSOR_SPECIFIC_NAME(SyscallState);
56 class PROCESSOR_SPECIFIC_NAME(ProcessorState);
57 class PROCESSOR_SPECIFIC_NAME(SchedulerState);
58 
60 typedef PROCESSOR_SPECIFIC_NAME(InterruptState) InterruptState;
62 typedef PROCESSOR_SPECIFIC_NAME(SyscallState) SyscallState;
65 typedef PROCESSOR_SPECIFIC_NAME(ProcessorState) ProcessorState;
68 typedef PROCESSOR_SPECIFIC_NAME(SchedulerState) SchedulerState;
69 
72 #undef PROCESSOR_SPECIFIC_NAME
73 
74 #endif
class PROCESSOR_SPECIFIC_NAME(InterruptState)