2 * Kernel header file for Linux crash dumps.
4 * Created by: Matt Robinson (yakker@sgi.com)
6 * Copyright 1999 Silicon Graphics, Inc. All rights reserved.
8 * This code is released under version 2 of the GNU GPL.
11 /* This header file holds the architecture specific crash dump header */
15 /* necessary header files */
16 #include <asm/ptrace.h>
18 #include <linux/threads.h>
22 #define DUMP_ASM_MAGIC_NUMBER 0xdeaddeadULL /* magic number */
23 #define DUMP_ASM_VERSION_NUMBER 0x3 /* version number */
25 /* max number of cpus */
26 #define DUMP_MAX_NUM_CPUS 32
29 * Structure: __dump_header_asm
30 * Function: This is the header for architecture-specific stuff. It
31 * follows right after the dump header.
33 struct __dump_header_asm {
34 /* the dump magic number -- unique to verify dump is valid */
37 /* the version number of this dump */
40 /* the size of this header (in case we can't read it) */
43 /* the esp for i386 systems */
46 /* the eip for i386 systems */
49 /* the dump registers */
50 struct pt_regs dha_regs;
55 struct pt_regs dha_smp_regs[DUMP_MAX_NUM_CPUS];
56 u32 dha_smp_current_task[DUMP_MAX_NUM_CPUS];
57 u32 dha_stack[DUMP_MAX_NUM_CPUS];
58 u32 dha_stack_ptr[DUMP_MAX_NUM_CPUS];
59 } __attribute__((packed));
63 extern struct __dump_header_asm dump_header_asm;
66 extern cpumask_t irq_affinity[];
67 extern int (*dump_ipi_function_ptr)(struct pt_regs *);
68 extern void dump_send_ipi(void);
70 #define dump_send_ipi() do { } while(0)
73 static inline void get_current_regs(struct pt_regs *regs)
75 __asm__ __volatile__("movl %%ebx,%0" : "=m"(regs->ebx));
76 __asm__ __volatile__("movl %%ecx,%0" : "=m"(regs->ecx));
77 __asm__ __volatile__("movl %%edx,%0" : "=m"(regs->edx));
78 __asm__ __volatile__("movl %%esi,%0" : "=m"(regs->esi));
79 __asm__ __volatile__("movl %%edi,%0" : "=m"(regs->edi));
80 __asm__ __volatile__("movl %%ebp,%0" : "=m"(regs->ebp));
81 __asm__ __volatile__("movl %%eax,%0" : "=m"(regs->eax));
82 __asm__ __volatile__("movl %%esp,%0" : "=m"(regs->esp));
83 __asm__ __volatile__("movw %%ss, %%ax;" :"=a"(regs->xss));
84 __asm__ __volatile__("movw %%cs, %%ax;" :"=a"(regs->xcs));
85 __asm__ __volatile__("movw %%ds, %%ax;" :"=a"(regs->xds));
86 __asm__ __volatile__("movw %%es, %%ax;" :"=a"(regs->xes));
87 __asm__ __volatile__("pushfl; popl %0" :"=m"(regs->eflags));
88 regs->eip = (unsigned long)current_text_addr();
91 #endif /* __KERNEL__ */
93 #endif /* _ASM_DUMP_H */