Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Jeff Dike | ba180fd | 2007-10-16 01:27:00 -0700 | [diff] [blame] | 2 | * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * Licensed under the GPL |
| 4 | */ |
| 5 | |
| 6 | #ifndef __UM_PTRACE_I386_H |
| 7 | #define __UM_PTRACE_I386_H |
| 8 | |
Jeff Dike | 79d20b1 | 2005-05-03 07:54:51 +0100 | [diff] [blame] | 9 | #define HOST_AUDIT_ARCH AUDIT_ARCH_I386 |
| 10 | |
Paolo 'Blaisorblade' Giarrusso | aa6758d | 2006-03-31 02:30:22 -0800 | [diff] [blame] | 11 | #include "linux/compiler.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | #include "asm/ptrace-generic.h" |
Jeff Dike | e8012b5 | 2007-10-16 01:27:16 -0700 | [diff] [blame] | 13 | #include <asm/user.h> |
Jeff Dike | ba180fd | 2007-10-16 01:27:00 -0700 | [diff] [blame] | 14 | #include "sysdep/ptrace.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | |
| 16 | #define PT_REGS_EAX(r) UPT_EAX(&(r)->regs) |
| 17 | #define PT_REGS_EBX(r) UPT_EBX(&(r)->regs) |
| 18 | #define PT_REGS_ECX(r) UPT_ECX(&(r)->regs) |
| 19 | #define PT_REGS_EDX(r) UPT_EDX(&(r)->regs) |
| 20 | #define PT_REGS_ESI(r) UPT_ESI(&(r)->regs) |
| 21 | #define PT_REGS_EDI(r) UPT_EDI(&(r)->regs) |
| 22 | #define PT_REGS_EBP(r) UPT_EBP(&(r)->regs) |
| 23 | |
| 24 | #define PT_REGS_CS(r) UPT_CS(&(r)->regs) |
| 25 | #define PT_REGS_SS(r) UPT_SS(&(r)->regs) |
| 26 | #define PT_REGS_DS(r) UPT_DS(&(r)->regs) |
| 27 | #define PT_REGS_ES(r) UPT_ES(&(r)->regs) |
| 28 | #define PT_REGS_FS(r) UPT_FS(&(r)->regs) |
| 29 | #define PT_REGS_GS(r) UPT_GS(&(r)->regs) |
| 30 | |
| 31 | #define PT_REGS_EFLAGS(r) UPT_EFLAGS(&(r)->regs) |
| 32 | |
| 33 | #define PT_REGS_ORIG_SYSCALL(r) PT_REGS_EAX(r) |
| 34 | #define PT_REGS_SYSCALL_RET(r) PT_REGS_EAX(r) |
| 35 | #define PT_FIX_EXEC_STACK(sp) do ; while(0) |
| 36 | |
Paolo 'Blaisorblade' Giarrusso | 84dd8d7 | 2005-06-25 14:55:26 -0700 | [diff] [blame] | 37 | /* Cope with a conditional i386 definition. */ |
| 38 | #undef profile_pc |
| 39 | #define profile_pc(regs) PT_REGS_IP(regs) |
| 40 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | #define user_mode(r) UPT_IS_USER(&(r)->regs) |
| 42 | |
Jeff Dike | ba180fd | 2007-10-16 01:27:00 -0700 | [diff] [blame] | 43 | /* |
| 44 | * Forward declaration to avoid including sysdep/tls.h, which causes a |
| 45 | * circular include, and compilation failures. |
| 46 | */ |
| 47 | struct user_desc; |
| 48 | |
Jeff Dike | e8012b5 | 2007-10-16 01:27:16 -0700 | [diff] [blame] | 49 | extern int get_fpxregs(struct user_fxsr_struct __user *buf, |
| 50 | struct task_struct *child); |
| 51 | extern int set_fpxregs(struct user_fxsr_struct __user *buf, |
| 52 | struct task_struct *tsk); |
| 53 | |
Paolo 'Blaisorblade' Giarrusso | aa6758d | 2006-03-31 02:30:22 -0800 | [diff] [blame] | 54 | extern int ptrace_get_thread_area(struct task_struct *child, int idx, |
| 55 | struct user_desc __user *user_desc); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | |
Paolo 'Blaisorblade' Giarrusso | aa6758d | 2006-03-31 02:30:22 -0800 | [diff] [blame] | 57 | extern int ptrace_set_thread_area(struct task_struct *child, int idx, |
| 58 | struct user_desc __user *user_desc); |
| 59 | |
Paolo 'Blaisorblade' Giarrusso | aa6758d | 2006-03-31 02:30:22 -0800 | [diff] [blame] | 60 | #endif |