[RTEMS Project] #4171: sparc: Remove set_vector() function

RTEMS trac trac at rtems.org
Wed Nov 4 16:20:03 UTC 2020


#4171: sparc: Remove set_vector() function
------------------------------+-----------------------------
  Reporter:  Sebastian Huber  |      Owner:  Sebastian Huber
      Type:  enhancement      |     Status:  assigned
  Priority:  normal           |  Milestone:  6.1
 Component:  arch/sparc       |    Version:  6
  Severity:  normal           |   Keywords:
Blocked By:                   |   Blocking:
------------------------------+-----------------------------
 The
 {{{#!c
 rtems_isr_entry set_vector(                   /* returns old vector */
   rtems_isr_entry     handler,                /* isr routine        */
   rtems_vector_number vector,                 /* vector number      */
   int                 type                    /* RTEMS or RAW intr  */
 )
 }}}
 is an unsafe interface since it works with incompatible function pointer
 types by design. This leads to warnings like this:
 {{{
 ../../../bsps/sparc/leon3/start/setvec.c: In function 'set_vector':
 ../../../bsps/sparc/leon3/start/setvec.c:51:43: warning: passing argument
 2 of '_CPU_ISR_install_raw_handler' from incompatible pointer type
 [-Wincompatible-pointer-types]
    51 |     _CPU_ISR_install_raw_handler( vector, handler, (void
 *)&previous_isr );
       |                                           ^~~~~~~
       |                                           |
       |                                           rtems_isr_entry {aka
 void (*)(unsigned int)}
 In file included from ../../../cpukit/include/rtems/config.h:30,
                  from ../../../cpukit/include/rtems.h:56,
                  from ../../../bsps/include/bsp/default-initial-
 extension.h:26,
                  from ../../../bsps/sparc/leon3/include/bsp.h:32,
                  from ../../../bsps/sparc/leon3/start/setvec.c:36:
 ../../../cpukit/score/cpu/sparc/include/rtems/score/cpu.h:958:24: note:
 expected 'CPU_ISR_raw_handler' {aka 'void (*)(void)'} but argument is of
 type 'rtems_isr_entry' {aka 'void (*)(unsigned int)'}
   958 |   CPU_ISR_raw_handler  new_handler,
       |   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
 }}}
 The set_vector() function is undocumented.

 The proposed solution is to

 1. clear and unmask the corresponding interrupts in
 rtems_interrupt_catch(),

 2. replace all set_vector(*, *, 1) calls wtith rtems_interrupt_catch(),

 3. verify that there are no set_vector(*, *, 0) uses, if present, then
 replace then with _CPU_ISR_install_raw_handler(), and

 4. remove set_vector().

--
Ticket URL: <http://devel.rtems.org/ticket/4171>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list