Skip to content
Snippets Groups Projects
Commit c3b11dea authored by Heinrich Schuchardt's avatar Heinrich Schuchardt Committed by Alexander Graf
Browse files

efi_loader: allow unaligned memory access


The UEFI spec mandates that unaligned memory access should be enabled if
supported by the CPU architecture.

This patch adds an empty weak function unaligned_access() that can be
overridden by an architecture specific routine.

Signed-off-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
parent fa241e2f
No related branches found
No related tags found
No related merge requests found
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <memalign.h> #include <memalign.h>
#include <asm/global_data.h> #include <asm/global_data.h>
#include <asm-generic/sections.h> #include <asm-generic/sections.h>
#include <asm-generic/unaligned.h>
#include <linux/linkage.h> #include <linux/linkage.h>
DECLARE_GLOBAL_DATA_PTR; DECLARE_GLOBAL_DATA_PTR;
...@@ -82,6 +83,15 @@ out: ...@@ -82,6 +83,15 @@ out:
return ret; return ret;
} }
/*
* 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. * Set the load options of an image from an environment variable.
* *
...@@ -370,6 +380,9 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) ...@@ -370,6 +380,9 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
efi_status_t r; efi_status_t r;
void *fdt_addr; void *fdt_addr;
/* Allow unaligned memory access */
allow_unaligned();
/* Initialize EFI drivers */ /* Initialize EFI drivers */
r = efi_init_obj_list(); r = efi_init_obj_list();
if (r != EFI_SUCCESS) { if (r != EFI_SUCCESS) {
......
...@@ -20,4 +20,7 @@ ...@@ -20,4 +20,7 @@
#error invalid endian #error invalid endian
#endif #endif
/* Allow unaligned memory access */
void allow_unaligned(void);
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment