Path: blob/master/arch/um/include/shared/ptrace_user.h
10819 views
/*1* Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)2* Licensed under the GPL3*/45#ifndef __PTRACE_USER_H__6#define __PTRACE_USER_H__78#include "sysdep/ptrace_user.h"910extern int ptrace_getregs(long pid, unsigned long *regs_out);11extern int ptrace_setregs(long pid, unsigned long *regs_in);1213/* syscall emulation path in ptrace */1415#ifndef PTRACE_SYSEMU16#define PTRACE_SYSEMU 3117#endif18#ifndef PTRACE_SYSEMU_SINGLESTEP19#define PTRACE_SYSEMU_SINGLESTEP 3220#endif2122/* On architectures, that started to support PTRACE_O_TRACESYSGOOD23* in linux 2.4, there are two different definitions of24* PTRACE_SETOPTIONS: linux 2.4 uses 21 while linux 2.6 uses 0x4200.25* For binary compatibility, 2.6 also supports the old "21", named26* PTRACE_OLDSETOPTION. On these architectures, UML always must use27* "21", to ensure the kernel runs on 2.4 and 2.6 host without28* recompilation. So, we use PTRACE_OLDSETOPTIONS in UML.29* We also want to be able to build the kernel on 2.4, which doesn't30* have PTRACE_OLDSETOPTIONS. So, if it is missing, we declare31* PTRACE_OLDSETOPTIONS to be the same as PTRACE_SETOPTIONS.32*33* On architectures, that start to support PTRACE_O_TRACESYSGOOD on34* linux 2.6, PTRACE_OLDSETOPTIONS never is defined, and also isn't35* supported by the host kernel. In that case, our trick lets us use36* the new 0x4200 with the name PTRACE_OLDSETOPTIONS.37*/38#ifndef PTRACE_OLDSETOPTIONS39#define PTRACE_OLDSETOPTIONS PTRACE_SETOPTIONS40#endif4142void set_using_sysemu(int value);43int get_using_sysemu(void);44extern int sysemu_supported;4546#define SELECT_PTRACE_OPERATION(sysemu_mode, singlestep_mode) \47(((int[3][3] ) { \48{ PTRACE_SYSCALL, PTRACE_SYSCALL, PTRACE_SINGLESTEP }, \49{ PTRACE_SYSEMU, PTRACE_SYSEMU, PTRACE_SINGLESTEP }, \50{ PTRACE_SYSEMU, PTRACE_SYSEMU_SINGLESTEP, \51PTRACE_SYSEMU_SINGLESTEP } }) \52[sysemu_mode][singlestep_mode])5354#endif555657