summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--payloads/libpayload/Makefile.mk3
-rw-r--r--payloads/libpayload/libc/Makefile.mk3
-rw-r--r--src/commonlib/Makefile.mk2
-rw-r--r--src/commonlib/include/commonlib/list.h (renamed from src/include/list.h)8
-rw-r--r--src/commonlib/list.c (renamed from src/lib/list.c)2
-rw-r--r--src/include/device_tree.h2
-rw-r--r--src/include/fit.h6
-rw-r--r--src/lib/Makefile.mk2
-rw-r--r--src/lib/cbfs.c2
-rw-r--r--src/lib/edid_fill_fb.c2
-rw-r--r--tests/commonlib/Makefile.mk4
-rw-r--r--tests/commonlib/list-test.c (renamed from tests/lib/list-test.c)2
-rw-r--r--tests/lib/Makefile.mk4
13 files changed, 25 insertions, 17 deletions
diff --git a/payloads/libpayload/Makefile.mk b/payloads/libpayload/Makefile.mk
index 61f932f1d6..e000868c2b 100644
--- a/payloads/libpayload/Makefile.mk
+++ b/payloads/libpayload/Makefile.mk
@@ -70,6 +70,9 @@ INCLUDES := -Iinclude -Iinclude/$(ARCHDIR-y) -I$(obj)
INCLUDES += -include include/kconfig.h
INCLUDES += -include $(coreboottop)/src/commonlib/bsd/include/commonlib/bsd/compiler.h
INCLUDES += -I$(coreboottop)/src/commonlib/bsd/include
+ifeq ($(CONFIG_LP_GPL),y)
+INCLUDES += -I$(coreboottop)/src/commonlib/include
+endif
INCLUDES += -I$(VBOOT_SOURCE)/firmware/include
CFLAGS += $(INCLUDES) -Os -pipe -nostdinc -ggdb3
diff --git a/payloads/libpayload/libc/Makefile.mk b/payloads/libpayload/libc/Makefile.mk
index 306bebfd97..6ff1eb8182 100644
--- a/payloads/libpayload/libc/Makefile.mk
+++ b/payloads/libpayload/libc/Makefile.mk
@@ -48,4 +48,7 @@ ifeq ($(CONFIG_LP_LIBC),y)
libc-srcs += $(coreboottop)/src/commonlib/bsd/elog.c
libc-srcs += $(coreboottop)/src/commonlib/bsd/gcd.c
libc-srcs += $(coreboottop)/src/commonlib/bsd/ipchksum.c
+ifeq ($(CONFIG_LP_GPL),y)
+libc-srcs += $(coreboottop)/src/commonlib/list.c
+endif
endif
diff --git a/src/commonlib/Makefile.mk b/src/commonlib/Makefile.mk
index 7ec4de91c0..30aaddf2cc 100644
--- a/src/commonlib/Makefile.mk
+++ b/src/commonlib/Makefile.mk
@@ -53,6 +53,8 @@ romstage-y += bsd/lz4_wrapper.c
ramstage-y += bsd/lz4_wrapper.c
postcar-y += bsd/lz4_wrapper.c
+all-y += list.c
+
ramstage-y += sort.c
romstage-y += bsd/elog.c
diff --git a/src/include/list.h b/src/commonlib/include/commonlib/list.h
index bfd92a747b..6c8a5d2cbb 100644
--- a/src/include/list.h
+++ b/src/commonlib/include/commonlib/list.h
@@ -1,8 +1,10 @@
/* Taken from depthcharge: src/base/list.h */
/* SPDX-License-Identifier: GPL-2.0-or-later */
-#ifndef __LIST_H__
-#define __LIST_H__
+#ifndef __COMMONLIB_LIST_H__
+#define __COMMONLIB_LIST_H__
+
+#include <commonlib/helpers.h>
struct list_node {
struct list_node *next;
@@ -24,4 +26,4 @@ void list_append(struct list_node *node, struct list_node *head);
(ptr) = container_of((ptr)->member.next, \
typeof(*(ptr)), member))
-#endif /* __LIST_H__ */
+#endif /* __COMMONLIB_LIST_H__ */
diff --git a/src/lib/list.c b/src/commonlib/list.c
index c3f8ee42c8..b1030c8263 100644
--- a/src/lib/list.c
+++ b/src/commonlib/list.c
@@ -1,7 +1,7 @@
/* Taken from depthcharge: src/base/list.c */
/* SPDX-License-Identifier: GPL-2.0-or-later */
-#include <list.h>
+#include <commonlib/list.h>
void list_remove(struct list_node *node)
{
diff --git a/src/include/device_tree.h b/src/include/device_tree.h
index 02fcaa7234..e7b79e1a94 100644
--- a/src/include/device_tree.h
+++ b/src/include/device_tree.h
@@ -6,7 +6,7 @@
#include <stddef.h>
#include <stdint.h>
-#include <list.h>
+#include <commonlib/list.h>
/*
* Flattened device tree structures/constants.
diff --git a/src/include/fit.h b/src/include/fit.h
index a1e970d502..d587750743 100644
--- a/src/include/fit.h
+++ b/src/include/fit.h
@@ -4,11 +4,11 @@
#ifndef __LIB_FIT_H__
#define __LIB_FIT_H__
-#include <stddef.h>
-#include <stdint.h>
+#include <commonlib/list.h>
#include <device_tree.h>
-#include <list.h>
#include <program_loading.h>
+#include <stddef.h>
+#include <stdint.h>
struct fit_image_node {
const char *name;
diff --git a/src/lib/Makefile.mk b/src/lib/Makefile.mk
index 2a95be9d10..fe24156dad 100644
--- a/src/lib/Makefile.mk
+++ b/src/lib/Makefile.mk
@@ -28,8 +28,6 @@ CFLAGS_ramstage += $(CFLAGS_asan)
$(obj)/ramstage/lib/asan.o: CFLAGS_asan =
endif
-all-y += list.c
-
decompressor-y += decompressor.c
$(call src-to-obj,decompressor,$(dir)/decompressor.c): $(objcbfs)/bootblock.lz4
$(call src-to-obj,decompressor,$(dir)/decompressor.c): CCACHE_EXTRAFILES=$(objcbfs)/bootblock.lz4
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c
index 92a00e4418..03624bf2d7 100644
--- a/src/lib/cbfs.c
+++ b/src/lib/cbfs.c
@@ -6,10 +6,10 @@
#include <cbmem.h>
#include <commonlib/bsd/cbfs_private.h>
#include <commonlib/bsd/compression.h>
+#include <commonlib/list.h>
#include <console/console.h>
#include <fmap.h>
#include <lib.h>
-#include <list.h>
#include <metadata_hash.h>
#include <security/tpm/tspi/crtm.h>
#include <security/vboot/vboot_common.h>
diff --git a/src/lib/edid_fill_fb.c b/src/lib/edid_fill_fb.c
index 1df37e8072..e4fb08c3fd 100644
--- a/src/lib/edid_fill_fb.c
+++ b/src/lib/edid_fill_fb.c
@@ -6,7 +6,7 @@
#include <framebuffer_info.h>
#include <string.h>
#include <stdlib.h>
-#include <list.h>
+#include <commonlib/list.h>
struct fb_info {
struct list_node node;
diff --git a/tests/commonlib/Makefile.mk b/tests/commonlib/Makefile.mk
index 6df1db8fc5..55c3ddd702 100644
--- a/tests/commonlib/Makefile.mk
+++ b/tests/commonlib/Makefile.mk
@@ -2,9 +2,13 @@
subdirs-y += bsd
+tests-y += list-test
tests-y += rational-test
tests-y += region-test
+list-test-srcs += tests/commonlib/list-test.c
+list-test-srcs += src/commonlib/list.c
+
rational-test-srcs += tests/commonlib/rational-test.c
rational-test-srcs += src/commonlib/rational.c
diff --git a/tests/lib/list-test.c b/tests/commonlib/list-test.c
index 39bfb17f7c..4ca48a468f 100644
--- a/tests/lib/list-test.c
+++ b/tests/commonlib/list-test.c
@@ -3,7 +3,7 @@
#include <tests/test.h>
#include <stdlib.h>
#include <string.h>
-#include <list.h>
+#include <commonlib/list.h>
struct test_container {
int value;
diff --git a/tests/lib/Makefile.mk b/tests/lib/Makefile.mk
index b8c4c71eaf..01777171c9 100644
--- a/tests/lib/Makefile.mk
+++ b/tests/lib/Makefile.mk
@@ -9,7 +9,6 @@ tests-y += timestamp-test
tests-y += edid-test
tests-y += cbmem_console-romstage-test
tests-y += cbmem_console-ramstage-test
-tests-y += list-test
tests-y += fmap-test
tests-y += imd_cbmem-romstage-test
tests-y += imd_cbmem-ramstage-test
@@ -74,9 +73,6 @@ cbmem_console-ramstage-test-stage := ramstage
cbmem_console-ramstage-test-srcs += tests/lib/cbmem_console-test.c
cbmem_console-ramstage-test-srcs += tests/stubs/console.c
-list-test-srcs += tests/lib/list-test.c
-list-test-srcs += src/lib/list.c
-
fmap-test-srcs += tests/lib/fmap-test.c
fmap-test-srcs += src/lib/fmap.c
fmap-test-srcs += tests/stubs/console.c