blob: 7f09533da771a13ffdbbe6cbff62b0d4f1fd3a0d [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _PARISC_PTRACE_H
2#define _PARISC_PTRACE_H
3
4/* written by Philipp Rumpf, Copyright (C) 1999 SuSE GmbH Nuernberg
5** Copyright (C) 2000 Grant Grundler, Hewlett-Packard
6*/
7
8#include <linux/types.h>
9
10/* This struct defines the way the registers are stored on the
11 * stack during a system call.
12 *
13 * N.B. gdb/strace care about the size and offsets within this
14 * structure. If you change things, you may break object compatibility
15 * for those applications.
16 */
17
18struct pt_regs {
19 unsigned long gr[32]; /* PSW is in gr[0] */
20 __u64 fr[32];
21 unsigned long sr[ 8];
22 unsigned long iasq[2];
23 unsigned long iaoq[2];
24 unsigned long cr27;
25 unsigned long pad0; /* available for other uses */
26 unsigned long orig_r28;
27 unsigned long ksp;
28 unsigned long kpc;
29 unsigned long sar; /* CR11 */
30 unsigned long iir; /* CR19 */
31 unsigned long isr; /* CR20 */
32 unsigned long ior; /* CR21 */
33 unsigned long ipsw; /* CR22 */
34};
35
Linus Torvalds1da177e2005-04-16 15:20:36 -070036/*
37 * The numbers chosen here are somewhat arbitrary but absolutely MUST
38 * not overlap with any of the number assigned in <linux/ptrace.h>.
39 *
40 * These ones are taken from IA-64 on the assumption that theirs are
41 * the most correct (and we also want to support PTRACE_SINGLEBLOCK
42 * since we have taken branch traps too)
43 */
44#define PTRACE_SINGLEBLOCK 12 /* resume execution until next branch */
Adrian Bunkf22ab812008-07-25 01:47:34 -070045
Linus Torvalds1da177e2005-04-16 15:20:36 -070046#ifdef __KERNEL__
47
Adrian Bunkf22ab812008-07-25 01:47:34 -070048#define task_regs(task) ((struct pt_regs *) ((char *)(task) + TASK_REGS))
49
Helge Deller81e192d2008-10-17 18:48:36 +000050#define arch_has_single_step() 1
Helge Deller81e192d2008-10-17 18:48:36 +000051#define arch_has_block_step() 1
Helge Deller81e192d2008-10-17 18:48:36 +000052
Linus Torvalds1da177e2005-04-16 15:20:36 -070053/* XXX should we use iaoq[1] or iaoq[0] ? */
54#define user_mode(regs) (((regs)->iaoq[0] & 3) ? 1 : 0)
55#define user_space(regs) (((regs)->iasq[1] != 0) ? 1 : 0)
56#define instruction_pointer(regs) ((regs)->iaoq[0] & ~3)
Kyle McMartin40e03b62009-07-05 15:59:56 -040057#define user_stack_pointer(regs) ((regs)->gr[30])
Randolph Chung5cd55b02005-10-21 22:42:18 -040058unsigned long profile_pc(struct pt_regs *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070059extern void show_regs(struct pt_regs *);
Kyle McMartin40e03b62009-07-05 15:59:56 -040060
61
62#endif /* __KERNEL__ */
Linus Torvalds1da177e2005-04-16 15:20:36 -070063
64#endif