revert between 56095 -> 55830 in arch
[AROS.git] / arch / x86_64-pc / kernel / kernel_cpu.h
blobd0235c4cd875ffdb8d3547221917d91550f20f99
1 /* CPU-specific definitions for x86-64 */
3 #ifndef KERNEL_CPU_H_
4 #define KERNEL_CPU_H_
6 #include <aros/x86_64/cpucontext.h>
8 #include "segments.h"
10 /* We use native context format, no conversion needed */
11 #define regs_t struct ExceptionContext
12 /* There are no private add-ons */
13 #define AROSCPUContext ExceptionContext
15 /* We have no VBlank emulation */
16 #define NO_VBLANK_EMU
18 /* User/supervisor mode switching */
19 #define cpumode_t __unused char
21 #define goSuper() 0
22 #define goUser()
23 #define goBack(mode)
25 /* A command to issue a syscall */
26 #define krnSysCall(num) asm volatile("int $0xfe"::"a"(num):"memory")
28 #define IN_USER_MODE \
29 ({ \
30 short __value; \
31 __asm__ __volatile__ ("mov %%cs,%%ax":"=a"(__value)); \
32 (__value & 0x03); \
35 #define PRINT_CPUCONTEXT(regs) \
36 bug("[Kernel] Flags=0x%08X\n", regs->Flags); \
37 bug("[Kernel] stack=%04x:%012x rflags=%016x ip=%04x:%012x ds=0x%04X\n", \
38 regs->ss, regs->rsp, regs->rflags, regs->cs, regs->rip, regs->ds); \
39 bug("[Kernel] rax=%016lx rbx=%016lx rcx=%016lx rdx=%016lx\n", regs->rax, regs->rbx, regs->rcx, regs->rdx); \
40 bug("[Kernel] rsi=%016lx rdi=%016lx rbp=%016lx rsp=%016lx\n", regs->rsi, regs->rdi, regs->rbp, regs->rsp); \
41 bug("[Kernel] r08=%016lx r09=%016lx r10=%016lx r11=%016lx\n", regs->r8, regs->r9, regs->r10, regs->r11); \
42 bug("[Kernel] r12=%016lx r13=%016lx r14=%016lx r15=%016lx\n", regs->r12, regs->r13, regs->r14, regs->r15);
44 #define SP(regs) regs->rsp
46 #endif