@@ -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;
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