summaryrefslogtreecommitdiff
path: root/payloads/libpayload/arch/mock
diff options
context:
space:
mode:
Diffstat (limited to 'payloads/libpayload/arch/mock')
-rw-r--r--payloads/libpayload/arch/mock/Kconfig16
-rw-r--r--payloads/libpayload/arch/mock/Makefile.inc7
-rw-r--r--payloads/libpayload/arch/mock/head.c3
-rw-r--r--payloads/libpayload/arch/mock/libpayload.ldscript3
-rw-r--r--payloads/libpayload/arch/mock/mock_media.c10
-rw-r--r--payloads/libpayload/arch/mock/virtual.c10
6 files changed, 49 insertions, 0 deletions
diff --git a/payloads/libpayload/arch/mock/Kconfig b/payloads/libpayload/arch/mock/Kconfig
new file mode 100644
index 0000000000..3903a76005
--- /dev/null
+++ b/payloads/libpayload/arch/mock/Kconfig
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+if ARCH_MOCK
+
+config ARCH_MOCK_BIG_ENDIAN
+ bool "Use big-endian for mock architecture"
+ default n
+ help
+ This option enables big-endinan support in the code.
+
+config ARCH_SPECIFIC_OPTIONS
+ def_bool y
+ select LITTLE_ENDIAN if !ARCH_MOCK_BIG_ENDIAN
+ select BIG_ENDIAN if ARCH_MOCK_BIG_ENDIAN
+
+endif
diff --git a/payloads/libpayload/arch/mock/Makefile.inc b/payloads/libpayload/arch/mock/Makefile.inc
new file mode 100644
index 0000000000..f15f0f9f1d
--- /dev/null
+++ b/payloads/libpayload/arch/mock/Makefile.inc
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+head.o-y += head.c
+
+libc-y += virtual.c
+
+libcbfs-$(CONFIG_LP_CBFS) += mock_media.c
diff --git a/payloads/libpayload/arch/mock/head.c b/payloads/libpayload/arch/mock/head.c
new file mode 100644
index 0000000000..55a691f910
--- /dev/null
+++ b/payloads/libpayload/arch/mock/head.c
@@ -0,0 +1,3 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+/* This file is empty on purpose. It should not be used. */
diff --git a/payloads/libpayload/arch/mock/libpayload.ldscript b/payloads/libpayload/arch/mock/libpayload.ldscript
new file mode 100644
index 0000000000..6842c9ad5c
--- /dev/null
+++ b/payloads/libpayload/arch/mock/libpayload.ldscript
@@ -0,0 +1,3 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+/* This file is empty on purpose. It is present only to satisfy install script */
diff --git a/payloads/libpayload/arch/mock/mock_media.c b/payloads/libpayload/arch/mock/mock_media.c
new file mode 100644
index 0000000000..2bb06edc29
--- /dev/null
+++ b/payloads/libpayload/arch/mock/mock_media.c
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <cbfs.h>
+
+int libpayload_init_default_cbfs_media(struct cbfs_media *media);
+
+__attribute__((weak)) int libpayload_init_default_cbfs_media(struct cbfs_media *media)
+{
+ return -1;
+}
diff --git a/payloads/libpayload/arch/mock/virtual.c b/payloads/libpayload/arch/mock/virtual.c
new file mode 100644
index 0000000000..6f369d2dcb
--- /dev/null
+++ b/payloads/libpayload/arch/mock/virtual.c
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <unistd.h>
+
+unsigned long virtual_offset = 0;
+
+int getpagesize(void)
+{
+ return 4096;
+}