diff options
Diffstat (limited to 'include/linux/kexec.h')
-rw-r--r-- | include/linux/kexec.h | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index 3265968cd2cd..17f76fc05173 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
@@ -25,8 +25,8 @@ | |||
25 | #error KEXEC_CONTROL_MEMORY_LIMIT not defined | 25 | #error KEXEC_CONTROL_MEMORY_LIMIT not defined |
26 | #endif | 26 | #endif |
27 | 27 | ||
28 | #ifndef KEXEC_CONTROL_CODE_SIZE | 28 | #ifndef KEXEC_CONTROL_PAGE_SIZE |
29 | #error KEXEC_CONTROL_CODE_SIZE not defined | 29 | #error KEXEC_CONTROL_PAGE_SIZE not defined |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | #ifndef KEXEC_ARCH | 32 | #ifndef KEXEC_ARCH |
@@ -83,6 +83,7 @@ struct kimage { | |||
83 | 83 | ||
84 | unsigned long start; | 84 | unsigned long start; |
85 | struct page *control_code_page; | 85 | struct page *control_code_page; |
86 | struct page *swap_page; | ||
86 | 87 | ||
87 | unsigned long nr_segments; | 88 | unsigned long nr_segments; |
88 | struct kexec_segment segment[KEXEC_SEGMENT_MAX]; | 89 | struct kexec_segment segment[KEXEC_SEGMENT_MAX]; |
@@ -98,18 +99,20 @@ struct kimage { | |||
98 | unsigned int type : 1; | 99 | unsigned int type : 1; |
99 | #define KEXEC_TYPE_DEFAULT 0 | 100 | #define KEXEC_TYPE_DEFAULT 0 |
100 | #define KEXEC_TYPE_CRASH 1 | 101 | #define KEXEC_TYPE_CRASH 1 |
102 | unsigned int preserve_context : 1; | ||
101 | }; | 103 | }; |
102 | 104 | ||
103 | 105 | ||
104 | 106 | ||
105 | /* kexec interface functions */ | 107 | /* kexec interface functions */ |
106 | extern NORET_TYPE void machine_kexec(struct kimage *image) ATTRIB_NORET; | 108 | extern void machine_kexec(struct kimage *image); |
107 | extern int machine_kexec_prepare(struct kimage *image); | 109 | extern int machine_kexec_prepare(struct kimage *image); |
108 | extern void machine_kexec_cleanup(struct kimage *image); | 110 | extern void machine_kexec_cleanup(struct kimage *image); |
109 | extern asmlinkage long sys_kexec_load(unsigned long entry, | 111 | extern asmlinkage long sys_kexec_load(unsigned long entry, |
110 | unsigned long nr_segments, | 112 | unsigned long nr_segments, |
111 | struct kexec_segment __user *segments, | 113 | struct kexec_segment __user *segments, |
112 | unsigned long flags); | 114 | unsigned long flags); |
115 | extern int kernel_kexec(void); | ||
113 | #ifdef CONFIG_COMPAT | 116 | #ifdef CONFIG_COMPAT |
114 | extern asmlinkage long compat_sys_kexec_load(unsigned long entry, | 117 | extern asmlinkage long compat_sys_kexec_load(unsigned long entry, |
115 | unsigned long nr_segments, | 118 | unsigned long nr_segments, |
@@ -127,8 +130,8 @@ void vmcoreinfo_append_str(const char *fmt, ...) | |||
127 | __attribute__ ((format (printf, 1, 2))); | 130 | __attribute__ ((format (printf, 1, 2))); |
128 | unsigned long paddr_vmcoreinfo_note(void); | 131 | unsigned long paddr_vmcoreinfo_note(void); |
129 | 132 | ||
130 | #define VMCOREINFO_OSRELEASE(name) \ | 133 | #define VMCOREINFO_OSRELEASE(value) \ |
131 | vmcoreinfo_append_str("OSRELEASE=%s\n", #name) | 134 | vmcoreinfo_append_str("OSRELEASE=%s\n", value) |
132 | #define VMCOREINFO_PAGESIZE(value) \ | 135 | #define VMCOREINFO_PAGESIZE(value) \ |
133 | vmcoreinfo_append_str("PAGESIZE=%ld\n", value) | 136 | vmcoreinfo_append_str("PAGESIZE=%ld\n", value) |
134 | #define VMCOREINFO_SYMBOL(name) \ | 137 | #define VMCOREINFO_SYMBOL(name) \ |
@@ -156,8 +159,9 @@ extern struct kimage *kexec_crash_image; | |||
156 | #define kexec_flush_icache_page(page) | 159 | #define kexec_flush_icache_page(page) |
157 | #endif | 160 | #endif |
158 | 161 | ||
159 | #define KEXEC_ON_CRASH 0x00000001 | 162 | #define KEXEC_ON_CRASH 0x00000001 |
160 | #define KEXEC_ARCH_MASK 0xffff0000 | 163 | #define KEXEC_PRESERVE_CONTEXT 0x00000002 |
164 | #define KEXEC_ARCH_MASK 0xffff0000 | ||
161 | 165 | ||
162 | /* These values match the ELF architecture values. | 166 | /* These values match the ELF architecture values. |
163 | * Unless there is a good reason that should continue to be the case. | 167 | * Unless there is a good reason that should continue to be the case. |
@@ -174,7 +178,12 @@ extern struct kimage *kexec_crash_image; | |||
174 | #define KEXEC_ARCH_MIPS_LE (10 << 16) | 178 | #define KEXEC_ARCH_MIPS_LE (10 << 16) |
175 | #define KEXEC_ARCH_MIPS ( 8 << 16) | 179 | #define KEXEC_ARCH_MIPS ( 8 << 16) |
176 | 180 | ||
177 | #define KEXEC_FLAGS (KEXEC_ON_CRASH) /* List of defined/legal kexec flags */ | 181 | /* List of defined/legal kexec flags */ |
182 | #ifndef CONFIG_KEXEC_JUMP | ||
183 | #define KEXEC_FLAGS KEXEC_ON_CRASH | ||
184 | #else | ||
185 | #define KEXEC_FLAGS (KEXEC_ON_CRASH | KEXEC_PRESERVE_CONTEXT) | ||
186 | #endif | ||
178 | 187 | ||
179 | #define VMCOREINFO_BYTES (4096) | 188 | #define VMCOREINFO_BYTES (4096) |
180 | #define VMCOREINFO_NOTE_NAME "VMCOREINFO" | 189 | #define VMCOREINFO_NOTE_NAME "VMCOREINFO" |