Enable FIQ interrupt handling on BCM mailboxes. Each CPU core has four of them and...
[AROS.git] / arch / arm-native / kernel / getcpucount.c
blobf80dda9fc1428761dd3b1843478f8859c3392055
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(unsigned int, KrnGetCPUCount,
13 struct KernelBase *, KernelBase, 36, Kernel)
15 AROS_LIBFUNC_INIT
17 uint32_t count;
19 count = __arm_affinitymask - ((__arm_affinitymask >> 1) & 0x55555555);
20 count = (count & 0x33333333) + ((count >> 2) & 0x33333333);
21 return (((count + (count >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24;
23 return count;
25 AROS_LIBFUNC_EXIT