In preparation of adding ARM support, this refactors the nochunk EFI param so that it does not populate the .data section, since that gets discarded on ARM.
Signed-off-by: Ard Biesheuvel ard.biesheuvel@linaro.org --- drivers/firmware/efi/libstub/efi-stub-helper.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/firmware/efi/libstub/efi-stub-helper.c b/drivers/firmware/efi/libstub/efi-stub-helper.c index f07d4a67fa76..15c8b27121fd 100644 --- a/drivers/firmware/efi/libstub/efi-stub-helper.c +++ b/drivers/firmware/efi/libstub/efi-stub-helper.c @@ -30,7 +30,7 @@ */ #define EFI_READ_CHUNK_SIZE (1024 * 1024)
-static unsigned long __chunk_size = EFI_READ_CHUNK_SIZE; +bool __nochunk;
/* * Allow the platform to override the allocation granularity: this allows @@ -335,7 +335,7 @@ efi_status_t efi_parse_options(char *cmdline) while (*str) { if (!strncmp(str, "nochunk", 7)) { str += strlen("nochunk"); - __chunk_size = -1UL; + __nochunk = true; }
/* Group words together, delimited by "," */ @@ -490,8 +490,8 @@ efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg, size = files[j].size; while (size) { unsigned long chunksize; - if (size > __chunk_size) - chunksize = __chunk_size; + if (!__nochunk && size > EFI_READ_CHUNK_SIZE) + chunksize = EFI_READ_CHUNK_SIZE; else chunksize = size;