aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-sparc64/ptrace.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/include/asm-sparc64/ptrace.h b/include/asm-sparc64/ptrace.h
index b4b951d570bb..714b81956f32 100644
--- a/include/asm-sparc64/ptrace.h
+++ b/include/asm-sparc64/ptrace.h
@@ -1,4 +1,3 @@
1/* $Id: ptrace.h,v 1.14 2002/02/09 19:49:32 davem Exp $ */
2#ifndef _SPARC64_PTRACE_H 1#ifndef _SPARC64_PTRACE_H
3#define _SPARC64_PTRACE_H 2#define _SPARC64_PTRACE_H
4 3
@@ -8,10 +7,15 @@
8 * stack during a system call and basically all traps. 7 * stack during a system call and basically all traps.
9 */ 8 */
10 9
10/* This magic value must have the low 9 bits clear,
11 * as that is where we encode the %tt value, see below.
12 */
11#define PT_REGS_MAGIC 0x57ac6c00 13#define PT_REGS_MAGIC 0x57ac6c00
12 14
13#ifndef __ASSEMBLY__ 15#ifndef __ASSEMBLY__
14 16
17#include <linux/types.h>
18
15struct pt_regs { 19struct pt_regs {
16 unsigned long u_regs[16]; /* globals and ins */ 20 unsigned long u_regs[16]; /* globals and ins */
17 unsigned long tstate; 21 unsigned long tstate;
@@ -33,6 +37,23 @@ struct pt_regs {
33 unsigned int magic; 37 unsigned int magic;
34}; 38};
35 39
40static inline int pt_regs_trap_type(struct pt_regs *regs)
41{
42 return regs->magic & 0x1ff;
43}
44
45static inline int pt_regs_clear_trap_type(struct pt_regs *regs)
46{
47 return regs->magic &= ~0x1ff;
48}
49
50static inline bool pt_regs_is_syscall(struct pt_regs *regs)
51{
52 int tt = pt_regs_trap_type(regs);
53
54 return (tt == 0x110 || tt == 0x111 || tt == 0x16d);
55}
56
36struct pt_regs32 { 57struct pt_regs32 {
37 unsigned int psr; 58 unsigned int psr;
38 unsigned int pc; 59 unsigned int pc;