Commit c16f9ed3adce9e930c296f167d48f4cb193fe59e

Authored by bellard
1 parent 8a4ed7ef

use correct types


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3596 c046a42c-6fe2-441c-8c8c-71466251a162
linux-user/qemu.h
... ... @@ -166,9 +166,9 @@ extern FILE *logfile;
166 166  
167 167 /* strace.c */
168 168 void print_syscall(int num,
169   - target_long arg1, target_long arg2, target_long arg3,
170   - target_long arg4, target_long arg5, target_long arg6);
171   -void print_syscall_ret(int num, target_long arg1);
  169 + abi_long arg1, abi_long arg2, abi_long arg3,
  170 + abi_long arg4, abi_long arg5, abi_long arg6);
  171 +void print_syscall_ret(int num, abi_long arg1);
172 172 extern int do_strace;
173 173  
174 174 /* signal.c */
... ...
linux-user/strace.c
... ... @@ -16,9 +16,9 @@ struct syscallname {
16 16 char *name;
17 17 char *format;
18 18 void (*call)(struct syscallname *,
19   - target_long, target_long, target_long,
20   - target_long, target_long, target_long);
21   - void (*result)(struct syscallname *, target_long);
  19 + abi_long, abi_long, abi_long,
  20 + abi_long, abi_long, abi_long);
  21 + void (*result)(struct syscallname *, abi_long);
22 22 };
23 23  
24 24 /*
... ... @@ -74,8 +74,9 @@ if( cmd == val ) { \
74 74 gemu_log("%d",cmd);
75 75 }
76 76  
  77 +#ifdef TARGET_NR__newselect
77 78 static void
78   -print_fdset(int n, target_ulong target_fds_addr)
  79 +print_fdset(int n, abi_ulong target_fds_addr)
79 80 {
80 81 int i;
81 82  
... ... @@ -101,7 +102,7 @@ print_fdset(int n, target_ulong target_fds_addr)
101 102 }
102 103  
103 104 static void
104   -print_timeval(target_ulong tv_addr)
  105 +print_timeval(abi_ulong tv_addr)
105 106 {
106 107 if( tv_addr ) {
107 108 struct target_timeval *tv;
... ... @@ -115,12 +116,14 @@ print_timeval(target_ulong tv_addr)
115 116 } else
116 117 gemu_log("NULL");
117 118 }
  119 +#endif
118 120  
119 121 /*
120 122 * Sysycall specific output functions
121 123 */
122 124  
123 125 /* select */
  126 +#ifdef TARGET_NR__newselect
124 127 static long newselect_arg1 = 0;
125 128 static long newselect_arg2 = 0;
126 129 static long newselect_arg3 = 0;
... ... @@ -129,10 +132,10 @@ static long newselect_arg5 = 0;
129 132  
130 133 static void
131 134 print_newselect(struct syscallname *name,
132   - target_long arg1, target_long arg2, target_long arg3,
133   - target_long arg4, target_long arg5, target_long arg6)
  135 + abi_long arg1, abi_long arg2, abi_long arg3,
  136 + abi_long arg4, abi_long arg5, abi_long arg6)
134 137 {
135   - gemu_log("%s(" TARGET_FMT_ld ",", name->name, arg1);
  138 + gemu_log("%s(" TARGET_ABI_FMT_ld ",", name->name, arg1);
136 139 print_fdset(arg1, arg2);
137 140 gemu_log(",");
138 141 print_fdset(arg1, arg3);
... ... @@ -149,23 +152,24 @@ print_newselect(struct syscallname *name,
149 152 newselect_arg4=arg4;
150 153 newselect_arg5=arg5;
151 154 }
  155 +#endif
152 156  
153 157 static void
154 158 print_semctl(struct syscallname *name,
155   - target_long arg1, target_long arg2, target_long arg3,
156   - target_long arg4, target_long arg5, target_long arg6)
  159 + abi_long arg1, abi_long arg2, abi_long arg3,
  160 + abi_long arg4, abi_long arg5, abi_long arg6)
157 161 {
158   - gemu_log("%s(" TARGET_FMT_ld "," TARGET_FMT_ld ",", name->name, arg1, arg2);
  162 + gemu_log("%s(" TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld ",", name->name, arg1, arg2);
159 163 print_ipc_cmd(arg3);
160   - gemu_log(",0x" TARGET_FMT_lx ")", arg4);
  164 + gemu_log(",0x" TARGET_ABI_FMT_lx ")", arg4);
161 165 }
162 166  
163 167 static void
164 168 print_execve(struct syscallname *name,
165   - target_long arg1, target_long arg2, target_long arg3,
166   - target_long arg4, target_long arg5, target_long arg6)
  169 + abi_long arg1, abi_long arg2, abi_long arg3,
  170 + abi_long arg4, abi_long arg5, abi_long arg6)
