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
65
|
#include "function_target.h"
#include "OS_system.h"
#pragma optimize_for_size on
extern void FUN_037F8CB4(s32 count);
ARM_FUNC asm OSIntrMode OS_EnableInterrupts(void)
{
mrs r0, CPSR
bic r1, r0, #HW_PSR_DISABLE_IRQ
msr CPSR_c, r1
and r0, r0, #HW_PSR_DISABLE_IRQ
bx lr
}
ARM_FUNC asm OSIntrMode OS_DisableInterrupts(void)
{
mrs r0, CPSR
orr r1, r0, #HW_PSR_DISABLE_IRQ
msr CPSR_c, r1
and r0, r0, #HW_PSR_DISABLE_IRQ
bx lr
}
ARM_FUNC asm OSIntrMode OS_RestoreInterrupts(register OSIntrMode state)
{
mrs r1, CPSR
bic r2, r1, #HW_PSR_DISABLE_IRQ
orr r2, r2, r0
msr CPSR_c, r2
and r0, r1, #HW_PSR_DISABLE_IRQ
bx lr
}
ARM_FUNC asm OSIntrMode OS_DisableInterrupts_IrqAndFiq(void)
{
mrs r0, CPSR
orr r1, r0, #HW_PSR_DISABLE_IRQ_FIQ
msr CPSR_c, r1
and r0, r0, #HW_PSR_DISABLE_IRQ_FIQ
bx lr
}
ARM_FUNC asm OSIntrMode OS_RestoreInterrupts_IrqAndFiq(register OSIntrMode state)
{
mrs r1, CPSR
bic r2, r1, #HW_PSR_DISABLE_IRQ_FIQ
orr r2, r2, r0
msr CPSR_c, r2
and r0, r1, #HW_PSR_DISABLE_IRQ_FIQ
bx lr
}
ARM_FUNC asm OSProcMode OS_GetProcMode(void)
{
mrs r0, CPSR
and r0, r0, #HW_PSR_CPU_MODE_MASK
bx lr
}
ARM_FUNC void OS_SpinWait(u32 cycle)
{
FUN_037F8CB4((s32)cycle / 4);
}
|