Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 
0003 /*
0004  * Set of msr bits that gdb can change on behalf of a process.
0005  */
0006 #ifdef CONFIG_PPC_ADV_DEBUG_REGS
0007 #define MSR_DEBUGCHANGE 0
0008 #else
0009 #define MSR_DEBUGCHANGE (MSR_SE | MSR_BE)
0010 #endif
0011 
0012 /*
0013  * Max register writeable via put_reg
0014  */
0015 #ifdef CONFIG_PPC32
0016 #define PT_MAX_PUT_REG  PT_MQ
0017 #else
0018 #define PT_MAX_PUT_REG  PT_CCR
0019 #endif
0020 
0021 #define TVSO(f) (offsetof(struct thread_vr_state, f))
0022 #define TFSO(f) (offsetof(struct thread_fp_state, f))
0023 #define TSO(f)  (offsetof(struct thread_struct, f))
0024 
0025 /*
0026  * These are our native regset flavors.
0027  */
0028 enum powerpc_regset {
0029     REGSET_GPR,
0030     REGSET_FPR,
0031 #ifdef CONFIG_ALTIVEC
0032     REGSET_VMX,
0033 #endif
0034 #ifdef CONFIG_VSX
0035     REGSET_VSX,
0036 #endif
0037 #ifdef CONFIG_SPE
0038     REGSET_SPE,
0039 #endif
0040 #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
0041     REGSET_TM_CGPR,     /* TM checkpointed GPR registers */
0042     REGSET_TM_CFPR,     /* TM checkpointed FPR registers */
0043     REGSET_TM_CVMX,     /* TM checkpointed VMX registers */
0044     REGSET_TM_CVSX,     /* TM checkpointed VSX registers */
0045     REGSET_TM_SPR,      /* TM specific SPR registers */
0046     REGSET_TM_CTAR,     /* TM checkpointed TAR register */
0047     REGSET_TM_CPPR,     /* TM checkpointed PPR register */
0048     REGSET_TM_CDSCR,    /* TM checkpointed DSCR register */
0049 #endif
0050 #ifdef CONFIG_PPC64
0051     REGSET_PPR,     /* PPR register */
0052     REGSET_DSCR,        /* DSCR register */
0053 #endif
0054 #ifdef CONFIG_PPC_BOOK3S_64
0055     REGSET_TAR,     /* TAR register */
0056     REGSET_EBB,     /* EBB registers */
0057     REGSET_PMR,     /* Performance Monitor Registers */
0058 #endif
0059 #ifdef CONFIG_PPC_MEM_KEYS
0060     REGSET_PKEY,        /* AMR register */
0061 #endif
0062 };
0063 
0064 /* ptrace-(no)vsx */
0065 
0066 user_regset_get2_fn fpr_get;
0067 int fpr_set(struct task_struct *target, const struct user_regset *regset,
0068         unsigned int pos, unsigned int count,
0069         const void *kbuf, const void __user *ubuf);
0070 
0071 /* ptrace-vsx */
0072 
0073 int vsr_active(struct task_struct *target, const struct user_regset *regset);
0074 user_regset_get2_fn vsr_get;
0075 int vsr_set(struct task_struct *target, const struct user_regset *regset,
0076         unsigned int pos, unsigned int count,
0077         const void *kbuf, const void __user *ubuf);
0078 
0079 /* ptrace-altivec */
0080 
0081 int vr_active(struct task_struct *target, const struct user_regset *regset);
0082 user_regset_get2_fn vr_get;
0083 int vr_set(struct task_struct *target, const struct user_regset *regset,
0084        unsigned int pos, unsigned int count,
0085        const void *kbuf, const void __user *ubuf);
0086 
0087 /* ptrace-spe */
0088 
0089 int evr_active(struct task_struct *target, const struct user_regset *regset);
0090 user_regset_get2_fn evr_get;
0091 int evr_set(struct task_struct *target, const struct user_regset *regset,
0092         unsigned int pos, unsigned int count,
0093         const void *kbuf, const void __user *ubuf);
0094 
0095 /* ptrace */
0096 
0097 int gpr32_get_common(struct task_struct *target,
0098              const struct user_regset *regset,
0099              struct membuf to,
0100              unsigned long *regs);
0101 int gpr32_set_common(struct task_struct *target,
0102              const struct user_regset *regset,
0103              unsigned int pos, unsigned int count,
0104              const void *kbuf, const void __user *ubuf,
0105              unsigned long *regs);
0106 
0107 /* ptrace-tm */
0108 
0109 #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
0110 void flush_tmregs_to_thread(struct task_struct *tsk);
0111 #else
0112 static inline void flush_tmregs_to_thread(struct task_struct *tsk) { }
0113 #endif
0114 
0115 int tm_cgpr_active(struct task_struct *target, const struct user_regset *regset);
0116 user_regset_get2_fn tm_cgpr_get;
0117 int tm_cgpr_set(struct task_struct *target, const struct user_regset *regset,
0118         unsigned int pos, unsigned int count,
0119         const void *kbuf, const void __user *ubuf);
0120 int tm_cfpr_active(struct task_struct *target, const struct user_regset *regset);
0121 user_regset_get2_fn tm_cfpr_get;
0122 int tm_cfpr_set(struct task_struct *target, const struct user_regset *regset,
0123         unsigned int pos, unsigned int count,
0124         const void *kbuf, const void __user *ubuf);
0125 int tm_cvmx_active(struct task_struct *target, const struct user_regset *regset);
0126 user_regset_get2_fn tm_cvmx_get;
0127 int tm_cvmx_set(struct task_struct *target, const struct user_regset *regset,
0128         unsigned int pos, unsigned int count,
0129         const void *kbuf, const void __user *ubuf);
0130 int tm_cvsx_active(struct task_struct *target, const struct user_regset *regset);
0131 user_regset_get2_fn tm_cvsx_get;
0132 int tm_cvsx_set(struct task_struct *target, const struct user_regset *regset,
0133         unsigned int pos, unsigned int count,
0134         const void *kbuf, const void __user *ubuf);
0135 int tm_spr_active(struct task_struct *target, const struct user_regset *regset);
0136 user_regset_get2_fn tm_spr_get;
0137 int tm_spr_set(struct task_struct *target, const struct user_regset *regset,
0138            unsigned int pos, unsigned int count,
0139            const void *kbuf, const void __user *ubuf);
0140 int tm_tar_active(struct task_struct *target, const struct user_regset *regset);
0141 user_regset_get2_fn tm_tar_get;
0142 int tm_tar_set(struct task_struct *target, const struct user_regset *regset,
0143            unsigned int pos, unsigned int count,
0144            const void *kbuf, const void __user *ubuf);
0145 int tm_ppr_active(struct task_struct *target, const struct user_regset *regset);
0146 user_regset_get2_fn tm_ppr_get;
0147 int tm_ppr_set(struct task_struct *target, const struct user_regset *regset,
0148            unsigned int pos, unsigned int count,
0149            const void *kbuf, const void __user *ubuf);
0150 int tm_dscr_active(struct task_struct *target, const struct user_regset *regset);
0151 user_regset_get2_fn tm_dscr_get;
0152 int tm_dscr_set(struct task_struct *target, const struct user_regset *regset,
0153         unsigned int pos, unsigned int count,
0154         const void *kbuf, const void __user *ubuf);
0155 user_regset_get2_fn tm_cgpr32_get;
0156 int tm_cgpr32_set(struct task_struct *target, const struct user_regset *regset,
0157           unsigned int pos, unsigned int count,
0158           const void *kbuf, const void __user *ubuf);
0159 
0160 /* ptrace-view */
0161 
0162 int ptrace_get_reg(struct task_struct *task, int regno, unsigned long *data);
0163 int ptrace_put_reg(struct task_struct *task, int regno, unsigned long data);
0164 
0165 extern const struct user_regset_view user_ppc_native_view;
0166 
0167 /* ptrace-fpu */
0168 int ptrace_get_fpr(struct task_struct *child, int index, unsigned long *data);
0169 int ptrace_put_fpr(struct task_struct *child, int index, unsigned long data);
0170 
0171 /* ptrace-(no)adv */
0172 void ppc_gethwdinfo(struct ppc_debug_info *dbginfo);
0173 int ptrace_get_debugreg(struct task_struct *child, unsigned long addr,
0174             unsigned long __user *datalp);
0175 int ptrace_set_debugreg(struct task_struct *task, unsigned long addr, unsigned long data);
0176 long ppc_set_hwdebug(struct task_struct *child, struct ppc_hw_breakpoint *bp_info);
0177 long ppc_del_hwdebug(struct task_struct *child, long data);