Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 621 → Rev 622

/kernel/trunk/generic/include/debug.h
33,12 → 33,7
#include <arch/debug.h>
#include <arch.h>
 
#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
#define CALLER ((__address *)__builtin_return_address(0))
 
#ifndef HERE
/** Current Instruction Pointer address */
/kernel/trunk/generic/src/synch/spinlock.c
63,7 → 63,6
void spinlock_lock(spinlock_t *sl)
{
count_t i = 0;
__address caller = CALLER(sl);
char *symbol;
bool deadlock_reported = false;
 
71,8 → 70,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/arch/mips32/include/debug.h
42,18 → 42,5
/** simulator enters interactive mode */
#define ___intmode() asm volatile ( "\t.word\t0x29\n");
 
/** Return current IP address */
static inline __address * _get_ra()
{
__address *ip;
 
__asm__ volatile (
"mov %%31, %0"
: "=r" (ip)
);
return ip;
}
#define CALLER(first_arg) (_get_ra())
 
 
#endif
/kernel/trunk/arch/ia32/include/debug.h
31,12 → 31,6
 
#include <arch/asm.h>
 
/** Return caller of this function
*
* @param first_arg First argument of the function
*/
#define CALLER(first_arg) ((__address *) &first_arg)[-1];
 
#define HERE get_ip()
 
#endif