struct kexec_segment __user *segments,
unsigned long flags);
extern int kernel_kexec(void);
+extern int kimage_arch_load_normal_segment(struct kimage *image,
+ struct kexec_segment *segment,
+ int *arch_status,
+ int (*add_phys_addr)(struct kimage *image,
+ unsigned long page));
+
extern int kexec_add_buffer(struct kimage *image, char *buffer,
unsigned long bufsz, unsigned long memsz,
unsigned long buf_align, unsigned long buf_min,
return page;
}
+int __weak kimage_arch_load_normal_segment(struct kimage *image,
+ struct kexec_segment *segment,
+ int *arch_status,
+ int (*add_phys_addr)(struct kimage *image,
+ unsigned long page))
+{
+ return -ENOENT;
+}
+
static int kimage_load_normal_segment(struct kimage *image,
struct kexec_segment *segment)
{
unsigned long maddr;
size_t ubytes, mbytes;
- int result;
+ int result, arch_status;
unsigned char __user *buf = NULL;
unsigned char *kbuf = NULL;
if (result < 0)
goto out;
+ /* Should the arch handle this segment load, then use the arch status.*/
+ result = kimage_arch_load_normal_segment(image, segment, &arch_status,
+ kimage_add_page);
+ if (!result) {
+ result = arch_status;
+ goto out;
+ }
+
while (mbytes) {
struct page *page;
char *ptr;