David K. Bainbridge | bd6b288 | 2021-08-26 13:31:02 +0000 | [diff] [blame] | 1 | // Code generated by linux/mkall.go generatePtracePair("arm", "arm64"). DO NOT EDIT. |
| 2 | |
| 3 | //go:build linux && (arm || arm64) |
| 4 | // +build linux |
| 5 | // +build arm arm64 |
| 6 | |
| 7 | package unix |
| 8 | |
| 9 | import "unsafe" |
| 10 | |
| 11 | // PtraceRegsArm is the registers used by arm binaries. |
| 12 | type PtraceRegsArm struct { |
| 13 | Uregs [18]uint32 |
| 14 | } |
| 15 | |
| 16 | // PtraceGetRegsArm fetches the registers used by arm binaries. |
| 17 | func PtraceGetRegsArm(pid int, regsout *PtraceRegsArm) error { |
| 18 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) |
| 19 | } |
| 20 | |
| 21 | // PtraceSetRegsArm sets the registers used by arm binaries. |
| 22 | func PtraceSetRegsArm(pid int, regs *PtraceRegsArm) error { |
| 23 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) |
| 24 | } |
| 25 | |
| 26 | // PtraceRegsArm64 is the registers used by arm64 binaries. |
| 27 | type PtraceRegsArm64 struct { |
| 28 | Regs [31]uint64 |
| 29 | Sp uint64 |
| 30 | Pc uint64 |
| 31 | Pstate uint64 |
| 32 | } |
| 33 | |
| 34 | // PtraceGetRegsArm64 fetches the registers used by arm64 binaries. |
| 35 | func PtraceGetRegsArm64(pid int, regsout *PtraceRegsArm64) error { |
| 36 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) |
| 37 | } |
| 38 | |
| 39 | // PtraceSetRegsArm64 sets the registers used by arm64 binaries. |
| 40 | func PtraceSetRegsArm64(pid int, regs *PtraceRegsArm64) error { |
| 41 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) |
| 42 | } |