Merge pull request #2687 from lubinszARM:pr_tls_1

PiperOrigin-RevId: 312299234
This commit is contained in:
gVisor bot 2020-05-19 09:55:20 -07:00
commit 5823629442
2 changed files with 16 additions and 0 deletions

View File

@ -38,6 +38,12 @@ func SaveVRegs(*byte)
// LoadVRegs loads V0-V31 registers.
func LoadVRegs(*byte)
// GetTLS returns the value of TPIDR_EL0 register.
func GetTLS() (value uint64)
// SetTLS writes the TPIDR_EL0 value.
func SetTLS(value uint64)
// Init sets function pointers based on architectural features.
//
// This must be called prior to using ring0.

View File

@ -15,6 +15,16 @@
#include "funcdata.h"
#include "textflag.h"
TEXT ·GetTLS(SB),NOSPLIT,$0-8
MRS TPIDR_EL0, R1
MOVD R1, ret+0(FP)
RET
TEXT ·SetTLS(SB),NOSPLIT,$0-8
MOVD addr+0(FP), R1
MSR R1, TPIDR_EL0
RET
TEXT ·CPACREL1(SB),NOSPLIT,$0-8
WORD $0xd5381041 // MRS CPACR_EL1, R1
MOVD R1, ret+0(FP)