summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--payloads/libpayload/arch/x86/boot_media.c6
-rw-r--r--payloads/libpayload/include/stddef.h5
-rw-r--r--src/commonlib/bsd/cbfs_mcache.c1
-rw-r--r--src/commonlib/bsd/cbfs_private.c1
4 files changed, 7 insertions, 6 deletions
diff --git a/payloads/libpayload/arch/x86/boot_media.c b/payloads/libpayload/arch/x86/boot_media.c
index 99fb4e3c2a..07e08b6134 100644
--- a/payloads/libpayload/arch/x86/boot_media.c
+++ b/payloads/libpayload/arch/x86/boot_media.c
@@ -1,11 +1,7 @@
/* SPDX-License-Identifier: BSD-3-Clause */
-#include <arch/virtual.h>
+#include <libpayload.h>
#include <boot_device.h>
-#include <commonlib/bsd/cb_err.h>
-#include <stddef.h>
-#include <string.h>
-#include <sysinfo.h>
__attribute__((weak)) ssize_t boot_device_read(void *buf, size_t offset, size_t size)
{
diff --git a/payloads/libpayload/include/stddef.h b/payloads/libpayload/include/stddef.h
index fb6ec9bf20..9003ac9550 100644
--- a/payloads/libpayload/include/stddef.h
+++ b/payloads/libpayload/include/stddef.h
@@ -2,7 +2,10 @@
#define _STDDEF_H
#include <arch/types.h>
-#include <commonlib/bsd/helpers.h>
+
+#if !defined(offsetof)
+#define offsetof(type, member) __builtin_offsetof(type, member)
+#endif
#ifndef __WCHAR_TYPE__
#define __WCHAR_TYPE__ int
diff --git a/src/commonlib/bsd/cbfs_mcache.c b/src/commonlib/bsd/cbfs_mcache.c
index 29ba110d7c..8714cc0ec6 100644
--- a/src/commonlib/bsd/cbfs_mcache.c
+++ b/src/commonlib/bsd/cbfs_mcache.c
@@ -2,6 +2,7 @@
#include <assert.h>
#include <commonlib/bsd/cbfs_private.h>
+#include <commonlib/bsd/helpers.h>
/*
* A CBFS metadata cache is an in memory data structure storing CBFS file headers (= metadata).
diff --git a/src/commonlib/bsd/cbfs_private.c b/src/commonlib/bsd/cbfs_private.c
index b9221fc776..7ad29861df 100644
--- a/src/commonlib/bsd/cbfs_private.c
+++ b/src/commonlib/bsd/cbfs_private.c
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later */
#include <commonlib/bsd/cbfs_private.h>
+#include <commonlib/bsd/helpers.h>
#include <assert.h>
static enum cb_err read_next_header(cbfs_dev_t dev, size_t *offset, struct cbfs_file *buffer,