syscall_sysv_stackargs.go raw

   1  // SPDX-License-Identifier: Apache-2.0
   2  // SPDX-FileCopyrightText: 2026 The Ebitengine Authors
   3  
   4  //go:build linux && (ppc64le || s390x)
   5  
   6  package purego
   7  
   8  import "unsafe"
   9  
  10  type callbackArgs struct {
  11  	index uintptr
  12  	// args points to the argument block.
  13  	//
  14  	// The structure of the arguments goes
  15  	// float registers followed by the
  16  	// integer registers followed by the stack.
  17  	//
  18  	// This variable is treated as a continuous
  19  	// block of memory containing all of the arguments
  20  	// for this callback.
  21  	args unsafe.Pointer
  22  	// Below are out-args from callbackWrap
  23  	result uintptr
  24  	// stackArgs points to stack-passed arguments for architectures where
  25  	// they can't be made contiguous with register args (e.g., ppc64le).
  26  	// On other architectures, this is nil and stack args are read from
  27  	// the end of the args block.
  28  	stackArgs unsafe.Pointer
  29  }
  30  
  31  func (c *callbackArgs) stackFrame() unsafe.Pointer {
  32  	return c.stackArgs
  33  }
  34