Skip to contentSkip to conversation

__FUNCTION__ - for /arch/mips

PATCH Vladimir Kondratiev 1 participant 1 message Jan 13, 2002 MIPS

lore
Share & tools
lore
#0 lore raw

Hi,
patch attached fixes __FUNCTION__ concatenation for mips arch. No side effects. Patch against 2.4.18-pre3.

arch/mips/kernel/traps.c +4 -4
diff -ur -X /home/vkondra-l/lib/dontdiff linux-2.4.18-pre3.orig/arch/mips/kernel/traps.c linux-2.4.18-pre3.patched/arch/mips/kernel/traps.c
@@ -191,13 +191,13 @@
 spinlock_t die_lock;
 
 extern void __die(const char * str, struct pt_regs * regs, const char *where,
-                  unsigned long line)
+                  const char* func, unsigned long line)
 {
 	console_verbose();
 	spin_lock_irq(&die_lock);
 	printk("%s", str);
 	if (where)
-		printk(" in %s, line %ld", where, line);
+		printk(" in %s:%s, line %ld", where, (func ? : "???"), line);
 	printk(":\n");
 	show_regs(regs);
 	printk("Process %s (pid: %d, stackpage=%08lx)\n",
@@ -211,10 +211,10 @@
 }
 
 void __die_if_kernel(const char * str, struct pt_regs * regs, const char *where,
-	unsigned long line)
+	const char* func, unsigned long line)
 {
 	if (!user_mode(regs))
-		__die(str, regs, where, line);
+		__die(str, regs, where, func, line);
 }
 
 extern const struct exception_table_entry __start___dbe_table[];
include/asm-mips/system.h +4 -4
diff -ur -X /home/vkondra-l/lib/dontdiff linux-2.4.18-pre3.orig/include/asm-mips/system.h linux-2.4.18-pre3.patched/include/asm-mips/system.h
@@ -252,13 +252,13 @@
 extern void *set_except_vector(int n, void *addr);
 
 extern void __die(const char *, struct pt_regs *, const char *where,
-	unsigned long line) __attribute__((noreturn));
+	const char* func, unsigned long line) __attribute__((noreturn));
 extern void __die_if_kernel(const char *, struct pt_regs *, const char *where,
-	unsigned long line);
+	const char* func, unsigned long line);
 
 #define die(msg, regs)							\
-	__die(msg, regs, __FILE__ ":"__FUNCTION__, __LINE__)
+	__die(msg, regs, __FILE__, __FUNCTION__, __LINE__)
 #define die_if_kernel(msg, regs)					\
-	__die_if_kernel(msg, regs, __FILE__ ":"__FUNCTION__, __LINE__)
+	__die_if_kernel(msg, regs, __FILE__, __FUNCTION__, __LINE__)
 
 #endif /* _ASM_SYSTEM_H */