1 #include <exec/execbase.h>
2 #include <exec/memory.h>
3 #include <proto/exec.h>
5 #include LC_LIBDEFS_FILE /* we want FUNCTIONS_COUNT */
7 #include <kernel_debug.h>
8 #include <kernel_globals.h>
9 #include "kernel_intern.h"
10 #include "kernel_unix.h"
14 struct KernelBase
*AllocKernelBase(struct ExecBase
*SysBase
)
17 struct KernelBase
*KernelBase
;
18 ULONG i
= FUNCTIONS_COUNT
* LIB_VECTSIZE
;
20 /* Align vector table size */
21 i
= ((i
- 1) / sizeof(IPTR
) + 1) * sizeof(IPTR
);
23 /* Allocate the memory. Note that we have platform-specific portion in KernelBase. */
24 mem
= AllocMem(i
+ sizeof(struct UnixKernelBase
), MEMF_PUBLIC
|MEMF_CLEAR
);
28 /* Skip past the vector table */
31 KernelBase
->kb_PlatformData
= AllocMem(sizeof(struct PlatformData
), MEMF_ANY
);
32 D(bug("[KRN] PlatformData %p\n", KernelBase
->kb_PlatformData
));
34 if (!KernelBase
->kb_PlatformData
)
37 /* Set global KernelBase storage and return */
38 setKernelBase(KernelBase
);