grub2: bring back build of aros-side grub2 tools
[AROS.git] / rom / kernel / allockernelbase.c
blob32a1da4d45ef435e458632e54c121fc60bbbcca9
1 /*
2 Copyright © 2011, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Allocate kernel.resource base.
6 Lang: english
7 */
9 #include <exec/memory.h>
10 #include <proto/exec.h>
12 #include LC_LIBDEFS_FILE
13 #include <kernel_globals.h>
15 struct KernelBase *AllocKernelBase(struct ExecBase *SysBase)
17 APTR mem;
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 */
24 mem = AllocMem(i + sizeof(struct KernelBase), MEMF_PUBLIC|MEMF_CLEAR);
25 if (!mem)
26 return NULL;
28 /* Skip past the vector table */
29 mem += i;
31 return mem;