[PATCH] kgdb: more barrier in blank weak function

From: Yinghai Lu
Date: Sat Dec 27 2008 - 00:08:20 EST



Impact: fix panic possible panic etc

some compiler seems to inline the weak global function if no line in it

Signed-off-by: Yinghai Lu <yinghai@xxxxxxxxxx>

diff --git a/kernel/kgdb.c b/kernel/kgdb.c
index e4dcfb2..70d2e36 100644
--- a/kernel/kgdb.c
+++ b/kernel/kgdb.c
@@ -223,7 +223,7 @@ int __weak kgdb_skipexception(int exception, struct pt_regs *regs)
void __weak
kgdb_post_primary_code(struct pt_regs *regs, int e_vector, int err_code)
{
- return;
+ barrier();
}

/**
@@ -236,6 +236,7 @@ kgdb_post_primary_code(struct pt_regs *regs, int e_vector, int err_code)
*/
void __weak kgdb_disable_hw_debug(struct pt_regs *regs)
{
+ barrier();
}

/*
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/