From: Keith Owens <kaos@sgi.com>
To: linux-arch@vger.kernel.org
Subject: [RFC] crash_stop: crash_stop_headers
Date: Fri, 13 Oct 2006 23:24:51 +1000 [thread overview]
Message-ID: <27420.1160745891@ocs3.ocs.com.au> (raw)
In-Reply-To: Your message of "Fri, 13 Oct 2006 23:23:35 +1000." <26656.1160745815@ocs3.ocs.com.au>
crash_stop() headers. The common header defines the API. The
architecture headers define arch dependent state that is saved on each
cpu, this is typically the data that is required to get a decent
backtrace.
---
include/asm-i386/crash_stop.h | 14 ++++++++++
include/linux/crash_stop.h | 57 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 71 insertions(+)
Index: linux/include/asm-i386/crash_stop.h
===================================================================
--- /dev/null
+++ linux/include/asm-i386/crash_stop.h
@@ -0,0 +1,14 @@
+#ifndef _ASM_CRASH_STOP_H
+#define _ASM_CRASH_STOP_H
+
+/* CONFIG_4KSTACKS means that the registers (including eip) at the time of the
+ * interrupt can be on one stack while the crash_stop code is running on
+ * another stack. We have to save the current esp and eip.
+ */
+struct crash_stop_running_process_arch
+{
+ unsigned long esp;
+ unsigned long eip;
+};
+
+#endif /* _ASM_CRASH_STOP_H */
Index: linux/include/linux/crash_stop.h
===================================================================
--- /dev/null
+++ linux/include/linux/crash_stop.h
@@ -0,0 +1,57 @@
+#ifndef _LINUX_CRASH_STOP_H
+#define _LINUX_CRASH_STOP_H
+
+#ifdef CONFIG_CRASH_STOP_SUPPORTED
+
+#include <linux/cpumask.h>
+#include <linux/ptrace.h>
+#include <asm/crash_stop.h>
+
+typedef asmlinkage int (*printk_t)(const char * fmt, ...)
+ __attribute__ ((format (printf, 1, 2)));
+
+/* These five entries are the only ones used by code outside crash_stop itself.
+ * Anything starting with 'crash_stop' is part of the external ABI, anything
+ * starting with'cs_' is only to be used by internal crash_stop code.
+ */
+extern int crash_stop(void (*callback)(int monarch, void *data),
+ void *data, struct pt_regs *regs, printk_t print,
+ const char *text);
+extern int crash_stop_recovered(void);
+extern void crash_stop_cpu(int monarch, struct pt_regs *regs);
+extern int crash_stop_sent_nmi(void);
+struct crash_stop_running_process {
+ struct task_struct *p;
+ struct pt_regs *regs;
+ struct crash_stop_running_process *prev;
+ struct crash_stop_running_process_arch arch;
+};
+
+extern void cs_common_ipi(struct pt_regs *regs);
+extern void cs_arch_send_ipi(int);
+extern void cs_arch_send_nmi(int);
+
+extern void cs_arch_cpu(int, struct crash_stop_running_process *);
+extern void cs_common_cpu(int);
+
+extern spinlock_t cs_lock;
+extern int cs_monarch;
+extern int cs_notify_chain;
+
+struct cs_global {
+ void (*callback)(int monarch, void *data);
+ void *data;
+ printk_t print;
+};
+extern struct cs_global cs_global;
+
+#else /* !CONFIG_CRASH_STOP_SUPPORTED */
+
+#define crash_stop(callback, data, regs, print, text) {(void) data; (void) regs; -ENOSYS}
+#define crash_stop_recovered() do {} while(0)
+#define crash_stop_cpu(monarch, regs) {(void) monarch; (void)regs}
+#define crash_stop_sent_nmi() 0
+
+#endif /* CONFIG_CRASH_STOP_SUPPORTED */
+
+#endif /* _LINUX_CRASH_STOP_H */
next prev parent reply other threads:[~2006-10-13 13:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-13 13:23 [RFC] Common API for bring the system to a crash_stop state Keith Owens
2006-10-13 13:24 ` Keith Owens [this message]
2006-10-13 13:25 ` [RFC] crash_stop: crash_stop_i386_handler Keith Owens
2006-10-13 13:55 ` James Bottomley
2006-10-13 14:00 ` Keith Owens
2006-10-13 13:26 ` [RFC] crash_stop: crash_stop_i386 Keith Owens
2006-10-13 13:27 ` [RFC] crash_stop: crash_stop_common Keith Owens
2006-10-13 13:28 ` [RFC] crash_stop: crash_stop_common_Kconfig Keith Owens
2006-10-13 13:28 ` [RFC] crash_stop: crash_stop_demo Keith Owens
2006-10-13 13:45 ` [RFC] Common API for bring the system to a crash_stop state Keith Owens
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=27420.1160745891@ocs3.ocs.com.au \
--to=kaos@sgi.com \
--cc=linux-arch@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.