revert between 56095 -> 55830 in arch
[AROS.git] / arch / all-pc / kernel / freecpumask.c
blobf6639297dce9d27576c253061e33e7fafc667f85
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_LH1(void, KrnFreeCPUMask,
17 AROS_LHA(void *, mask, A0),
18 struct KernelBase *, KernelBase, 43, Kernel)
20 AROS_LIBFUNC_INIT
22 struct PlatformData *pdata = KernelBase->kb_PlatformData;
23 struct APICData *apicData;
24 int count;
26 if ((IPTR)mask == TASKAFFINITY_ANY)
27 return;
29 if ((pdata) && (pdata->kb_APIC))
31 apicData = pdata->kb_APIC;
33 count = apicData->apic_count / 32;
35 if ((count * 32) < apicData->apic_count)
36 count += 1;
38 FreeMem(mask, count * sizeof(ULONG));
41 return;
43 AROS_LIBFUNC_EXIT