diff options
author | Yvan Roux <yvan.roux@linaro.org> | 2017-08-17 08:47:40 +0200 |
---|---|---|
committer | Yvan Roux <yvan.roux@linaro.org> | 2017-08-17 08:47:40 +0200 |
commit | ddc8f6a772b5c0be5767de6c13d51fed2ff2b4bd (patch) | |
tree | d83f226e5c158395a319d285cab7417b33c5d11a /libgo | |
parent | d16cc92b9de59611269a89dc9f18161313b1238c (diff) |
Merge branches/gcc-7-branch rev 251138.
Change-Id: I97fe02630ee0e0dac705ef3ef3bf76ddafd5cab8
Diffstat (limited to 'libgo')
-rw-r--r-- | libgo/go/syscall/syscall_linux_s390.go | 25 | ||||
-rw-r--r-- | libgo/go/syscall/syscall_linux_s390x.go | 25 | ||||
-rw-r--r-- | libgo/mksigtab.sh | 14 |
3 files changed, 58 insertions, 6 deletions
diff --git a/libgo/go/syscall/syscall_linux_s390.go b/libgo/go/syscall/syscall_linux_s390.go index a744f6b7841..4903783b61a 100644 --- a/libgo/go/syscall/syscall_linux_s390.go +++ b/libgo/go/syscall/syscall_linux_s390.go @@ -12,10 +12,29 @@ func (r *PtraceRegs) PC() uint64 { return uint64(r.Psw.Addr) } func (r *PtraceRegs) SetPC(pc uint64) { r.Psw.Addr = uint32(pc) } -func PtraceGetRegs(pid int, regsout *PtraceRegs) (err error) { - return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) +const syscall_PTRACE_PEEKUSR_AREA = 0x5000 +const syscall_PTRACE_POKEUSR_AREA = 0x5001 + +type syscall_ptrace_area struct { + len uint32 + kernel_addr uint32 + process_addr uint32 +} + +func PtraceGetRegs(pid int, regs *PtraceRegs) (err error) { + parea := syscall_ptrace_area{ + 12, + 0, + uint32(uintptr(unsafe.Pointer(regs))), + } + return ptrace(syscall_PTRACE_PEEKUSR_AREA, pid, uintptr(unsafe.Pointer(&parea)), 0) } func PtraceSetRegs(pid int, regs *PtraceRegs) (err error) { - return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) + parea := syscall_ptrace_area{ + 12, + 0, + uint32(uintptr(unsafe.Pointer(regs))), + } + return ptrace(syscall_PTRACE_POKEUSR_AREA, pid, uintptr(unsafe.Pointer(&parea)), 0) } diff --git a/libgo/go/syscall/syscall_linux_s390x.go b/libgo/go/syscall/syscall_linux_s390x.go index 44d567983c8..daa094c6f17 100644 --- a/libgo/go/syscall/syscall_linux_s390x.go +++ b/libgo/go/syscall/syscall_linux_s390x.go @@ -12,10 +12,29 @@ func (r *PtraceRegs) PC() uint64 { return r.Psw.Addr } func (r *PtraceRegs) SetPC(pc uint64) { r.Psw.Addr = pc } -func PtraceGetRegs(pid int, regsout *PtraceRegs) (err error) { - return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) +const syscall_PTRACE_PEEKUSR_AREA = 0x5000 +const syscall_PTRACE_POKEUSR_AREA = 0x5001 + +type syscall_ptrace_area struct { + len uint32 + kernel_addr uint64 + process_addr uint64 +} + +func PtraceGetRegs(pid int, regs *PtraceRegs) (err error) { + parea := syscall_ptrace_area{ + 24, + 0, + uint64(uintptr(unsafe.Pointer(regs))), + } + return ptrace(syscall_PTRACE_PEEKUSR_AREA, pid, uintptr(unsafe.Pointer(&parea)), 0) } func PtraceSetRegs(pid int, regs *PtraceRegs) (err error) { - return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) + parea := syscall_ptrace_area{ + 24, + 0, + uint64(uintptr(unsafe.Pointer(regs))), + } + return ptrace(syscall_PTRACE_POKEUSR_AREA, pid, uintptr(unsafe.Pointer(&parea)), 0) } diff --git a/libgo/mksigtab.sh b/libgo/mksigtab.sh index fd31022824c..358e0ed907e 100644 --- a/libgo/mksigtab.sh +++ b/libgo/mksigtab.sh @@ -86,6 +86,20 @@ if test "${GOOS}" = "linux"; then fi nsig=`grep 'const _*NSIG = [0-9]*$' gen-sysinfo.go | sed -e 's/.* = \([0-9]*\)/\1/'` +if test -z "$nsig"; then + if grep 'const _*NSIG = [ (]*_*SIGRTMAX + 1[ )]*' gen-sysinfo.go >/dev/null 2>&1; then + rtmax=`grep 'const _*SIGRTMAX = [0-9]*$' gen-sysinfo.go | sed -e 's/.* = \([0-9]*\)/\1/'` + if test -n "$rtmax"; then + nsig=`expr $rtmax + 1` + fi + fi +fi + +if test -z "$nsig"; then + echo 1>&2 "could not determine number of signals" + exit 1 +fi + i=1 while test "$i" -lt "$nsig"; do if ! grep "const _SIG.* = $i" gen-sysinfo.go >/dev/null 2>&1; then |