make the linux-ppc packags be in synch with other platforms
[tangerine.git] / arch / x86_64-pc / kernel / kernel_intern.h
blob419522661142da5940e7170937814f850bca18da
1 #ifndef KERNEL_INTERN_H_
2 #define KERNEL_INTERN_H_
4 #include <inttypes.h>
5 #include <exec/nodes.h>
6 #include <exec/lists.h>
7 #include <aros/kernel.h>
8 #include <utility/tagitem.h>
9 #include <asm/cpu.h>
11 #include <stdio.h>
13 #include "acpi.h"
14 #include "apic.h"
16 struct KernelBase {
17 struct Node kb_Node;
18 void * kb_MemPool;
19 struct List kb_Intr[256];
20 IPTR kb_ACPIRSDP;
21 uint16_t kb_XTPIC_Mask;
22 IPTR kb_APICBase;
23 UBYTE *kb_APICIDMap;
24 UBYTE kb_APICCount;
27 #define KBL_INTERNAL 0
28 #define KBL_XTPIC 1
29 #define KBL_APIC 2
31 struct IntrNode {
32 struct MinNode in_Node;
33 void (*in_Handler)(void *, void *);
34 void *in_HandlerData;
35 void *in_HandlerData2;
38 #define STACK_SIZE 8192
39 #define PAGE_SIZE 0x1000
41 #define SC_CAUSE 0
42 #define SC_DISPATCH 1
43 #define SC_SWITCH 2
44 #define SC_SCHEDULE 3
46 int exec_main(struct TagItem *msg, void *entry);
47 void core_LeaveInterrupt(regs_t *regs) __attribute__((noreturn));
48 void core_Switch(regs_t *regs) __attribute__((noreturn));
49 void core_Schedule(regs_t *regs) __attribute__((noreturn));
50 void core_Dispatch(regs_t *regs) __attribute__((noreturn));
51 void core_ExitInterrupt(regs_t *regs) __attribute__((noreturn));
52 void core_IRQHandle(regs_t regs);
53 void core_Cause(struct ExecBase *SysBase);
54 /** ACPI Functions **/
55 IPTR core_ACPIProbe();
56 ULONG core_ACPIInitialise();
57 int core_ACPIIsBlacklisted();
58 IPTR core_ACPIRootSystemDescriptionPointerLocate();
59 IPTR core_ACPIRootSystemDescriptionPointerScan(IPTR, IPTR);
60 int core_ACPITableChecksum(void *, unsigned long);
61 IPTR core_ACPITableSDTGet(struct acpi_table_rsdp *);
62 int core_ACPITableParse(int, struct acpi_table_hook *);
63 int core_ACPITableMADTParse(int, struct acpi_madt_entry_hook *);
64 int core_ACPITableMADTFamParse(int, unsigned long, int, struct acpi_madt_entry_hook *);
65 int core_ACPITableHeaderEarly(int, struct acpi_table_header **);
66 /** CPU Functions **/
67 IPTR core_APICProbe();
68 IPTR core_APICGetMSRAPICBase();
69 UBYTE core_APICGetID(IPTR);
70 void core_APICInitialise(IPTR);
71 unsigned long core_APICIPIWake(UBYTE, IPTR);
72 void core_SetupIDT();
73 void core_SetupGDT();
74 void core_SetupMMU();
75 void core_CPUSetup(IPTR);
76 void core_ProtKernelArea(intptr_t addr, intptr_t length, char p, char rw, char us);
77 void core_DefaultIRETQ();
78 /** Kernel Attribute Functions **/
79 struct TagItem *krnNextTagItem(const struct TagItem **tagListPtr);
80 struct TagItem *krnFindTagItem(Tag tagValue, const struct TagItem *tagList);
81 IPTR krnGetTagData(Tag tagValue, intptr_t defaultVal, const struct TagItem *tagList);
82 void krnSetTagData(Tag tagValue, intptr_t newtagValue, const struct TagItem *tagList);
84 /* Debug support .. */
85 void scr_RawPutChars(char *, int);
86 void clr();
87 static char tab[512];
88 #ifdef rkprintf
89 #undef rkprintf
90 #endif
91 #define rkprintf(x...) scr_RawPutChars(tab, snprintf(tab, 510, x))
93 #endif /*KERNEL_INTERN_H_*/