Changeset 0c94a46 in rtems


Ignore:
Timestamp:
Jan 9, 2015, 8:03:59 AM (5 years ago)
Author:
Daniel Cederman <cederman@…>
Branches:
4.11, master
Children:
8d8573ac
Parents:
1c7ee73
git-author:
Daniel Cederman <cederman@…> (01/09/15 08:03:59)
git-committer:
Daniel Hellstrom <daniel@…> (02/11/15 14:35:23)
Message:

bsp/sparc: Move BSP_ISR_handler to a separate file and rename it

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.

Location:
c/src/lib/libbsp/sparc
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/Makefile.am

    r1c7ee73 r0c94a46  
    1212# Interrupt
    1313EXTRA_DIST += shared/irq/irq-shared.c
     14EXTRA_DIST += shared/irq/bsp_isr_handler.c
    1415
    1516# AMBA Plug&Play bus
  • c/src/lib/libbsp/sparc/erc32/Makefile.am

    r1c7ee73 r0c94a46  
    7272libbsp_a_SOURCES += \
    7373    ../../sparc/shared/irq/irq-shared.c \
     74    ../../sparc/shared/irq/bsp_isr_handler.c \
    7475    ../../shared/src/irq-default-handler.c \
    7576    ../../shared/src/irq-generic.c \
  • c/src/lib/libbsp/sparc/erc32/include/bsp.h

    r1c7ee73 r0c94a46  
    107107extern void BSP_shared_interrupt_init(void);
    108108
     109/* Called directly from IRQ trap handler TRAP[0x10..0x1F] = IRQ[0..15] */
     110void bsp_isr_handler(rtems_vector_number vector);
     111
    109112/* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
    110113 * interrupt handlers may use the same IRQ number, all ISRs will be called
  • c/src/lib/libbsp/sparc/leon2/Makefile.am

    r1c7ee73 r0c94a46  
    8181libbsp_a_SOURCES += \
    8282    ../../sparc/shared/irq/irq-shared.c \
     83    ../../sparc/shared/irq/bsp_isr_handler.c \
    8384    ../../shared/src/irq-default-handler.c \
    8485    ../../shared/src/irq-generic.c \
  • c/src/lib/libbsp/sparc/leon2/include/bsp.h

    r1c7ee73 r0c94a46  
    131131extern void BSP_shared_interrupt_init(void);
    132132
     133/* Called directly from IRQ trap handler TRAP[0x10..0x1F] = IRQ[0..15] */
     134void bsp_isr_handler(rtems_vector_number vector);
     135
    133136/* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
    134137 * interrupt handlers may use the same IRQ number, all ISRs will be called
  • c/src/lib/libbsp/sparc/leon3/Makefile.am

    r1c7ee73 r0c94a46  
    8383    startup/eirq.c \
    8484    ../../sparc/shared/irq/irq-shared.c \
     85    ../../sparc/shared/irq/bsp_isr_handler.c \
    8586    ../../shared/src/irq-default-handler.c \
    8687    ../../shared/src/irq-generic.c \
  • c/src/lib/libbsp/sparc/leon3/include/bsp.h

    r1c7ee73 r0c94a46  
    153153/* Initializes the Shared System Interrupt service */
    154154extern void BSP_shared_interrupt_init(void);
     155
     156/* Called directly from IRQ trap handler TRAP[0x10..0x1F] = IRQ[0..15] */
     157void bsp_isr_handler(rtems_vector_number vector);
    155158
    156159/* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
  • c/src/lib/libbsp/sparc/shared/irq/irq-shared.c

    r1c7ee73 r0c94a46  
     1/*
     2*  COPYRIGHT (c) 2012-2015
     3*  Cobham Gaisler
     4*
     5*  The license and distribution terms for this file may be
     6*  found in the file LICENSE in this distribution or at
     7*  http://www.rtems.org/license/LICENSE.
     8*
     9*/
     10
    111#include <rtems.h>
    212#include <bsp.h>
     
    2838#endif
    2939
    30 static inline void bsp_dispatch_irq(int irq)
    31 {
    32   bsp_interrupt_handler_entry *e =
    33     &bsp_interrupt_handler_table[bsp_interrupt_handler_index(irq)];
    34 
    35   while (e != NULL) {
    36     (*e->handler)(e->arg);
    37     e = e->next;
    38   }
    39 }
    40 
    41 /* Called directly from IRQ trap handler TRAP[0x10..0x1F] = IRQ[0..15] */
    42 static void BSP_ISR_handler(rtems_vector_number vector)
    43 {
    44   int irq = vector - 0x10;
    45 
    46   /* Let BSP fixup and/or handle incomming IRQ */
    47   irq = bsp_irq_fixup(irq);
    48 
    49   bsp_dispatch_irq(irq);
    50 }
    51 
    5240/* Initialize interrupts */
    5341void BSP_shared_interrupt_init(void)
     
    6553#endif
    6654    vector = SPARC_ASYNCHRONOUS_TRAP(i) + 0x10;
    67     rtems_interrupt_catch(BSP_ISR_handler, vector, &previous_isr);
     55    rtems_interrupt_catch(bsp_isr_handler, vector, &previous_isr);
    6856  }
    6957
Note: See TracChangeset for help on using the changeset viewer.