[PATCH 3/3] bsps/irq: Remove BSP_INTERRUPT_VECTOR_MAX

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Jun 18 14:19:22 UTC 2021


On 18/06/2021 15:53, Sebastian Huber wrote:
> On 18/06/2021 09:20, Sebastian Huber wrote:
>> diff --git a/bsps/sparc/erc32/include/bsp/irq.h 
>> b/bsps/sparc/erc32/include/bsp/irq.h
>> index ad3a65fcc1..7bf6cff2ff 100644
>> --- a/bsps/sparc/erc32/include/bsp/irq.h
>> +++ b/bsps/sparc/erc32/include/bsp/irq.h
>> @@ -20,8 +20,7 @@
>>   #include <rtems/score/processormask.h>
>> -#define BSP_INTERRUPT_VECTOR_MAX_STD 15 /* Standard IRQ controller */
>> -#define BSP_INTERRUPT_VECTOR_MAX BSP_INTERRUPT_VECTOR_MAX_STD
>> +#define BSP_INTERRUPT_VECTOR_COUNT 16 /* Standard IRQ controller */
>>   /* No extra check is needed */
>>   #undef BSP_INTERRUPT_CUSTOM_VALID_VECTOR
>> diff --git a/bsps/sparc/leon2/include/bsp/irq.h 
>> b/bsps/sparc/leon2/include/bsp/irq.h
>> index 287530e275..a85eefaf10 100644
>> --- a/bsps/sparc/leon2/include/bsp/irq.h
>> +++ b/bsps/sparc/leon2/include/bsp/irq.h
>> @@ -18,8 +18,7 @@
>>   #ifndef LIBBSP_LEON2_IRQ_CONFIG_H
>>   #define LIBBSP_LEON2_IRQ_CONFIG_H
>> -#define BSP_INTERRUPT_VECTOR_MAX_STD 15 /* Standard IRQ controller */
>> -#define BSP_INTERRUPT_VECTOR_MAX BSP_INTERRUPT_VECTOR_MAX_STD
>> +#define BSP_INTERRUPT_VECTOR_COUNT 16 /* Standard IRQ controller */
>>   /* No extra check is needed */
>>   #undef BSP_INTERRUPT_CUSTOM_VALID_VECTOR
>> diff --git a/bsps/sparc/leon3/include/bsp/irq.h 
>> b/bsps/sparc/leon3/include/bsp/irq.h
>> index 77f9fc2528..980f3f5bfb 100644
>> --- a/bsps/sparc/leon3/include/bsp/irq.h
>> +++ b/bsps/sparc/leon3/include/bsp/irq.h
>> @@ -21,10 +21,7 @@
>>   #include <leon.h>
>>   #include <rtems/score/processormask.h>
>> -#define BSP_INTERRUPT_VECTOR_MAX_STD 15 /* Standard IRQ controller */
>> -#define BSP_INTERRUPT_VECTOR_MAX_EXT 31 /* Extended IRQ controller */
>> -
>> -#define BSP_INTERRUPT_VECTOR_MAX BSP_INTERRUPT_VECTOR_MAX_EXT
>> +#define BSP_INTERRUPT_VECTOR_COUNT 32
>>   /* The check is different depending on IRQ controller, runtime 
>> detected */
>>   #define BSP_INTERRUPT_CUSTOM_VALID_VECTOR
> 
> It seems that the SPARC processor and a "standard" interrupt controller 
> supports only 15 external interrupts (BSP_INTERRUPT_VECTOR_COUNT should 
> be 15 in this case) and some systems have an interrupt controller which 
> supports an extended interrupt which multiplex additional 16 interrupts 
> to a standard interrupt (BSP_INTERRUPT_VECTOR_COUNT should be 31 in this 
> case). Is this correct?

Actually, this doesn't fit with:

/* Initialize interrupts */
void BSP_shared_interrupt_init(void)
{
   rtems_vector_number vector;
   rtems_isr_entry previous_isr;
   int i;

   for (i=0; i <= BSP_INTERRUPT_VECTOR_MAX_STD; i++) {
#if defined(LEON3) && (defined(RTEMS_SMP) || defined(RTEMS_MULTIPROCESSING))
     /* Don't install IRQ handler on IPI interrupt */
     if (i == LEON3_mp_irq)
       continue;
#endif
     vector = SPARC_ASYNCHRONOUS_TRAP(i) + 0x10;
     rtems_interrupt_catch(bsp_isr_handler, vector, &previous_isr);
   }

   /* Initalize interrupt support */
   bsp_interrupt_initialize();
}

Can external interrupts end up in this trap: 
SPARC_ASYNCHRONOUS_TRAP(0x10)? In start.S we have:

   BAD_TRAP;                                     ! 10 undefined

   /*
    *  ERC32 defined traps
    */

   BAD_TRAP;                                     ! 11 masked errors

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


More information about the devel mailing list