lib: Include helper libc functions directly in libsbi.
authorAtish Patra <atish.patra@wdc.com>
Tue, 18 Jun 2019 21:54:02 +0000 (14:54 -0700)
committerAnup Patel <anup.patel@wdc.com>
Wed, 19 Jun 2019 04:18:54 +0000 (09:48 +0530)
libsbi needs some of the custom libc functions. It should be directly
included in libsbi instead of platform specific libraries.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
Acked-by: Anup Patel <anup.patel@wdc.com>
include/sbi/string.h [moved from platform/common/include/plat/string.h with 100% similarity]
lib/sbi/libc/objects.mk [moved from platform/common/libc/objects.mk with 62% similarity]
lib/sbi/libc/string.c [moved from platform/common/libc/string.c with 99% similarity]
lib/sbi/objects.mk
lib/sbi/sbi_fifo.c
lib/sbi/sbi_ipi.c
lib/sbi/sbi_tlb.c
platform/common/irqchip/plic.c
platform/common/libfdt/libfdt_env.h
platform/common/tinyfdt.c

similarity index 62%
rename from platform/common/libc/objects.mk
rename to lib/sbi/libc/objects.mk
index 1dcfe8e..7a6ebbe 100644 (file)
@@ -10,6 +10,6 @@
 libc_files = string.o
 
 $(foreach file, $(libc_files), \
-       $(eval CFLAGS_$(file) = -I$(src)/../../common/libc))
+       $(eval CFLAGS_$(file) = -I$(src)/../../sbi/libc))
 
-platform-common-objs-$(PLATFORM_INCLUDE_LIBC) += $(addprefix libc/,$(libc_files))
+libsbi-objs-y += $(addprefix libc/,$(libc_files))
similarity index 99%
rename from platform/common/libc/string.c
rename to lib/sbi/libc/string.c
index 6e273d0..b5743fe 100644 (file)
@@ -12,7 +12,7 @@
  * bugs as well. Use any optimized routines from newlib or glibc if required.
  */
 
-#include <plat/string.h>
+#include <sbi/string.h>
 
 int strcmp(const char *a, const char *b)
 {
index 817e805..d0fd856 100644 (file)
@@ -27,6 +27,3 @@ libsbi-objs-y += sbi_system.o
 libsbi-objs-y += sbi_timer.o
 libsbi-objs-y += sbi_tlb.o
 libsbi-objs-y += sbi_trap.o
-
-# External Libraries to include
-PLATFORM_INCLUDE_LIBC=y
index a92b46c..e823d2a 100644 (file)
@@ -10,7 +10,7 @@
 #include <sbi/riscv_locks.h>
 #include <sbi/sbi_error.h>
 #include <sbi/sbi_fifo.h>
-#include <plat/string.h>
+#include <sbi/string.h>
 
 void sbi_fifo_init(struct sbi_fifo *fifo, void *queue_mem, u16 entries,
                   u16 entry_size)
index 48d5b22..19da029 100644 (file)
@@ -19,7 +19,7 @@
 #include <sbi/sbi_platform.h>
 #include <sbi/sbi_timer.h>
 #include <sbi/sbi_tlb.h>
-#include <plat/string.h>
+#include <sbi/string.h>
 
 static unsigned long ipi_data_off;
 
index 814d402..1031df3 100644 (file)
@@ -16,7 +16,7 @@
 #include <sbi/sbi_bitops.h>
 #include <sbi/sbi_scratch.h>
 #include <sbi/sbi_tlb.h>
-#include <plat/string.h>
+#include <sbi/string.h>
 
 static unsigned long ipi_tlb_fifo_off;
 static unsigned long ipi_tlb_fifo_mem_off;
index 90a7820..e3cdb17 100644 (file)
@@ -10,7 +10,7 @@
 #include <sbi/riscv_io.h>
 #include <sbi/riscv_encoding.h>
 #include <sbi/sbi_console.h>
-#include <plat/string.h>
+#include <sbi/string.h>
 #include <plat/tinyfdt.h>
 #include <plat/irqchip/plic.h>
 
index 2428fd5..adcd315 100644 (file)
@@ -52,7 +52,7 @@
  *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <plat/string.h>
+#include <sbi/string.h>
 #include <sbi/sbi_types.h>
 
 #define INT_MAX                ((int)(~0U >> 1))
index e62a809..73dd131 100644 (file)
@@ -7,7 +7,7 @@
  *   Anup Patel <anup.patel@wdc.com>
  */
 
-#include <plat/string.h>
+#include <sbi/string.h>
 #include <plat/tinyfdt.h>
 
 #define FDT_MAGIC 0xd00dfeed