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