Home | History | Annotate | Line # | Download | only in include
ptrace.h revision 1.6.48.2
      1  1.6.48.2  jdolecek /*	$NetBSD: ptrace.h,v 1.6.48.2 2002/06/23 17:37:29 jdolecek Exp $	*/
      2  1.6.48.1   thorpej 
      3  1.6.48.1   thorpej /*
      4  1.6.48.1   thorpej  * Copyright (c) 2001 Wasabi Systems, Inc.
      5  1.6.48.1   thorpej  * All rights reserved.
      6  1.6.48.1   thorpej  *
      7  1.6.48.1   thorpej  * Written by Jason R. Thorpe for Wasabi Systems, Inc.
      8  1.6.48.1   thorpej  *
      9  1.6.48.1   thorpej  * Redistribution and use in source and binary forms, with or without
     10  1.6.48.1   thorpej  * modification, are permitted provided that the following conditions
     11  1.6.48.1   thorpej  * are met:
     12  1.6.48.1   thorpej  * 1. Redistributions of source code must retain the above copyright
     13  1.6.48.1   thorpej  *    notice, this list of conditions and the following disclaimer.
     14  1.6.48.1   thorpej  * 2. Redistributions in binary form must reproduce the above copyright
     15  1.6.48.1   thorpej  *    notice, this list of conditions and the following disclaimer in the
     16  1.6.48.1   thorpej  *    documentation and/or other materials provided with the distribution.
     17  1.6.48.1   thorpej  * 3. All advertising materials mentioning features or use of this software
     18  1.6.48.1   thorpej  *    must display the following acknowledgement:
     19  1.6.48.1   thorpej  *	This product includes software developed for the NetBSD Project by
     20  1.6.48.1   thorpej  *	Wasabi Systems, Inc.
     21  1.6.48.1   thorpej  * 4. The name of Wasabi Systems, Inc. may not be used to endorse
     22  1.6.48.1   thorpej  *    or promote products derived from this software without specific prior
     23  1.6.48.1   thorpej  *    written permission.
     24  1.6.48.1   thorpej  *
     25  1.6.48.1   thorpej  * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
     26  1.6.48.1   thorpej  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     27  1.6.48.1   thorpej  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     28  1.6.48.1   thorpej  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
     29  1.6.48.1   thorpej  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     30  1.6.48.1   thorpej  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     31  1.6.48.1   thorpej  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     32  1.6.48.1   thorpej  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     33  1.6.48.1   thorpej  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     34  1.6.48.1   thorpej  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     35  1.6.48.1   thorpej  * POSSIBILITY OF SUCH DAMAGE.
     36  1.6.48.1   thorpej  */
     37       1.5       cgd 
     38       1.1       cgd /*
     39       1.1       cgd  * Copyright (c) 1993 Christopher G. Demetriou
     40       1.1       cgd  * All rights reserved.
     41       1.1       cgd  *
     42       1.1       cgd  * Redistribution and use in source and binary forms, with or without
     43       1.1       cgd  * modification, are permitted provided that the following conditions
     44       1.1       cgd  * are met:
     45       1.1       cgd  * 1. Redistributions of source code must retain the above copyright
     46       1.1       cgd  *    notice, this list of conditions and the following disclaimer.
     47       1.1       cgd  * 2. Redistributions in binary form must reproduce the above copyright
     48       1.1       cgd  *    notice, this list of conditions and the following disclaimer in the
     49       1.1       cgd  *    documentation and/or other materials provided with the distribution.
     50       1.1       cgd  * 3. All advertising materials mentioning features or use of this software
     51       1.1       cgd  *    must display the following acknowledgement:
     52       1.1       cgd  *      This product includes software developed by Christopher G. Demetriou.
     53       1.1       cgd  * 4. The name of the author may not be used to endorse or promote products
     54       1.4       jtc  *    derived from this software without specific prior written permission
     55       1.1       cgd  *
     56       1.1       cgd  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     57       1.1       cgd  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     58       1.1       cgd  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     59       1.1       cgd  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     60       1.1       cgd  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     61       1.1       cgd  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     62       1.1       cgd  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     63       1.1       cgd  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     64       1.1       cgd  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     65       1.1       cgd  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     66       1.1       cgd  */
     67       1.1       cgd 
     68  1.6.48.1   thorpej #ifndef _I386_PTRACE_H_
     69  1.6.48.1   thorpej #define	_I386_PTRACE_H_
     70  1.6.48.1   thorpej 
     71       1.1       cgd /*
     72       1.1       cgd  * i386-dependent ptrace definitions
     73       1.1       cgd  */
     74       1.2       cgd #define	PT_STEP		(PT_FIRSTMACH + 0)
     75       1.2       cgd #define	PT_GETREGS	(PT_FIRSTMACH + 1)
     76       1.2       cgd #define	PT_SETREGS	(PT_FIRSTMACH + 2)
     77       1.2       cgd #define	PT_GETFPREGS	(PT_FIRSTMACH + 3)
     78       1.2       cgd #define	PT_SETFPREGS	(PT_FIRSTMACH + 4)
     79  1.6.48.1   thorpej 
     80  1.6.48.1   thorpej /* We have machine-dependent process tracing needs. */
     81  1.6.48.1   thorpej #define	__HAVE_PTRACE_MACHDEP
     82  1.6.48.1   thorpej 
     83  1.6.48.1   thorpej /* We have machine-dependent procfs nodes. */
     84  1.6.48.1   thorpej #define	__HAVE_PROCFS_MACHDEP
     85  1.6.48.1   thorpej 
     86  1.6.48.1   thorpej /* The machine-dependent ptrace(2) requests. */
     87  1.6.48.1   thorpej #define	PT_GETXMMREGS	(PT_FIRSTMACH + 5)
     88  1.6.48.1   thorpej #define	PT_SETXMMREGS	(PT_FIRSTMACH + 6)
     89  1.6.48.1   thorpej 
     90  1.6.48.1   thorpej #ifdef _KERNEL
     91  1.6.48.1   thorpej 
     92  1.6.48.1   thorpej /*
     93  1.6.48.1   thorpej  * These are used in sys_ptrace() to find good ptrace(2) requests.
     94  1.6.48.1   thorpej  */
     95  1.6.48.1   thorpej #define	PTRACE_MACHDEP_REQUEST_CASES					\
     96  1.6.48.1   thorpej 	case PT_GETXMMREGS:						\
     97  1.6.48.1   thorpej 	case PT_SETXMMREGS:
     98  1.6.48.1   thorpej 
     99  1.6.48.1   thorpej /*
    100  1.6.48.1   thorpej  * These are used to define machine-dependent procfs node types.
    101  1.6.48.1   thorpej  */
    102  1.6.48.1   thorpej #define	PROCFS_MACHDEP_NODE_TYPES					\
    103  1.6.48.1   thorpej 	Pmachdep_xmmregs,	/* extended FP register set */
    104  1.6.48.1   thorpej 
    105  1.6.48.1   thorpej /*
    106  1.6.48.1   thorpej  * These are used in switch statements to catch machine-dependent
    107  1.6.48.1   thorpej  * procfs node types.
    108  1.6.48.1   thorpej  */
    109  1.6.48.1   thorpej #define	PROCFS_MACHDEP_NODETYPE_CASES					\
    110  1.6.48.1   thorpej 	case Pmachdep_xmmregs:
    111  1.6.48.1   thorpej 
    112  1.6.48.1   thorpej /*
    113  1.6.48.1   thorpej  * These are used to protect a privileged process's state.
    114  1.6.48.1   thorpej  */
    115  1.6.48.1   thorpej #define	PROCFS_MACHDEP_PROTECT_CASES					\
    116  1.6.48.1   thorpej 	case Pmachdep_xmmregs:
    117  1.6.48.1   thorpej 
    118  1.6.48.1   thorpej /*
    119  1.6.48.1   thorpej  * These are used to define the machine-dependent procfs nodes.
    120  1.6.48.1   thorpej  */
    121  1.6.48.1   thorpej #define	PROCFS_MACHDEP_NODETYPE_DEFNS					\
    122  1.6.48.1   thorpej 	{ DT_REG, N("xmmregs"), Pmachdep_xmmregs,			\
    123  1.6.48.1   thorpej 	  procfs_machdep_validxmmregs },
    124  1.6.48.1   thorpej 
    125  1.6.48.1   thorpej struct xmmregs;
    126  1.6.48.1   thorpej 
    127  1.6.48.1   thorpej /* Functions used by both ptrace(2) and procfs. */
    128  1.6.48.2  jdolecek int	process_machdep_doxmmregs(struct proc *, struct proc *, struct uio *);
    129  1.6.48.2  jdolecek int	process_machdep_validxmmregs(struct proc *);
    130  1.6.48.1   thorpej 
    131  1.6.48.2  jdolecek /* Functions used by procfs. */
    132  1.6.48.2  jdolecek struct mount;
    133  1.6.48.2  jdolecek struct pfsnode;
    134  1.6.48.1   thorpej int	procfs_machdep_doxmmregs(struct proc *, struct proc *,
    135  1.6.48.1   thorpej 	    struct pfsnode *, struct uio *);
    136  1.6.48.2  jdolecek int	procfs_machdep_validxmmregs(struct proc *, struct mount *);
    137  1.6.48.1   thorpej 
    138  1.6.48.1   thorpej #endif /* _KERNEL */
    139  1.6.48.1   thorpej 
    140  1.6.48.1   thorpej #endif /* _I386_PTRACE_H_ */
    141