From: msalter@redhat.com (Mark Salter)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/6] efi: create memory map iteration helper
Date: Fri, 10 Jan 2014 17:29:05 -0500 [thread overview]
Message-ID: <1389392950-22457-2-git-send-email-msalter@redhat.com> (raw)
In-Reply-To: <1389392950-22457-1-git-send-email-msalter@redhat.com>
There are a lot of places in the kernel which iterate through an
EFI memory map. Most of these places use essentially the same
for-loop code. This patch adds a for_each_efi_memory_desc()
helper to clean up all of the existing duplicate code and avoid
more in the future.
Signed-off-by: Mark Salter <msalter@redhat.com>
---
include/linux/efi.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 11ce678..9dc5b05 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -618,6 +618,12 @@ extern int efi_set_rtc_mmss(const struct timespec *now);
extern void efi_reserve_boot_services(void);
extern struct efi_memory_map memmap;
+/* Iterate through an efi_memory_map */
+#define for_each_efi_memory_desc(m, md) \
+ for ((md) = (m)->map; \
+ (md) <= (efi_memory_desc_t *)((m)->map_end - (m)->desc_size); \
+ (md) = (void *)(md) + (m)->desc_size)
+
/**
* efi_range_is_wc - check the WC bit on an address range
* @start: starting kvirt address
--
1.8.3.1
next prev parent reply other threads:[~2014-01-10 22:29 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-10 22:29 [PATCH 0/6] arm64: Add EFI stub and runtime services support Mark Salter
2014-01-10 22:29 ` Mark Salter [this message]
2014-01-13 15:17 ` [PATCH 1/6] efi: create memory map iteration helper Matt Fleming
2014-01-13 17:53 ` Mark Salter
2014-01-10 22:29 ` [PATCH 2/6] arm64: Add function to create identity mappings Mark Salter
2014-01-22 17:39 ` Catalin Marinas
2014-01-10 22:29 ` [PATCH 3/6] efi: add helper function to get UEFI params from FDT Mark Salter
2014-01-10 22:29 ` [PATCH 4/6] arm64: add EFI stub Mark Salter
2014-01-13 18:49 ` Arnd Bergmann
2014-01-14 14:44 ` Mark Salter
2014-01-14 19:26 ` Roy Franz
2014-01-22 18:04 ` Catalin Marinas
2014-01-10 22:29 ` [PATCH 5/6] doc: arm64: add description of EFI stub support Mark Salter
2014-01-10 22:29 ` [PATCH 6/6] arm64: add EFI runtime services Mark Salter
2014-01-23 11:24 ` Catalin Marinas
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=1389392950-22457-2-git-send-email-msalter@redhat.com \
--to=msalter@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).