diff mbox series

[RFC,v2,38/48] lib: Kconfig: add a config symbol for getting lmb memory map updates

Message ID 20240704073544.670249-39-sughosh.ganu@linaro.org
State New
Headers show
Series Make U-Boot memory reservations coherent | expand

Commit Message

Sughosh Ganu July 4, 2024, 7:35 a.m. UTC
Add a Kconfig symbol to enable getting updates on any memory map
changes that might be done by the LMB module. This notification
mechanism can then be used to have a synchronous view of allocated and
free memory.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
---
Changes since V1:
* Change the description to highlight only LMB notifications.
* Add a separate line for dependencies.

 lib/Kconfig | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Tom Rini July 5, 2024, 7:50 p.m. UTC | #1
On Thu, Jul 04, 2024 at 01:05:34PM +0530, Sughosh Ganu wrote:

> Add a Kconfig symbol to enable getting updates on any memory map
> changes that might be done by the LMB module. This notification
> mechanism can then be used to have a synchronous view of allocated and
> free memory.
> 
> Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
> ---
> Changes since V1:
> * Change the description to highlight only LMB notifications.
> * Add a separate line for dependencies.
> 
>  lib/Kconfig | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/lib/Kconfig b/lib/Kconfig
> index 7eea517b3b..b422183a0f 100644
> --- a/lib/Kconfig
> +++ b/lib/Kconfig
> @@ -74,6 +74,16 @@ config HAVE_PRIVATE_LIBGCC
>  config LIB_UUID
>  	bool
>  
> +config MEM_MAP_UPDATE_NOTIFY
> +	bool "Get notified of any changes to the LMB memory map"
> +	depends on EVENT && LMB && EFI_LOADER
> +	default y
> +	help
> +	  Enable this option to get notification on any changes to the
> +	  memory that is allocated or freed by the LMB module. This will
> +	  allow different modules that allocate memory or maintain a memory
> +	  map to have a synchronous view of available and allocated memory.

This needs to be select'd when it's going to be used, opting out of
making sure memory reservations are obeyed isn't a good idea.
diff mbox series

Patch

diff --git a/lib/Kconfig b/lib/Kconfig
index 7eea517b3b..b422183a0f 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -74,6 +74,16 @@  config HAVE_PRIVATE_LIBGCC
 config LIB_UUID
 	bool
 
+config MEM_MAP_UPDATE_NOTIFY
+	bool "Get notified of any changes to the LMB memory map"
+	depends on EVENT && LMB && EFI_LOADER
+	default y
+	help
+	  Enable this option to get notification on any changes to the
+	  memory that is allocated or freed by the LMB module. This will
+	  allow different modules that allocate memory or maintain a memory
+	  map to have a synchronous view of available and allocated memory.
+
 config RANDOM_UUID
 	bool "GPT Random UUID generation"
 	select LIB_UUID