[Concept,10/35] malloc: Use mcheck.h header instead of local declaration

Message ID 20251210000737.180797-11-sjg@u-boot.org
State New
Headers
Series malloc: Add heap debugging commands and mcheck caller tracking |

Commit Message

Simon Glass Dec. 10, 2025, 12:07 a.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Include <mcheck.h> and remove the local declaration of
mcheck_on_ramrelocation() to use the proper header file.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 common/board_f.c | 2 +-
 include/mcheck.h | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
  

Patch

diff --git a/common/board_f.c b/common/board_f.c
index 879862865e1..a3e4c69d449 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -33,6 +33,7 @@ 
 #include <log.h>
 #include <malloc.h>
 #include <mapmem.h>
+#include <mcheck.h>
 #include <os.h>
 #include <post.h>
 #include <relocate.h>
@@ -723,7 +724,6 @@  static int reloc_bloblist(void)
 	return 0;
 }
 
-void mcheck_on_ramrelocation(size_t offset);
 static int setup_reloc(void)
 {
 	if (!(gd->flags & GD_FLG_SKIP_RELOC)) {
diff --git a/include/mcheck.h b/include/mcheck.h
index bd506ae6291..b170acf6281 100644
--- a/include/mcheck.h
+++ b/include/mcheck.h
@@ -48,4 +48,7 @@  void mcheck_check_all(void);
  */
 enum mcheck_status mprobe(void *__ptr);
 
+/* Called during RAM relocation to reset the heap registry */
+void mcheck_on_ramrelocation(size_t offset);
+
 #endif