github.com/f-secure-foundry/tamago@v0.0.0-20220307101044-d73fcdd7f11b/arm/tz.s (about) 1 // ARM processor support 2 // https://github.com/f-secure-foundry/tamago 3 // 4 // Copyright (c) F-Secure Corporation 5 // https://foundry.f-secure.com 6 // 7 // Use of this source code is governed by the license 8 // that can be found in the LICENSE file. 9 10 // func read_scr() uint32 11 TEXT ·read_scr(SB),$0-4 12 // ARM Architecture Reference Manual - ARMv7-A and ARMv7-R edition 13 // B4.1.129 SCR, Secure Configuration Register, Security Extensions 14 MRC 15, 0, R0, C1, C1, 0 15 MOVW R0, ret+0(FP) 16 17 RET 18 19 // func write_nsacr(scr uint32) 20 TEXT ·write_nsacr(SB),$0-4 21 // ARM Architecture Reference Manual - ARMv7-A and ARMv7-R edition 22 // B4.1.111 NSACR, Non-Secure Access Control Register, Security Extensions 23 MOVW scr+0(FP), R0 24 MCR 15, 0, R0, C1, C1, 2 25 26 RET