-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathbarrier.h
More file actions
30 lines (24 loc) · 711 Bytes
/
barrier.h
File metadata and controls
30 lines (24 loc) · 711 Bytes
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
#ifndef BARRIER_H
#define BARRIER_H
/*
* Data memory barrier
* No memory access after the DMB can run until all memory accesses before it
* have completed
*/
#define dmb() asm volatile \
("mcr p15, #0, %[zero], c7, c10, #5" : : [zero] "r" (0) )
/*
* Data synchronisation barrier
* No instruction after the DSB can run until all instructions before it have
* completed
*/
#define dsb() asm volatile \
("mcr p15, #0, %[zero], c7, c10, #4" : : [zero] "r" (0) )
/*
* Clean and invalidate entire cache
* Flush pending writes to main memory
* Remove all data in data cache
*/
#define flushcache() asm volatile \
("mcr p15, #0, %[zero], c7, c14, #0" : : [zero] "r" (0) )
#endif /* BARRIER_H */