167 171 {
168   - target_ulong arg_ptr_addr;
  172 + abi_ulong arg_ptr_addr;
169 173 char *s;
170 174  
171 175 if (!(s = lock_user_string(arg1)))
... ... @@ -173,10 +177,10 @@ print_execve(struct syscallname *name,
173 177 gemu_log("%s(\"%s\",{", name->name, s);
174 178 unlock_user(s, arg1, 0);
175 179  
176   - for (arg_ptr_addr = arg2; ; arg_ptr_addr += sizeof(target_ulong)) {
177   - target_ulong *arg_ptr, arg_addr, s_addr;
  180 + for (arg_ptr_addr = arg2; ; arg_ptr_addr += sizeof(abi_ulong)) {
  181 + abi_ulong *arg_ptr, arg_addr, s_addr;
178 182  
179   - arg_ptr = lock_user(VERIFY_READ, arg_ptr_addr, sizeof(target_ulong), 1);
  183 + arg_ptr = lock_user(VERIFY_READ, arg_ptr_addr, sizeof(abi_ulong), 1);
180 184 if (!arg_ptr)
181 185 return;
182 186 arg_addr = tswapl(*arg_ptr);
... ... @@ -192,10 +196,11 @@ print_execve(struct syscallname *name,
192 196 gemu_log("NULL})");
193 197 }
194 198  
  199 +#ifdef TARGET_NR_ipc
195 200 static void
196 201 print_ipc(struct syscallname *name,
197   - target_long arg1, target_long arg2, target_long arg3,
198   - target_long arg4, target_long arg5, target_long arg6)
  202 + abi_long arg1, abi_long arg2, abi_long arg3,
  203 + abi_long arg4, abi_long arg5, abi_long arg6)
199 204 {
200 205 switch(arg1) {
201 206 case IPCOP_semctl:
... ... @@ -203,38 +208,39 @@ print_ipc(struct syscallname *name,
203 208 print_semctl(name,arg2,arg3,arg4,arg5,arg6,0);
204 209 break;
205 210 default:
206   - gemu_log("%s(" TARGET_FMT_ld "," TARGET_FMT_ld "," TARGET_FMT_ld "," TARGET_FMT_ld ")",
  211 + gemu_log("%s(" TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld ")",
207 212 name->name, arg1, arg2, arg3, arg4);
208 213 }
209 214 }
  215 +#endif
210 216  
211 217 /*
212 218 * Variants for the return value output function
213 219 */
214 220  
215 221 static void
216   -print_syscall_ret_addr(struct syscallname *name, target_long ret)
  222 +print_syscall_ret_addr(struct syscallname *name, abi_long ret)
217 223 {
218 224 if( ret == -1 ) {
219 225 gemu_log(" = -1 errno=%d (%s)\n", errno, target_strerror(errno));
220 226 } else {
221   - gemu_log(" = " TARGET_FMT_lx "\n", ret);
  227 + gemu_log(" = " TARGET_ABI_FMT_lx "\n", ret);
222 228 }
223 229 }
224 230  
225 231 #if 0 /* currently unused */
226 232 static void
227   -print_syscall_ret_raw(struct syscallname *name, target_long ret)
  233 +print_syscall_ret_raw(struct syscallname *name, abi_long ret)
228 234 {
229   - gemu_log(" = " TARGET_FMT_lx "\n", ret);
  235 + gemu_log(" = " TARGET_ABI_FMT_lx "\n", ret);
230 236 }
231 237 #endif
232 238  
233 239 #ifdef TARGET_NR__newselect
234 240 static void
235   -print_syscall_ret_newselect(struct syscallname *name, target_long ret)
  241 +print_syscall_ret_newselect(struct syscallname *name, abi_long ret)
236 242 {
237   - gemu_log(" = " TARGET_FMT_lx " (", ret);
  243 + gemu_log(" = " TARGET_ABI_FMT_lx " (", ret);
238 244 print_fdset(newselect_arg1,newselect_arg2);
239 245 gemu_log(",");
240 246 print_fdset(newselect_arg1,newselect_arg3);
... ... @@ -261,8 +267,8 @@ static int nsyscalls = sizeof(scnames)/sizeof(struct syscallname);
261 267 */
262 268 void
263 269 print_syscall(int num,
264   - target_long arg1, target_long arg2, target_long arg3,
265   - target_long arg4, target_long arg5, target_long arg6)
  270 + abi_long arg1, abi_long arg2, abi_long arg3,
  271 + abi_long arg4, abi_long arg5, abi_long arg6)
266 272 {
267 273 int i;
268 274 char *format="%s(%ld,%ld,%ld,%ld,%ld,%ld)";
... ... @@ -284,7 +290,7 @@ print_syscall(int num,
284 290  
285 291  
286 292 void
287   -print_syscall_ret(int num, target_long ret)
  293 +print_syscall_ret(int num, abi_long ret)
288 294 {
289 295 int i;
290 296  
... ... @@ -294,9 +300,9 @@ print_syscall_ret(int num, target_long ret)
294 300 scnames[i].result(&scnames[i],ret);
295 301 } else {
296 302 if( ret < 0 ) {
297   - gemu_log(" = -1 errno=%d (%s)\n", -ret, target_strerror(-ret));
  303 + gemu_log(" = -1 errno=" TARGET_ABI_FMT_ld " (%s)\n", -ret, target_strerror(-ret));
298 304 } else {
299   - gemu_log(" = %d\n", ret);
  305 + gemu_log(" = " TARGET_ABI_FMT_ld "\n", ret);
300 306 }
301 307 }
302 308 break;
... ...