/kernel/trunk/generic/src/synch/spinlock.c |
---|
63,6 → 63,7 |
void spinlock_lock(spinlock_t *sl) |
{ |
count_t i = 0; |
__address caller = CALLER(sl); |
char *symbol; |
bool deadlock_reported = false; |
70,8 → 71,8 |
while (test_and_set(&sl->val)) { |
if (i++ > 300000) { |
printf("cpu%d: looping on spinlock %p:%s, caller=%p", |
CPU->id, sl, sl->name, CALLER); |
symbol = get_symtab_entry(CALLER); |
CPU->id, sl, sl->name, caller); |
symbol = get_symtab_entry(caller); |
if (symbol) |
printf("(%s)", symbol); |
printf("\n"); |
/kernel/trunk/generic/include/debug.h |
---|
33,7 → 33,12 |
#include <arch/debug.h> |
#include <arch.h> |
#define CALLER ((__address *)__builtin_return_address(0)) |
#ifndef CALLER |
/** Default (returns 0) macro for getting address of calling function |
* @param x First argument of the called function |
*/ |
# define CALLER(x) ((__address *) 0) |
#endif |
#ifndef HERE |
/** Current Instruction Pointer address */ |