ia64/xen-unstable

view xen/include/xen/elfcore.h @ 12980:af39d20b2b72

[POWERPC][XEN] Fix warning by removing "packed".
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Hollis Blanchard <hollisb@us.ibm.com>
date Tue Dec 12 11:17:27 2006 -0600 (2006-12-12)
parents f4089172c96b
children 4ef0dbe95eac
line source
1 /******************************************************************************
2 * elfcore.h
3 *
4 * Based heavily on include/linux/elfcore.h from Linux 2.6.16
5 * Naming scheeme based on include/xen/elf.h (not include/linux/elfcore.h)
6 *
7 */
9 #ifndef __ELFCOREC_H__
10 #define __ELFCOREC_H__
12 #include <xen/types.h>
13 #include <xen/elf.h>
14 #include <asm/elf.h>
15 #include <public/xen.h>
17 #define NT_PRSTATUS 1
19 typedef struct
20 {
21 int signo; /* signal number */
22 int code; /* extra code */
23 int errno; /* errno */
24 } ELF_Signifo;
26 /* These seem to be the same length on all architectures on Linux */
27 typedef int ELF_Pid;
28 typedef struct {
29 long tv_sec;
30 long tv_usec;
31 } ELF_Timeval;
33 /*
34 * Definitions to generate Intel SVR4-like core files.
35 * These mostly have the same names as the SVR4 types with "elf_"
36 * tacked on the front to prevent clashes with linux definitions,
37 * and the typedef forms have been avoided. This is mostly like
38 * the SVR4 structure, but more Linuxy, with things that Linux does
39 * not support and which gdb doesn't really use excluded.
40 */
41 typedef struct
42 {
43 ELF_Signifo pr_info; /* Info associated with signal */
44 short pr_cursig; /* Current signal */
45 unsigned long pr_sigpend; /* Set of pending signals */
46 unsigned long pr_sighold; /* Set of held signals */
47 ELF_Pid pr_pid;
48 ELF_Pid pr_ppid;
49 ELF_Pid pr_pgrp;
50 ELF_Pid pr_sid;
51 ELF_Timeval pr_utime; /* User time */
52 ELF_Timeval pr_stime; /* System time */
53 ELF_Timeval pr_cutime; /* Cumulative user time */
54 ELF_Timeval pr_cstime; /* Cumulative system time */
55 ELF_Gregset pr_reg; /* GP registers - from asm header file */
56 int pr_fpvalid; /* True if math co-processor being used. */
57 } ELF_Prstatus;
59 /*
60 * The following data structures provide 64-bit ELF notes. In theory it should
61 * be possible to support both 64-bit and 32-bit ELF files, but to keep it
62 * simple we only do 64-bit.
63 *
64 * Please note that the current code aligns the 64-bit notes in the same
65 * way as Linux does. We are not following the 64-bit ELF spec, no one does.
66 *
67 * We are avoiding two problems by restricting us to 64-bit notes only:
68 * - Alignment of notes change with the word size. Ick.
69 * - We would need to tell kexec-tools which format we are using in the
70 * hypervisor to make sure the right ELF format is generated.
71 * That requires infrastructure. Let's not.
72 */
74 #define NOTE_ALIGN(x, n) ((x + ((1 << n) - 1)) / (1 << n))
75 #define PAD32(x) u32 pad_data[NOTE_ALIGN(x, 2)]
77 #define TYPEDEF_NOTE(type, strlen, desctype) \
78 typedef struct { \
79 union { \
80 struct { \
81 Elf_Note note; \
82 unsigned char name[strlen]; \
83 } note; \
84 PAD32(sizeof(Elf_Note) + strlen); \
85 } note; \
86 union { \
87 desctype desc; \
88 PAD32(sizeof(desctype)); \
89 } desc; \
90 } type
92 #define CORE_STR "CORE"
93 #define CORE_STR_LEN 5 /* including terminating zero */
95 TYPEDEF_NOTE(crash_note_core_t, CORE_STR_LEN, ELF_Prstatus);
97 #define XEN_STR "Xen"
98 #define XEN_STR_LEN 4 /* including terminating zero */
100 TYPEDEF_NOTE(crash_note_xen_core_t, XEN_STR_LEN, crash_xen_core_t);
102 typedef struct {
103 unsigned long xen_major_version;
104 unsigned long xen_minor_version;
105 unsigned long xen_extra_version;
106 unsigned long xen_changeset;
107 unsigned long xen_compiler;
108 unsigned long xen_compile_date;
109 unsigned long xen_compile_time;
110 unsigned long tainted;
111 #ifdef CONFIG_X86
112 unsigned long dom0_pfn_to_mfn_frame_list_list;
113 #endif
114 } crash_xen_info_t;
116 TYPEDEF_NOTE(crash_note_xen_info_t, XEN_STR_LEN, crash_xen_info_t);
118 typedef struct {
119 crash_note_core_t core;
120 crash_note_xen_core_t xen_regs;
121 crash_note_xen_info_t xen_info;
122 } crash_note_t;
124 #define setup_crash_note(np, member, str, str_len, id) \
125 np->member.note.note.note.namesz = str_len; \
126 np->member.note.note.note.descsz = sizeof(np->member.desc.desc); \
127 np->member.note.note.note.type = id; \
128 memcpy(np->member.note.note.name, str, str_len)
130 #endif /* __ELFCOREC_H__ */
132 /*
133 * Local variables:
134 * mode: C
135 * c-set-style: "BSD"
136 * c-basic-offset: 4
137 * tab-width: 4
138 * indent-tabs-mode: nil
139 * End:
140 */