blob: 1b0ba5e182b0c5624f18e20adb0764881f7f9606 [file] [log] [blame]
David Howellsb920de12008-02-08 04:19:31 -08001/* MN10300 Exception frame layout and ptrace constants
2 *
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11#ifndef _ASM_PTRACE_H
12#define _ASM_PTRACE_H
13
14#define PT_A3 0
15#define PT_A2 1
16#define PT_D3 2
17#define PT_D2 3
18#define PT_MCVF 4
19#define PT_MCRL 5
20#define PT_MCRH 6
21#define PT_MDRQ 7
22#define PT_E1 8
23#define PT_E0 9
24#define PT_E7 10
25#define PT_E6 11
26#define PT_E5 12
27#define PT_E4 13
28#define PT_E3 14
29#define PT_E2 15
30#define PT_SP 16
31#define PT_LAR 17
32#define PT_LIR 18
33#define PT_MDR 19
34#define PT_A1 20
35#define PT_A0 21
36#define PT_D1 22
37#define PT_D0 23
38#define PT_ORIG_D0 24
39#define PT_EPSW 25
40#define PT_PC 26
41#define NR_PTREGS 27
42
43#ifndef __ASSEMBLY__
44/*
45 * This defines the way registers are stored in the event of an exception
46 * - the strange order is due to the MOVM instruction
47 */
48struct pt_regs {
49 unsigned long a3; /* syscall arg 3 */
50 unsigned long a2; /* syscall arg 4 */
51 unsigned long d3; /* syscall arg 5 */
52 unsigned long d2; /* syscall arg 6 */
53 unsigned long mcvf;
54 unsigned long mcrl;
55 unsigned long mcrh;
56 unsigned long mdrq;
57 unsigned long e1;
58 unsigned long e0;
59 unsigned long e7;
60 unsigned long e6;
61 unsigned long e5;
62 unsigned long e4;
63 unsigned long e3;
64 unsigned long e2;
65 unsigned long sp;
66 unsigned long lar;
67 unsigned long lir;
68 unsigned long mdr;
69 unsigned long a1;
70 unsigned long a0; /* syscall arg 1 */
71 unsigned long d1; /* syscall arg 2 */
72 unsigned long d0; /* syscall ret */
73 struct pt_regs *next; /* next frame pointer */
74 unsigned long orig_d0; /* syscall number */
75 unsigned long epsw;
76 unsigned long pc;
77};
78#endif
79
David Howellsb920de12008-02-08 04:19:31 -080080/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
81#define PTRACE_GETREGS 12
82#define PTRACE_SETREGS 13
83#define PTRACE_GETFPREGS 14
84#define PTRACE_SETFPREGS 15
85
86/* options set using PTRACE_SETOPTIONS */
87#define PTRACE_O_TRACESYSGOOD 0x00000001
88
Adrian Bunkf22ab812008-07-25 01:47:34 -070089#if defined(__KERNEL__)
90
Jaswinder Singh Rajputc14e1a12009-06-14 11:49:41 +053091extern struct pt_regs *__frame; /* current frame pointer */
92
Adrian Bunkf22ab812008-07-25 01:47:34 -070093#if !defined(__ASSEMBLY__)
David Howells5d289962009-06-11 13:08:37 +010094struct task_struct;
95
David Howellsb920de12008-02-08 04:19:31 -080096#define user_mode(regs) (((regs)->epsw & EPSW_nSL) == EPSW_nSL)
97#define instruction_pointer(regs) ((regs)->pc)
David Howells5d289962009-06-11 13:08:37 +010098#define user_stack_pointer(regs) ((regs)->sp)
David Howellsb920de12008-02-08 04:19:31 -080099extern void show_regs(struct pt_regs *);
David Howells5d289962009-06-11 13:08:37 +0100100
101#define arch_has_single_step() (1)
102extern void user_enable_single_step(struct task_struct *);
103extern void user_disable_single_step(struct task_struct *);
104
Adrian Bunkf22ab812008-07-25 01:47:34 -0700105#endif /* !__ASSEMBLY */
David Howellsb920de12008-02-08 04:19:31 -0800106
107#define profile_pc(regs) ((regs)->pc)
108
Adrian Bunkf22ab812008-07-25 01:47:34 -0700109#endif /* __KERNEL__ */
David Howellsb920de12008-02-08 04:19:31 -0800110#endif /* _ASM_PTRACE_H */