diff options
author | Simon Glass <sjg@chromium.org> | 2020-02-03 07:36:16 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2020-02-05 19:33:46 -0700 |
commit | 336d4615f8fa774557d14f9b3245daa9e5fe3dbc (patch) | |
tree | 7a4d2d33113f44238d64e7e409fd3aafef63c2ed /lib | |
parent | 61b29b82683863a970fd4609a7c58512872616bc (diff) | |
download | u-boot-336d4615f8fa774557d14f9b3245daa9e5fe3dbc.tar.gz |
dm: core: Create a new header file for 'compat' features
At present dm/device.h includes the linux-compatible features. This
requires including linux/compat.h which in turn includes a lot of headers.
One of these is malloc.h which we thus end up including in every file in
U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
which needs to use the system malloc() in some files.
Move the compatibility features into a separate header file.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bch.c | 1 | ||||
-rw-r--r-- | lib/binman.c | 1 | ||||
-rw-r--r-- | lib/bzip2/bzlib.c | 1 | ||||
-rw-r--r-- | lib/crypto/rsa_helper.c | 1 | ||||
-rw-r--r-- | lib/efi/efi.c | 1 | ||||
-rw-r--r-- | lib/efi/efi_app.c | 1 | ||||
-rw-r--r-- | lib/efi/efi_stub.c | 1 | ||||
-rw-r--r-- | lib/efi_driver/efi_block_device.c | 1 | ||||
-rw-r--r-- | lib/efi_driver/efi_uclass.c | 1 | ||||
-rw-r--r-- | lib/efi_loader/efi_console.c | 1 | ||||
-rw-r--r-- | lib/efi_loader/efi_runtime.c | 1 | ||||
-rw-r--r-- | lib/fdtdec.c | 1 | ||||
-rw-r--r-- | lib/libavb/avb_cmdline.c | 1 | ||||
-rw-r--r-- | lib/libavb/avb_descriptor.c | 1 | ||||
-rw-r--r-- | lib/libavb/avb_rsa.c | 1 | ||||
-rw-r--r-- | lib/libavb/avb_slot_verify.c | 1 | ||||
-rw-r--r-- | lib/libavb/avb_sysdeps_posix.c | 1 | ||||
-rw-r--r-- | lib/libavb/avb_util.c | 1 | ||||
-rw-r--r-- | lib/linux_compat.c | 1 | ||||
-rw-r--r-- | lib/lmb.c | 1 | ||||
-rw-r--r-- | lib/rsa/rsa-sign.c | 1 | ||||
-rw-r--r-- | lib/rsa/rsa-verify.c | 1 | ||||
-rw-r--r-- | lib/zstd/decompress.c | 1 | ||||
-rw-r--r-- | lib/zstd/zstd_common.c | 1 |
24 files changed, 24 insertions, 0 deletions
@@ -55,6 +55,7 @@ #ifndef USE_HOSTCC #include <common.h> +#include <malloc.h> #include <ubi_uboot.h> #include <dm/devres.h> diff --git a/lib/binman.c b/lib/binman.c index 1774bdf2e5..6cf6dcfdad 100644 --- a/lib/binman.c +++ b/lib/binman.c @@ -9,6 +9,7 @@ #include <common.h> #include <binman.h> #include <dm.h> +#include <malloc.h> struct binman_info { ofnode image; diff --git a/lib/bzip2/bzlib.c b/lib/bzip2/bzlib.c index 9262e4055e..377b269b06 100644 --- a/lib/bzip2/bzlib.c +++ b/lib/bzip2/bzlib.c @@ -1,5 +1,6 @@ #include <config.h> #include <common.h> +#include <malloc.h> #include <watchdog.h> /* diff --git a/lib/crypto/rsa_helper.c b/lib/crypto/rsa_helper.c index aca627a4a6..cc0c0d6637 100644 --- a/lib/crypto/rsa_helper.c +++ b/lib/crypto/rsa_helper.c @@ -6,6 +6,7 @@ * Authors: Tadeusz Struk <tadeusz.struk@intel.com> */ #ifndef __UBOOT__ +#include <linux/compat.h> #include <linux/kernel.h> #include <linux/export.h> #endif diff --git a/lib/efi/efi.c b/lib/efi/efi.c index 7cba57b131..0c16a5fdd3 100644 --- a/lib/efi/efi.c +++ b/lib/efi/efi.c @@ -11,6 +11,7 @@ #include <common.h> #include <debug_uart.h> #include <errno.h> +#include <malloc.h> #include <linux/err.h> #include <linux/types.h> #include <efi.h> diff --git a/lib/efi/efi_app.c b/lib/efi/efi_app.c index af5a878fc3..7c64077d42 100644 --- a/lib/efi/efi_app.c +++ b/lib/efi/efi_app.c @@ -13,6 +13,7 @@ #include <debug_uart.h> #include <dm.h> #include <errno.h> +#include <malloc.h> #include <linux/err.h> #include <linux/types.h> #include <efi.h> diff --git a/lib/efi/efi_stub.c b/lib/efi/efi_stub.c index 6dd93ff435..7d650d512e 100644 --- a/lib/efi/efi_stub.c +++ b/lib/efi/efi_stub.c @@ -14,6 +14,7 @@ #include <efi.h> #include <efi_api.h> #include <errno.h> +#include <malloc.h> #include <ns16550.h> #include <asm/cpu.h> #include <asm/io.h> diff --git a/lib/efi_driver/efi_block_device.c b/lib/efi_driver/efi_block_device.c index cf02341931..33e66fcad2 100644 --- a/lib/efi_driver/efi_block_device.c +++ b/lib/efi_driver/efi_block_device.c @@ -29,6 +29,7 @@ */ #include <efi_driver.h> +#include <malloc.h> #include <dm/device-internal.h> #include <dm/root.h> diff --git a/lib/efi_driver/efi_uclass.c b/lib/efi_driver/efi_uclass.c index 25b27ece6d..f8badadf66 100644 --- a/lib/efi_driver/efi_uclass.c +++ b/lib/efi_driver/efi_uclass.c @@ -18,6 +18,7 @@ */ #include <efi_driver.h> +#include <malloc.h> /** * check_node_type() - check node type diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c index 8494044799..ac0dec1146 100644 --- a/lib/efi_loader/efi_console.c +++ b/lib/efi_loader/efi_console.c @@ -7,6 +7,7 @@ #include <common.h> #include <charset.h> +#include <malloc.h> #include <time.h> #include <dm/device.h> #include <efi_loader.h> diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c index df0485cdad..4b3c843b2c 100644 --- a/lib/efi_loader/efi_runtime.c +++ b/lib/efi_loader/efi_runtime.c @@ -11,6 +11,7 @@ #include <dm.h> #include <elf.h> #include <efi_loader.h> +#include <malloc.h> #include <rtc.h> #include <u-boot/crc.h> diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 7fbb4c7ddc..eb11fc898e 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -9,6 +9,7 @@ #include <dm.h> #include <hang.h> #include <init.h> +#include <malloc.h> #include <dm/of_extra.h> #include <env.h> #include <errno.h> diff --git a/lib/libavb/avb_cmdline.c b/lib/libavb/avb_cmdline.c index 684c512bb9..dd859d3467 100644 --- a/lib/libavb/avb_cmdline.c +++ b/lib/libavb/avb_cmdline.c @@ -7,6 +7,7 @@ #include "avb_sha.h" #include "avb_util.h" #include "avb_version.h" +#include <malloc.h> #define NUM_GUIDS 3 diff --git a/lib/libavb/avb_descriptor.c b/lib/libavb/avb_descriptor.c index 9f03b9777a..86b8d1b994 100644 --- a/lib/libavb/avb_descriptor.c +++ b/lib/libavb/avb_descriptor.c @@ -6,6 +6,7 @@ #include "avb_descriptor.h" #include "avb_util.h" #include "avb_vbmeta_image.h" +#include <malloc.h> bool avb_descriptor_validate_and_byteswap(const AvbDescriptor* src, AvbDescriptor* dest) { diff --git a/lib/libavb/avb_rsa.c b/lib/libavb/avb_rsa.c index bbf15626b8..d7bf8905be 100644 --- a/lib/libavb/avb_rsa.c +++ b/lib/libavb/avb_rsa.c @@ -12,6 +12,7 @@ #include "avb_sha.h" #include "avb_util.h" #include "avb_vbmeta_image.h" +#include <malloc.h> typedef struct IAvbKey { unsigned int len; /* Length of n[] in number of uint32_t */ diff --git a/lib/libavb/avb_slot_verify.c b/lib/libavb/avb_slot_verify.c index c0defdf9c9..58baf522fc 100644 --- a/lib/libavb/avb_slot_verify.c +++ b/lib/libavb/avb_slot_verify.c @@ -14,6 +14,7 @@ #include "avb_util.h" #include "avb_vbmeta_image.h" #include "avb_version.h" +#include <malloc.h> /* Maximum number of partitions that can be loaded with avb_slot_verify(). */ #define MAX_NUMBER_OF_LOADED_PARTITIONS 32 diff --git a/lib/libavb/avb_sysdeps_posix.c b/lib/libavb/avb_sysdeps_posix.c index 0bb0cc1498..6ffdb0b7eb 100644 --- a/lib/libavb/avb_sysdeps_posix.c +++ b/lib/libavb/avb_sysdeps_posix.c @@ -4,6 +4,7 @@ */ #include <hang.h> +#include <malloc.h> #include <stdarg.h> #include <stdlib.h> diff --git a/lib/libavb/avb_util.c b/lib/libavb/avb_util.c index 405d625351..94773b77e7 100644 --- a/lib/libavb/avb_util.c +++ b/lib/libavb/avb_util.c @@ -4,6 +4,7 @@ */ #include "avb_util.h" +#include <malloc.h> #include <stdarg.h> diff --git a/lib/linux_compat.c b/lib/linux_compat.c index 3f440deaa0..89a6fd6ec9 100644 --- a/lib/linux_compat.c +++ b/lib/linux_compat.c @@ -1,5 +1,6 @@ #include <common.h> +#include <malloc.h> #include <memalign.h> #include <linux/compat.h> @@ -8,6 +8,7 @@ #include <common.h> #include <lmb.h> +#include <malloc.h> #define LMB_ALLOC_ANYWHERE 0 diff --git a/lib/rsa/rsa-sign.c b/lib/rsa/rsa-sign.c index 5b5905aeb5..6400ef63d6 100644 --- a/lib/rsa/rsa-sign.c +++ b/lib/rsa/rsa-sign.c @@ -4,6 +4,7 @@ */ #include "mkimage.h" +#include <malloc.h> #include <stdio.h> #include <string.h> #include <image.h> diff --git a/lib/rsa/rsa-verify.c b/lib/rsa/rsa-verify.c index 82dc513260..326a5e4ea9 100644 --- a/lib/rsa/rsa-verify.c +++ b/lib/rsa/rsa-verify.c @@ -6,6 +6,7 @@ #ifndef USE_HOSTCC #include <common.h> #include <fdtdec.h> +#include <malloc.h> #include <asm/types.h> #include <asm/byteorder.h> #include <linux/errno.h> diff --git a/lib/zstd/decompress.c b/lib/zstd/decompress.c index ac5ab528bb..ae3be3f02a 100644 --- a/lib/zstd/decompress.c +++ b/lib/zstd/decompress.c @@ -23,6 +23,7 @@ #include "huf.h" #include "mem.h" /* low level memory routines */ #include "zstd_internal.h" +#include <malloc.h> #include <linux/kernel.h> #include <linux/compat.h> #include <linux/string.h> /* memcpy, memmove, memset */ diff --git a/lib/zstd/zstd_common.c b/lib/zstd/zstd_common.c index 9a217e1573..6b2c79eeb6 100644 --- a/lib/zstd/zstd_common.c +++ b/lib/zstd/zstd_common.c @@ -9,6 +9,7 @@ ***************************************/ #include "error_private.h" #include "zstd_internal.h" /* declaration of ZSTD_isError, ZSTD_getErrorName, ZSTD_getErrorCode, ZSTD_getErrorString, ZSTD_versionNumber */ +#include <malloc.h> #include <linux/kernel.h> /*=************************************************************** |