aboutsummaryrefslogtreecommitdiff
path: root/cmd/bootefi.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2018-04-03 21:59:32 +0200
committerAlexander Graf <agraf@suse.de>2018-06-03 15:27:21 +0200
commitc3b11dea7c9f9bb009cb7358170c47abd1c4a298 (patch)
tree1209493facd75a94acd1e34ead5a23005d420c0e /cmd/bootefi.c
parentfa241e2f19c58d08f2d978f32d133eab24b02a92 (diff)
downloadu-boot-c3b11dea7c9f9bb009cb7358170c47abd1c4a298.zip
u-boot-c3b11dea7c9f9bb009cb7358170c47abd1c4a298.tar.gz
u-boot-c3b11dea7c9f9bb009cb7358170c47abd1c4a298.tar.bz2
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: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'cmd/bootefi.c')
-rw-r--r--cmd/bootefi.c13
1 files changed, 13 insertions, 0 deletions
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 <memalign.h>
#include <asm/global_data.h>
#include <asm-generic/sections.h>
+#include <asm-generic/unaligned.h>
#include <linux/linkage.h>
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) {