diff mbox series

[v4,02/15] lmb: add a flag to allow suppressing memory map change notification

Message ID 20241015153717.401371-3-sughosh.ganu@linaro.org
State Accepted
Commit 3c6896ad2fb876b0a23202f62a83c0d44380c9ea
Headers show
Series Make EFI memory allocations synchronous with LMB | expand

Commit Message

Sughosh Ganu Oct. 15, 2024, 3:37 p.m. UTC
Add a flag LMB_NONOTIFY that can be passed to the LMB API's for
reserving memory. This will then result in no notification being sent
from the LMB module for the changes to the LMB's memory map.

While here, also add a description of the memory attributes that the
flags signify.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
---
Changes since V3:
* Add comments for the LMB_NOOVERWRITE and LMB_NONOTIFY flags

 include/lmb.h | 3 +++
 lib/lmb.c     | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/include/lmb.h b/include/lmb.h
index 0e8426f4379..ec477c1f51d 100644
--- a/include/lmb.h
+++ b/include/lmb.h
@@ -18,11 +18,14 @@ 
  * enum lmb_flags - definition of memory region attributes
  * @LMB_NONE: no special request
  * @LMB_NOMAP: don't add to mmu configuration
+ * @LMB_NOOVERWRITE: the memory region cannot be overwritten/re-reserved
+ * @LMB_NONOTIFY: do not notify other modules of changes to this memory region
  */
 enum lmb_flags {
 	LMB_NONE		= 0,
 	LMB_NOMAP		= BIT(1),
 	LMB_NOOVERWRITE		= BIT(2),
+	LMB_NONOTIFY		= BIT(3),
 };
 
 /**
diff --git a/lib/lmb.c b/lib/lmb.c
index a38537af9c3..e1e616679f0 100644
--- a/lib/lmb.c
+++ b/lib/lmb.c
@@ -30,7 +30,7 @@  static struct lmb lmb;
 static void lmb_print_region_flags(enum lmb_flags flags)
 {
 	u64 bitpos;
-	const char *flag_str[] = { "none", "no-map", "no-overwrite" };
+	const char *flag_str[] = { "none", "no-map", "no-overwrite", "no-notify" };
 
 	do {
 		bitpos = flags ? fls(flags) - 1 : 0;