Ignore:
Timestamp:
2008-11-21T14:04:08Z (16 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
384c488
Parents:
18c485a
Message:

Udebug comments - 'is go', not 'has go'. Missing periods.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/udebug/udebug_ops.c

    r18c485a r1378b2b  
    5858 * Specifically, verifies that thread t exists, is a userspace thread,
    5959 * and belongs to the current task (TASK). Verifies, that the thread
    60  * has (or hasn't) go according to having_go (typically false).
     60 * is (or is not) go according to being_go (typically false).
    6161 * It also locks t->udebug.lock, making sure that t->udebug.debug_active
    6262 * is true - that the thread is in a valid debugging session.
     
    7171 *
    7272 * @param t             Pointer, need not at all be valid.
    73  * @param having_go     Required thread state.
     73 * @param being_go      Required thread state.
    7474 *
    7575 * Returns EOK if all went well, or an error code otherwise.
    7676 */
    77 static int _thread_op_begin(thread_t *t, bool having_go)
     77static int _thread_op_begin(thread_t *t, bool being_go)
    7878{
    7979        task_id_t taskid;
     
    9999        spinlock_unlock(&threads_lock);
    100100
    101         /* Verify that 't' is a userspace thread */
     101        /* Verify that 't' is a userspace thread. */
    102102        if ((t->flags & THREAD_FLAG_USPACE) == 0) {
    103103                /* It's not, deny its existence */
     
    108108        }
    109109
    110         /* Verify debugging state */
     110        /* Verify debugging state. */
    111111        if (t->udebug.debug_active != true) {
    112112                /* Not in debugging session or undesired GO state */
     
    125125        interrupts_restore(ipl);
    126126
    127         /* Only mutex TASK->udebug.lock left */
     127        /* Only mutex TASK->udebug.lock left. */
    128128       
    129         /* Now verify that the thread belongs to the current task */
     129        /* Now verify that the thread belongs to the current task. */
    130130        if (t->task != TASK) {
    131131                /* No such thread belonging this task*/
     
    140140        mutex_lock(&t->udebug.lock);
    141141
    142         /* The big task mutex is no longer needed */
    143         mutex_unlock(&TASK->udebug.lock);
    144 
    145         if (!t->udebug.stop != having_go) {
    146                 /* Not in debugging session or undesired GO state */
     142        /* The big task mutex is no longer needed. */
     143        mutex_unlock(&TASK->udebug.lock);
     144
     145        if (!t->udebug.stop != being_go) {
     146                /* Not in debugging session or undesired GO state. */
    147147                mutex_unlock(&t->udebug.lock);
    148148                return EINVAL;
    149149        }
    150150
    151         /* Only t->udebug.lock left */
    152 
    153         return EOK;     /* All went well */
     151        /* Only t->udebug.lock left. */
     152
     153        return EOK;     /* All went well. */
    154154}
    155155
     
    205205        }
    206206       
    207         /* Set udebug.debug_active on all of the task's userspace threads */
     207        /* Set udebug.debug_active on all of the task's userspace threads. */
    208208
    209209        for (cur = TASK->th_head.next; cur != &TASK->th_head; cur = cur->next) {
     
    274274/** Give thread GO.
    275275 *
    276  * Upon recieving a go message, the thread is given GO. Having GO
     276 * Upon recieving a go message, the thread is given GO. Being GO
    277277 * means the thread is allowed to execute userspace code (until
    278278 * a debugging event or STOP occurs, at which point the thread loses GO.
     
    285285        int rc;
    286286
    287         /* On success, this will lock t->udebug.lock */
     287        /* On success, this will lock t->udebug.lock. */
    288288        rc = _thread_op_begin(t, false);
    289289        if (rc != EOK) {
     
    296296
    297297        /*
    298          * Neither t's lock nor threads_lock may be held during wakeup
     298         * Neither t's lock nor threads_lock may be held during wakeup.
    299299         */
    300300        waitq_wakeup(&t->udebug.go_wq, WAKEUP_FIRST);
     
    329329        }
    330330
    331         /* Take GO away from the thread */
     331        /* Take GO away from the thread. */
    332332        t->udebug.stop = true;
    333333
    334334        if (!t->udebug.stoppable) {
    335                 /* Answer will be sent when the thread becomes stoppable */
     335                /* Answer will be sent when the thread becomes stoppable. */
    336336                _thread_op_end(t);
    337337                return 0;
     
    339339
    340340        /*
    341          * Answer GO call
     341         * Answer GO call.
    342342         */
    343343        LOG("udebug_stop - answering go call\n");
    344344
    345         /* Make sure nobody takes this call away from us */
     345        /* Make sure nobody takes this call away from us. */
    346346        call = t->udebug.go_call;
    347347        t->udebug.go_call = NULL;
     
    423423                spinlock_unlock(&t->lock);
    424424
    425                 /* Not interested in kernel threads */
     425                /* Not interested in kernel threads. */
    426426                if ((flags & THREAD_FLAG_USPACE) != 0) {
    427427                        /* Using thread struct pointer as identification hash */
     
    459459        unative_t *arg_buffer;
    460460
    461         /* Prepare a buffer to hold the arguments */
     461        /* Prepare a buffer to hold the arguments. */
    462462        arg_buffer = malloc(6 * sizeof(unative_t), 0);
    463463
    464         /* On success, this will lock t->udebug.lock */
     464        /* On success, this will lock t->udebug.lock. */
    465465        rc = _thread_op_begin(t, false);
    466466        if (rc != EOK) {
     
    468468        }
    469469
    470         /* Additionally we need to verify that we are inside a syscall */
     470        /* Additionally we need to verify that we are inside a syscall. */
    471471        if (t->udebug.cur_event != UDEBUG_EVENT_SYSCALL_B &&
    472472            t->udebug.cur_event != UDEBUG_EVENT_SYSCALL_E) {
     
    475475        }
    476476
    477         /* Copy to a local buffer before releasing the lock */
     477        /* Copy to a local buffer before releasing the lock. */
    478478        memcpy(arg_buffer, t->udebug.syscall_args, 6 * sizeof(unative_t));
    479479
Note: See TracChangeset for help on using the changeset viewer.