xref: /netbsd-src/sys/compat/linux/common/linux_ptrace.h (revision ce099b40997c43048fb78bd578195f81d2456523)
1*ce099b40Smartin /*	$NetBSD: linux_ptrace.h,v 1.12 2008/04/28 20:23:43 martin Exp $	*/
2c3ce0bc3Stron 
3c3ce0bc3Stron /*-
4c3ce0bc3Stron  * Copyright (c) 1999 The NetBSD Foundation, Inc.
5c3ce0bc3Stron  * All rights reserved.
6c3ce0bc3Stron  *
7c3ce0bc3Stron  * This code is derived from software contributed to The NetBSD Foundation
8c3ce0bc3Stron  * by Matthias Scheler.
9c3ce0bc3Stron  *
10c3ce0bc3Stron  * Redistribution and use in source and binary forms, with or without
11c3ce0bc3Stron  * modification, are permitted provided that the following conditions
12c3ce0bc3Stron  * are met:
13c3ce0bc3Stron  * 1. Redistributions of source code must retain the above copyright
14c3ce0bc3Stron  *    notice, this list of conditions and the following disclaimer.
15c3ce0bc3Stron  * 2. Redistributions in binary form must reproduce the above copyright
16c3ce0bc3Stron  *    notice, this list of conditions and the following disclaimer in the
17c3ce0bc3Stron  *    documentation and/or other materials provided with the distribution.
18c3ce0bc3Stron  *
19c3ce0bc3Stron  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20c3ce0bc3Stron  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21c3ce0bc3Stron  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22c3ce0bc3Stron  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23c3ce0bc3Stron  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24c3ce0bc3Stron  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25c3ce0bc3Stron  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26c3ce0bc3Stron  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27c3ce0bc3Stron  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28c3ce0bc3Stron  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29c3ce0bc3Stron  * POSSIBILITY OF SUCH DAMAGE.
30c3ce0bc3Stron  */
31c3ce0bc3Stron 
32c3ce0bc3Stron #ifndef _LINUX_PTRACE_H
33c3ce0bc3Stron #define _LINUX_PTRACE_H
34c3ce0bc3Stron 
35c3ce0bc3Stron #define LINUX_PTRACE_TRACEME		 0
36c3ce0bc3Stron #define LINUX_PTRACE_PEEKTEXT		 1
37c3ce0bc3Stron #define LINUX_PTRACE_PEEKDATA		 2
38c3ce0bc3Stron #define LINUX_PTRACE_PEEKUSR		 3
39c3ce0bc3Stron #define LINUX_PTRACE_POKETEXT		 4
40c3ce0bc3Stron #define LINUX_PTRACE_POKEDATA		 5
41c3ce0bc3Stron #define LINUX_PTRACE_POKEUSR		 6
42c3ce0bc3Stron #define LINUX_PTRACE_CONT		 7
43c3ce0bc3Stron #define LINUX_PTRACE_KILL		 8
44c3ce0bc3Stron #define LINUX_PTRACE_SINGLESTEP		 9
458d9bc849Sjdolecek #define LINUX_PTRACE_GETREGS		12
468d9bc849Sjdolecek #define LINUX_PTRACE_SETREGS		13
478d9bc849Sjdolecek #define LINUX_PTRACE_GETFPREGS		14
488d9bc849Sjdolecek #define LINUX_PTRACE_SETFPREGS		15
49c3ce0bc3Stron #define LINUX_PTRACE_ATTACH		16
50c3ce0bc3Stron #define LINUX_PTRACE_DETACH		17
51c3ce0bc3Stron #define LINUX_PTRACE_SYSCALL		24
52c3ce0bc3Stron 
534929dc57Sbjh21 #if defined(__i386__) || defined (__powerpc__) || defined (__mips__) || \
544929dc57Sbjh21     defined(__arm__)
557e2790cfSdsl struct linux_sys_ptrace_args;
567e2790cfSdsl int linux_sys_ptrace_arch(struct lwp *, const struct linux_sys_ptrace_args *, register_t *);
574aec38a7Stron 
5841978f78Sthorpej #define LINUX_SYS_PTRACE_ARCH(l,v,r)	linux_sys_ptrace_arch((l),(v),(r))
594aec38a7Stron #else
6041978f78Sthorpej #define LINUX_SYS_PTRACE_ARCH(l,v,r)	EIO
614aec38a7Stron #endif
624aec38a7Stron 
63c3ce0bc3Stron #endif /* !_LINUX_PTRACE_H */
64