aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kexec.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/kexec.h')
-rw-r--r--include/linux/kexec.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index 8c2c7fcd58ce..ad4b82ce84af 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -121,6 +121,30 @@ extern struct page *kimage_alloc_control_pages(struct kimage *image,
121extern void crash_kexec(struct pt_regs *); 121extern void crash_kexec(struct pt_regs *);
122int kexec_should_crash(struct task_struct *); 122int kexec_should_crash(struct task_struct *);
123void crash_save_cpu(struct pt_regs *regs, int cpu); 123void crash_save_cpu(struct pt_regs *regs, int cpu);
124void crash_save_vmcoreinfo(void);
125void arch_crash_save_vmcoreinfo(void);
126void vmcoreinfo_append_str(const char *fmt, ...)
127 __attribute__ ((format (printf, 1, 2)));
128unsigned long paddr_vmcoreinfo_note(void);
129
130#define VMCOREINFO_SYMBOL(name) \
131 vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)&name)
132#define VMCOREINFO_SIZE(name) \
133 vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \
134 (unsigned long)sizeof(struct name))
135#define VMCOREINFO_TYPEDEF_SIZE(name) \
136 vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \
137 (unsigned long)sizeof(name))
138#define VMCOREINFO_OFFSET(name, field) \
139 vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #field, \
140 (unsigned long)&(((struct name *)0)->field))
141#define VMCOREINFO_LENGTH(name, value) \
142 vmcoreinfo_append_str("LENGTH(%s)=%lu\n", #name, (unsigned long)value)
143#define VMCOREINFO_NUMBER(name) \
144 vmcoreinfo_append_str("NUMBER(%s)=%ld\n", #name, (long)name)
145#define VMCOREINFO_CONFIG(name) \
146 vmcoreinfo_append_str("CONFIG_%s=y\n", #name)
147
124extern struct kimage *kexec_image; 148extern struct kimage *kexec_image;
125extern struct kimage *kexec_crash_image; 149extern struct kimage *kexec_crash_image;
126 150
@@ -148,11 +172,20 @@ extern struct kimage *kexec_crash_image;
148 172
149#define KEXEC_FLAGS (KEXEC_ON_CRASH) /* List of defined/legal kexec flags */ 173#define KEXEC_FLAGS (KEXEC_ON_CRASH) /* List of defined/legal kexec flags */
150 174
175#define VMCOREINFO_BYTES (4096)
176#define VMCOREINFO_NOTE_NAME "VMCOREINFO"
177#define VMCOREINFO_NOTE_NAME_BYTES ALIGN(sizeof(VMCOREINFO_NOTE_NAME), 4)
178#define VMCOREINFO_NOTE_SIZE (KEXEC_NOTE_HEAD_BYTES*2 + VMCOREINFO_BYTES \
179 + VMCOREINFO_NOTE_NAME_BYTES)
180
151/* Location of a reserved region to hold the crash kernel. 181/* Location of a reserved region to hold the crash kernel.
152 */ 182 */
153extern struct resource crashk_res; 183extern struct resource crashk_res;
154typedef u32 note_buf_t[KEXEC_NOTE_BYTES/4]; 184typedef u32 note_buf_t[KEXEC_NOTE_BYTES/4];
155extern note_buf_t *crash_notes; 185extern note_buf_t *crash_notes;
186extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4];
187extern size_t vmcoreinfo_size;
188extern size_t vmcoreinfo_max_size;
156 189
157 190
158#else /* !CONFIG_KEXEC */ 191#else /* !CONFIG_KEXEC */