aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/include/sysdep-i386/ptrace.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/include/sysdep-i386/ptrace.h')
-rw-r--r--arch/um/include/sysdep-i386/ptrace.h67
1 files changed, 22 insertions, 45 deletions
diff --git a/arch/um/include/sysdep-i386/ptrace.h b/arch/um/include/sysdep-i386/ptrace.h
index c0ea4dbd042b..45573088864c 100644
--- a/arch/um/include/sysdep-i386/ptrace.h
+++ b/arch/um/include/sysdep-i386/ptrace.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
@@ -9,7 +9,6 @@
9#include "uml-config.h" 9#include "uml-config.h"
10#include "user_constants.h" 10#include "user_constants.h"
11#include "sysdep/faultinfo.h" 11#include "sysdep/faultinfo.h"
12#include "choose-mode.h"
13 12
14#define MAX_REG_NR (UM_FRAME_SIZE / sizeof(unsigned long)) 13#define MAX_REG_NR (UM_FRAME_SIZE / sizeof(unsigned long))
15#define MAX_REG_OFFSET (UM_FRAME_SIZE) 14#define MAX_REG_OFFSET (UM_FRAME_SIZE)
@@ -67,40 +66,23 @@ union uml_pt_regs {
67#define EMPTY_UML_PT_REGS { } 66#define EMPTY_UML_PT_REGS { }
68 67
69#define UPT_SC(r) ((r)->tt.sc) 68#define UPT_SC(r) ((r)->tt.sc)
70#define UPT_IP(r) \ 69#define UPT_IP(r) REGS_IP((r)->skas.regs)
71 __CHOOSE_MODE(SC_IP(UPT_SC(r)), REGS_IP((r)->skas.regs)) 70#define UPT_SP(r) REGS_SP((r)->skas.regs)
72#define UPT_SP(r) \ 71#define UPT_EFLAGS(r) REGS_EFLAGS((r)->skas.regs)
73 __CHOOSE_MODE(SC_SP(UPT_SC(r)), REGS_SP((r)->skas.regs)) 72#define UPT_EAX(r) REGS_EAX((r)->skas.regs)
74#define UPT_EFLAGS(r) \ 73#define UPT_EBX(r) REGS_EBX((r)->skas.regs)
75 __CHOOSE_MODE(SC_EFLAGS(UPT_SC(r)), REGS_EFLAGS((r)->skas.regs)) 74#define UPT_ECX(r) REGS_ECX((r)->skas.regs)
76#define UPT_EAX(r) \ 75#define UPT_EDX(r) REGS_EDX((r)->skas.regs)
77 __CHOOSE_MODE(SC_EAX(UPT_SC(r)), REGS_EAX((r)->skas.regs)) 76#define UPT_ESI(r) REGS_ESI((r)->skas.regs)
78#define UPT_EBX(r) \ 77#define UPT_EDI(r) REGS_EDI((r)->skas.regs)
79 __CHOOSE_MODE(SC_EBX(UPT_SC(r)), REGS_EBX((r)->skas.regs)) 78#define UPT_EBP(r) REGS_EBP((r)->skas.regs)
80#define UPT_ECX(r) \ 79#define UPT_ORIG_EAX(r) ((r)->skas.syscall)
81 __CHOOSE_MODE(SC_ECX(UPT_SC(r)), REGS_ECX((r)->skas.regs)) 80#define UPT_CS(r) REGS_CS((r)->skas.regs)
82#define UPT_EDX(r) \ 81#define UPT_SS(r) REGS_SS((r)->skas.regs)
83 __CHOOSE_MODE(SC_EDX(UPT_SC(r)), REGS_EDX((r)->skas.regs)) 82#define UPT_DS(r) REGS_DS((r)->skas.regs)
84#define UPT_ESI(r) \ 83#define UPT_ES(r) REGS_ES((r)->skas.regs)
85 __CHOOSE_MODE(SC_ESI(UPT_SC(r)), REGS_ESI((r)->skas.regs)) 84#define UPT_FS(r) REGS_FS((r)->skas.regs)
86#define UPT_EDI(r) \ 85#define UPT_GS(r) REGS_GS((r)->skas.regs)
87 __CHOOSE_MODE(SC_EDI(UPT_SC(r)), REGS_EDI((r)->skas.regs))
88#define UPT_EBP(r) \
89 __CHOOSE_MODE(SC_EBP(UPT_SC(r)), REGS_EBP((r)->skas.regs))
90#define UPT_ORIG_EAX(r) \
91 __CHOOSE_MODE((r)->tt.syscall, (r)->skas.syscall)
92#define UPT_CS(r) \
93 __CHOOSE_MODE(SC_CS(UPT_SC(r)), REGS_CS((r)->skas.regs))
94#define UPT_SS(r) \
95 __CHOOSE_MODE(SC_SS(UPT_SC(r)), REGS_SS((r)->skas.regs))
96#define UPT_DS(r) \
97 __CHOOSE_MODE(SC_DS(UPT_SC(r)), REGS_DS((r)->skas.regs))
98#define UPT_ES(r) \
99 __CHOOSE_MODE(SC_ES(UPT_SC(r)), REGS_ES((r)->skas.regs))
100#define UPT_FS(r) \
101 __CHOOSE_MODE(SC_FS(UPT_SC(r)), REGS_FS((r)->skas.regs))
102#define UPT_GS(r) \
103 __CHOOSE_MODE(SC_GS(UPT_SC(r)), REGS_GS((r)->skas.regs))
104 86
105#define UPT_SYSCALL_ARG1(r) UPT_EBX(r) 87#define UPT_SYSCALL_ARG1(r) UPT_EBX(r)
106#define UPT_SYSCALL_ARG2(r) UPT_ECX(r) 88#define UPT_SYSCALL_ARG2(r) UPT_ECX(r)
@@ -111,8 +93,7 @@ union uml_pt_regs {
111 93
112extern int user_context(unsigned long sp); 94extern int user_context(unsigned long sp);
113 95
114#define UPT_IS_USER(r) \ 96#define UPT_IS_USER(r) ((r)->skas.is_user)
115 CHOOSE_MODE(user_context(UPT_SP(r)), (r)->skas.is_user)
116 97
117struct syscall_args { 98struct syscall_args {
118 unsigned long args[6]; 99 unsigned long args[6];
@@ -181,18 +162,14 @@ struct syscall_args {
181 } while (0) 162 } while (0)
182 163
183#define UPT_SET_SYSCALL_RETURN(r, res) \ 164#define UPT_SET_SYSCALL_RETURN(r, res) \
184 CHOOSE_MODE(SC_SET_SYSCALL_RETURN(UPT_SC(r), (res)), \ 165 REGS_SET_SYSCALL_RETURN((r)->skas.regs, (res))
185 REGS_SET_SYSCALL_RETURN((r)->skas.regs, (res)))
186 166
187#define UPT_RESTART_SYSCALL(r) \ 167#define UPT_RESTART_SYSCALL(r) REGS_RESTART_SYSCALL((r)->skas.regs)
188 CHOOSE_MODE(SC_RESTART_SYSCALL(UPT_SC(r)), \
189 REGS_RESTART_SYSCALL((r)->skas.regs))
190 168
191#define UPT_ORIG_SYSCALL(r) UPT_EAX(r) 169#define UPT_ORIG_SYSCALL(r) UPT_EAX(r)
192#define UPT_SYSCALL_NR(r) UPT_ORIG_EAX(r) 170#define UPT_SYSCALL_NR(r) UPT_ORIG_EAX(r)
193#define UPT_SYSCALL_RET(r) UPT_EAX(r) 171#define UPT_SYSCALL_RET(r) UPT_EAX(r)
194 172
195#define UPT_FAULTINFO(r) \ 173#define UPT_FAULTINFO(r) (&(r)->skas.faultinfo)
196 CHOOSE_MODE((&(r)->tt.faultinfo), (&(r)->skas.faultinfo))
197 174
198#endif 175#endif