Ignore:
Timestamp:
Oct 1, 2014, 11:53:03 AM (7 years ago)
Author:
Daniel Cederman <cederman@…>
Branches:
4.11, 5, master
Children:
9a8b2984
Parents:
456eab7d
git-author:
Daniel Cederman <cederman@…> (10/01/14 11:53:03)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/02/14 05:29:05)
Message:

bsp/leon3: Replace the define LEON3_MP_IRQ with a weakly linked variable

The LEON3_MP_IRQ define is used to pick the IRQ to be used by the
shared memory driver and for inter-processor interrupts. On some LEON3
systems, for example the GR712RC, the default value of 14 is not suitable.
To make this value configurable from the application, it is replaced with
a weakly linked variable that can be overridden from the application.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c

    r456eab7d r93b000e  
    2222#include <stdlib.h>
    2323
     24/* Irq used by shared memory driver and for inter-processor interrupts.
     25 * Can be overridden by being defined in the application.
     26 */
     27unsigned char LEON3_mp_irq __attribute__((weak)) = 14;
     28
    2429#if !defined(__leon__) || defined(RTEMS_PARAVIRT)
    2530uint32_t _CPU_SMP_Get_current_processor( void )
     
    4247  leon3_set_cache_control_register(0x80000F);
    4348  /* Unmask IPI interrupts at Interrupt controller for this CPU */
    44   LEON3_IrqCtrl_Regs->mask[cpu_index_self] |= 1U << LEON3_MP_IRQ;
     49  LEON3_IrqCtrl_Regs->mask[cpu_index_self] |= 1U << LEON3_mp_irq;
    4550
    4651  _SMP_Start_multitasking_on_secondary_processor();
     
    5257
    5358  if ( rtems_configuration_get_maximum_processors() > 1 ) {
    54     LEON_Unmask_interrupt(LEON3_MP_IRQ);
    55     set_vector(bsp_inter_processor_interrupt, LEON_TRAP_TYPE(LEON3_MP_IRQ), 1);
     59    LEON_Unmask_interrupt(LEON3_mp_irq);
     60    set_vector(bsp_inter_processor_interrupt, LEON_TRAP_TYPE(LEON3_mp_irq), 1);
    5661  }
    5762
     
    8085{
    8186  /* send interrupt to destination CPU */
    82   LEON3_IrqCtrl_Regs->force[target_processor_index] = 1 << LEON3_MP_IRQ;
     87  LEON3_IrqCtrl_Regs->force[target_processor_index] = 1 << LEON3_mp_irq;
    8388}
    8489
Note: See TracChangeset for help on using the changeset viewer.