revert between 56095 -> 55830 in arch
[AROS.git] / arch / all-pc / kernel / alloccpumask.c
blob01c38610919c83b802869e202cd1ff1dd72a5992
1 /*
2 Copyright © 2017, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 */
8 #include <proto/exec.h>
10 #include <aros/kernel.h>
11 #include <aros/libcall.h>
13 #include "kernel_base.h"
14 #include "kernel_intern.h"
16 AROS_LH0(void *, KrnAllocCPUMask,
17 struct KernelBase *, KernelBase, 42, Kernel)
19 AROS_LIBFUNC_INIT
21 void *mask = NULL;
22 struct PlatformData *pdata = KernelBase->kb_PlatformData;
23 struct APICData *apicData;
24 int count;
26 if ((pdata) && (pdata->kb_APIC))
28 apicData = pdata->kb_APIC;
30 count = apicData->apic_count / 32;
32 if ((count * 32) < apicData->apic_count)
33 count += 1;
35 mask = AllocMem(count * sizeof(ULONG), MEMF_CLEAR | MEMF_PUBLIC);
38 return mask;
40 AROS_LIBFUNC_EXIT