revert between 56095 -> 55830 in arch
[AROS.git] / arch / all-pc / kernel / clearcpumask.c
blob0e8dd52becd310051af54defb1650375f6f051cd
1 /*
2 Copyright © 2017, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 */
8 #include <aros/kernel.h>
9 #include <aros/libcall.h>
11 #include "kernel_base.h"
12 #include "kernel_intern.h"
14 AROS_LH1(void, KrnClearCPUMask,
15 AROS_LHA(void *, mask, A0),
16 struct KernelBase *, KernelBase, 44, Kernel)
18 AROS_LIBFUNC_INIT
20 ULONG *apicMask;
21 struct PlatformData *pdata = KernelBase->kb_PlatformData;
22 struct APICData *apicData;
23 int count, i;
25 if ((IPTR)mask == TASKAFFINITY_ANY)
26 return;
28 if ((pdata) && (pdata->kb_APIC) && ((apicMask = (ULONG *)mask) != NULL))
30 apicData = pdata->kb_APIC;
32 count = apicData->apic_count / 32;
34 if ((count * 32) < apicData->apic_count)
35 count += 1;
37 for (i = 0; i < count; i++)
38 apicMask[i] = 0;
40 return;
42 AROS_LIBFUNC_EXIT