Changeset 2d93f1f9 in mainline for generic/src/synch


Ignore:
Timestamp:
2005-12-06T21:58:18Z (20 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a80d406
Parents:
36e7b6c3
Message:

Named spinlocks

Location:
generic/src/synch
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • generic/src/synch/rwlock.c

    r36e7b6c3 r2d93f1f9  
    7676 */
    7777void rwlock_initialize(rwlock_t *rwl) {
    78         spinlock_initialize(&rwl->lock);
     78        spinlock_initialize(&rwl->lock, "rwlock");
    7979        mutex_initialize(&rwl->exclusive);
    8080        rwl->readers_in = 0;
  • generic/src/synch/spinlock.c

    r36e7b6c3 r2d93f1f9  
    3434#include <print.h>
    3535#include <debug.h>
     36#include <symtab.h>
    3637
    3738#ifdef CONFIG_SMP
     
    4344 * @param sl Pointer to spinlock_t structure.
    4445 */
    45 void spinlock_initialize(spinlock_t *sl)
     46void spinlock_initialize(spinlock_t *sl, char *name)
    4647{
    4748        sl->val = 0;
     49#ifdef CONFIG_DEBUG_SPINLOCK
     50        sl->name = name;
     51#endif 
    4852}
    4953
     
    6064{
    6165        int i = 0;
    62         __address caller = ((__u32 *) &sl)[-1];
     66        __address caller = ((__address *) &sl)[-1];
     67        char *symbol;
    6368
    6469        preemption_disable();
    6570        while (test_and_set(&sl->val)) {
    6671                if (i++ > 300000) {
    67                         printf("cpu%d: looping on spinlock %X, caller=%X\n", CPU->id, sl, caller);
     72                        printf("cpu%d: looping on spinlock %p:%s, caller=%p",
     73                               CPU->id, sl, sl->name, caller);
     74                        symbol = get_symtab_entry(caller);
     75                        if (symbol)
     76                                printf("(%s)", symbol);
     77                        printf("\n");
    6878                        i = 0;
    6979                }
  • generic/src/synch/waitq.c

    r36e7b6c3 r2d93f1f9  
    4747void waitq_initialize(waitq_t *wq)
    4848{
    49         spinlock_initialize(&wq->lock);
     49        spinlock_initialize(&wq->lock, "waitq_lock");
    5050        list_initialize(&wq->head);
    5151        wq->missed_wakeups = 0;
Note: See TracChangeset for help on using the changeset viewer.