2 Copyright © 2015, The AROS Development Team. All rights reserved.
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
, KrnGetCPUNumber
,
13 struct KernelBase
*, KernelBase
, 41, Kernel
)
17 register unsigned int superSP
;
24 " mov %[superSP], sp \n"
27 : [superSP
] "=r" (superSP
)
28 : [swi_no
] "I" (6 /*SC_SUPERSTATE*/) : "r1"
31 asm volatile (" mrc p15, 0, %0, c0, c0, 5 " : "=r" (tmp
));
38 " mov sp, %[superSP] \n"
39 " cpsie i, %[mode_user] \n"
42 : : [superSP
] "r" (superSP
), [mode_user
] "I" (CPUMODE_USER
) : "r1" );
47 return (cpuid_t
)(((tmp
& 0xF00) >> 4) | (tmp
& 0xF));
50 // Uniprocessor System