All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/8] efi_loader: Use EFI_CACHELINE_SIZE in the image loader too
Date: Wed, 18 Apr 2018 15:40:27 +0200	[thread overview]
Message-ID: <20180418134030.55127-6-agraf@suse.de> (raw)
In-Reply-To: <20180418134030.55127-1-agraf@suse.de>

We were using our EFI_CACHELINE_SIZE define only in the runtime service
code, but left the image loader to use plain CONFIG_SYS_CACHELINE_SIZE.

This patch moves EFI_CACHELINE_SIZE into efi_loader.h and converts
the image loader to use it.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 include/efi_loader.h              | 7 +++++++
 lib/efi_loader/efi_image_loader.c | 2 +-
 lib/efi_loader/efi_runtime.c      | 7 -------
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/efi_loader.h b/include/efi_loader.h
index 17f9d3d1ef..0b1b3df55a 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -76,6 +76,13 @@ const char *__efi_nesting_dec(void);
 		##__VA_ARGS__); \
 	})
 
+#ifdef CONFIG_SYS_CACHELINE_SIZE
+#define EFI_CACHELINE_SIZE CONFIG_SYS_CACHELINE_SIZE
+#else
+/* Just use the greatest cache flush alignment requirement I'm aware of */
+#define EFI_CACHELINE_SIZE 128
+#endif
+
 extern struct efi_runtime_services efi_runtime_services;
 extern struct efi_system_table systab;
 
diff --git a/lib/efi_loader/efi_image_loader.c b/lib/efi_loader/efi_image_loader.c
index d5fbba3138..2476a97a6a 100644
--- a/lib/efi_loader/efi_image_loader.c
+++ b/lib/efi_loader/efi_image_loader.c
@@ -290,7 +290,7 @@ void *efi_load_pe(void *efi, struct efi_loaded_image *loaded_image_info)
 
 	/* Flush cache */
 	flush_cache((ulong)efi_reloc,
-		    ALIGN(virt_size, CONFIG_SYS_CACHELINE_SIZE));
+		    ALIGN(virt_size, EFI_CACHELINE_SIZE));
 	invalidate_icache_all();
 
 	/* Populate the loaded image interface bits */
diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c
index 8558124c0a..573a5d6ac1 100644
--- a/lib/efi_loader/efi_runtime.c
+++ b/lib/efi_loader/efi_runtime.c
@@ -30,13 +30,6 @@ static efi_status_t __efi_runtime EFIAPI efi_unimplemented(void);
 static efi_status_t __efi_runtime EFIAPI efi_device_error(void);
 static efi_status_t __efi_runtime EFIAPI efi_invalid_parameter(void);
 
-#ifdef CONFIG_SYS_CACHELINE_SIZE
-#define EFI_CACHELINE_SIZE CONFIG_SYS_CACHELINE_SIZE
-#else
-/* Just use the greatest cache flush alignment requirement I'm aware of */
-#define EFI_CACHELINE_SIZE 128
-#endif
-
 #if defined(CONFIG_ARM64)
 #define R_RELATIVE	1027
 #define R_MASK		0xffffffffULL
-- 
2.12.3

  parent reply	other threads:[~2018-04-18 13:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-18 13:40 [U-Boot] [PATCH 0/8] riscv: Enable efi_loader support Alexander Graf
2018-04-18 13:40 ` [U-Boot] [PATCH 1/8] riscv: Add setjmp/longjmp code Alexander Graf
2018-04-18 13:40 ` [U-Boot] [PATCH 2/8] riscv: Enable function sections Alexander Graf
2018-04-18 13:40 ` [U-Boot] [PATCH 3/8] efi_loader: selftest: Do not build relocation tests for risc-v Alexander Graf
2018-04-18 15:48   ` Heinrich Schuchardt
2018-04-18 16:41     ` Alexander Graf
2018-04-19  5:57   ` Heinrich Schuchardt
2018-04-18 13:40 ` [U-Boot] [PATCH 4/8] riscv: Add board_quiesce_devices stub Alexander Graf
2018-04-18 13:40 ` Alexander Graf [this message]
2018-04-18 13:40 ` [U-Boot] [PATCH 6/8] distro: Extend with RISC-V defines Alexander Graf
2018-04-18 15:43   ` Heinrich Schuchardt
2018-04-18 13:40 ` [U-Boot] [PATCH 7/8] riscv: nx25: Enable distro boot Alexander Graf
2018-04-18 13:40 ` [U-Boot] [PATCH 8/8] efi_loader: Enable RISC-V support Alexander Graf
2018-04-19  5:14   ` Heinrich Schuchardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180418134030.55127-6-agraf@suse.de \
    --to=agraf@suse.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.