5 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
11 #ifndef __KERNEL_NOLIBBASE__
12 #define __KERNEL_NOLIBBASE__
13 #endif /* __KERNEL_NOLIBBASE__ */
15 #include <exec/execbase.h>
16 #include <exec/memory.h>
17 #include <exec/semaphores.h>
18 #include <aros/kernel.h>
20 /* Early declaration for ictl functions */
23 /* These two specify IRQ_COUNT and EXCEPTIONS_COUNT */
24 #include <kernel_arch.h>
25 #include <kernel_cpu.h>
27 /* Declare global variable at absolute address */
28 #define IMPORT_GLOBAL(var, addr) \
29 asm(".globl " # var "\n" \
30 ".set " # var ", " # addr )
32 /* Platform-specific stuff. Black box here. */
37 #define HW_IRQ_COUNT (256 - INTB_KERNEL - HW_IRQ_BASE)
39 #define HW_IRQ_COUNT (256 - INTB_KERNEL)
41 #endif /* !HW_IRQ_COUNT */
43 #define KBL_INTERNAL 0
44 #endif /* !KBL_INTERNAL */
46 #ifdef KERNELIRQ_NEEDSPRIVATE
49 IPTR ki_Priv
; /* arch specific per-irq data */
52 #define KERNELIRQ_LIST(x) KernelBase->kb_Interrupts[x].ki_List
54 #define KernelInt List
55 #define KERNELIRQ_LIST(x) KernelBase->kb_Interrupts[x]
58 /* kernel.resource base. Nothing spectacular, really. */
62 #ifdef KERNELIRQ_NEEDSCONTROLLERS
63 struct List kb_ICList
; /* list of all controller types */
64 struct List kb_InterruptMappings
;
66 struct MinList kb_Exceptions
[EXCEPTIONS_COUNT
];
67 struct KernelInt kb_Interrupts
[HW_IRQ_COUNT
];
68 ULONG kb_ContextFlags
; /* Hints for KrnCreateContext() */
69 ULONG kb_ContextSize
; /* Total length of CPU context */
70 ULONG kb_PageSize
; /* Physical memory page size */
71 struct PlatformData
*kb_PlatformData
;
72 #ifdef KERNELIRQ_NEEDSCONTROLLERS
73 UBYTE kb_ICTypeBase
; /* used to set IC controller ID's */
78 * Some useful global variables. They are global because:
79 * - BootMsg needs to be stored before KernelBase is allocated;
80 * - KernelBase is needed by interrupt handling code
82 extern struct TagItem
*BootMsg
;
83 extern struct KernelBase
*KernelBase
;
85 /* Allocation function */
86 struct KernelBase
*AllocKernelBase(struct ExecBase
*SysBase
);
88 /* Utility function to clear BSS segments. Call it before storing any globals!!! */
89 void __clear_bss(const struct KernelBSS
*bss
);
91 /* Memory header initialization functions */
92 void krnCreateMemHeader(CONST_STRPTR name
, BYTE pri
, APTR start
, IPTR size
, ULONG flags
);
93 struct MemHeader
*krnCreateROMHeader(CONST_STRPTR name
, APTR start
, APTR end
);
94 /* Memhry header - TLSF support functions */
95 void krnCreateTLSFMemHeader(CONST_STRPTR name
, BYTE pri
, APTR start
, IPTR size
, ULONG flags
);
96 struct MemHeader
* krnConvertMemHeaderToTLSF(struct MemHeader
* source
);
98 #ifdef KERNELIRQ_NEEDSCONTROLLERS
99 #include <kernel_interruptcontrollers.h>
102 #endif /* !KERNEL_BASE_H */