Home | History | Annotate | Line # | Download | only in include
ptrace.h revision 1.13
      1 /*	$NetBSD: ptrace.h,v 1.13 2017/04/08 00:25:49 kamil Exp $	*/
      2 
      3 #ifndef _POWERPC_PTRACE_H
      4 #define	_POWERPC_PTRACE_H
      5 
      6 #define	PT_STEP		(PT_FIRSTMACH + 0)
      7 #define	PT_GETREGS	(PT_FIRSTMACH + 1)
      8 #define	PT_SETREGS	(PT_FIRSTMACH + 2)
      9 #define	PT_GETFPREGS	(PT_FIRSTMACH + 3)
     10 #define	PT_SETFPREGS	(PT_FIRSTMACH + 4)
     11 #define	PT_GETVECREGS	(PT_FIRSTMACH + 5)
     12 #define	PT_SETVECREGS	(PT_FIRSTMACH + 6)
     13 #define	PT_SETSTEP	(PT_FIRSTMACH + 7)
     14 #define	PT_CLEARSTEP	(PT_FIRSTMACH + 8)
     15 
     16 #define	PT_MACHDEP_STRINGS				\
     17 	"PT_STEP",					\
     18 	"PT_GETREGS",		"PT_SETREGS",		\
     19 	"PT_GETFPREGS",		"PT_SETFPREGS",		\
     20 	"PT_GETVECREGS",	"PT_SETVECREGS",	\
     21 	"PT_SETSTEP",		"PT_CLEARSTEP",
     22 
     23 #include <machine/reg.h>
     24 #define PTRACE_REG_PC(r)	(r)->pc
     25 #define PTRACE_REG_SET_PC(r, v)	(r)->pc = (v)
     26 #define PTRACE_REG_SP(r)	(r)->fixreg[1]
     27 #define PTRACE_REG_INTRV(r)	(r)->fixreg[3]
     28 
     29 #ifdef _KERNEL
     30 #ifdef _KERNEL_OPT
     31 #include "opt_altivec.h"
     32 #endif
     33 
     34 #if defined(ALTIVEC) || defined(PPC_HAVE_SPE)
     35 
     36 /* We have machine-dependent process tracing requests.  */
     37 #define __HAVE_PTRACE_MACHDEP
     38 
     39 #define	PTRACE_MACHDEP_REQUEST_CASES \
     40 	case PT_GETVECREGS: \
     41 	case PT_SETVECREGS:
     42 
     43 int ptrace_machdep_dorequest(struct lwp *, struct lwp *, int, void *, int);
     44 int process_machdep_dovecregs(struct lwp *, struct lwp *, struct uio *);
     45 int process_machdep_validvecregs(struct proc *);
     46 
     47 /* We have machine-dependent procfs nodes.  */
     48 #define __HAVE_PROCFS_MACHDEP
     49 
     50 #define	PROCFS_MACHDEP_NODE_TYPES \
     51 	Pmachdep_vecregs,		/* AltiVec register set */
     52 
     53 #define	PROCFS_MACHDEP_NODETYPE_CASES \
     54 	case Pmachdep_vecregs:
     55 
     56 #define	PROCFS_MACHDEP_PROTECT_CASES \
     57 	case Pmachdep_vecregs:
     58 
     59 #define	PROCFS_MACHDEP_NODETYPE_DEFNS \
     60 	{ DT_REG, N("vecregs"), Pmachdep_vecregs, \
     61 	  procfs_machdep_validvecregs },
     62 
     63 /* Functions used by procfs.  */
     64 struct mount;
     65 struct pfsnode;
     66 int procfs_machdep_dovecregs(struct lwp *, struct lwp *,
     67 	struct pfsnode *, struct uio *);
     68 int procfs_machdep_validvecregs(struct lwp *, struct mount *);
     69 
     70 #endif /* ALTIVEC || PPC_HAVE_SPE */
     71 #endif /* _KERNEL */
     72 
     73 #endif /* _POWERPC_PTRACE_H */
     74