1 // Copyright 2024 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 #include "textflag.h"
6
7 TEXT ·EnableDIT(SB),$0-1
8 MRS DIT, R0
9 UBFX $24, R0, $1, R1
10 MOVB R1, ret+0(FP)
11 MSR $1, DIT
12 // TODO(roland): the SB instruction is significantly more
13 // performant when available. We should detect its availability
14 // and use it when we can.
15 DSB $7 // nsh
16 ISB $15 // sy
17 RET
18
19 TEXT ·DITEnabled(SB),$0-1
20 MRS DIT, R0
21 UBFX $24, R0, $1, R1
22 MOVB R1, ret+0(FP)
23 RET
24
25 TEXT ·DisableDIT(SB),$0
26 MSR $0, DIT
27 RET
28
View as plain text