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

Gedare Bloom gedare at rtems.org
Fri Mar 14 12:41:13 UTC 2014


On Fri, Mar 14, 2014 at 7:15 AM, Daniel Cederman <cederman at gaisler.com> wrote:
>
> On 2014-03-14 09:52, Daniel Cederman wrote:
>>
>> So I should place gnatcommon.h in
>> c/src/lib/libbsp/sparc/shared/include/bsp instead?
>>
Only if all bsps in sparc port share it.

>
> Or is it just that I should add the file to include_bsp_HEADERS instead of
> include_HEADERS?
>
Yes.

> Daniel Cederman
> Software Engineer
> Aeroflex Gaisler AB
> Aeroflex Microelectronic Solutions - HiRel
> Kungsgatan 12
> SE-411 19 Gothenburg, Sweden
> Phone: +46 31 7758665
> cederman at gaisler.com
> www.Aeroflex.com/Gaisler
>
>
>> On 2014-03-13 15:23, Joel Sherrill wrote:
>>>
>>>
>>> On 3/13/2014 9:14 AM, Daniel Cederman wrote:
>>>>
>>>> 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"
>>>>
>>>
>>> Since you installed this as <gnatcommon.h>, it should use <>
>>> not ".../.../"
>>>
>>> Also I think it should have been installed as <bsp/gnatcommon.h>
>>>
>>> Other than that, this patch is Ok.
>>>
>>>
>>>>   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
>>>
>>>
>> _______________________________________________
>> rtems-devel mailing list
>> rtems-devel at rtems.org
>> http://www.rtems.org/mailman/listinfo/rtems-devel
>
> _______________________________________________
> rtems-devel mailing list
> rtems-devel at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-devel



More information about the devel mailing list