2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
6 #include <exec/execbase.h>
7 #include <exec/memory.h>
8 #include <proto/exec.h>
10 #include LC_LIBDEFS_FILE /* we want FUNCTIONS_COUNT */
12 #include <kernel_debug.h>
13 #include <kernel_globals.h>
14 #include "kernel_intern.h"
15 #include "kernel_unix.h"
19 struct KernelBase
*AllocKernelBase(struct ExecBase
*SysBase
)
22 struct KernelBase
*KernelBase
;
23 ULONG i
= FUNCTIONS_COUNT
* LIB_VECTSIZE
;
25 /* Align vector table size */
26 i
= ((i
- 1) / sizeof(IPTR
) + 1) * sizeof(IPTR
);
28 /* Allocate the memory. Note that we have platform-specific portion in KernelBase. */
29 mem
= AllocMem(i
+ sizeof(struct UnixKernelBase
), MEMF_PUBLIC
|MEMF_CLEAR
);
33 /* Skip past the vector table */
36 KernelBase
->kb_PlatformData
= AllocMem(sizeof(struct PlatformData
), MEMF_ANY
);
37 D(bug("[KRN] PlatformData %p\n", KernelBase
->kb_PlatformData
));
39 if (!KernelBase
->kb_PlatformData
)
42 /* Set global KernelBase storage and return */
43 setKernelBase(KernelBase
);