[PATCH 24] SPARC BSPS: added defines for set_vec type argument to bsp.h

Daniel Hellstrom daniel at gaisler.com
Tue Apr 3 14:00:26 UTC 2012


On 03/29/2012 10:38 PM, Gedare Bloom wrote:
> On Thu, Mar 29, 2012 at 4:26 PM, Joel Sherrill
> <joel.sherrill at oarcorp.com>  wrote:
>> On 03/29/2012 03:15 PM, Gedare Bloom wrote:
>>> How do you want to proceed?
>> I am a bit concerned about adding the constants since
>> this method is supposed to be the same on all targets.
>>
>> Is this one critical Daniel? I would really like to consider
>> adding a shared .h file and moving the prototype for
>> all BSPs to there.
Not at all, you can change the name of the macro as well.
> That would also allow us to eliminate the declarations of set_vector
> from a bunch of bsp.h files.
I agree with you both. Please make any changes.

I wonder if all BSPs/CPUs really implement this. I mean, platforms implement trap-vectors differently? That is one reason why I think set_vector() never should be used in libchip/.

And, I'm a bit suprised that rtems_interrupt_handler_install() that is supposed to be generic, takes a vector number instead of a IRQ-number that the BSP can route into a vector itself:

   rtems_status_code rtems_interrupt_handler_install(
     rtems_vector_number vector,
     const char *info,
     rtems_option options,
     rtems_interrupt_handler handler,
     void *arg);

Daniel

