Indentation fix, cleanup.
[AROS.git] / arch / arm-native / kernel / kernel_cpu.h
blob2864e56b679cca0743172037c6e635ecdc557ccd
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 #define krnSysCall(n) asm volatile ("swi %[swi_no]\n\t" : : [swi_no] "I" (n) : "lr");
38 void cpu_DumpRegs(regs_t *regs);
40 static inline int GetCPUNumber() {
41 int tmp;
42 asm volatile (" mrc p15, 0, %0, c0, c0, 5 " : "=r" (tmp));
43 return tmp & 3;
46 static inline void SendIPISelf(uint32_t ipi, uint32_t ipi_param)
48 int cpu = GetCPUNumber();
49 __arm_arosintern.ARMI_SendIPI((ipi & 0x0fffffff) | (cpu << 28), ipi_param, (1 << cpu));
52 static inline void SendIPIOthers(uint32_t ipi, uint32_t ipi_param)
54 int cpu = GetCPUNumber();
55 __arm_arosintern.ARMI_SendIPI((ipi & 0x0fffffff) | (cpu << 28), ipi_param, 0xf & ~(1 << cpu));
58 static inline void SendIPIAll(uint32_t ipi, uint32_t ipi_param)
60 int cpu = GetCPUNumber();
61 __arm_arosintern.ARMI_SendIPI((ipi & 0x0fffffff) | (cpu << 28), ipi_param, 0xf);
64 #endif /* CPU_ARM_H_ */