blob: 713546cb0579dc7ed666a99c96d84ac37a4db788 [file] [log] [blame]
Ian Lance Taylorafaaddb2011-04-01 16:01:39 -07001// syscall_linux_alpha.go -- GNU/Linux ALPHA specific support
2
3// Copyright 2011 The Go Authors. All rights reserved.
4// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
7package syscall
8
Ian Lance Taylorbdafd5c2012-01-31 06:21:32 -08009import "unsafe"
10
Ian Lance Taylor71101f32011-05-31 11:14:19 -070011type PtraceRegs struct {
Ian Lance Taylorbdafd5c2012-01-31 06:21:32 -080012 R0 uint64
13 R1 uint64
14 R2 uint64
15 R3 uint64
16 R4 uint64
17 R5 uint64
18 R6 uint64
19 R7 uint64
20 R8 uint64
21 R19 uint64
22 R20 uint64
23 R21 uint64
24 R22 uint64
25 R23 uint64
26 R24 uint64
27 R25 uint64
28 R26 uint64
29 R27 uint64
30 R28 uint64
31 Hae uint64
Ian Lance Taylor71101f32011-05-31 11:14:19 -070032 Trap_a0 uint64
33 Trap_a1 uint64
34 Trap_a2 uint64
Ian Lance Taylorbdafd5c2012-01-31 06:21:32 -080035 Ps uint64
36 Pc uint64
37 Gp uint64
38 R16 uint64
39 R17 uint64
40 R18 uint64
Ian Lance Taylor71101f32011-05-31 11:14:19 -070041}
42
Ian Lance Taylorafaaddb2011-04-01 16:01:39 -070043func (r *PtraceRegs) PC() uint64 {
Ian Lance Taylorbdafd5c2012-01-31 06:21:32 -080044 return r.Pc
Ian Lance Taylorafaaddb2011-04-01 16:01:39 -070045}
46
47func (r *PtraceRegs) SetPC(pc uint64) {
Ian Lance Taylorbdafd5c2012-01-31 06:21:32 -080048 r.Pc = pc
49}
50
51func PtraceGetRegs(pid int, regsout *PtraceRegs) (err error) {
52 return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
53}
54
55func PtraceSetRegs(pid int, regs *PtraceRegs) (err error) {
56 return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
Ian Lance Taylorafaaddb2011-04-01 16:01:39 -070057}