diff mbox

[1/6] KGDB: Add kgdb_in_use

Message ID 20090904125119.18939.97835.stgit@mchn012c.ww002.siemens.net (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Kiszka Sept. 4, 2009, 12:51 p.m. UTC
Allow other kernel subsystems to check for kgdb debug sessions. This will
first be used by kvm to switch to conservative debug register saving/restoring
on x86 if kgdb is in use.

CC: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

 include/linux/kgdb.h |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h
index 6adcc29..aebc768 100644
--- a/include/linux/kgdb.h
+++ b/include/linux/kgdb.h
@@ -72,6 +72,23 @@  struct uart_port;
  */
 void kgdb_breakpoint(void);
 
+/**
+ *	kgdb_in_use - Check if kgdb is currently in use
+ *
+ *	This function allows other kernel subsystems to check if the kernel
+ *	is currently being debugged via kgdb.  It returns false if not or if
+ *	kgdb support was not built into the kernel.
+ *
+ */
+static inline int kgdb_in_use(void)
+{
+#ifdef CONFIG_KGDB
+	return kgdb_connected;
+#else
+	return 0;
+#endif
+}
+
 extern int kgdb_connected;
 
 extern atomic_t			kgdb_setting_breakpoint;