revert between 56095 -> 55830 in arch
[AROS.git] / arch / arm-native / kernel / kernel_cpu.h
blob8a96be156918878cb83f3359b2da3ecc5565419c
1 /*
2 Copyright © 2013, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #ifndef CPU_ARM_H_
7 #define CPU_ARM_H_
9 #include <inttypes.h>
10 #include "kernel_arm.h"
12 extern uint32_t __arm_affinitymask;
14 #define EXCEPTIONS_COUNT 1
16 #define ARM_FPU_TYPE FPU_VFP
17 #define ARM_FPU_SIZE 32*64
19 /* We use native context format, no conversion needed */
20 #define regs_t struct ExceptionContext
21 /* There are no private add-ons */
22 #define AROSCPUContext ExceptionContext
24 #define ADDTIME(dest, src) \
25 (dest)->tv_micro += (src)->tv_micro; \
26 (dest)->tv_secs += (src)->tv_secs; \
27 while((dest)->tv_micro > 999999) \
28 { \
29 (dest)->tv_secs++; \
30 (dest)->tv_micro -= 1000000; \
33 #define goSuper() 0
34 #define goUser()
36 #undef krnSysCall
37 #define krnSysCall(n) asm volatile ("swi %[swi_no]\n\t" : : [swi_no] "I" (n) : "lr");
39 void cpu_DumpRegs(regs_t *regs);
41 static inline int GetCPUNumber() {
42 int tmp;
43 asm volatile (" mrc p15, 0, %0, c0, c0, 5 " : "=r" (tmp));
44 return tmp & 3;
47 static inline void SendIPISelf(uint32_t ipi, uint32_t ipi_param)
49 int cpu = GetCPUNumber();
50 __arm_arosintern.ARMI_SendIPI((ipi & 0x0fffffff) | (cpu << 28), ipi_param, (1 << cpu));
53 static inline void SendIPIOthers(uint32_t ipi, uint32_t ipi_param)
55 int cpu = GetCPUNumber();
56 __arm_arosintern.ARMI_SendIPI((ipi & 0x0fffffff) | (cpu << 28), ipi_param, 0xf & ~(1 << cpu));
59 static inline void SendIPIAll(uint32_t ipi, uint32_t ipi_param)
61 int cpu = GetCPUNumber();
62 __arm_arosintern.ARMI_SendIPI((ipi & 0x0fffffff) | (cpu << 28), ipi_param, 0xf);
65 #endif /* CPU_ARM_H_ */