revert between 56095 -> 55830 in arch
[AROS.git] / arch / arm-native / kernel / getcpucount.c
blobe8123cee0b68d5191421933190dfdbab5a841149
1 /*
2 Copyright © 2015, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <aros/kernel.h>
7 #include <aros/libcall.h>
9 #include "kernel_base.h"
10 #include "kernel_intern.h"
12 AROS_LH0(cpuid_t, KrnGetCPUCount,
13 struct KernelBase *, KernelBase, 40, Kernel)
15 AROS_LIBFUNC_INIT
17 cpuid_t count;
19 count = __arm_arosintern.ARMI_AffinityMask
20 - ((__arm_arosintern.ARMI_AffinityMask >> 1) & 0x55555555);
21 count = (count & 0x33333333) + ((count >> 2) & 0x33333333);
22 return (((count + (count >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24;
24 return count;
26 AROS_LIBFUNC_EXIT