zptrace_mipsnn_linux.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // Code generated by linux/mkall.go generatePtracePair("mips", "mips64"). DO NOT EDIT.
  2. //go:build linux && (mips || mips64)
  3. // +build linux
  4. // +build mips mips64
  5. package unix
  6. import "unsafe"
  7. // PtraceRegsMips is the registers used by mips binaries.
  8. type PtraceRegsMips struct {
  9. Regs [32]uint64
  10. Lo uint64
  11. Hi uint64
  12. Epc uint64
  13. Badvaddr uint64
  14. Status uint64
  15. Cause uint64
  16. }
  17. // PtraceGetRegsMips fetches the registers used by mips binaries.
  18. func PtraceGetRegsMips(pid int, regsout *PtraceRegsMips) error {
  19. return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
  20. }
  21. // PtraceSetRegsMips sets the registers used by mips binaries.
  22. func PtraceSetRegsMips(pid int, regs *PtraceRegsMips) error {
  23. return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
  24. }
  25. // PtraceRegsMips64 is the registers used by mips64 binaries.
  26. type PtraceRegsMips64 struct {
  27. Regs [32]uint64
  28. Lo uint64
  29. Hi uint64
  30. Epc uint64
  31. Badvaddr uint64
  32. Status uint64
  33. Cause uint64
  34. }
  35. // PtraceGetRegsMips64 fetches the registers used by mips64 binaries.
  36. func PtraceGetRegsMips64(pid int, regsout *PtraceRegsMips64) error {
  37. return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
  38. }
  39. // PtraceSetRegsMips64 sets the registers used by mips64 binaries.
  40. func PtraceSetRegsMips64(pid int, regs *PtraceRegsMips64) error {
  41. return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
  42. }