4 /* First include CPU-dependent definitions */
10 #include "cpu_x86_64.h"
13 /* This macro serves as an indicator of included file */
14 #ifndef PRINT_CPUCONTEXT
15 #error Unsupported CPU
20 #define regs_t CONTEXT
22 /* Some common definitions */
23 #define cpumode_t __unused char
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)
57 /* Interrupt enable states */
63 #define SLEEP_MODE_OFF 0
64 #define SLEEP_MODE_PENDING 1
65 #define SLEEP_MODE_ON 2