github.com/ttpreport/gvisor-ligolo@v0.0.0-20240123134145-a858404967ba/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  //go:build arm64
    16  // +build arm64
    17  
    18  package ring0
    19  
    20  // storeEl0Fpstate writes the address of application's fpstate.
    21  func storeEl0Fpstate(value *byte)
    22  
    23  // storeAppASID writes the application's asid value.
    24  func storeAppASID(asid uintptr)
    25  
    26  // LocalFlushTlbAll same as FlushTlbAll, but only applies to the calling CPU.
    27  func LocalFlushTlbAll()
    28  
    29  // FlushTlbByVA invalidates tlb by VA/Last-level/Inner-Shareable.
    30  func FlushTlbByVA(addr uintptr)
    31  
    32  // FlushTlbByASID invalidates tlb by ASID/Inner-Shareable.
    33  func FlushTlbByASID(asid uintptr)
    34  
    35  // LocalFlushTlbByASID invalidates tlb by ASID.
    36  func LocalFlushTlbByASID(asid uintptr)
    37  
    38  // FlushTlbAll invalidates all tlb.
    39  func FlushTlbAll()
    40  
    41  // CPACREL1 returns the value of the CPACR_EL1 register.
    42  func CPACREL1() (value uintptr)
    43  
    44  // GetFPCR returns the value of FPCR register.
    45  func GetFPCR() (value uintptr)
    46  
    47  // SetFPCR writes the FPCR value.
    48  func SetFPCR(value uintptr)
    49  
    50  // GetFPSR returns the value of FPSR register.
    51  func GetFPSR() (value uintptr)
    52  
    53  // SetFPSR writes the FPSR value.
    54  func SetFPSR(value uintptr)
    55  
    56  // SaveVRegs saves V0-V31 registers.
    57  // V0-V31: 32 128-bit registers for floating point and simd.
    58  func SaveVRegs(*byte)
    59  
    60  // LoadVRegs loads V0-V31 registers.
    61  func LoadVRegs(*byte)
    62  
    63  // LoadFloatingPoint loads floating point state.
    64  func LoadFloatingPoint(*byte)
    65  
    66  // SaveFloatingPoint saves floating point state.
    67  func SaveFloatingPoint(*byte)
    68  
    69  // FPSIMDDisableTrap disables fpsimd.
    70  func FPSIMDDisableTrap()
    71  
    72  // FPSIMDEnableTrap enables fpsimd.
    73  func FPSIMDEnableTrap()
    74  
    75  // Init sets function pointers based on architectural features.
    76  //
    77  // This must be called prior to using ring0.
    78  func Init() {}
    79  
    80  // InitDefault calls Init with default parameters.
    81  // On ARM, this is not much.
    82  func InitDefault() {}