Fix for Bug 2984 - [GCCE] Illegal inline assembler in kernel/eka/debug/utrace/src/e32utrace.cpp GCC_SURGE
authormikek
Wed, 16 Jun 2010 12:59:18 +0100
branchGCC_SURGE
changeset 160 30e086416910
parent 159 185ac9ba847c
child 161 d5bf4ee37cad
Fix for Bug 2984 - [GCCE] Illegal inline assembler in kernel/eka/debug/utrace/src/e32utrace.cpp
kernel/eka/debug/ost/inc/traceutils.h
kernel/eka/debug/utrace/inc/traceutils.h
--- a/kernel/eka/debug/ost/inc/traceutils.h	Wed Jun 16 12:01:26 2010 +0100
+++ b/kernel/eka/debug/ost/inc/traceutils.h	Wed Jun 16 12:59:18 2010 +0100
@@ -85,9 +85,17 @@
 
 #ifdef __MARM_ARMV5__
 	//armv5
-#define GET_PC(pc) \
-	TUint32 pc = 0; \
-	asm("mov pc, __return_address()")
+	#if defined(__GCCE__)
+	#define GET_PC(pc) \
+		TUint32 pc = 0; \
+		asm("mov %[res], %[val]" : [res] "=r" (pc) : [val] "r" (__builtin_return_address(0)))
+	#elif defined(__ARMCC__)
+	#define GET_PC(pc) \
+		TUint32 pc = 0; \
+		asm("mov pc, __return_address()")
+	#else
+	#error What compiler?
+	#endif
 #elif __MARM_ARM4__
 	//arm4 not implemented yet!
 #define GET_PC(pc) \
--- a/kernel/eka/debug/utrace/inc/traceutils.h	Wed Jun 16 12:01:26 2010 +0100
+++ b/kernel/eka/debug/utrace/inc/traceutils.h	Wed Jun 16 12:59:18 2010 +0100
@@ -77,9 +77,17 @@
 
 #ifdef __MARM_ARMV5__
 	//armv5
-#define GET_PC(pc) \
-	TUint32 pc = 0; \
-	asm("mov pc, __return_address()")
+	#if defined(__GCCE__)
+	#define GET_PC(pc) \
+		TUint32 pc = 0; \
+		asm("mov %[res], %[val]" : [res] "=r" (pc) : [val] "r" (__builtin_return_address(0)))
+	#elif defined(__ARMCC__)
+	#define GET_PC(pc) \
+		TUint32 pc = 0; \
+		asm("mov pc, __return_address()")
+	#else
+	#error What compiler?
+	#endif
 #elif __MARM_ARM4__
 	//arm4 not implemented yet!
 #define GET_PC(pc) \