[PATCH 4/4] bsp: Add new riscv64_generic bsp
Hesham Almatary
heshamelmatary at gmail.com
Fri Oct 27 09:49:33 UTC 2017
symlink riscv_generic -> riscv64_generic
Update #3109
---
.../riscv_generic/make/custom/riscv64_generic.cfg | 7 ++
c/src/lib/libbsp/riscv64/Makefile.am | 14 ++++
c/src/lib/libbsp/riscv64/acinclude.m4 | 10 +++
c/src/lib/libbsp/riscv64/configure.ac | 19 +++++
c/src/lib/libbsp/riscv64/riscv64_generic | 1 +
.../libbsp/riscv64/shared/include/linker-symbols.h | 81 ++++++++++++++++++++++
6 files changed, 132 insertions(+)
create mode 100644 c/src/lib/libbsp/riscv32/riscv_generic/make/custom/riscv64_generic.cfg
create mode 100644 c/src/lib/libbsp/riscv64/Makefile.am
create mode 100644 c/src/lib/libbsp/riscv64/acinclude.m4
create mode 100644 c/src/lib/libbsp/riscv64/configure.ac
create mode 120000 c/src/lib/libbsp/riscv64/riscv64_generic
create mode 100644 c/src/lib/libbsp/riscv64/shared/include/linker-symbols.h
diff --git a/c/src/lib/libbsp/riscv32/riscv_generic/make/custom/riscv64_generic.cfg b/c/src/lib/libbsp/riscv32/riscv_generic/make/custom/riscv64_generic.cfg
new file mode 100644
index 0000000..e2925c2
--- /dev/null
+++ b/c/src/lib/libbsp/riscv32/riscv_generic/make/custom/riscv64_generic.cfg
@@ -0,0 +1,7 @@
+include $(RTEMS_ROOT)/make/custom/default.cfg
+
+RTEMS_CPU = riscv64
+
+CPU_CFLAGS = -mcmodel=medany
+
+CFLAGS_OPTIMIZE_V ?= -O0 -g
diff --git a/c/src/lib/libbsp/riscv64/Makefile.am b/c/src/lib/libbsp/riscv64/Makefile.am
new file mode 100644
index 0000000..9c319b6
--- /dev/null
+++ b/c/src/lib/libbsp/riscv64/Makefile.am
@@ -0,0 +1,14 @@
+ACLOCAL_AMFLAGS = -I ../../../aclocal
+## Descend into the @RTEMS_BSP_FAMILY@ directory
+## Currently, the shared directory is not explicitly
+## added but it is present in the source tree.
+
+
+_SUBDIRS = @RTEMS_BSP_FAMILY@
+
+include_bspdir = $(includedir)/bsp
+include_bsp_HEADERS = shared/include/linker-symbols.h
+
+include $(srcdir)/preinstall.am
+include $(top_srcdir)/../../../automake/subdirs.am
+include $(top_srcdir)/../../../automake/local.am
diff --git a/c/src/lib/libbsp/riscv64/acinclude.m4 b/c/src/lib/libbsp/riscv64/acinclude.m4
new file mode 100644
index 0000000..9982df9
--- /dev/null
+++ b/c/src/lib/libbsp/riscv64/acinclude.m4
@@ -0,0 +1,10 @@
+# RTEMS_CHECK_BSPDIR(RTEMS_BSP_FAMILY)
+AC_DEFUN([RTEMS_CHECK_BSPDIR],
+[
+ case "$1" in
+ riscv64_generic )
+ AC_CONFIG_SUBDIRS([riscv64_generic]);;
+ *)
+ AC_MSG_ERROR([Invalid BSP]);;
+ esac
+])
diff --git a/c/src/lib/libbsp/riscv64/configure.ac b/c/src/lib/libbsp/riscv64/configure.ac
new file mode 100644
index 0000000..bcd91b9
--- /dev/null
+++ b/c/src/lib/libbsp/riscv64/configure.ac
@@ -0,0 +1,19 @@
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.69])
+AC_INIT([rtems-c-src-lib-libbsp-riscv64],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
+AC_CONFIG_SRCDIR([../riscv64])
+RTEMS_TOP(../../../../..)
+
+RTEMS_CANONICAL_TARGET_CPU
+AM_INIT_AUTOMAKE([no-define foreign subdir-objects 1.12.2])
+AM_MAINTAINER_MODE
+
+RTEMS_ENV_RTEMSBSP
+RTEMS_PROJECT_ROOT
+
+RTEMS_CHECK_BSPDIR([$RTEMS_BSP_FAMILY])
+
+# Explicitly list all Makefiles here
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/c/src/lib/libbsp/riscv64/riscv64_generic b/c/src/lib/libbsp/riscv64/riscv64_generic
new file mode 120000
index 0000000..835d65d
--- /dev/null
+++ b/c/src/lib/libbsp/riscv64/riscv64_generic
@@ -0,0 +1 @@
+../riscv32/riscv_generic
\ No newline at end of file
diff --git a/c/src/lib/libbsp/riscv64/shared/include/linker-symbols.h b/c/src/lib/libbsp/riscv64/shared/include/linker-symbols.h
new file mode 100644
index 0000000..a4b03f5
--- /dev/null
+++ b/c/src/lib/libbsp/riscv64/shared/include/linker-symbols.h
@@ -0,0 +1,81 @@
+#ifndef LIBBSP_RISCV_SHARED_LINKER_SYMBOLS_H
+#define LIBBSP_RISCV_SHARED_LINKER_SYMBOLS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @defgroup riscv_linker Linker Support
+ *
+ * @ingroup riscv_shared
+ *
+ * @brief Linker support.
+ *
+ * @{
+ */
+
+#ifndef ASM
+#define LINKER_SYMBOL(sym) extern char sym [];
+#else
+#define LINKER_SYMBOL(sym) .extern sym
+#endif
+
+LINKER_SYMBOL(bsp_section_start_begin)
+LINKER_SYMBOL(bsp_section_start_end)
+LINKER_SYMBOL(bsp_section_start_size)
+
+LINKER_SYMBOL(bsp_section_vector_begin)
+LINKER_SYMBOL(bsp_section_vector_end)
+LINKER_SYMBOL(bsp_section_vector_size)
+
+LINKER_SYMBOL(bsp_section_text_begin)
+LINKER_SYMBOL(bsp_section_text_end)
+LINKER_SYMBOL(bsp_section_text_size)
+LINKER_SYMBOL(bsp_section_text_load_begin)
+LINKER_SYMBOL(bsp_section_text_load_end)
+
+LINKER_SYMBOL(bsp_section_rodata_begin)
+LINKER_SYMBOL(bsp_section_rodata_end)
+LINKER_SYMBOL(bsp_section_rodata_size)
+LINKER_SYMBOL(bsp_section_rodata_load_begin)
+LINKER_SYMBOL(bsp_section_rodata_load_end)
+
+LINKER_SYMBOL(bsp_section_data_begin)
+LINKER_SYMBOL(bsp_section_data_end)
+LINKER_SYMBOL(bsp_section_data_size)
+LINKER_SYMBOL(bsp_section_data_load_begin)
+LINKER_SYMBOL(bsp_section_data_load_end)
+
+LINKER_SYMBOL(bsp_section_bss_begin)
+LINKER_SYMBOL(bsp_section_bss_end)
+LINKER_SYMBOL(bsp_section_bss_size)
+
+LINKER_SYMBOL(bsp_section_work_begin)
+LINKER_SYMBOL(bsp_section_work_end)
+LINKER_SYMBOL(bsp_section_work_size)
+
+LINKER_SYMBOL(bsp_section_stack_begin)
+LINKER_SYMBOL(bsp_section_stack_end)
+LINKER_SYMBOL(bsp_section_stack_size)
+
+LINKER_SYMBOL(bsp_vector_table_begin)
+LINKER_SYMBOL(bsp_vector_table_end)
+LINKER_SYMBOL(bsp_vector_table_size)
+
+LINKER_SYMBOL(bsp_start_vector_table_begin)
+LINKER_SYMBOL(bsp_start_vector_table_end)
+LINKER_SYMBOL(bsp_start_vector_table_size)
+
+LINKER_SYMBOL(bsp_translation_table_base)
+LINKER_SYMBOL(bsp_translation_table_end)
+
+LINKER_SYMBOL(_bsp_processor_count)
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* LIBBSP_RISCV_SHARED_LINKER_SYMBOLS_H */
--
2.7.4
More information about the devel
mailing list