Added support for compiling C++ files. It isn't included for all
[AROS.git] / arch / all-mingw32 / kernel / kernel_cpu.h
blobc7f184828a0f395dd59336f6fb70f17b4016e48c
1 #ifndef KERNEL_CPU_H_
2 #define KERNEL_CPU_H_
4 /* First include CPU-dependent definitions */
6 #ifdef __i386__
7 #include "cpu_i386.h"
8 #endif
9 #ifdef __x86_64__
10 #include "cpu_x86_64.h"
11 #endif
12 #ifdef __arm__
13 #include "cpu_arm.h"
14 #endif
16 /* This macro serves as an indicator of included file */
17 #ifndef PRINT_CPUCONTEXT
18 #error Unsupported CPU
19 #endif
21 #ifdef __AROS__
23 #define regs_t CONTEXT
25 /* Some common definitions */
26 #define cpumode_t __unused char
28 #define goSuper() 0
29 #define goUser()
30 #define goBack(mode)
32 #define AROS_EXCEPTION_SYSCALL 0x00080001
33 #define AROS_EXCEPTION_RESUME 0x00080002
35 /* Our virtual CPU interface. It's needed here for krnSysCall() definition */
36 struct KernelInterface
38 int (*core_init)(unsigned int TimerPeriod);
39 void (*core_raise)(ULONG num, const IPTR n);
40 unsigned int (*core_protect)(void *addr, unsigned int len, unsigned int prot);
41 void (*core_putc)(char c);
42 int (*core_getc)(void);
43 void (*core_alert)(const char *text);
44 int (**TrapVector)(unsigned int num, IPTR *args, CONTEXT *regs);
45 int (**IRQVector)(unsigned char *irqs, CONTEXT *regs);
46 volatile int *IntState;
47 volatile int *SuperState;
48 volatile unsigned char *SleepState;
49 volatile ULONG **LastErrorPtr;
52 extern struct KernelInterface KernelIFace;
54 #define krnSysCall(n) KernelIFace.core_raise(AROS_EXCEPTION_SYSCALL, n)
55 #define Sleep_Mode (*KernelIFace.SleepState)
56 #define LastErrorPtr (*KernelIFace.LastErrorPtr)
58 #endif
60 /* Interrupt enable states */
61 #define INT_DISABLE 0
62 #define INT_ENABLE 1
63 #define INT_HALT -1
65 /* Sleep states */
66 #define SLEEP_MODE_OFF 0
67 #define SLEEP_MODE_PENDING 1
68 #define SLEEP_MODE_ON 2
70 #endif