revert between 56095 -> 55830 in arch
[AROS.git] / arch / i386-pc / kernel / kernel_cpu.h
blob104824a3a70609e3039a1a6b305fd937db8b53e4
1 /*
2 Copyright © 1995-2018, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: CPU-specific definitions.
6 */
8 #ifndef KERNEL_CPU_H_
9 #define KERNEL_CPU_H_
11 #include <aros/i386/cpucontext.h>
13 #include "segments.h"
15 /* We use native context format, no conversion needed */
16 #define regs_t struct ExceptionContext
17 /* There are no private add-ons */
18 #define AROSCPUContext ExceptionContext
20 /* We have no VBlank emulation */
21 #define NO_VBLANK_EMU
23 /* User/supervisor mode switching - not used */
24 #define cpumode_t __unused char
26 #define goSuper() 0
27 #define goUser()
28 #define goBack(mode)
30 /* A command to issue a syscall */
31 #define krnSysCall(num) asm volatile("int $0xfe"::"a"(num):"memory")
33 #define IN_USER_MODE \
34 ({ short __value; \
35 __asm__ __volatile__ ("mov %%cs,%%ax":"=a"(__value)); \
36 (__value & 0x03); })
38 #define PRINT_CPUCONTEXT(regs) \
39 { \
40 bug("[Kernel] Flags=0x%08X\n", regs->Flags); \
41 bug("[Kernel] stack=%04x:%08x eflags=%08x eip=%04x:%08x ds=0x%04X\n", \
42 regs->ss, regs->esp, regs->eflags, regs->cs, regs->eip, regs->ds); \
43 bug("[Kernel] eax=%08x ebx=%08x ecx=%08x edx=%08x\n", regs->eax, regs->ebx, regs->ecx, regs->edx); \
44 bug("[Kernel] esi=%08x edi=%08x ebp=%08x esp=%08x\n", regs->esi, regs->edi, regs->ebp, regs->esp); \
47 #define SP(regs) regs->esp
49 #endif