blob: 0273e4d09af7b65e47c5dab30936f5d1acd69643 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Jeff Dikeba180fd2007-10-16 01:27:00 -07002 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 * Licensed under the GPL
4 */
5
6#ifndef __UM_PTRACE_I386_H
7#define __UM_PTRACE_I386_H
8
Jeff Dike79d20b12005-05-03 07:54:51 +01009#define HOST_AUDIT_ARCH AUDIT_ARCH_I386
10
Paolo 'Blaisorblade' Giarrussoaa6758d2006-03-31 02:30:22 -080011#include "linux/compiler.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070012#include "asm/ptrace-generic.h"
13
14#define PT_REGS_EAX(r) UPT_EAX(&(r)->regs)
15#define PT_REGS_EBX(r) UPT_EBX(&(r)->regs)
16#define PT_REGS_ECX(r) UPT_ECX(&(r)->regs)
17#define PT_REGS_EDX(r) UPT_EDX(&(r)->regs)
18#define PT_REGS_ESI(r) UPT_ESI(&(r)->regs)
19#define PT_REGS_EDI(r) UPT_EDI(&(r)->regs)
20#define PT_REGS_EBP(r) UPT_EBP(&(r)->regs)
21
22#define PT_REGS_CS(r) UPT_CS(&(r)->regs)
23#define PT_REGS_SS(r) UPT_SS(&(r)->regs)
24#define PT_REGS_DS(r) UPT_DS(&(r)->regs)
25#define PT_REGS_ES(r) UPT_ES(&(r)->regs)
26#define PT_REGS_FS(r) UPT_FS(&(r)->regs)
27#define PT_REGS_GS(r) UPT_GS(&(r)->regs)
28
29#define PT_REGS_EFLAGS(r) UPT_EFLAGS(&(r)->regs)
30
31#define PT_REGS_ORIG_SYSCALL(r) PT_REGS_EAX(r)
32#define PT_REGS_SYSCALL_RET(r) PT_REGS_EAX(r)
33#define PT_FIX_EXEC_STACK(sp) do ; while(0)
34
Paolo 'Blaisorblade' Giarrusso84dd8d72005-06-25 14:55:26 -070035#define profile_pc(regs) PT_REGS_IP(regs)
36
Linus Torvalds1da177e2005-04-16 15:20:36 -070037#define user_mode(r) UPT_IS_USER(&(r)->regs)
38
Jeff Dikeba180fd2007-10-16 01:27:00 -070039/*
40 * Forward declaration to avoid including sysdep/tls.h, which causes a
41 * circular include, and compilation failures.
42 */
43struct user_desc;
44
Jeff Dikee8012b52007-10-16 01:27:16 -070045extern int get_fpxregs(struct user_fxsr_struct __user *buf,
46 struct task_struct *child);
47extern int set_fpxregs(struct user_fxsr_struct __user *buf,
48 struct task_struct *tsk);
49
Paolo 'Blaisorblade' Giarrussoaa6758d2006-03-31 02:30:22 -080050extern int ptrace_get_thread_area(struct task_struct *child, int idx,
51 struct user_desc __user *user_desc);
Linus Torvalds1da177e2005-04-16 15:20:36 -070052
Paolo 'Blaisorblade' Giarrussoaa6758d2006-03-31 02:30:22 -080053extern int ptrace_set_thread_area(struct task_struct *child, int idx,
54 struct user_desc __user *user_desc);
55
Paolo 'Blaisorblade' Giarrussoaa6758d2006-03-31 02:30:22 -080056#endif