>>> On Thu, Mar 29, 2012 at 4:09 PM, Joel Sherrill
>>> <joel.sherrill at oarcorp.com>    wrote:
>>>> On 03/29/2012 02:54 PM, Gedare Bloom wrote:
>>>>> I do like the idea of pushing the macro up so that other architectures
>>>>> will implement it, but I'm not sure where the macro should live in
>>>>> that case.
>>>> If bootcard.h were "bsp_framework.h", it would be perfect. :)
>>>>
>>>> For now, we are stuff with something like bsp/setvec.h.
>>>>
>>>>> Renaming it is a good idea but clearly requires more consideration.
>>>> Yep. Likely to break stuff but not more than a search and replace.
>>>>
>>>>> On Thu, Mar 29, 2012 at 3:48 PM, Joel Sherrill
>>>>> <joel.sherrill at oarcorp.com>      wrote:
>>>>>> On 03/29/2012 02:45 PM, Gedare Bloom wrote:
>>>>>>> looks good
>>>>>> I am OK with it also but it seems like set_vector() is a
>>>>>> required part of BSPs for the Simple Vectored Architectures.
>>>>>> Shouldn't the prototype and any constants associated
>>>>>> with it be in a common header file?
>>>>>>
>>>>>> And maybe (I hate to suggest this), it be renamed
>>>>>> to bsp_set_vector() per current naming guidelines.
>>>>>>>
>>>>>>> On Thu, Mar 29, 2012 at 7:52 AM, Daniel Hellstrom<daniel at gaisler.com>
>>>>>>>   wrote:
>>>>>>>> Signed-off-by: Daniel Hellstrom<daniel at gaisler.com>
>>>>>>>> ---
>>>>>>>>   c/src/lib/libbsp/sparc/erc32/include/bsp.h    |    4 ++++
>>>>>>>>   c/src/lib/libbsp/sparc/erc32/startup/setvec.c |    2 +-
>>>>>>>>   c/src/lib/libbsp/sparc/leon2/include/bsp.h    |    4 ++++
>>>>>>>>   c/src/lib/libbsp/sparc/leon2/startup/setvec.c |    2 +-
>>>>>>>>   c/src/lib/libbsp/sparc/leon3/include/bsp.h    |    4 ++++
>>>>>>>>   c/src/lib/libbsp/sparc/leon3/startup/setvec.c |    2 +-
>>>>>>>>   6 files changed, 15 insertions(+), 3 deletions(-)
>>>>>>>>
>>>>>>>> diff --git a/c/src/lib/libbsp/sparc/erc32/include/bsp.h
>>>>>>>> b/c/src/lib/libbsp/sparc/erc32/include/bsp.h
>>>>>>>> index a88673e..70f1ce3 100644
>>>>>>>> --- a/c/src/lib/libbsp/sparc/erc32/include/bsp.h
>>>>>>>> +++ b/c/src/lib/libbsp/sparc/erc32/include/bsp.h
>>>>>>>> @@ -69,6 +69,10 @@ extern int   end;        /* last address in the
>>>>>>>> program */
>>>>>>>>
>>>>>>>>   /* functions */
>>>>>>>>
>>>>>>>> +/* set_vec type */
>>>>>>>> +#define SET_VECTOR_RAW  0  /* Raw trap handler */
>>>>>>>> +#define SET_VECTOR_INT  1  /* Trap handler with _ISR_Handler
>>>>>>>> interrupt
>>>>>>>> handler */
>>>>>>>> +
>>>>>>>>   rtems_isr_entry set_vector(                     /* returns old
>>>>>>>> vector
>>>>>>>> */
>>>>>>>>      rtems_isr_entry     handler,                /* isr routine
>>>>>>>>   */
>>>>>>>>      rtems_vector_number vector,                 /* vector number
>>>>>>>>   */
>>>>>>>> diff --git a/c/src/lib/libbsp/sparc/erc32/startup/setvec.c
>>>>>>>> b/c/src/lib/libbsp/sparc/erc32/startup/setvec.c
>>>>>>>> index 3a7601d..7e697a0 100644
>>>>>>>> --- a/c/src/lib/libbsp/sparc/erc32/startup/setvec.c
>>>>>>>> +++ b/c/src/lib/libbsp/sparc/erc32/startup/setvec.c
>>>>>>>> @@ -42,7 +42,7 @@ rtems_isr_entry set_vector(                   /*
>>>>>>>> returns old vector */
>>>>>>>>    uint32_t        real_trap;
>>>>>>>>    uint32_t        source;
>>>>>>>>
>>>>>>>> -  if ( type )
>>>>>>>> +  if ( type == SET_VECTOR_INT )
>>>>>>>>      rtems_interrupt_catch( handler, vector,&previous_isr );
>>>>>>>>
>>>>>>>>    else
>>>>>>>>      _CPU_ISR_install_raw_handler( vector, handler, (void
>>>>>>>> *)&previous_isr
>>>>>>>> );
>>>>>>>> diff --git a/c/src/lib/libbsp/sparc/leon2/include/bsp.h
>>>>>>>> b/c/src/lib/libbsp/sparc/leon2/include/bsp.h
>>>>>>>> index 796290e..a2f3360 100644
>>>>>>>> --- a/c/src/lib/libbsp/sparc/leon2/include/bsp.h
>>>>>>>> +++ b/c/src/lib/libbsp/sparc/leon2/include/bsp.h
>>>>>>>> @@ -88,6 +88,10 @@ extern int   end;        /* last address in the
>>>>>>>> program */
>>>>>>>>
>>>>>>>>   /* miscellaneous stuff assumed to exist */
>>>>>>>>
>>>>>>>> +/* set_vec type */
>>>>>>>> +#define SET_VECTOR_RAW  0  /* Raw trap handler */
>>>>>>>> +#define SET_VECTOR_INT  1  /* Trap handler with _ISR_Handler
>>>>>>>> interrupt
>>>>>>>> handler */
>>>>>>>> +
>>>>>>>>   rtems_isr_entry set_vector(                     /* returns old
>>>>>>>> vector
>>>>>>>> */
>>>>>>>>      rtems_isr_entry     handler,                /* isr routine
>>>>>>>>   */
>>>>>>>>      rtems_vector_number vector,                 /* vector number
>>>>>>>>   */
>>>>>>>> diff --git a/c/src/lib/libbsp/sparc/leon2/startup/setvec.c
>>>>>>>> b/c/src/lib/libbsp/sparc/leon2/startup/setvec.c
>>>>>>>> index c7b8af6..028b17a 100644
>>>>>>>> --- a/c/src/lib/libbsp/sparc/leon2/startup/setvec.c
>>>>>>>> +++ b/c/src/lib/libbsp/sparc/leon2/startup/setvec.c
>>>>>>>> @@ -42,7 +42,7 @@ rtems_isr_entry set_vector(                   /*
>>>>>>>> returns old vector */
>>>>>>>>    uint32_t      real_trap;
>>>>>>>>    uint32_t      source;
>>>>>>>>
>>>>>>>> -  if ( type )
>>>>>>>> +  if ( type == SET_VECTOR_INT )
>>>>>>>>      rtems_interrupt_catch( handler, vector,&previous_isr );
>>>>>>>>
>>>>>>>>    else
>>>>>>>>      _CPU_ISR_install_raw_handler( vector, handler, (void
>>>>>>>> *)&previous_isr
>>>>>>>> );
>>>>>>>> diff --git a/c/src/lib/libbsp/sparc/leon3/include/bsp.h
>>>>>>>> b/c/src/lib/libbsp/sparc/leon3/include/bsp.h
>>>>>>>> index 07a7412..04279d9 100644
>>>>>>>> --- a/c/src/lib/libbsp/sparc/leon3/include/bsp.h
>>>>>>>> +++ b/c/src/lib/libbsp/sparc/leon3/include/bsp.h
>>>>>>>> @@ -98,6 +98,10 @@ extern int   end;        /* last address in the
>>>>>>>> program */
>>>>>>>>
>>>>>>>>   /* miscellaneous stuff assumed to exist */
>>>>>>>>
>>>>>>>> +/* set_vec type */
>>>>>>>> +#define SET_VECTOR_RAW  0  /* Raw trap handler */
>>>>>>>> +#define SET_VECTOR_INT  1  /* Trap handler with _ISR_Handler
>>>>>>>> interrupt
>>>>>>>> handler */
>>>>>>>> +
>>>>>>>>   rtems_isr_entry set_vector(                     /* returns old
>>>>>>>> vector
>>>>>>>> */
>>>>>>>>      rtems_isr_entry     handler,                /* isr routine
>>>>>>>>   */
>>>>>>>>      rtems_vector_number vector,                 /* vector number
>>>>>>>>   */
>>>>>>>> diff --git a/c/src/lib/libbsp/sparc/leon3/startup/setvec.c
>>>>>>>> b/c/src/lib/libbsp/sparc/leon3/startup/setvec.c
>>>>>>>> index c7b8af6..028b17a 100644
>>>>>>>> --- a/c/src/lib/libbsp/sparc/leon3/startup/setvec.c
>>>>>>>> +++ b/c/src/lib/libbsp/sparc/leon3/startup/setvec.c
>>>>>>>> @@ -42,7 +42,7 @@ rtems_isr_entry set_vector(                   /*
>>>>>>>> returns old vector */
>>>>>>>>    uint32_t      real_trap;
>>>>>>>>    uint32_t      source;
>>>>>>>>
>>>>>>>> -  if ( type )
>>>>>>>> +  if ( type == SET_VECTOR_INT )
>>>>>>>>      rtems_interrupt_catch( handler, vector,&previous_isr );
>>>>>>>>
>>>>>>>>    else
>>>>>>>>      _CPU_ISR_install_raw_handler( vector, handler, (void
>>>>>>>> *)&previous_isr
>>>>>>>> );
>>>>>>>> --
>>>>>>>> 1.7.0.4
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> 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
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Joel Sherrill, Ph.D.             Director of Research&
>>>>>> Development
>>>>>> joel.sherrill at OARcorp.com        On-Line Applications Research
>>>>>> Ask me about RTEMS: a free RTOS  Huntsville AL 35805
>>>>>>     Support Available             (256) 722-9985
>>>>>>
>>>>>>
>>>> --
>>>> Joel Sherrill, Ph.D.             Director of Research&       Development
>>>> joel.sherrill at OARcorp.com        On-Line Applications Research
>>>> Ask me about RTEMS: a free RTOS  Huntsville AL 35805
>>>>     Support Available             (256) 722-9985
>>>>
>>>>
>>
>> --
>> Joel Sherrill, Ph.D.             Director of Research&     Development
>> joel.sherrill at OARcorp.com        On-Line Applications Research
>> Ask me about RTEMS: a free RTOS  Huntsville AL 35805
>>     Support Available             (256) 722-9985
>>
>>
>




More information about the devel mailing list