Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: src/arm/assembler-arm.cc

Issue 2318553002: [arm] Implement barriers on ARMv6 using CP15. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm/assembler-arm.h ('k') | src/arm/disasm-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/assembler-arm.cc
diff --git a/src/arm/assembler-arm.cc b/src/arm/assembler-arm.cc
index 7a9af3928650ee85d2056b2e8dd1d334277211ae..79afd82b9ac42d9e5aa8f96959e0d2a5d76ad2a0 100644
--- a/src/arm/assembler-arm.cc
+++ b/src/arm/assembler-arm.cc
@@ -2307,17 +2307,38 @@ void Assembler::svc(uint32_t imm24, Condition cond) {
void Assembler::dmb(BarrierOption option) {
- emit(kSpecialCondition | 0x57ff*B12 | 5*B4 | option);
+ if (CpuFeatures::IsSupported(ARMv7)) {
+ // Details available in ARM DDI 0406C.b, A8-378.
+ emit(kSpecialCondition | 0x57ff * B12 | 5 * B4 | option);
+ } else {
+ // Details available in ARM DDI 0406C.b, B3-1750.
+ // CP15DMB: CRn=c7, opc1=0, CRm=c10, opc2=5, Rt is ignored.
+ mcr(p15, 0, r0, cr7, cr10, 5);
+ }
}
void Assembler::dsb(BarrierOption option) {
- emit(kSpecialCondition | 0x57ff*B12 | 4*B4 | option);
+ if (CpuFeatures::IsSupported(ARMv7)) {
+ // Details available in ARM DDI 0406C.b, A8-380.
+ emit(kSpecialCondition | 0x57ff * B12 | 4 * B4 | option);
+ } else {
+ // Details available in ARM DDI 0406C.b, B3-1750.
+ // CP15DSB: CRn=c7, opc1=0, CRm=c10, opc2=4, Rt is ignored.
+ mcr(p15, 0, r0, cr7, cr10, 4);
+ }
}
void Assembler::isb(BarrierOption option) {
- emit(kSpecialCondition | 0x57ff*B12 | 6*B4 | option);
+ if (CpuFeatures::IsSupported(ARMv7)) {
+ // Details available in ARM DDI 0406C.b, A8-389.
+ emit(kSpecialCondition | 0x57ff * B12 | 6 * B4 | option);
+ } else {
+ // Details available in ARM DDI 0406C.b, B3-1750.
+ // CP15ISB: CRn=c7, opc1=0, CRm=c5, opc2=4, Rt is ignored.
+ mcr(p15, 0, r0, cr7, cr5, 4);
+ }
}
« no previous file with comments | « src/arm/assembler-arm.h ('k') | src/arm/disasm-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698