Changeset 3faa8459 in rtems for cpukit


Ignore:
Timestamp:
Nov 8, 2018, 5:25:32 AM (12 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
d997aa1
Parents:
b15b288
git-author:
Sebastian Huber <sebastian.huber@…> (11/08/18 05:25:32)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/12/18 12:25:42)
Message:

rtems: Simplify rtems_interrupt_catch()

Remove casts and superfluous inline functions.

Update #3585.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/rtems/src/intrcatch.c

    rb15b288 r3faa8459  
    1919#endif
    2020
    21 #include <rtems/system.h>
    22 #include <rtems/rtems/status.h>
     21#include <rtems/rtems/intr.h>
    2322#include <rtems/score/isr.h>
    24 #include <rtems/rtems/intr.h>
    2523
    2624#if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE)
    27 
    28 /**
    29  * This function returns true if the vector is a valid vector number
    30  * for this processor and false otherwise.
    31  */
    32 
    33 RTEMS_INLINE_ROUTINE bool _ISR_Is_vector_number_valid (
    34   uint32_t   vector
    35 )
    36 {
    37   return ( vector <= CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER );
    38 }
    39 
    40 /**
    41  * This function returns true if handler is the entry point of a valid
    42  * use interrupt service routine and false otherwise.
    43  */
    44 
    45 RTEMS_INLINE_ROUTINE bool _ISR_Is_valid_user_handler (
    46   void *handler
    47 )
    48 {
    49   return (handler != NULL);
    50 }
    51 
    5225rtems_status_code rtems_interrupt_catch(
    5326  rtems_isr_entry      new_isr_handler,
     
    5629)
    5730{
    58   if ( !_ISR_Is_vector_number_valid( vector ) )
     31  if ( vector > CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER )
    5932    return RTEMS_INVALID_NUMBER;
    6033
    61   if ( !_ISR_Is_valid_user_handler( (void *) new_isr_handler ) )
     34  if ( new_isr_handler == NULL )
    6235    return RTEMS_INVALID_ADDRESS;
    6336
    64   if ( !_ISR_Is_valid_user_handler( (void *) old_isr_handler ) )
     37  if ( old_isr_handler == NULL )
    6538    return RTEMS_INVALID_ADDRESS;
    6639
    67   _ISR_Install_vector(
    68     vector, (proc_ptr)new_isr_handler, (proc_ptr *)old_isr_handler );
     40  _ISR_Install_vector( vector, new_isr_handler, old_isr_handler );
    6941
    7042  return RTEMS_SUCCESSFUL;
Note: See TracChangeset for help on using the changeset viewer.