Rev 3471 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 3471 | Rev 3611 | ||
|---|---|---|---|
| Line 53... | Line 53... | ||
| 53 | void *uspace_data; |
53 | void *uspace_data; |
| 54 | unative_t to_copy; |
54 | unative_t to_copy; |
| 55 | int rc; |
55 | int rc; |
| 56 | void *buffer; |
56 | void *buffer; |
| 57 | 57 | ||
| 58 | printf("debug_regs_write()\n"); |
58 | LOG("debug_regs_write()\n"); |
| 59 | 59 | ||
| 60 | uspace_data = (void *)IPC_GET_ARG3(call->data); |
60 | uspace_data = (void *)IPC_GET_ARG3(call->data); |
| 61 | to_copy = sizeof(istate_t); |
61 | to_copy = sizeof(istate_t); |
| 62 | buffer = malloc(to_copy, 0); |
62 | buffer = malloc(to_copy, 0); |
| 63 | 63 | ||
| 64 | rc = copy_from_uspace(buffer, uspace_data, to_copy); |
64 | rc = copy_from_uspace(buffer, uspace_data, to_copy); |
| 65 | if (rc != 0) { |
65 | if (rc != 0) { |
| 66 | printf("debug_regs_write() - copy failed\n"); |
66 | LOG("debug_regs_write() - copy failed\n"); |
| 67 | return rc; |
67 | return rc; |
| 68 | } |
68 | } |
| 69 | 69 | ||
| 70 | call->buffer = buffer; |
70 | call->buffer = buffer; |
| 71 | 71 | ||
| 72 | printf(" - done\n"); |
72 | LOG(" - done\n"); |
| 73 | return 0; |
73 | return 0; |
| 74 | } |
74 | } |
| 75 | 75 | ||
| 76 | static int udebug_rp_mem_write(call_t *call, phone_t *phone) |
76 | static int udebug_rp_mem_write(call_t *call, phone_t *phone) |
| 77 | { |
77 | { |
| 78 | void *uspace_data; |
78 | void *uspace_data; |
| 79 | unative_t to_copy; |
79 | unative_t to_copy; |
| 80 | int rc; |
80 | int rc; |
| 81 | void *buffer; |
81 | void *buffer; |
| 82 | 82 | ||
| 83 | printf("udebug_rp_mem_write()\n"); |
83 | LOG("udebug_rp_mem_write()\n"); |
| 84 | 84 | ||
| 85 | uspace_data = (void *)IPC_GET_ARG2(call->data); |
85 | uspace_data = (void *)IPC_GET_ARG2(call->data); |
| 86 | to_copy = IPC_GET_ARG4(call->data); |
86 | to_copy = IPC_GET_ARG4(call->data); |
| 87 | 87 | ||
| 88 | buffer = malloc(to_copy, 0); |
88 | buffer = malloc(to_copy, 0); |
| 89 | 89 | ||
| 90 | rc = copy_from_uspace(buffer, uspace_data, to_copy); |
90 | rc = copy_from_uspace(buffer, uspace_data, to_copy); |
| 91 | if (rc != 0) { |
91 | if (rc != 0) { |
| 92 | printf(" - copy failed\n"); |
92 | LOG(" - copy failed\n"); |
| 93 | return rc; |
93 | return rc; |
| 94 | } |
94 | } |
| 95 | 95 | ||
| 96 | call->buffer = buffer; |
96 | call->buffer = buffer; |
| 97 | 97 | ||
| 98 | printf(" - done\n"); |
98 | LOG(" - done\n"); |
| 99 | return 0; |
99 | return 0; |
| 100 | } |
100 | } |
| 101 | 101 | ||
| 102 | 102 | ||
| 103 | int udebug_request_preprocess(call_t *call, phone_t *phone) |
103 | int udebug_request_preprocess(call_t *call, phone_t *phone) |
| Line 315... | Line 315... | ||
| 315 | unative_t uspace_addr; |
315 | unative_t uspace_addr; |
| 316 | unative_t to_copy; |
316 | unative_t to_copy; |
| 317 | void *buffer; |
317 | void *buffer; |
| 318 | int rc; |
318 | int rc; |
| 319 | 319 | ||
| 320 | printf("debug_regs_read()\n"); |
320 | LOG("debug_regs_read()\n"); |
| 321 | 321 | ||
| 322 | t = (thread_t *) IPC_GET_ARG2(call->data); |
322 | t = (thread_t *) IPC_GET_ARG2(call->data); |
| 323 | buffer = malloc(sizeof(istate_t), 0); |
323 | buffer = malloc(sizeof(istate_t), 0); |
| 324 | 324 | ||
| 325 | rc = udebug_regs_read(t, buffer); |
325 | rc = udebug_regs_read(t, buffer); |
| Line 412... | Line 412... | ||
| 412 | { |
412 | { |
| 413 | unative_t uspace_dst; |
413 | unative_t uspace_dst; |
| 414 | unsigned size; |
414 | unsigned size; |
| 415 | int rc; |
415 | int rc; |
| 416 | 416 | ||
| 417 | printf("udebug_receive_mem_write()\n"); |
417 | LOG("udebug_receive_mem_write()\n"); |
| 418 | 418 | ||
| 419 | uspace_dst = IPC_GET_ARG3(call->data); |
419 | uspace_dst = IPC_GET_ARG3(call->data); |
| 420 | size = IPC_GET_ARG4(call->data); |
420 | size = IPC_GET_ARG4(call->data); |
| 421 | 421 | ||
| 422 | rc = udebug_mem_write(uspace_dst, call->buffer, size); |
422 | rc = udebug_mem_write(uspace_dst, call->buffer, size); |