[PATCH] bsp/sparc: Move BSP_ISR_handler to a separate file
Daniel Cederman
cederman at gaisler.com
Fri Feb 6 15:48:27 UTC 2015
> I'd like to entertain a new name for this "BSP_ISR_handler" function
> now that it becomes an exported symbol. We should put it into a proper
> namespace.
Any suggestion on what to change it to?
/Daniel C
On 2015-02-04 16:12, Gedare Bloom wrote:
> I'd like to entertain a new name for this "BSP_ISR_handler" function
> now that it becomes an exported symbol. We should put it into a proper
> namespace.
>
> Also, I'm not sure on the legality of putting a copyright for Cobham
> Gaisler that predates Cobham's acquisition of Aeroflex. But I am not a
> lawyer.
>
> -Gedare
>
> On Wed, Feb 4, 2015 at 4:52 AM, Daniel Cederman <cederman at gaisler.com> wrote:
>> This allows it to be wrapped by another function at link-time
>> and can be used to trace interrupts. If not placed in a separate
>> file, the function pointer address used in BSP_shared_interrupt_init
>> will be resolved at compile-time, and the function will not be wrappable.
>> ---
>> c/src/lib/libbsp/sparc/Makefile.am | 1 +
>> c/src/lib/libbsp/sparc/erc32/Makefile.am | 1 +
>> c/src/lib/libbsp/sparc/erc32/include/bsp.h | 3 ++
>> c/src/lib/libbsp/sparc/leon2/Makefile.am | 1 +
>> c/src/lib/libbsp/sparc/leon2/include/bsp.h | 3 ++
>> c/src/lib/libbsp/sparc/leon3/Makefile.am | 1 +
>> c/src/lib/libbsp/sparc/leon3/include/bsp.h | 3 ++
>> .../lib/libbsp/sparc/shared/irq/bsp_isr_handler.c | 35 ++++++++++++++++++++++
>> c/src/lib/libbsp/sparc/shared/irq/irq-shared.c | 32 +++++++-------------
>> 9 files changed, 58 insertions(+), 22 deletions(-)
>> create mode 100644 c/src/lib/libbsp/sparc/shared/irq/bsp_isr_handler.c
>>
>> diff --git a/c/src/lib/libbsp/sparc/Makefile.am b/c/src/lib/libbsp/sparc/Makefile.am
>> index 3d433fb..615aea7 100644
>> --- a/c/src/lib/libbsp/sparc/Makefile.am
>> +++ b/c/src/lib/libbsp/sparc/Makefile.am
>> @@ -11,6 +11,7 @@ EXTRA_DIST += shared/start/start.S
>>
>> # Interrupt
>> EXTRA_DIST += shared/irq/irq-shared.c
>> +EXTRA_DIST += shared/irq/bsp_isr_handler.c
>>
>> # AMBA Plug&Play bus
>> EXTRA_DIST += shared/include/ambapp.h
>> diff --git a/c/src/lib/libbsp/sparc/erc32/Makefile.am b/c/src/lib/libbsp/sparc/erc32/Makefile.am
>> index c99d2fb..8dcdd32 100644
>> --- a/c/src/lib/libbsp/sparc/erc32/Makefile.am
>> +++ b/c/src/lib/libbsp/sparc/erc32/Makefile.am
>> @@ -71,6 +71,7 @@ include_bsp_HEADERS += \
>> include/bsp/irq.h
>> libbsp_a_SOURCES += \
>> ../../sparc/shared/irq/irq-shared.c \
>> + ../../sparc/shared/irq/bsp_isr_handler.c \
>> ../../shared/src/irq-default-handler.c \
>> ../../shared/src/irq-generic.c \
>> ../../shared/src/irq-info.c \
>> diff --git a/c/src/lib/libbsp/sparc/erc32/include/bsp.h b/c/src/lib/libbsp/sparc/erc32/include/bsp.h
>> index 3393910..2e531ec 100644
>> --- a/c/src/lib/libbsp/sparc/erc32/include/bsp.h
>> +++ b/c/src/lib/libbsp/sparc/erc32/include/bsp.h
>> @@ -106,6 +106,9 @@ typedef void (*bsp_shared_isr)(void *arg);
>> /* Initializes the Shared System Interrupt service */
>> extern void BSP_shared_interrupt_init(void);
>>
>> +/* Called directly from IRQ trap handler TRAP[0x10..0x1F] = IRQ[0..15] */
>> +void BSP_ISR_handler(rtems_vector_number vector);
>> +
>> /* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
>> * interrupt handlers may use the same IRQ number, all ISRs will be called
>> * when an interrupt on that line is fired.
>> diff --git a/c/src/lib/libbsp/sparc/leon2/Makefile.am b/c/src/lib/libbsp/sparc/leon2/Makefile.am
>> index d1e3817..efcb286 100644
>> --- a/c/src/lib/libbsp/sparc/leon2/Makefile.am
>> +++ b/c/src/lib/libbsp/sparc/leon2/Makefile.am
>> @@ -80,6 +80,7 @@ include_bsp_HEADERS += \
>> include/bsp/irq.h
>> libbsp_a_SOURCES += \
>> ../../sparc/shared/irq/irq-shared.c \
>> + ../../sparc/shared/irq/bsp_isr_handler.c \
>> ../../shared/src/irq-default-handler.c \
>> ../../shared/src/irq-generic.c \
>> ../../shared/src/irq-info.c \
>> diff --git a/c/src/lib/libbsp/sparc/leon2/include/bsp.h b/c/src/lib/libbsp/sparc/leon2/include/bsp.h
>> index 41a1e43..807f8d9 100644
>> --- a/c/src/lib/libbsp/sparc/leon2/include/bsp.h
>> +++ b/c/src/lib/libbsp/sparc/leon2/include/bsp.h
>> @@ -130,6 +130,9 @@ typedef void (*bsp_shared_isr)(void *arg);
>> /* Initializes the Shared System Interrupt service */
>> extern void BSP_shared_interrupt_init(void);
>>
>> +/* Called directly from IRQ trap handler TRAP[0x10..0x1F] = IRQ[0..15] */
>> +void BSP_ISR_handler(rtems_vector_number vector);
>> +
>> /* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
>> * interrupt handlers may use the same IRQ number, all ISRs will be called
>> * when an interrupt on that line is fired.
>> diff --git a/c/src/lib/libbsp/sparc/leon3/Makefile.am b/c/src/lib/libbsp/sparc/leon3/Makefile.am
>> index c894095..cec0b34 100644
>> --- a/c/src/lib/libbsp/sparc/leon3/Makefile.am
>> +++ b/c/src/lib/libbsp/sparc/leon3/Makefile.am
>> @@ -82,6 +82,7 @@ include_bsp_HEADERS += \
>> libbsp_a_SOURCES += \
>> startup/eirq.c \
>> ../../sparc/shared/irq/irq-shared.c \
>> + ../../sparc/shared/irq/bsp_isr_handler.c \
>> ../../shared/src/irq-default-handler.c \
>> ../../shared/src/irq-generic.c \
>> ../../shared/src/irq-info.c \
>> diff --git a/c/src/lib/libbsp/sparc/leon3/include/bsp.h b/c/src/lib/libbsp/sparc/leon3/include/bsp.h
>> index 2514190..f4e1121 100644
>> --- a/c/src/lib/libbsp/sparc/leon3/include/bsp.h
>> +++ b/c/src/lib/libbsp/sparc/leon3/include/bsp.h
>> @@ -153,6 +153,9 @@ typedef void (*bsp_shared_isr)(void *arg);
>> /* Initializes the Shared System Interrupt service */
>> extern void BSP_shared_interrupt_init(void);
>>
>> +/* Called directly from IRQ trap handler TRAP[0x10..0x1F] = IRQ[0..15] */
>> +void BSP_ISR_handler(rtems_vector_number vector);
>> +
>> /* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
>> * interrupt handlers may use the same IRQ number, all ISRs will be called
>> * when an interrupt on that line is fired.
>> diff --git a/c/src/lib/libbsp/sparc/shared/irq/bsp_isr_handler.c b/c/src/lib/libbsp/sparc/shared/irq/bsp_isr_handler.c
>> new file mode 100644
>> index 0000000..cc55a15
>> --- /dev/null
>> +++ b/c/src/lib/libbsp/sparc/shared/irq/bsp_isr_handler.c
>> @@ -0,0 +1,35 @@
>> +/*
>> +* COPYRIGHT (c) 2015
>> +* Cobham Gaisler
>> +*
>> +* The license and distribution terms for this file may be
>> +* found in the file LICENSE in this distribution or at
>> +* http://www.rtems.org/license/LICENSE.
>> +*
>> +*/
>> +
>> +#include <rtems.h>
>> +#include <bsp.h>
>> +#include <bsp/irq-generic.h>
>> +
>> +static inline void bsp_dispatch_irq(int irq)
>> +{
>> + bsp_interrupt_handler_entry *e =
>> + &bsp_interrupt_handler_table[bsp_interrupt_handler_index(irq)];
>> +
>> + while (e != NULL) {
>> + (*e->handler)(e->arg);
>> + e = e->next;
>> + }
>> +}
>> +
>> +/* Called directly from IRQ trap handler TRAP[0x10..0x1F] = IRQ[0..15] */
>> +void BSP_ISR_handler(rtems_vector_number vector)
>> +{
>> + int irq = vector - 0x10;
>> +
>> + /* Let BSP fixup and/or handle incomming IRQ */
>> + irq = bsp_irq_fixup(irq);
>> +
>> + bsp_dispatch_irq(irq);
>> +}
>> diff --git a/c/src/lib/libbsp/sparc/shared/irq/irq-shared.c b/c/src/lib/libbsp/sparc/shared/irq/irq-shared.c
>> index 79dbe55..d75dee0 100644
>> --- a/c/src/lib/libbsp/sparc/shared/irq/irq-shared.c
>> +++ b/c/src/lib/libbsp/sparc/shared/irq/irq-shared.c
>> @@ -1,3 +1,13 @@
>> +/*
>> +* COPYRIGHT (c) 2012-2015
>> +* Cobham Gaisler
>> +*
>> +* The license and distribution terms for this file may be
>> +* found in the file LICENSE in this distribution or at
>> +* http://www.rtems.org/license/LICENSE.
>> +*
>> +*/
>> +
>> #include <rtems.h>
>> #include <bsp.h>
>> #include <bsp/irq-generic.h>
>> @@ -27,28 +37,6 @@ static inline int bsp_irq_cpu(int irq)
>> }
>> #endif
>>
>> -static inline void bsp_dispatch_irq(int irq)
>> -{
>> - bsp_interrupt_handler_entry *e =
>> - &bsp_interrupt_handler_table[bsp_interrupt_handler_index(irq)];
>> -
>> - while (e != NULL) {
>> - (*e->handler)(e->arg);
>> - e = e->next;
>> - }
>> -}
>> -
>> -/* Called directly from IRQ trap handler TRAP[0x10..0x1F] = IRQ[0..15] */
>> -static void BSP_ISR_handler(rtems_vector_number vector)
>> -{
>> - int irq = vector - 0x10;
>> -
>> - /* Let BSP fixup and/or handle incomming IRQ */
>> - irq = bsp_irq_fixup(irq);
>> -
>> - bsp_dispatch_irq(irq);
>> -}
>> -
>> /* Initialize interrupts */
>> void BSP_shared_interrupt_init(void)
>> {
>> --
>> 2.2.1
>>
>> _______________________________________________
>> devel mailing list
>> devel at rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel
--
Daniel Cederman
Software Engineer
Cobham Gaisler
daniel.cederman at gaisler.com
Cobham Gaisler AB, Kungsgatan 12, SE-411 19, GÖTEBORG, Sweden.
+46 (0) 31 775 8650, www.cobham.com/gaisler
Please consider the environment before printing this email
This e-mail and any files transmitted with it ("E-mail") is intended
solely for the addressee(s) and may contain confidential and/or legally
privileged information. If you are not the addressee(s), any disclosure,
reproduction, copying, distribution or other use of the E-mail is
prohibited. If you have received this E-mail in error, please delete it
and notify the sender immediately via our switchboard or return e-mail.
Neither the company nor any subsidiary or affiliate or associated
company nor any individual sending this Email accepts any liability in
respect of the content (including errors and omissions) nor shall this
e-mail be deemed to enter the company or any subsidiary or affiliate or
associated company into a contract or to create any legally binding
obligations unless expressly agreed to in writing under separate cover
and timeliness of the E-mail which arise as a result of transmission. If
verification is required, please request a hard copy version from the
sender.
More information about the devel
mailing list