github.com/usbarmory/tamago@v0.0.0-20240508072735-8612bbe1e454/arm/tz.s (about) 1 // ARM processor support 2 // https://github.com/usbarmory/tamago 3 // 4 // Copyright (c) WithSecure Corporation 5 // https://foundry.withsecure.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