-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathkernel_cpu.h
64 lines (49 loc) · 1.58 KB
/
kernel_cpu.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
Copyright (C) 2013, The AROS Development Team. All rights reserved.
*/
#ifndef CPU_ARM_H_
#define CPU_ARM_H_
#include <inttypes.h>
#include "kernel_arm.h"
extern uint32_t __arm_affinitymask;
#define EXCEPTIONS_COUNT 1
#define ARM_FPU_TYPE FPU_VFP
#define ARM_FPU_SIZE 32*64
/* We use native context format, no conversion needed */
#define regs_t struct ExceptionContext
/* There are no private add-ons */
#define AROSCPUContext ExceptionContext
#define ADDTIME(dest, src) \
(dest)->tv_micro += (src)->tv_micro; \
(dest)->tv_secs += (src)->tv_secs; \
while((dest)->tv_micro > 999999) \
{ \
(dest)->tv_secs++; \
(dest)->tv_micro -= 1000000; \
}
#define goSuper() 0
#define goUser()
#undef krnSysCall
#define krnSysCall(n) asm volatile ("swi %[swi_no]\n\t" : : [swi_no] "I" (n) : "lr");
void cpu_DumpRegs(regs_t *regs);
static inline int GetCPUNumber() {
int tmp;
asm volatile (" mrc p15, 0, %0, c0, c0, 5 " : "=r" (tmp));
return tmp & 3;
}
static inline void SendIPISelf(uint32_t ipi, uint32_t ipi_param)
{
int cpu = GetCPUNumber();
__arm_arosintern.ARMI_SendIPI((ipi & 0x0fffffff) | (cpu << 28), ipi_param, (1 << cpu));
}
static inline void SendIPIOthers(uint32_t ipi, uint32_t ipi_param)
{
int cpu = GetCPUNumber();
__arm_arosintern.ARMI_SendIPI((ipi & 0x0fffffff) | (cpu << 28), ipi_param, 0xf & ~(1 << cpu));
}
static inline void SendIPIAll(uint32_t ipi, uint32_t ipi_param)
{
int cpu = GetCPUNumber();
__arm_arosintern.ARMI_SendIPI((ipi & 0x0fffffff) | (cpu << 28), ipi_param, 0xf);
}
#endif /* CPU_ARM_H_ */