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
12 #include <hardware/vbe.h>
16 typedef struct int_gate_32bit apicidt_t
;
20 #define STACK_SIZE 8192
21 #define PAGE_SIZE 0x1000
22 #define PAGE_MASK 0x0FFF
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 /* Platform-specific part of KernelBase */
46 struct List kb_SysCallHandlers
;
47 APTR kb_APIC_TrampolineBase
;
48 struct ACPIData
*kb_ACPI
;
49 struct APICData
*kb_APIC
;
50 struct IOAPICData
*kb_IOAPIC
;
53 #define IDT_SIZE sizeof(apicidt_t) * 256
54 #define GDT_SIZE sizeof(long long) * 8
55 #define TLS_SIZE sizeof(struct tss)
58 #define __save_flags(x) __asm__ __volatile__("pushf ; pop %0":"=g" (x): /* no input */)
59 #define __restore_flags(x) __asm__ __volatile__("push %0 ; popf": /* no output */ :"g" (x):"memory", "cc")
61 #define krnLeaveSupervisorRing(_flags) \
62 asm("movl %[user_ds],%%eax\n\t" \
63 "mov %%eax,%%ds\n\t" \
64 "mov %%eax,%%es\n\t" \
65 "movl %%esp,%%ebx\n\t" \
68 "pushl %[iflags]\n\t" \
73 : : [user_ds] "r" (USER_DS), [cs] "i" (USER_CS), \
74 [iflags] "i" (_flags) \
77 #define FLAGS_INTENABLED 0x3002
79 void vesahack_Init(char *cmdline
, struct vbe_mode
*vmode
);
80 void core_Unused_Int(void);
84 void core_SetupGDT(struct KernBootPrivate
*, apicid_t
, APTR
, APTR
, APTR
);
85 void core_SetupMMU(struct KernBootPrivate
*, IPTR memtop
);
88 void core_CPUSetup(apicid_t
, APTR
, IPTR
);
90 void ictl_Initialize(struct KernelBase
*KernelBase
);
93 /* HW IRQ Related Functions */
94 struct ExceptionContext
;
95 extern const void *IntrDefaultGates
[256];
97 void core_LeaveInterrupt(struct ExceptionContext
*);
98 void core_Supervisor(struct ExceptionContext
*);
100 void PlatformPostInit(void);
102 #endif /* KERNEL_INTERN_H_ */