2026-08-30 11:27:54 +02:00
|
|
|
// Copyright (c) 2026 Petr Balvín <opensource@petrbalvin.org> (https://petrbalvin.org)
|
|
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
|
|
|
|
|
|
//go:build arm64
|
|
|
|
|
|
|
|
|
|
package verify
|
|
|
|
|
|
|
|
|
|
// leaveCheckedPtr is initialised by the linker from the GLOBL/DATA in
|
|
|
|
|
// abi_arm64.s: it holds the raw address of leaveJITCheckedRaw (which has
|
|
|
|
|
// no ABIInternal wrapper, so the JIT function RETs directly into it).
|
|
|
|
|
var leaveCheckedPtr uintptr
|
|
|
|
|
|
|
|
|
|
// enterJITChecked sets sentinels in R29 (frame pointer) and R28 (g),
|
|
|
|
|
// switches to the prepared stack and branches to fn.
|
|
|
|
|
// The body lives in abi_arm64.s and reads the parameters from the frame by
|
|
|
|
|
// name, which GoLand cannot see.
|
|
|
|
|
//
|
|
|
|
|
// noinspection GoUnusedParameter
|
|
|
|
|
//
|
|
|
|
|
//go:nosplit
|
|
|
|
|
func enterJITChecked(fn uintptr, stack uintptr)
|
|
|
|
|
|
|
|
|
|
// leaveJITCheckedRaw is the raw return trampoline for ABI checks. Its
|
|
|
|
|
// address is obtained from the GLOBL in abi_arm64.s (leaveCheckedPtr),
|
2026-09-14 18:22:18 +02:00
|
|
|
// which points to the .abi0 code, NOT the ABIInternal wrapper that this
|
2026-08-30 11:27:54 +02:00
|
|
|
// declaration would generate. The declaration exists solely to satisfy
|
|
|
|
|
// go vet's "missing Go declaration" check.
|
|
|
|
|
//
|
|
|
|
|
// noinspection GoUnusedFunction
|
|
|
|
|
//
|
|
|
|
|
//lint:ignore U1000 the assembly obtains this address through leaveCheckedPtr
|
|
|
|
|
//go:nosplit
|
|
|
|
|
func leaveJITCheckedRaw()
|