-
Notifications
You must be signed in to change notification settings - Fork 0
/
intrinsics.s
39 lines (35 loc) · 815 Bytes
/
intrinsics.s
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
.syntax unified
.p2align 2
.global DisableInterrupts
.type DisableInterrupts,%function
DisableInterrupts:
.fnstart
CPSID I
BX LR
.fnend
.global EnableInterrupts
.type EnableInterrupts,%function
EnableInterrupts:
.fnstart
CPSIE I
BX LR
.fnend
# *********** StartCritical ************************
# make a copy of previous I bit, disable interrupts
.global StartCritical
.type StartCritical,%function
StartCritical:
.fnstart
MRS R0, PRIMASK @ save old status
CPSID I @ mask all (except faults)
BX LR
.fnend
# *********** EndCritical ************
# restore I bit to its previous value
.global EndCritical
.type EndCritical,%function
EndCritical:
.fnstart
MSR PRIMASK, R0 @ restore
BX LR
.fnend