Index: arch/mips32/include/debug.h
===================================================================
--- arch/mips32/include/debug.h	(revision aace66246817c8294c86afeed5614d6d999892dd)
+++ arch/mips32/include/debug.h	(revision 72f5866d024b9caad084cece4024c1293f3ba11f)
@@ -43,3 +43,17 @@
 #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
