grub2: bring back build of aros-side grub2 tools
[AROS.git] / rom / kernel / kernel_base.h
blob23506b5664e0b3495e5567f71d9fc1343c4a26cf
1 /*
2 Copyright � 1995-2013, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 */
8 #define __KERNEL_NOLIBBASE__
10 #include <exec/execbase.h>
11 #include <exec/memory.h>
12 #include <exec/semaphores.h>
13 #include <aros/kernel.h>
15 /* Early declaration for ictl functions */
16 struct KernelBase;
18 /* These two specify IRQ_COUNT and EXCEPTIONS_COUNT */
19 #include <kernel_arch.h>
20 #include <kernel_cpu.h>
22 /* Declare global variable at absolute address */
23 #define IMPORT_GLOBAL(var, addr) \
24 asm(".globl " # var "\n" \
25 ".set " # var ", " # addr )
27 /* Platform-specific stuff. Black box here. */
28 struct PlatformData;
30 /* kernel.resource base. Nothing spectacular, really. */
31 struct KernelBase
33 struct Node kb_Node;
34 struct MinList kb_Exceptions[EXCEPTIONS_COUNT];
35 struct List kb_Interrupts[IRQ_COUNT];
36 ULONG kb_ContextFlags; /* Hints for KrnCreateContext() */
37 ULONG kb_ContextSize; /* Total length of CPU context */
38 ULONG kb_PageSize; /* Physical memory page size */
39 struct PlatformData *kb_PlatformData;
43 * Some useful global variables. They are global because:
44 * - BootMsg needs to be stored before KernelBase is allocated;
45 * - KernelBase is needed by interrupt handling code
47 extern struct TagItem *BootMsg;
48 extern struct KernelBase *KernelBase;
50 /* Allocation function */
51 struct KernelBase *AllocKernelBase(struct ExecBase *SysBase);
53 /* Utility function to clear BSS segments. Call it before storing any globals!!! */
54 void __clear_bss(const struct KernelBSS *bss);
56 /* Memory header initialization functions */
57 void krnCreateMemHeader(CONST_STRPTR name, BYTE pri, APTR start, IPTR size, ULONG flags);
58 struct MemHeader *krnCreateROMHeader(CONST_STRPTR name, APTR start, APTR end);
59 /* Memhry header - TLSF support functions */
60 void krnCreateTLSFMemHeader(CONST_STRPTR name, BYTE pri, APTR start, IPTR size, ULONG flags);
61 struct MemHeader * krnConvertMemHeaderToTLSF(struct MemHeader * source);