Changeset 8a65a960 in rtems


Ignore:
Timestamp:
Feb 18, 2014, 12:36:35 PM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
2cb0877
Parents:
c4ff027
git-author:
Sebastian Huber <sebastian.huber@…> (02/18/14 12:36:35)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/19/14 08:59:42)
Message:

score: _SMP_Inter_processor_interrupt_handler()

Inline _SMP_Inter_processor_interrupt_handler() to avoid function call
overhead. Remove debug output.

Location:
cpukit/score
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/include/rtems/score/smpimpl.h

    rc4ff027 r8a65a960  
    2020
    2121#include <rtems/score/smp.h>
     22#include <rtems/score/percpu.h>
     23#include <rtems/fatal.h>
    2224
    2325#ifdef __cplusplus
     
    9395 * @brief Interrupt handler for inter-processor interrupts.
    9496 */
    95 void _SMP_Inter_processor_interrupt_handler( void );
     97static inline void _SMP_Inter_processor_interrupt_handler( void )
     98{
     99  Per_CPU_Control *self_cpu = _Per_CPU_Get();
     100
     101  if ( self_cpu->message != 0 ) {
     102    uint32_t  message;
     103    ISR_Level level;
     104
     105    _Per_CPU_ISR_disable_and_acquire( self_cpu, level );
     106    message = self_cpu->message;
     107    self_cpu->message = 0;
     108    _Per_CPU_Release_and_ISR_enable( self_cpu, level );
     109
     110    if ( ( message & SMP_MESSAGE_SHUTDOWN ) != 0 ) {
     111      _Per_CPU_Change_state( self_cpu, PER_CPU_STATE_SHUTDOWN );
     112
     113      rtems_fatal( RTEMS_FATAL_SOURCE_SMP, SMP_FATAL_SHUTDOWN );
     114      /* does not continue past here */
     115    }
     116  }
     117}
    96118
    97119/**
  • cpukit/score/src/smp.c

    rc4ff027 r8a65a960  
    2424#include <rtems/score/threadimpl.h>
    2525#include <rtems/config.h>
    26 #include <rtems/fatal.h>
    2726
    2827#if defined(RTEMS_DEBUG)
     
    6261
    6362  _Thread_Start_multitasking();
    64 }
    65 
    66 void _SMP_Inter_processor_interrupt_handler( void )
    67 {
    68   Per_CPU_Control *self_cpu = _Per_CPU_Get();
    69 
    70 
    71   if ( self_cpu->message != 0 ) {
    72     uint32_t  message;
    73     ISR_Level level;
    74 
    75     _Per_CPU_ISR_disable_and_acquire( self_cpu, level );
    76     message = self_cpu->message;
    77     self_cpu->message = 0;
    78     _Per_CPU_Release_and_ISR_enable( self_cpu, level );
    79 
    80     #if defined(RTEMS_DEBUG)
    81       {
    82         void *sp = __builtin_frame_address(0);
    83         if ( !(message & SMP_MESSAGE_SHUTDOWN) ) {
    84           printk(
    85             "ISR on CPU %d -- (0x%02x) (0x%p)\n",
    86             _Per_CPU_Get_index( self_cpu ),
    87             message,
    88             sp
    89           );
    90           if ( message & SMP_MESSAGE_SHUTDOWN )
    91             printk( "shutdown\n" );
    92         }
    93         printk( "Dispatch level %d\n", _Thread_Dispatch_get_disable_level() );
    94       }
    95     #endif
    96 
    97     if ( ( message & SMP_MESSAGE_SHUTDOWN ) != 0 ) {
    98       _Per_CPU_Change_state( self_cpu, PER_CPU_STATE_SHUTDOWN );
    99 
    100       rtems_fatal( RTEMS_FATAL_SOURCE_SMP, SMP_FATAL_SHUTDOWN );
    101       /* does not continue past here */
    102     }
    103   }
    10463}
    10564
Note: See TracChangeset for help on using the changeset viewer.