Rev 4661 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4661 | Rev 4681 | ||
---|---|---|---|
Line 204... | Line 204... | ||
204 | return 0; |
204 | return 0; |
205 | } |
205 | } |
206 | 206 | ||
207 | void val_print(sysarg_t val, val_type_t v_type) |
207 | void val_print(sysarg_t val, val_type_t v_type) |
208 | { |
208 | { |
- | 209 | long sval; |
|
- | 210 | ||
- | 211 | sval = (long) val; |
|
- | 212 | ||
209 | switch (v_type) { |
213 | switch (v_type) { |
210 | case V_VOID: |
214 | case V_VOID: |
211 | printf("<void>"); |
215 | printf("<void>"); |
212 | break; |
216 | break; |
213 | 217 | ||
214 | case V_INTEGER: |
218 | case V_INTEGER: |
215 | printf("%ld", val); |
219 | printf("%ld", sval); |
216 | break; |
220 | break; |
217 | 221 | ||
218 | case V_HASH: |
222 | case V_HASH: |
219 | case V_PTR: |
223 | case V_PTR: |
220 | printf("0x%08lx", val); |
224 | printf("0x%08lx", val); |
221 | break; |
225 | break; |
222 | 226 | ||
223 | case V_ERRNO: |
227 | case V_ERRNO: |
224 | if (val >= -15 && val <= 0) { |
228 | if (sval >= -15 && sval <= 0) { |
225 | printf("%ld %s (%s)", val, |
229 | printf("%ld %s (%s)", sval, |
226 | err_desc[-val].name, |
230 | err_desc[-sval].name, |
227 | err_desc[-val].desc); |
231 | err_desc[-sval].desc); |
228 | } else { |
232 | } else { |
229 | printf("%ld", val); |
233 | printf("%ld", sval); |
230 | } |
234 | } |
231 | break; |
235 | break; |
232 | case V_INT_ERRNO: |
236 | case V_INT_ERRNO: |
233 | if (val >= -15 && val < 0) { |
237 | if (sval >= -15 && sval < 0) { |
234 | printf("%ld %s (%s)", val, |
238 | printf("%ld %s (%s)", sval, |
235 | err_desc[-val].name, |
239 | err_desc[-sval].name, |
236 | err_desc[-val].desc); |
240 | err_desc[-sval].desc); |
237 | } else { |
241 | } else { |
238 | printf("%ld", val); |
242 | printf("%ld", sval); |
239 | } |
243 | } |
240 | break; |
244 | break; |
241 | 245 | ||
242 | case V_CHAR: |
246 | case V_CHAR: |
243 | if (val >= 0x20 && val < 0x7f) { |
247 | if (sval >= 0x20 && sval < 0x7f) { |
244 | printf("'%c'", val); |
248 | printf("'%c'", sval); |
245 | } else { |
249 | } else { |
246 | switch (val) { |
250 | switch (sval) { |
247 | case '\a': printf("'\\a'"); break; |
251 | case '\a': printf("'\\a'"); break; |
248 | case '\b': printf("'\\b'"); break; |
252 | case '\b': printf("'\\b'"); break; |
249 | case '\n': printf("'\\n'"); break; |
253 | case '\n': printf("'\\n'"); break; |
250 | case '\r': printf("'\\r'"); break; |
254 | case '\r': printf("'\\r'"); break; |
251 | case '\t': printf("'\\t'"); break; |
255 | case '\t': printf("'\\t'"); break; |
Line 280... | Line 284... | ||
280 | static void sc_ipc_call_async_fast(sysarg_t *sc_args, sysarg_t sc_rc) |
284 | static void sc_ipc_call_async_fast(sysarg_t *sc_args, sysarg_t sc_rc) |
281 | { |
285 | { |
282 | ipc_call_t call; |
286 | ipc_call_t call; |
283 | ipcarg_t phoneid; |
287 | ipcarg_t phoneid; |
284 | 288 | ||
- | 289 | if (sc_rc == (sysarg_t) IPC_CALLRET_FATAL || |
|
285 | if (sc_rc == IPC_CALLRET_FATAL || sc_rc == IPC_CALLRET_TEMPORARY) |
290 | sc_rc == (sysarg_t) IPC_CALLRET_TEMPORARY) |
286 | return; |
291 | return; |
287 | 292 | ||
288 | phoneid = sc_args[0]; |
293 | phoneid = sc_args[0]; |
289 | 294 | ||
290 | IPC_SET_METHOD(call, sc_args[1]); |
295 | IPC_SET_METHOD(call, sc_args[1]); |
Line 300... | Line 305... | ||
300 | static void sc_ipc_call_async_slow(sysarg_t *sc_args, sysarg_t sc_rc) |
305 | static void sc_ipc_call_async_slow(sysarg_t *sc_args, sysarg_t sc_rc) |
301 | { |
306 | { |
302 | ipc_call_t call; |
307 | ipc_call_t call; |
303 | int rc; |
308 | int rc; |
304 | 309 | ||
- | 310 | if (sc_rc == (sysarg_t) IPC_CALLRET_FATAL || |
|
305 | if (sc_rc == IPC_CALLRET_FATAL || sc_rc == IPC_CALLRET_TEMPORARY) |
311 | sc_rc == (sysarg_t) IPC_CALLRET_TEMPORARY) |
306 | return; |
312 | return; |
307 | 313 | ||
308 | memset(&call, 0, sizeof(call)); |
314 | memset(&call, 0, sizeof(call)); |
309 | rc = udebug_mem_read(phoneid, &call.args, sc_args[1], sizeof(call.args)); |
315 | rc = udebug_mem_read(phoneid, &call.args, sc_args[1], sizeof(call.args)); |
310 | 316 | ||
Line 341... | Line 347... | ||
341 | ipcp_call_sync(phoneidx, &question, &reply); |
347 | ipcp_call_sync(phoneidx, &question, &reply); |
342 | } |
348 | } |
343 | 349 | ||
344 | static void sc_ipc_call_sync_slow_b(unsigned thread_id, sysarg_t *sc_args) |
350 | static void sc_ipc_call_sync_slow_b(unsigned thread_id, sysarg_t *sc_args) |
345 | { |
351 | { |
346 | ipc_call_t question, reply; |
352 | ipc_call_t question; |
347 | int rc; |
353 | int rc; |
348 | 354 | ||
349 | memset(&question, 0, sizeof(question)); |
355 | memset(&question, 0, sizeof(question)); |
350 | rc = udebug_mem_read(phoneid, &question.args, sc_args[1], sizeof(question.args)); |
356 | rc = udebug_mem_read(phoneid, &question.args, sc_args[1], |
- | 357 | sizeof(question.args)); |
|
- | 358 | ||
351 | if (rc < 0) { |
359 | if (rc < 0) { |
352 | printf("Error: mem_read->%d\n", rc); |
360 | printf("Error: mem_read->%d\n", rc); |
353 | return; |
361 | return; |
354 | } |
362 | } |
355 | 363 | ||
356 | thread_ipc_req[thread_id] = question; |
364 | thread_ipc_req[thread_id] = question; |
357 | } |
365 | } |
358 | 366 | ||
359 | static void sc_ipc_call_sync_slow_e(unsigned thread_id, sysarg_t *sc_args) |
367 | static void sc_ipc_call_sync_slow_e(unsigned thread_id, sysarg_t *sc_args) |
360 | { |
368 | { |
361 | ipc_call_t question, reply; |
369 | ipc_call_t reply; |
362 | int rc; |
370 | int rc; |
363 | 371 | ||
364 | memset(&reply, 0, sizeof(reply)); |
372 | memset(&reply, 0, sizeof(reply)); |
365 | rc = udebug_mem_read(phoneid, &reply.args, sc_args[2], sizeof(reply.args)); |
373 | rc = udebug_mem_read(phoneid, &reply.args, sc_args[2], |
- | 374 | sizeof(reply.args)); |
|
- | 375 | ||
366 | if (rc < 0) { |
376 | if (rc < 0) { |
367 | printf("Error: mem_read->%d\n", rc); |
377 | printf("Error: mem_read->%d\n", rc); |
368 | return; |
378 | return; |
369 | } |
379 | } |
370 | 380 |