mirror of
https://github.com/golang/sys.git
synced 2026-02-09 04:06:04 +03:00
CL 204418 adds functions PtraceGetRegSetArm64 and PtraceSetRegSetArm64 to file zptrace_armnn_linux.go, both of which depend on type Iovec. The definitions of type Iovec on linux arm and arm64 are different, but file zptrace_armnn_linux.go is shared by them. So these two functions cause compilation errors on linux arm. This patch fixes this error by moving these two functions into a separate file. Fixes golang/go#36032 Change-Id: Ia380bd863895900599c09d4631ed26f204955112 Reviewed-on: https://go-review.googlesource.com/c/sys/+/210322 Run-TryBot: eric fang <eric.fang@arm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
18 lines
733 B
Go
18 lines
733 B
Go
// Code generated by linux/mkall.go generatePtraceRegSet("arm64"). DO NOT EDIT.
|
|
|
|
package unix
|
|
|
|
import "unsafe"
|
|
|
|
// PtraceGetRegSetArm64 fetches the registers used by arm64 binaries.
|
|
func PtraceGetRegSetArm64(pid, addr int, regsout *PtraceRegsArm64) error {
|
|
iovec := Iovec{(*byte)(unsafe.Pointer(regsout)), uint64(unsafe.Sizeof(*regsout))}
|
|
return ptrace(PTRACE_GETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec)))
|
|
}
|
|
|
|
// PtraceSetRegSetArm64 sets the registers used by arm64 binaries.
|
|
func PtraceSetRegSetArm64(pid, addr int, regs *PtraceRegsArm64) error {
|
|
iovec := Iovec{(*byte)(unsafe.Pointer(regs)), uint64(unsafe.Sizeof(*regs))}
|
|
return ptrace(PTRACE_SETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec)))
|
|
}
|