[PATCH] bsps/sparc: Add common gnat handler function prototype.

Daniel Cederman cederman at gaisler.com
Thu Mar 13 14:14:07 UTC 2014


Moved prototype for __gnat_install_handler and __gnat_install_handler_common to common header file.
---
 c/src/lib/libbsp/sparc/Makefile.am                 |    1 +
 c/src/lib/libbsp/sparc/erc32/Makefile.am           |    1 +
 c/src/lib/libbsp/sparc/erc32/gnatsupp/gnatsupp.c   |    2 +-
 c/src/lib/libbsp/sparc/erc32/preinstall.am         |    4 ++++
 c/src/lib/libbsp/sparc/leon2/Makefile.am           |    1 +
 c/src/lib/libbsp/sparc/leon2/gnatsupp/gnatsupp.c   |    2 +-
 c/src/lib/libbsp/sparc/leon2/preinstall.am         |    4 ++++
 c/src/lib/libbsp/sparc/leon3/Makefile.am           |    1 +
 c/src/lib/libbsp/sparc/leon3/gnatsupp/gnatsupp.c   |    2 +-
 c/src/lib/libbsp/sparc/leon3/preinstall.am         |    4 ++++
 c/src/lib/libbsp/sparc/shared/gnatcommon.c         |    1 +
 c/src/lib/libbsp/sparc/shared/include/gnatcommon.h |   19 +++++++++++++++++++
 12 files changed, 39 insertions(+), 3 deletions(-)
 create mode 100644 c/src/lib/libbsp/sparc/shared/include/gnatcommon.h

diff --git a/c/src/lib/libbsp/sparc/Makefile.am b/c/src/lib/libbsp/sparc/Makefile.am
index 3508d89..3d433fb 100644
--- a/c/src/lib/libbsp/sparc/Makefile.am
+++ b/c/src/lib/libbsp/sparc/Makefile.am
@@ -6,6 +6,7 @@ SUBDIRS = @RTEMS_BSP_FAMILY@
 EXTRA_DIST =
 
 EXTRA_DIST += shared/gnatcommon.c
+EXTRA_DIST += shared/include/gnatcommon.h
 EXTRA_DIST += shared/start/start.S
 
 # Interrupt
diff --git a/c/src/lib/libbsp/sparc/erc32/Makefile.am b/c/src/lib/libbsp/sparc/erc32/Makefile.am
index 677c44e..5f161e1 100644
--- a/c/src/lib/libbsp/sparc/erc32/Makefile.am
+++ b/c/src/lib/libbsp/sparc/erc32/Makefile.am
@@ -39,6 +39,7 @@ libbsp_a_SOURCES += ../../shared/bspclean.c ../../shared/bsplibc.c \
 libbsp_a_SOURCES += ../../sparc/shared/irq_asm.S
 # gnatsupp
 libbsp_a_SOURCES += gnatsupp/gnatsupp.c ../../sparc/shared/gnatcommon.c
+include_HEADERS += ../shared/include/gnatcommon.h
 # console
 libbsp_a_SOURCES += console/erc32_console.c ../../shared/console.c \
     ../../shared/console_select.c  ../../shared/console_control.c \
diff --git a/c/src/lib/libbsp/sparc/erc32/gnatsupp/gnatsupp.c b/c/src/lib/libbsp/sparc/erc32/gnatsupp/gnatsupp.c
index ebab714..74403cd 100644
--- a/c/src/lib/libbsp/sparc/erc32/gnatsupp/gnatsupp.c
+++ b/c/src/lib/libbsp/sparc/erc32/gnatsupp/gnatsupp.c
@@ -4,7 +4,7 @@
  * Jiri Gaisler, ESA/ESTEC, 17-02-1999.
  */
 
-void __gnat_install_handler_common( int, int );
+#include "../../shared/include/gnatcommon.h"
 
 void
 __gnat_install_handler (void)
