[PATCH] kgdb: more barrier in blank weak function

Yinghai Lu
2008-12-27T05:08:19Z

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@kernel.org>

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();
}

/*