github.com/SagerNet/gvisor@v0.0.0-20210707092255-7731c139d75c/pkg/ring0/lib_arm64.go (about)

     1  // Copyright 2019 The gVisor Authors.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  // +build arm64
    16  
    17  package ring0
    18  
    19  // storeEl0Fpstate writes the address of application's fpstate.
    20  func storeEl0Fpstate(value *byte)
    21  
    22  // storeAppASID writes the application's asid value.
    23  func storeAppASID(asid uintptr)
    24  
    25  // LocalFlushTlbAll same as FlushTlbAll, but only applies to the calling CPU.
    26  func LocalFlushTlbAll()
    27  
    28  // FlushTlbByVA invalidates tlb by VA/Last-level/Inner-Shareable.
    29  func FlushTlbByVA(addr uintptr)
    30  
    31  // FlushTlbByASID invalidates tlb by ASID/Inner-Shareable.
    32  func FlushTlbByASID(asid uintptr)
    33  
    34  // LocalFlushTlbByASID invalidates tlb by ASID.
    35  func LocalFlushTlbByASID(asid uintptr)
    36  
    37  // FlushTlbAll invalidates all tlb.
    38  func FlushTlbAll()
    39  
    40  // CPACREL1 returns the value of the CPACR_EL1 register.
    41  func CPACREL1() (value uintptr)
    42  
    43  // GetFPCR returns the value of FPCR register.
    44  func GetFPCR() (value uintptr)
    45  
    46  // SetFPCR writes the FPCR value.
    47  func SetFPCR(value uintptr)
    48  
    49  // GetFPSR returns the value of FPSR register.
    50  func GetFPSR() (value uintptr)
    51  
    52  // SetFPSR writes the FPSR value.
    53  func SetFPSR(value uintptr)
    54  
    55  // SaveVRegs saves V0-V31 registers.
    56  // V0-V31: 32 128-bit registers for floating point and simd.
    57  func SaveVRegs(*byte)
    58  
    59  // LoadVRegs loads V0-V31 registers.
    60  func LoadVRegs(*byte)
    61  
    62  // LoadFloatingPoint loads floating point state.
    63  func LoadFloatingPoint(*byte)
    64  
    65  // SaveFloatingPoint saves floating point state.
    66  func SaveFloatingPoint(*byte)
    67  
    68  // FPSIMDDisableTrap disables fpsimd.
    69  func FPSIMDDisableTrap()
    70  
    71  // FPSIMDEnableTrap enables fpsimd.
    72  func FPSIMDEnableTrap()
    73  
    74  // Init sets function pointers based on architectural features.
    75  //
    76  // This must be called prior to using ring0.
    77  func Init() {}