summaryrefslogtreecommitdiff
path: root/lib/libavb
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-02-03 07:36:16 -0700
committerSimon Glass <sjg@chromium.org>2020-02-05 19:33:46 -0700
commit336d4615f8fa774557d14f9b3245daa9e5fe3dbc (patch)
tree7a4d2d33113f44238d64e7e409fd3aafef63c2ed /lib/libavb
parent61b29b82683863a970fd4609a7c58512872616bc (diff)
downloadu-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/libavb')
-rw-r--r--lib/libavb/avb_cmdline.c1
-rw-r--r--lib/libavb/avb_descriptor.c1
-rw-r--r--lib/libavb/avb_rsa.c1
-rw-r--r--lib/libavb/avb_slot_verify.c1
-rw-r--r--lib/libavb/avb_sysdeps_posix.c1
-rw-r--r--lib/libavb/avb_util.c1
6 files changed, 6 insertions, 0 deletions
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>