1 #ifndef KERNEL_INTERN_H_
2 #define KERNEL_INTERN_H_
4 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
7 Desc: 32bit x86 kernel_intern.h
13 #include <aros/kernel.h>
14 #include <utility/tagitem.h>
16 #include <hardware/vbe.h>
18 typedef struct int_gate_32bit apicidt_t
;
22 #define STACK_SIZE 8192
24 #define DEF_IRQRETFUNC core_DefaultIRET
27 * Boot-time private data.
28 * This structure is write-protected in user mode and survives warm restarts.
30 struct KernBootPrivate
32 IPTR _APICBase
; /* Bootstrap APIC base address */
33 UWORD kbp_APIC_BSPID
; /* Bootstrap APIC logical ID */
38 struct CPUMMUConfig MMU
;
41 extern struct KernBootPrivate
*__KernBootPrivate
;
43 #define IDT_SIZE sizeof(apicidt_t) * 256
44 #define GDT_SIZE sizeof(long long) * 8
45 #define TLS_SIZE sizeof(struct tss)
48 #define __save_flags(x) __asm__ __volatile__("pushf ; pop %0":"=g" (x): /* no input */)
49 #define __restore_flags(x) __asm__ __volatile__("push %0 ; popf": /* no output */ :"g" (x):"memory", "cc")
51 #define krnLeaveSupervisorRing(_flags) \
52 asm("movl %[user_ds],%%eax\n\t" \
53 "mov %%eax,%%ds\n\t" \
54 "mov %%eax,%%es\n\t" \
55 "movl %%esp,%%ebx\n\t" \
58 "pushl %[iflags]\n\t" \
63 : : [user_ds] "r" (USER_DS), [cs] "i" (USER_CS), \
64 [iflags] "i" (_flags) \
67 #define FLAGS_INTENABLED 0x3002
69 void vesahack_Init(char *cmdline
, struct vbe_mode
*vmode
);
70 void core_Unused_Int(void);
74 void core_SetupGDT(struct KernBootPrivate
*, apicid_t
, APTR
, APTR
, APTR
);
75 void core_SetupMMU(struct KernBootPrivate
*, IPTR memtop
);
78 void core_CPUSetup(apicid_t
, APTR
, IPTR
);
80 void ictl_Initialize(struct KernelBase
*KernelBase
);
83 /* HW IRQ Related Functions */
84 struct ExceptionContext
;
85 extern const void *IntrDefaultGates
[256];
87 void core_LeaveInterrupt(struct ExceptionContext
*);
88 void core_Supervisor(struct ExceptionContext
*);
90 void PlatformPostInit(void);
92 #endif /* KERNEL_INTERN_H_ */