diff --git a/c/src/lib/libbsp/sparc/erc32/preinstall.am b/c/src/lib/libbsp/sparc/erc32/preinstall.am
index a235296..b3f4f22 100644
--- a/c/src/lib/libbsp/sparc/erc32/preinstall.am
+++ b/c/src/lib/libbsp/sparc/erc32/preinstall.am
@@ -73,6 +73,10 @@ $(PROJECT_LIB)/linkcmds.base: ../shared/startup/linkcmds.base $(PROJECT_LIB)/$(d
 	$(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.base
 PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.base
 
+$(PROJECT_INCLUDE)/gnatcommon.h: ../shared/include/gnatcommon.h $(PROJECT_INCLUDE)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/gnatcommon.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/gnatcommon.h
+
 $(PROJECT_INCLUDE)/bsp/irq-generic.h: ../../shared/include/irq-generic.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq-generic.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq-generic.h
diff --git a/c/src/lib/libbsp/sparc/leon2/Makefile.am b/c/src/lib/libbsp/sparc/leon2/Makefile.am
index c08f159..50e61fb 100644
--- a/c/src/lib/libbsp/sparc/leon2/Makefile.am
+++ b/c/src/lib/libbsp/sparc/leon2/Makefile.am
@@ -56,6 +56,7 @@ libbsp_a_SOURCES += ../../shared/bspclean.c ../../shared/bsplibc.c \
 libbsp_a_SOURCES += ../../sparc/shared/irq_asm.S
 # gnatsupp
 libbsp_a_SOURCES += gnatsupp/gnatsupp.c ../../sparc/shared/gnatcommon.c
+include_HEADERS += ../shared/include/gnatcommon.h
 # console
 libbsp_a_SOURCES += console/console.c console/debugputs.c
 # clock
diff --git a/c/src/lib/libbsp/sparc/leon2/gnatsupp/gnatsupp.c b/c/src/lib/libbsp/sparc/leon2/gnatsupp/gnatsupp.c
index b3a7c18..c0ee1e2 100644
--- a/c/src/lib/libbsp/sparc/leon2/gnatsupp/gnatsupp.c
+++ b/c/src/lib/libbsp/sparc/leon2/gnatsupp/gnatsupp.c
@@ -10,7 +10,7 @@
  * Jiri Gaisler, ESA/ESTEC, 17-02-1999.
  */
 
-void __gnat_install_handler_common (int t1, int t2);
+#include "../../shared/include/gnatcommon.h"
 
 /*
  *  Avoid trap 0x18 which is used by the clock tick, and
diff --git a/c/src/lib/libbsp/sparc/leon2/preinstall.am b/c/src/lib/libbsp/sparc/leon2/preinstall.am
index 84aa2b4..2fe4f1c 100644
--- a/c/src/lib/libbsp/sparc/leon2/preinstall.am
+++ b/c/src/lib/libbsp/sparc/leon2/preinstall.am
@@ -141,6 +141,10 @@ $(PROJECT_LIB)/linkcmds.base: ../shared/startup/linkcmds.base $(PROJECT_LIB)/$(d
 	$(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.base
 PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.base
 
+$(PROJECT_INCLUDE)/gnatcommon.h: ../shared/include/gnatcommon.h $(PROJECT_INCLUDE)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/gnatcommon.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/gnatcommon.h
+
 $(PROJECT_INCLUDE)/bsp/irq-generic.h: ../../shared/include/irq-generic.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq-generic.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq-generic.h
diff --git a/c/src/lib/libbsp/sparc/leon3/Makefile.am b/c/src/lib/libbsp/sparc/leon3/Makefile.am
index 3c87e18..7fbf5ba 100644
--- a/c/src/lib/libbsp/sparc/leon3/Makefile.am
+++ b/c/src/lib/libbsp/sparc/leon3/Makefile.am
@@ -45,6 +45,7 @@ libbsp_a_SOURCES += startup/cpucounter.c
 libbsp_a_SOURCES += ../../sparc/shared/irq_asm.S
 # gnatsupp
 libbsp_a_SOURCES += gnatsupp/gnatsupp.c ../../sparc/shared/gnatcommon.c
+include_HEADERS += ../shared/include/gnatcommon.h
 # AMBA bus
 include_HEADERS += include/amba.h
 include_HEADERS += ../../sparc/shared/include/ambapp.h
diff --git a/c/src/lib/libbsp/sparc/leon3/gnatsupp/gnatsupp.c b/c/src/lib/libbsp/sparc/leon3/gnatsupp/gnatsupp.c
index 4b1056f..0e65ee7 100644
--- a/c/src/lib/libbsp/sparc/leon3/gnatsupp/gnatsupp.c
+++ b/c/src/lib/libbsp/sparc/leon3/gnatsupp/gnatsupp.c
@@ -8,7 +8,7 @@
  * Jiri Gaisler, ESA/ESTEC, 17-02-1999.
  */
 
-void __gnat_install_handler_common (int t1, int t2);
+#include <gnatcommon.h>
 
 /*
  *  Avoid trap 0x18 which is used by the clock tick, and
diff --git a/c/src/lib/libbsp/sparc/leon3/preinstall.am b/c/src/lib/libbsp/sparc/leon3/preinstall.am
index 0005edd..ed6e96d 100644
--- a/c/src/lib/libbsp/sparc/leon3/preinstall.am
+++ b/c/src/lib/libbsp/sparc/leon3/preinstall.am
@@ -85,6 +85,10 @@ $(PROJECT_LIB)/linkcmds.ngmp: startup/linkcmds.ngmp $(PROJECT_LIB)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.ngmp
 PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.ngmp
 
+$(PROJECT_INCLUDE)/gnatcommon.h: ../shared/include/gnatcommon.h $(PROJECT_INCLUDE)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/gnatcommon.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/gnatcommon.h
+
 $(PROJECT_INCLUDE)/amba.h: include/amba.h $(PROJECT_INCLUDE)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/amba.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/amba.h
diff --git a/c/src/lib/libbsp/sparc/shared/gnatcommon.c b/c/src/lib/libbsp/sparc/shared/gnatcommon.c
index 4128982..32d9de9 100644
--- a/c/src/lib/libbsp/sparc/shared/gnatcommon.c
+++ b/c/src/lib/libbsp/sparc/shared/gnatcommon.c
@@ -11,6 +11,7 @@
 #include <rtems/bspIo.h>
 #include <signal.h>
 #include <stdlib.h>
+#include <gnatcommon.h>
 
 /*
  * Synchronous trap handler. Map the trap number of SIGFPE, SIGSEGV
diff --git a/c/src/lib/libbsp/sparc/shared/include/gnatcommon.h b/c/src/lib/libbsp/sparc/shared/include/gnatcommon.h
new file mode 100644
index 0000000..1a04449
--- /dev/null
+++ b/c/src/lib/libbsp/sparc/shared/include/gnatcommon.h
@@ -0,0 +1,19 @@
+#ifndef __GNATCOMMON_H
+#define __GNATCOMMON_H
+
+/*
+ * Support for gnat/rtems interrupts and exception handling.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void __gnat_install_handler (void);
+void __gnat_install_handler_common (int t1, int t2);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
-- 
1.7.9.5




More information about the devel mailing list