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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
//! The three memory barriers, in whichever spelling the target
//! architecture has.
//!
//! `dsb`, `dmb` and `isb` are ARMv7 mnemonics. ARMv6 has the same three
//! barriers but only as CP15 operations (`c7, c10, 4`, `c7, c10, 5` and
//! `c7, c5, 4`), and an assembler targeting ARMv6 rejects the mnemonics
//! outright -- "instruction requires: data-barriers". Since a barrier
//! appears in nearly every architecture-specific file in this crate, the
//! `cfg` lives here once rather than at each of those sites, where the
//! ARMv6 arm would be easy to add to some and forget in others.
//!
//! These are the full-system barriers: no domain or access-type
//! qualifier. ARMv6 has no domain-qualified forms at all -- `dsb sy` is
//! the only thing its CP15 operation can mean -- so the narrower ARMv7
//! and AArch64 variants (`dsb ish`, `dsb ishst`) stay written out at the
//! sites that use them, in modules (`multicore`, `mmu64`,
//! `generic_timer`) that are not built for ARMv6 anyway.
use asm;
/// Data synchronization barrier over the full system domain: does not
/// complete until every memory access and cache/TLB maintenance
/// operation issued by this core before it has completed.
///
/// This is the barrier that makes cache maintenance (`crate::cache`)
/// actually finished before a bus master is told to run, and the
/// ordering barrier for the VideoCore shared-memory protocols
/// (`crate::vchiq`), whose region is mapped non-cacheable rather than
/// maintained by hand: no maintenance is needed there, but plain
/// Normal-memory accesses can still be reordered and merged, so
/// publishing a structure before the flag that advertises it still needs
/// this.
pub
/// Data memory barrier over the full system domain: orders the memory
/// accesses either side of it, without waiting for them to complete the
/// way [`dsb`] does.
// Nothing in this crate needs the weaker barrier today -- every site
// wants completion, not just ordering. Kept anyway so the set is
// complete: a barrier module missing one of the three invites a bare
// `dmb` written inline at the first site that wants one, which is
// exactly the ARMv6 trap this module exists to close.
pub
/// Instruction synchronization barrier: flushes the pipeline, so
/// instructions after it are fetched and decoded against whatever system
/// state was just written -- a new translation table, a newly enabled
/// MMU or cache, a coprocessor that has just been granted access.
// Used only from `mmu32.rs`, which the `mmu` feature gates -- so with
// that feature off this is genuinely unused rather than merely
// unreferenced yet.
pub
compile_error!;