Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 /*
0003  * This file is subject to the terms and conditions of the GNU General Public
0004  * License.  See the file "COPYING" in the main directory of this archive
0005  * for more details.
0006  *
0007  * Copyright (C) 1994, 95, 96, 97, 98, 99, 2000 by Ralf Baechle
0008  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
0009  */
0010 #ifndef _UAPI_ASM_PTRACE_H
0011 #define _UAPI_ASM_PTRACE_H
0012 
0013 #include <linux/types.h>
0014 
0015 /* 0 - 31 are integer registers, 32 - 63 are fp registers.  */
0016 #define FPR_BASE    32
0017 #define PC      64
0018 #define CAUSE       65
0019 #define BADVADDR    66
0020 #define MMHI        67
0021 #define MMLO        68
0022 #define FPC_CSR     69
0023 #define FPC_EIR     70
0024 #define DSP_BASE    71      /* 3 more hi / lo register pairs */
0025 #define DSP_CONTROL 77
0026 #define ACX     78
0027 
0028 /*
0029  * This struct defines the registers as used by PTRACE_{GET,SET}REGS. The
0030  * format is the same for both 32- and 64-bit processes. Registers for 32-bit
0031  * processes are sign extended.
0032  */
0033 #ifdef __KERNEL__
0034 struct user_pt_regs {
0035 #else
0036 struct pt_regs {
0037 #endif
0038     /* Saved main processor registers. */
0039     __u64 regs[32];
0040 
0041     /* Saved special registers. */
0042     __u64 lo;
0043     __u64 hi;
0044     __u64 cp0_epc;
0045     __u64 cp0_badvaddr;
0046     __u64 cp0_status;
0047     __u64 cp0_cause;
0048 } __attribute__ ((aligned (8)));
0049 
0050 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
0051 #define PTRACE_GETREGS      12
0052 #define PTRACE_SETREGS      13
0053 #define PTRACE_GETFPREGS        14
0054 #define PTRACE_SETFPREGS        15
0055 /* #define PTRACE_GETFPXREGS        18 */
0056 /* #define PTRACE_SETFPXREGS        19 */
0057 
0058 #define PTRACE_OLDSETOPTIONS    21
0059 
0060 #define PTRACE_GET_THREAD_AREA  25
0061 #define PTRACE_SET_THREAD_AREA  26
0062 
0063 /* Calls to trace a 64bit program from a 32bit program.  */
0064 #define PTRACE_PEEKTEXT_3264    0xc0
0065 #define PTRACE_PEEKDATA_3264    0xc1
0066 #define PTRACE_POKETEXT_3264    0xc2
0067 #define PTRACE_POKEDATA_3264    0xc3
0068 #define PTRACE_GET_THREAD_AREA_3264 0xc4
0069 
0070 /* Read and write watchpoint registers.  */
0071 enum pt_watch_style {
0072     pt_watch_style_mips32,
0073     pt_watch_style_mips64
0074 };
0075 struct mips32_watch_regs {
0076     unsigned int watchlo[8];
0077     /* Lower 16 bits of watchhi. */
0078     unsigned short watchhi[8];
0079     /* Valid mask and I R W bits.
0080      * bit 0 -- 1 if W bit is usable.
0081      * bit 1 -- 1 if R bit is usable.
0082      * bit 2 -- 1 if I bit is usable.
0083      * bits 3 - 11 -- Valid watchhi mask bits.
0084      */
0085     unsigned short watch_masks[8];
0086     /* The number of valid watch register pairs.  */
0087     unsigned int num_valid;
0088 } __attribute__((aligned(8)));
0089 
0090 struct mips64_watch_regs {
0091     unsigned long long watchlo[8];
0092     unsigned short watchhi[8];
0093     unsigned short watch_masks[8];
0094     unsigned int num_valid;
0095 } __attribute__((aligned(8)));
0096 
0097 struct pt_watch_regs {
0098     enum pt_watch_style style;
0099     union {
0100         struct mips32_watch_regs mips32;
0101         struct mips64_watch_regs mips64;
0102     };
0103 };
0104 
0105 #define PTRACE_GET_WATCH_REGS   0xd0
0106 #define PTRACE_SET_WATCH_REGS   0xd1
0107 
0108 
0109 #endif /* _UAPI_ASM_PTRACE_H */