diff --git a/cmd/bootefi.c b/cmd/bootefi.c index 80491c7..8063398 100644 --- a/cmd/bootefi.c +++ b/cmd/bootefi.c @@ -17,6 +17,7 @@ #include #include #include +#include #include DECLARE_GLOBAL_DATA_PTR; @@ -83,6 +84,15 @@ out: } /* + * Allow unaligned memory access. + * + * This routine is overridden by architectures providing this feature. + */ +void __weak allow_unaligned(void) +{ +} + +/* * Set the load options of an image from an environment variable. * * @loaded_image_info: the image @@ -370,6 +380,9 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) efi_status_t r; void *fdt_addr; + /* Allow unaligned memory access */ + allow_unaligned(); + /* Initialize EFI drivers */ r = efi_init_obj_list(); if (r != EFI_SUCCESS) { diff --git a/include/asm-generic/unaligned.h b/include/asm-generic/unaligned.h index fd02550..3d33a5a 100644 --- a/include/asm-generic/unaligned.h +++ b/include/asm-generic/unaligned.h @@ -20,4 +20,7 @@ #error invalid endian #endif +/* Allow unaligned memory access */ +void allow_unaligned(void); + #endif