mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-14 05:12:17 +00:00
dd93938a92
The x86 specific arch_prctl() arbitrarily changed prctl's 'option' to 'code'. Before adding new options, rename it. Signed-off-by: Kyle Huey <khuey@kylehuey.com> Cc: Grzegorz Andrejczuk <grzegorz.andrejczuk@intel.com> Cc: kvm@vger.kernel.org Cc: Radim Krčmář <rkrcmar@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: linux-kselftest@vger.kernel.org Cc: Nadav Amit <nadav.amit@gmail.com> Cc: Robert O'Callahan <robert@ocallahan.org> Cc: Richard Weinberger <richard@nod.at> Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com> Cc: Borislav Petkov <bp@suse.de> Cc: Andy Lutomirski <luto@kernel.org> Cc: Len Brown <len.brown@intel.com> Cc: Shuah Khan <shuah@kernel.org> Cc: user-mode-linux-devel@lists.sourceforge.net Cc: Jeff Dike <jdike@addtoit.com> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: user-mode-linux-user@lists.sourceforge.net Cc: David Matlack <dmatlack@google.com> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com> Cc: Dmitry Safonov <dsafonov@virtuozzo.com> Cc: linux-fsdevel@vger.kernel.org Cc: Paolo Bonzini <pbonzini@redhat.com> Link: http://lkml.kernel.org/r/20170320081628.18952-3-khuey@kylehuey.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
87 lines
2.5 KiB
C
87 lines
2.5 KiB
C
#ifndef __UM_X86_PTRACE_H
|
|
#define __UM_X86_PTRACE_H
|
|
|
|
#include <linux/compiler.h>
|
|
#ifndef CONFIG_X86_32
|
|
#define __FRAME_OFFSETS /* Needed to get the R* macros */
|
|
#endif
|
|
#include <asm/ptrace-generic.h>
|
|
|
|
#define user_mode(r) UPT_IS_USER(&(r)->regs)
|
|
|
|
#define PT_REGS_AX(r) UPT_AX(&(r)->regs)
|
|
#define PT_REGS_BX(r) UPT_BX(&(r)->regs)
|
|
#define PT_REGS_CX(r) UPT_CX(&(r)->regs)
|
|
#define PT_REGS_DX(r) UPT_DX(&(r)->regs)
|
|
|
|
#define PT_REGS_SI(r) UPT_SI(&(r)->regs)
|
|
#define PT_REGS_DI(r) UPT_DI(&(r)->regs)
|
|
#define PT_REGS_BP(r) UPT_BP(&(r)->regs)
|
|
#define PT_REGS_EFLAGS(r) UPT_EFLAGS(&(r)->regs)
|
|
|
|
#define PT_REGS_CS(r) UPT_CS(&(r)->regs)
|
|
#define PT_REGS_SS(r) UPT_SS(&(r)->regs)
|
|
#define PT_REGS_DS(r) UPT_DS(&(r)->regs)
|
|
#define PT_REGS_ES(r) UPT_ES(&(r)->regs)
|
|
|
|
#define PT_REGS_ORIG_SYSCALL(r) PT_REGS_AX(r)
|
|
#define PT_REGS_SYSCALL_RET(r) PT_REGS_AX(r)
|
|
|
|
#define PT_FIX_EXEC_STACK(sp) do ; while(0)
|
|
|
|
#define profile_pc(regs) PT_REGS_IP(regs)
|
|
|
|
#define UPT_RESTART_SYSCALL(r) (UPT_IP(r) -= 2)
|
|
#define PT_REGS_SET_SYSCALL_RETURN(r, res) (PT_REGS_AX(r) = (res))
|
|
|
|
static inline long regs_return_value(struct pt_regs *regs)
|
|
{
|
|
return PT_REGS_AX(regs);
|
|
}
|
|
|
|
/*
|
|
* Forward declaration to avoid including sysdep/tls.h, which causes a
|
|
* circular include, and compilation failures.
|
|
*/
|
|
struct user_desc;
|
|
|
|
#ifdef CONFIG_X86_32
|
|
|
|
extern int ptrace_get_thread_area(struct task_struct *child, int idx,
|
|
struct user_desc __user *user_desc);
|
|
|
|
extern int ptrace_set_thread_area(struct task_struct *child, int idx,
|
|
struct user_desc __user *user_desc);
|
|
|
|
#else
|
|
|
|
#define PT_REGS_R8(r) UPT_R8(&(r)->regs)
|
|
#define PT_REGS_R9(r) UPT_R9(&(r)->regs)
|
|
#define PT_REGS_R10(r) UPT_R10(&(r)->regs)
|
|
#define PT_REGS_R11(r) UPT_R11(&(r)->regs)
|
|
#define PT_REGS_R12(r) UPT_R12(&(r)->regs)
|
|
#define PT_REGS_R13(r) UPT_R13(&(r)->regs)
|
|
#define PT_REGS_R14(r) UPT_R14(&(r)->regs)
|
|
#define PT_REGS_R15(r) UPT_R15(&(r)->regs)
|
|
|
|
#include <asm/errno.h>
|
|
|
|
static inline int ptrace_get_thread_area(struct task_struct *child, int idx,
|
|
struct user_desc __user *user_desc)
|
|
{
|
|
return -ENOSYS;
|
|
}
|
|
|
|
static inline int ptrace_set_thread_area(struct task_struct *child, int idx,
|
|
struct user_desc __user *user_desc)
|
|
{
|
|
return -ENOSYS;
|
|
}
|
|
|
|
extern long arch_prctl(struct task_struct *task, int option,
|
|
unsigned long __user *addr);
|
|
|
|
#endif
|
|
#define user_stack_pointer(regs) PT_REGS_SP(regs)
|
|
#endif /* __UM_X86_PTRACE_H */
|