1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 #ifndef _UAPI_METAG_PTRACE_H
3 #define _UAPI_METAG_PTRACE_H
8 * These are the layouts of the regsets returned by the GETREGSET ptrace call
11 /* user_gp_regs::status */
13 /* CBMarker bit (indicates catch state / catch replay) */
14 #define USER_GP_REGS_STATUS_CATCH_BIT (1 << 22)
15 #define USER_GP_REGS_STATUS_CATCH_S 22
16 /* LSM_STEP field (load/store multiple step) */
17 #define USER_GP_REGS_STATUS_LSM_STEP_BITS (0x7 << 8)
18 #define USER_GP_REGS_STATUS_LSM_STEP_S 8
19 /* SCC bit (indicates split 16x16 condition flags) */
20 #define USER_GP_REGS_STATUS_SCC_BIT (1 << 4)
21 #define USER_GP_REGS_STATUS_SCC_S 4
23 /* normal condition flags */
24 /* CF_Z bit (Zero flag) */
25 #define USER_GP_REGS_STATUS_CF_Z_BIT (1 << 3)
26 #define USER_GP_REGS_STATUS_CF_Z_S 3
27 /* CF_N bit (Negative flag) */
28 #define USER_GP_REGS_STATUS_CF_N_BIT (1 << 2)
29 #define USER_GP_REGS_STATUS_CF_N_S 2
30 /* CF_V bit (oVerflow flag) */
31 #define USER_GP_REGS_STATUS_CF_V_BIT (1 << 1)
32 #define USER_GP_REGS_STATUS_CF_V_S 1
33 /* CF_C bit (Carry flag) */
34 #define USER_GP_REGS_STATUS_CF_C_BIT (1 << 0)
35 #define USER_GP_REGS_STATUS_CF_C_S 0
37 /* split 16x16 condition flags */
38 /* SCF_LZ bit (Low Zero flag) */
39 #define USER_GP_REGS_STATUS_SCF_LZ_BIT (1 << 3)
40 #define USER_GP_REGS_STATUS_SCF_LZ_S 3
41 /* SCF_HZ bit (High Zero flag) */
42 #define USER_GP_REGS_STATUS_SCF_HZ_BIT (1 << 2)
43 #define USER_GP_REGS_STATUS_SCF_HZ_S 2
44 /* SCF_HC bit (High Carry flag) */
45 #define USER_GP_REGS_STATUS_SCF_HC_BIT (1 << 1)
46 #define USER_GP_REGS_STATUS_SCF_HC_S 1
47 /* SCF_LC bit (Low Carry flag) */
48 #define USER_GP_REGS_STATUS_SCF_LC_BIT (1 << 0)
49 #define USER_GP_REGS_STATUS_SCF_LC_S 0
52 * struct user_gp_regs - User general purpose registers
53 * @dx: GP data unit regs (dx[reg][unit] = D{unit:0-1}.{reg:0-7})
54 * @ax: GP address unit regs (ax[reg][unit] = A{unit:0-1}.{reg:0-3})
56 * @status: TXSTATUS register (condition flags, LSM_STEP etc)
57 * @rpt: TXRPT registers (branch repeat counter)
58 * @bpobits: TXBPOBITS register ("branch prediction other" bits)
59 * @mode: TXMODE register
60 * @_pad1: Reserved padding to make sizeof obviously 64bit aligned
62 * This is the user-visible general purpose register state structure.
64 * It can be accessed through PTRACE_GETREGSET with NT_PRSTATUS.
66 * It is also used in the signal context.
69 unsigned long dx[8][2];
70 unsigned long ax[4][2];
74 unsigned long bpobits;
80 * struct user_cb_regs - User catch buffer registers
81 * @flags: TXCATCH0 register (fault flags)
82 * @addr: TXCATCH1 register (fault address)
83 * @data: TXCATCH2 and TXCATCH3 registers (low and high data word)
85 * This is the user-visible catch buffer register state structure containing
86 * information about a failed memory access, and allowing the access to be
87 * modified and replayed.
89 * It can be accessed through PTRACE_GETREGSET with NT_METAG_CBUF.
94 unsigned long long data;
98 * struct user_rp_state - User read pipeline state
99 * @entries: Read pipeline entries
100 * @mask: Mask of valid pipeline entries (RPMask from TXDIVTIME register)
102 * This is the user-visible read pipeline state structure containing the entries
103 * currently in the read pipeline and the mask of valid entries.
105 * It can be accessed through PTRACE_GETREGSET with NT_METAG_RPIPE.
107 struct user_rp_state {
108 unsigned long long entries[6];
112 #endif /* __ASSEMBLY__ */
114 #endif /* _UAPI_METAG_PTRACE_H */