wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * This file is subject to the terms and conditions of the GNU General Public |
| 3 | * License. See the file "COPYING" in the main directory of this archive |
| 4 | * for more details. |
| 5 | * |
| 6 | * Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000 by Ralf Baechle |
| 7 | * |
| 8 | * Machine dependent structs and defines to help the user use |
| 9 | * the ptrace system call. |
| 10 | */ |
| 11 | #ifndef _ASM_PTRACE_H |
| 12 | #define _ASM_PTRACE_H |
| 13 | |
| 14 | #include <asm/isadep.h> |
| 15 | #include <linux/types.h> |
| 16 | |
| 17 | /* 0 - 31 are integer registers, 32 - 63 are fp registers. */ |
| 18 | #define FPR_BASE 32 |
| 19 | #define PC 64 |
| 20 | #define CAUSE 65 |
| 21 | #define BADVADDR 66 |
| 22 | #define MMHI 67 |
| 23 | #define MMLO 68 |
| 24 | #define FPC_CSR 69 |
| 25 | #define FPC_EIR 70 |
| 26 | |
| 27 | #ifndef _LANGUAGE_ASSEMBLY |
| 28 | /* |
| 29 | * This struct defines the way the registers are stored on the stack during a |
| 30 | * system call/exception. As usual the registers k0/k1 aren't being saved. |
| 31 | */ |
| 32 | struct pt_regs { |
| 33 | /* Pad bytes for argument save space on the stack. */ |
| 34 | unsigned long pad0[6]; |
| 35 | |
| 36 | /* Saved main processor registers. */ |
| 37 | unsigned long regs[32]; |
| 38 | |
| 39 | /* Other saved registers. */ |
| 40 | unsigned long lo; |
| 41 | unsigned long hi; |
| 42 | |
| 43 | /* |
| 44 | * saved cp0 registers |
| 45 | */ |
| 46 | unsigned long cp0_epc; |
| 47 | unsigned long cp0_badvaddr; |
| 48 | unsigned long cp0_status; |
| 49 | unsigned long cp0_cause; |
| 50 | }; |
| 51 | |
| 52 | #endif /* !(_LANGUAGE_ASSEMBLY) */ |
| 53 | |
| 54 | /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ |
| 55 | /* #define PTRACE_GETREGS 12 */ |
| 56 | /* #define PTRACE_SETREGS 13 */ |
| 57 | /* #define PTRACE_GETFPREGS 14 */ |
| 58 | /* #define PTRACE_SETFPREGS 15 */ |
| 59 | /* #define PTRACE_GETFPXREGS 18 */ |
| 60 | /* #define PTRACE_SETFPXREGS 19 */ |
| 61 | |
| 62 | #define PTRACE_SETOPTIONS 21 |
| 63 | |
| 64 | /* options set using PTRACE_SETOPTIONS */ |
| 65 | #define PTRACE_O_TRACESYSGOOD 0x00000001 |
| 66 | |
| 67 | #if 0 /* def _LANGUAGE_ASSEMBLY */ |
| 68 | #include <asm/offset.h> |
| 69 | #endif |
| 70 | |
| 71 | #ifdef __KERNEL__ |
| 72 | |
| 73 | #ifndef _LANGUAGE_ASSEMBLY |
| 74 | /* |
| 75 | * Does the process account for user or for system time? |
| 76 | */ |
| 77 | #define user_mode(regs) (((regs)->cp0_status & KU_MASK) == KU_USER) |
| 78 | |
| 79 | #define instruction_pointer(regs) ((regs)->cp0_epc) |
| 80 | |
| 81 | extern void show_regs(struct pt_regs *); |
| 82 | #endif /* !(_LANGUAGE_ASSEMBLY) */ |
| 83 | |
| 84 | #endif |
| 85 | |
| 86 | #endif /* _ASM_PTRACE_H */ |