From fc65a2cdee2167442dc81c5b294e7ba109627dc7 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Fri, 16 Dec 2011 13:30:58 +0100 Subject: [PATCH] --- yaml --- r: 283537 b: refs/heads/master c: 2d2da60fb40a80cc59383121ccf763e0e0e8a42a h: refs/heads/master i: 283535: 350a571716969ae1c9d96604aa9f31379db49501 v: v3 --- [refs] | 2 +- trunk/arch/x86/boot/compressed/eboot.c | 20 ++++++++++++++------ trunk/arch/x86/boot/compressed/eboot.h | 1 + 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 096c7bc3a17a..80a44fe55b1c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 291f36325f9f252bd76ef5f603995f37e453fc60 +refs/heads/master: 2d2da60fb40a80cc59383121ccf763e0e0e8a42a diff --git a/trunk/arch/x86/boot/compressed/eboot.c b/trunk/arch/x86/boot/compressed/eboot.c index 4055e63d0b04..fec216f4fbc3 100644 --- a/trunk/arch/x86/boot/compressed/eboot.c +++ b/trunk/arch/x86/boot/compressed/eboot.c @@ -643,14 +643,22 @@ static efi_status_t handle_ramdisks(efi_loaded_image_t *image, u64 size; size = initrds[j].size; - status = efi_call_phys3(fh->read, initrds[j].handle, - &size, addr); - if (status != EFI_SUCCESS) - goto free_initrd_total; + while (size) { + u64 chunksize; + if (size > EFI_READ_CHUNK_SIZE) + chunksize = EFI_READ_CHUNK_SIZE; + else + chunksize = size; + status = efi_call_phys3(fh->read, + initrds[j].handle, + &chunksize, addr); + if (status != EFI_SUCCESS) + goto free_initrd_total; + addr += chunksize; + size -= chunksize; + } efi_call_phys1(fh->close, initrds[j].handle); - - addr += size; } } diff --git a/trunk/arch/x86/boot/compressed/eboot.h b/trunk/arch/x86/boot/compressed/eboot.h index f66d023e91ef..39251663e65b 100644 --- a/trunk/arch/x86/boot/compressed/eboot.h +++ b/trunk/arch/x86/boot/compressed/eboot.h @@ -12,6 +12,7 @@ #define DESC_TYPE_CODE_DATA (1 << 0) #define EFI_PAGE_SIZE (1UL << EFI_PAGE_SHIFT) +#define EFI_READ_CHUNK_SIZE (1024 * 1024) #define PIXEL_RGB_RESERVED_8BIT_PER_COLOR 0 #define PIXEL_BGR_RESERVED_8BIT_PER_COLOR 1