Dmitry V. Levin | 665f10c | 2014-12-11 19:21:54 +0000 | [diff] [blame] | 1 | #include "defs.h" |
| 2 | |
| 3 | int |
| 4 | sys_getcpu(struct tcb *tcp) |
| 5 | { |
| 6 | if (exiting(tcp)) { |
| 7 | unsigned u; |
| 8 | if (tcp->u_arg[0] == 0) |
| 9 | tprints("NULL, "); |
| 10 | else if (umove(tcp, tcp->u_arg[0], &u) < 0) |
| 11 | tprintf("%#lx, ", tcp->u_arg[0]); |
| 12 | else |
| 13 | tprintf("[%u], ", u); |
| 14 | if (tcp->u_arg[1] == 0) |
| 15 | tprints("NULL, "); |
| 16 | else if (umove(tcp, tcp->u_arg[1], &u) < 0) |
| 17 | tprintf("%#lx, ", tcp->u_arg[1]); |
| 18 | else |
| 19 | tprintf("[%u], ", u); |
| 20 | tprintf("%#lx", tcp->u_arg[2]); |
| 21 | } |
| 22 | return 0; |
| 23 | } |