Fix IO memory access .. SB128 driver makes noises in VMWare - CMI is untested (Curren...
[AROS.git] / arch / all-mingw32 / kernel / kernel_cpu.h
blobad9eb1c336b67f6ba47342b4e8329fa3810e1dd2
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
13 /* This macro serves as an indicator of included file */
14 #ifndef PRINT_CPUCONTEXT
15 #error Unsupported CPU
16 #endif
18 #ifdef __AROS__
20 #define regs_t CONTEXT
22 /* Some common definitions */
23 #define cpumode_t __unused char
25 #define goSuper() 0
26 #define goUser()
27 #define goBack(mode)
29 #define AROS_EXCEPTION_SYSCALL 0x00080001
30 #define AROS_EXCEPTION_RESUME 0x00080002
32 /* Our virtual CPU interface. It's needed here for krnSysCall() definition */
33 struct KernelInterface
35 int (*core_init)(unsigned int TimerPeriod);
36 void (*core_raise)(ULONG num, const IPTR n);
37 unsigned int (*core_protect)(void *addr, unsigned int len, unsigned int prot);
38 void (*core_putc)(char c);
39 int (*core_getc)(void);
40 void (*core_alert)(const char *text);
41 int (**TrapVector)(unsigned int num, IPTR *args, CONTEXT *regs);
42 int (**IRQVector)(unsigned char *irqs, CONTEXT *regs);
43 volatile int *IntState;
44 volatile int *SuperState;
45 volatile unsigned char *SleepState;
46 volatile ULONG **LastErrorPtr;
49 extern struct KernelInterface KernelIFace;
51 #define krnSysCall(n) KernelIFace.core_raise(AROS_EXCEPTION_SYSCALL, n)
52 #define Sleep_Mode (*KernelIFace.SleepState)
53 #define LastErrorPtr (*KernelIFace.LastErrorPtr)
55 #endif
57 /* Interrupt enable states */
58 #define INT_DISABLE 0
59 #define INT_ENABLE 1
60 #define INT_HALT -1
62 /* Sleep states */
63 #define SLEEP_MODE_OFF 0
64 #define SLEEP_MODE_PENDING 1
65 #define SLEEP_MODE_ON 2
67 #endif