Changeset eb13ef8 in mainline for kernel/generic/src/udebug/udebug_ipc.c
- Timestamp:
- 2019-02-06T13:25:12Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fafb8e5
- Parents:
- bb97118
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-02 14:04:02)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-06 13:25:12)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/udebug/udebug_ipc.c
rbb97118 reb13ef8 53 53 errno_t udebug_request_preprocess(call_t *call, phone_t *phone) 54 54 { 55 switch (IPC_GET_ARG1( call->data)) {55 switch (IPC_GET_ARG1(&call->data)) { 56 56 /* future UDEBUG_M_REGS_WRITE, UDEBUG_M_MEM_WRITE: */ 57 57 default: … … 76 76 rc = udebug_begin(call, &active); 77 77 if (rc != EOK) { 78 IPC_SET_RETVAL( call->data, rc);78 IPC_SET_RETVAL(&call->data, rc); 79 79 ipc_answer(&TASK->kb.box, call); 80 80 return; … … 86 86 */ 87 87 if (active) { 88 IPC_SET_RETVAL( call->data, EOK);88 IPC_SET_RETVAL(&call->data, EOK); 89 89 ipc_answer(&TASK->kb.box, call); 90 90 } … … 102 102 rc = udebug_end(); 103 103 104 IPC_SET_RETVAL( call->data, rc);104 IPC_SET_RETVAL(&call->data, rc); 105 105 ipc_answer(&TASK->kb.box, call); 106 106 } … … 116 116 udebug_evmask_t mask; 117 117 118 mask = IPC_GET_ARG2( call->data);118 mask = IPC_GET_ARG2(&call->data); 119 119 rc = udebug_set_evmask(mask); 120 120 121 IPC_SET_RETVAL( call->data, rc);121 IPC_SET_RETVAL(&call->data, rc); 122 122 ipc_answer(&TASK->kb.box, call); 123 123 } … … 133 133 errno_t rc; 134 134 135 t = (thread_t *)IPC_GET_ARG2( call->data);135 t = (thread_t *)IPC_GET_ARG2(&call->data); 136 136 137 137 rc = udebug_go(t, call); 138 138 if (rc != EOK) { 139 IPC_SET_RETVAL( call->data, rc);139 IPC_SET_RETVAL(&call->data, rc); 140 140 ipc_answer(&TASK->kb.box, call); 141 141 return; … … 153 153 errno_t rc; 154 154 155 t = (thread_t *)IPC_GET_ARG2( call->data);155 t = (thread_t *)IPC_GET_ARG2(&call->data); 156 156 157 157 rc = udebug_stop(t, call); 158 IPC_SET_RETVAL( call->data, rc);158 IPC_SET_RETVAL(&call->data, rc); 159 159 ipc_answer(&TASK->kb.box, call); 160 160 } … … 173 173 errno_t rc; 174 174 175 uspace_addr = IPC_GET_ARG2( call->data); /* Destination address */176 buf_size = IPC_GET_ARG3( call->data); /* Dest. buffer size */175 uspace_addr = IPC_GET_ARG2(&call->data); /* Destination address */ 176 buf_size = IPC_GET_ARG3(&call->data); /* Dest. buffer size */ 177 177 178 178 /* … … 182 182 rc = udebug_thread_read(&buffer, buf_size, &copied, &needed); 183 183 if (rc != EOK) { 184 IPC_SET_RETVAL( call->data, rc);184 IPC_SET_RETVAL(&call->data, rc); 185 185 ipc_answer(&TASK->kb.box, call); 186 186 return; … … 191 191 */ 192 192 193 IPC_SET_RETVAL( call->data, 0);194 /* 195 * ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that 196 * same code in process_answer() can be used 197 * (no way to distinguish method in answer) 198 */ 199 IPC_SET_ARG1( call->data, uspace_addr);200 IPC_SET_ARG2( call->data, copied);201 IPC_SET_ARG3( call->data, needed);193 IPC_SET_RETVAL(&call->data, 0); 194 /* 195 * ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that 196 * same code in process_answer() can be used 197 * (no way to distinguish method in answer) 198 */ 199 IPC_SET_ARG1(&call->data, uspace_addr); 200 IPC_SET_ARG2(&call->data, copied); 201 IPC_SET_ARG3(&call->data, needed); 202 202 call->buffer = buffer; 203 203 … … 219 219 void *data; 220 220 221 uspace_addr = IPC_GET_ARG2( call->data); /* Destination address */222 buf_size = IPC_GET_ARG3( call->data); /* Dest. buffer size */221 uspace_addr = IPC_GET_ARG2(&call->data); /* Destination address */ 222 buf_size = IPC_GET_ARG3(&call->data); /* Dest. buffer size */ 223 223 224 224 /* … … 238 238 */ 239 239 240 IPC_SET_RETVAL( call->data, 0);241 /* 242 * ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that 243 * same code in process_answer() can be used 244 * (no way to distinguish method in answer) 245 */ 246 IPC_SET_ARG1( call->data, uspace_addr);247 IPC_SET_ARG2( call->data, to_copy);248 249 IPC_SET_ARG3( call->data, data_size);240 IPC_SET_RETVAL(&call->data, 0); 241 /* 242 * ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that 243 * same code in process_answer() can be used 244 * (no way to distinguish method in answer) 245 */ 246 IPC_SET_ARG1(&call->data, uspace_addr); 247 IPC_SET_ARG2(&call->data, to_copy); 248 249 IPC_SET_ARG3(&call->data, data_size); 250 250 call->buffer = data; 251 251 … … 268 268 as_area_info_t *data; 269 269 270 uspace_addr = IPC_GET_ARG2( call->data); /* Destination address */271 buf_size = IPC_GET_ARG3( call->data); /* Dest. buffer size */270 uspace_addr = IPC_GET_ARG2(&call->data); /* Destination address */ 271 buf_size = IPC_GET_ARG3(&call->data); /* Dest. buffer size */ 272 272 273 273 /* … … 276 276 data = as_get_area_info(AS, &data_size); 277 277 if (!data) { 278 IPC_SET_RETVAL( call->data, ENOMEM);278 IPC_SET_RETVAL(&call->data, ENOMEM); 279 279 ipc_answer(&TASK->kb.box, call); 280 280 return; … … 292 292 */ 293 293 294 IPC_SET_RETVAL( call->data, 0);295 /* 296 * ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that 297 * same code in process_answer() can be used 298 * (no way to distinguish method in answer) 299 */ 300 IPC_SET_ARG1( call->data, uspace_addr);301 IPC_SET_ARG2( call->data, to_copy);302 303 IPC_SET_ARG3( call->data, data_size);294 IPC_SET_RETVAL(&call->data, 0); 295 /* 296 * ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that 297 * same code in process_answer() can be used 298 * (no way to distinguish method in answer) 299 */ 300 IPC_SET_ARG1(&call->data, uspace_addr); 301 IPC_SET_ARG2(&call->data, to_copy); 302 303 IPC_SET_ARG3(&call->data, data_size); 304 304 call->buffer = (uint8_t *) data; 305 305 … … 319 319 void *buffer; 320 320 321 t = (thread_t *)IPC_GET_ARG2( call->data);321 t = (thread_t *)IPC_GET_ARG2(&call->data); 322 322 323 323 rc = udebug_args_read(t, &buffer); 324 324 if (rc != EOK) { 325 IPC_SET_RETVAL( call->data, rc);325 IPC_SET_RETVAL(&call->data, rc); 326 326 ipc_answer(&TASK->kb.box, call); 327 327 return; … … 332 332 */ 333 333 334 uspace_addr = IPC_GET_ARG3( call->data);335 336 IPC_SET_RETVAL( call->data, 0);337 /* 338 * ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that 339 * same code in process_answer() can be used 340 * (no way to distinguish method in answer) 341 */ 342 IPC_SET_ARG1( call->data, uspace_addr);343 IPC_SET_ARG2( call->data, 6 * sizeof(sysarg_t));334 uspace_addr = IPC_GET_ARG3(&call->data); 335 336 IPC_SET_RETVAL(&call->data, 0); 337 /* 338 * ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that 339 * same code in process_answer() can be used 340 * (no way to distinguish method in answer) 341 */ 342 IPC_SET_ARG1(&call->data, uspace_addr); 343 IPC_SET_ARG2(&call->data, 6 * sizeof(sysarg_t)); 344 344 call->buffer = buffer; 345 345 … … 359 359 errno_t rc; 360 360 361 t = (thread_t *) IPC_GET_ARG2( call->data);361 t = (thread_t *) IPC_GET_ARG2(&call->data); 362 362 363 363 rc = udebug_regs_read(t, &buffer); 364 364 if (rc != EOK) { 365 IPC_SET_RETVAL( call->data, rc);365 IPC_SET_RETVAL(&call->data, rc); 366 366 ipc_answer(&TASK->kb.box, call); 367 367 return; … … 374 374 */ 375 375 376 uspace_addr = IPC_GET_ARG3( call->data);376 uspace_addr = IPC_GET_ARG3(&call->data); 377 377 to_copy = sizeof(istate_t); 378 378 379 IPC_SET_RETVAL( call->data, 0);380 /* 381 * ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that 382 * same code in process_answer() can be used 383 * (no way to distinguish method in answer) 384 */ 385 IPC_SET_ARG1( call->data, uspace_addr);386 IPC_SET_ARG2( call->data, to_copy);379 IPC_SET_RETVAL(&call->data, 0); 380 /* 381 * ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that 382 * same code in process_answer() can be used 383 * (no way to distinguish method in answer) 384 */ 385 IPC_SET_ARG1(&call->data, uspace_addr); 386 IPC_SET_ARG2(&call->data, to_copy); 387 387 388 388 call->buffer = buffer; … … 404 404 errno_t rc; 405 405 406 uspace_dst = IPC_GET_ARG2( call->data);407 uspace_src = IPC_GET_ARG3( call->data);408 size = IPC_GET_ARG4( call->data);406 uspace_dst = IPC_GET_ARG2(&call->data); 407 uspace_src = IPC_GET_ARG3(&call->data); 408 size = IPC_GET_ARG4(&call->data); 409 409 410 410 rc = udebug_mem_read(uspace_src, size, &buffer); 411 411 if (rc != EOK) { 412 IPC_SET_RETVAL( call->data, rc);412 IPC_SET_RETVAL(&call->data, rc); 413 413 ipc_answer(&TASK->kb.box, call); 414 414 return; … … 417 417 assert(buffer != NULL); 418 418 419 IPC_SET_RETVAL( call->data, 0);420 /* 421 * ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that 422 * same code in process_answer() can be used 423 * (no way to distinguish method in answer) 424 */ 425 IPC_SET_ARG1( call->data, uspace_dst);426 IPC_SET_ARG2( call->data, size);419 IPC_SET_RETVAL(&call->data, 0); 420 /* 421 * ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that 422 * same code in process_answer() can be used 423 * (no way to distinguish method in answer) 424 */ 425 IPC_SET_ARG1(&call->data, uspace_dst); 426 IPC_SET_ARG2(&call->data, size); 427 427 call->buffer = buffer; 428 428 … … 439 439 int debug_method; 440 440 441 debug_method = IPC_GET_ARG1( call->data);441 debug_method = IPC_GET_ARG1(&call->data); 442 442 443 443 if (debug_method != UDEBUG_M_BEGIN) { … … 450 450 */ 451 451 if (TASK->udebug.debugger != call->sender) { 452 IPC_SET_RETVAL( call->data, EINVAL);452 IPC_SET_RETVAL(&call->data, EINVAL); 453 453 ipc_answer(&TASK->kb.box, call); 454 454 return;
Note:
See TracChangeset
for help on using the changeset viewer.