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