Changes in kernel/generic/src/udebug/udebug_ops.c [cde999a:44a7ee5] in mainline
- File:
-
- 1 edited
-
kernel/generic/src/udebug/udebug_ops.c (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/udebug/udebug_ops.c
rcde999a r44a7ee5 46 46 #include <errno.h> 47 47 #include <print.h> 48 #include <stdbool.h>49 48 #include <str.h> 50 49 #include <syscall/copy.h> … … 158 157 * 159 158 * Initiates a debugging session for the current task (and its threads). 160 * When the debugging session has started a reply shouldbe sent to the159 * When the debugging session has started a reply will be sent to the 161 160 * UDEBUG_BEGIN call. This may happen immediately in this function if 162 161 * all the threads in this task are stoppable at the moment and in this 163 * case the function sets @a *active to @c true. 164 * 165 * Otherwise the function sets @a *active to false and the resonse should 166 * be sent as soon as all the threads become stoppable (i.e. they can be 167 * considered stopped). 162 * case the function returns 1. 163 * 164 * Otherwise the function returns 0 and the reply will be sent as soon as 165 * all the threads become stoppable (i.e. they can be considered stopped). 168 166 * 169 167 * @param call The BEGIN call we are servicing. 170 * @param active Place to store @c true iff we went directly to active state, 171 * @c false if we only went to beginning state 172 * 173 * @return EOK on success, EBUSY if the task is already has an active 174 * debugging session. 175 */ 176 int udebug_begin(call_t *call, bool *active) 168 * 169 * @return 0 (OK, but not done yet), 1 (done) or negative error code. 170 * 171 */ 172 int udebug_begin(call_t *call) 177 173 { 178 174 LOG("Debugging task %" PRIu64, TASK->taskid); … … 189 185 TASK->udebug.debugger = call->sender; 190 186 187 int reply; 188 191 189 if (TASK->udebug.not_stoppable_count == 0) { 192 190 TASK->udebug.dt_state = UDEBUG_TS_ACTIVE; 193 191 TASK->udebug.begin_call = NULL; 194 *active = true; /* directly to active state*/192 reply = 1; /* immediate reply */ 195 193 } else 196 *active = false; /* only in beginning state*/194 reply = 0; /* no reply */ 197 195 198 196 /* Set udebug.active on all of the task's userspace threads. */ … … 209 207 210 208 mutex_unlock(&TASK->udebug.lock); 211 return EOK;209 return reply; 212 210 } 213 211 … … 216 214 * Closes the debugging session for the current task. 217 215 * 218 * @return Zero on success or anerror code.216 * @return Zero on success or negative error code. 219 217 * 220 218 */ … … 236 234 * @param mask Or combination of events that should be enabled. 237 235 * 238 * @return Zero on success or anerror code.236 * @return Zero on success or negative error code. 239 237 * 240 238 */ … … 253 251 mutex_unlock(&TASK->udebug.lock); 254 252 255 return EOK;253 return 0; 256 254 } 257 255 … … 285 283 _thread_op_end(thread); 286 284 287 return EOK;285 return 0; 288 286 } 289 287 … … 316 314 /* Answer will be sent when the thread becomes stoppable. */ 317 315 _thread_op_end(thread); 318 return EOK;316 return 0; 319 317 } 320 318 … … 339 337 mutex_unlock(&TASK->udebug.lock); 340 338 341 return EOK;339 return 0; 342 340 } 343 341 … … 414 412 *needed = (copied_ids + extra_ids) * sizeof(sysarg_t); 415 413 416 return EOK;414 return 0; 417 415 } 418 416 … … 437 435 memcpy(*data, TASK->name, name_size); 438 436 439 return EOK;437 return 0; 440 438 } 441 439 … … 480 478 481 479 *buffer = arg_buffer; 482 return EOK;480 return 0; 483 481 } 484 482 … … 522 520 523 521 *buffer = (void *) state_buf; 524 return EOK;522 return 0; 525 523 } 526 524 … … 560 558 561 559 *buffer = data_buffer; 562 return EOK;560 return 0; 563 561 } 564 562
Note:
See TracChangeset
for help on using the changeset viewer.
