Changeset 1378b2b in mainline


Ignore:
Timestamp:
2008-11-21T14:04:08Z (15 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.

Location:
kernel/generic
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/udebug/udebug.h

    r18c485a r1378b2b  
    177177        atomic_t int_lock;
    178178
    179         /** Synchronize debug ops on this thread / access to this structure */
     179        /** Synchronize debug ops on this thread / access to this structure. */
    180180        mutex_t lock;
    181181
     
    184184        unative_t syscall_args[6];
    185185
    186         /** What type of event are we stopped in or 0 if none */
     186        /** What type of event are we stopped in or 0 if none. */
    187187        udebug_event_t cur_event;       
    188188        bool stop;
    189189        bool stoppable;
    190         bool debug_active; /**< In a debugging session */
     190        bool debug_active; /**< in a debugging session */
    191191} udebug_thread_t;
    192192
  • kernel/generic/src/udebug/udebug.c

    r18c485a r1378b2b  
    248248
    249249                goto restart;
    250                 /* must try again - have to lose stoppability atomically */
     250                /* Must try again - have to lose stoppability atomically. */
    251251        } else {
    252252                ++TASK->udebug.not_stoppable_count;
     
    322322        mutex_lock(&THREAD->udebug.lock);
    323323
    324         /* Must only generate events when in debugging session and have go */
     324        /* Must only generate events when in debugging session and is go. */
    325325        if (THREAD->udebug.debug_active != true ||
    326326            THREAD->udebug.stop == true ||
     
    440440        LOG("- check state\n");
    441441
    442         /* Must only generate events when in debugging session */
     442        /* Must only generate events when in debugging session. */
    443443        if (THREAD->udebug.debug_active != true) {
    444444/*              printf("- debug_active: %s, udebug.stop: %s\n",
     
    457457        IPC_SET_ARG1(call->data, UDEBUG_EVENT_THREAD_E);
    458458
    459         /* Prevent any further debug activity in thread */
     459        /* Prevent any further debug activity in thread. */
    460460        THREAD->udebug.debug_active = false;
    461461        THREAD->udebug.cur_event = 0;           /* none */
     
    467467        mutex_unlock(&TASK->udebug.lock);
    468468
    469         /* Leave int_lock enabled */
    470         /* This event does not sleep - debugging has finished in this thread */
     469        /* Leave int_lock enabled. */
     470        /* This event does not sleep - debugging has finished in this thread. */
    471471}
    472472
     
    513513                interrupts_restore(ipl);
    514514
    515                 /* Only process userspace threads */
     515                /* Only process userspace threads. */
    516516                if ((flags & THREAD_FLAG_USPACE) != 0) {
    517                         /* Prevent any further debug activity in thread */
     517                        /* Prevent any further debug activity in thread. */
    518518                        t->udebug.debug_active = false;
    519519                        t->udebug.cur_event = 0;        /* none */
    520520
    521                         /* Still has go? */
     521                        /* Is the thread still go? */
    522522                        if (t->udebug.stop == false) {
    523523                                /*
  • 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.