syscall_sysv_stackargs.go 921 B

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