[PATCH 12/13] memory: stub out request_barebox_region for PBL

Ahmad Fatoum a.fatoum at pengutronix.de
Wed Oct 16 02:01:49 PDT 2024


To optimize out calls to undefined functions in PBL at compile-time
instead of link time, let's define stubs for the functions that
are referenced in obj-pbl-y files, but inside function sections
that are ultimately unreferenced.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 include/memory.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/memory.h b/include/memory.h
index 571effd3b0d6..d5934e3ec533 100644
--- a/include/memory.h
+++ b/include/memory.h
@@ -63,8 +63,18 @@ static inline u64 memory_sdram_size(unsigned int cols,
 
 void register_barebox_area(resource_size_t start, resource_size_t size);
 
+#ifndef __PBL__
 struct resource *request_barebox_region(const char *name,
 					resource_size_t start,
 					resource_size_t size);
+#else
+static inline struct resource *request_barebox_region(const char *name,
+					resource_size_t start,
+					resource_size_t size)
+{
+
+		return ERR_PTR(-ENOSYS);
+}
+#endif
 
 #endif
-- 
2.39.5




More information about the barebox mailing list