Changeset 2d93f1f9 in mainline for generic/src/synch/spinlock.c


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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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                }
Note: See TracChangeset for help on using the changeset viewer.