summaryrefslogtreecommitdiff
path: root/exec
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-05-03 22:53:52 +0000
committerRoland McGrath <roland@gnu.org>2002-05-03 22:53:52 +0000
commit239535a699ea79647f5fb8cbf968009f831bf794 (patch)
tree85b40734a4072ff03bc932203074fb33d125720c /exec
parent45bb0ba58046de10fa2af6ae26fdd179636e73b2 (diff)
2002-05-01 Roland McGrath <roland@frob.com>
* elfcore.c [ALPHA_THREAD_STATE] (ELF_MACHINE, fetch_thread_regset, fetch_thread_fpregset): New definitions for Alpha CPU.
Diffstat (limited to 'exec')
-rw-r--r--exec/elfcore.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/exec/elfcore.c b/exec/elfcore.c
index cb877825..16904a8c 100644
--- a/exec/elfcore.c
+++ b/exec/elfcore.c
@@ -74,6 +74,34 @@ fetch_thread_fpregset (thread_t thread, prfpregset_t *fpregs)
}
}
+#elif defined ALPHA_THREAD_STATE
+# define ELF_MACHINE EM_ALPHA
+
+/* The gregset_t format (compatible with Linux/Alpha) almost fits
+ the Mach alpha_thread_state. */
+static inline void
+fetch_thread_regset (thread_t thread, prgregset_t *gregs)
+{
+ mach_msg_type_number_t count = ALPHA_THREAD_STATE_COUNT;
+ assert (sizeof (struct alpha_thread_state) <= sizeof (prgregset_t));
+ (void) thread_get_state (thread, ALPHA_THREAD_STATE,
+ (thread_state_t) gregs, &count);
+ /* XXX
+ gregs[32] is process-status word: Mach doesn't return it!
+ It's already zero'd.
+ */
+}
+
+/* The FPU state matches exactly. */
+static inline void
+fetch_thread_fpregset (thread_t thread, prfpregset_t *fpregs)
+{
+ mach_msg_type_number_t count = ALPHA_FLOAT_STATE_COUNT;
+ assert (sizeof (struct alpha_float_state) == sizeof *fpregs);
+ (void) thread_get_state (thread, ALPHA_FLOAT_STATE,
+ (thread_state_t) fpregs, &count);
+}
+
#else
# warning "do not understand this machine flavor, no registers in dumps"
# define ELF_MACHINE EM_NONE