[PATCH 3/5] decompressor: define macros for non-PBL case as well

Ahmad Fatoum a.fatoum at pengutronix.de
Wed Jul 13 03:09:20 PDT 2022


Do as Linux does to allow the same file to be built both for preboot
decompression and for use in barebox proper.

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

diff --git a/include/linux/decompress/mm.h b/include/linux/decompress/mm.h
index ac0702dfb111..1891a5136842 100644
--- a/include/linux/decompress/mm.h
+++ b/include/linux/decompress/mm.h
@@ -66,8 +66,17 @@ static __maybe_unused void simple_free(void *where)
 #define MALLOC simple_malloc
 #define FREE simple_free
 
-#define INIT
+#else
+
+#define large_malloc(a) malloc(a)
+#define large_free(a) free(a)
 
 #endif /* STATIC */
 
+#ifndef STATIC
+#define STATIC
+#endif
+
+#define INIT
+
 #endif /* DECOMPR_MM_H */
-- 
2.30.2




More information about the barebox mailing list