File indexing completed on 2025-05-11 08:24:01
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032 #include <rtems/score/cpu.h>
0033 #include <rtems/score/isr.h>
0034 #include <rtems/score/threaddispatch.h>
0035 #include <rtems/score/sh.h>
0036 #include <rtems/score/ispsh7750.h>
0037 #include <rtems/score/iosh7750.h>
0038 #include <rtems/score/sh4_regs.h>
0039 #include <rtems/score/sh_io.h>
0040
0041 unsigned long *_old_stack_ptr;
0042
0043 register unsigned long *stack_ptr __asm__ ("r15");
0044
0045
0046
0047
0048
0049 void __ISR_Handler( uint32_t vector)
0050 {
0051 ISR_Level level;
0052
0053 _ISR_Local_disable( level );
0054
0055 _Thread_Dispatch_disable();
0056
0057 if ( _ISR_Nest_level == 0 )
0058 {
0059
0060 _old_stack_ptr = stack_ptr;
0061 stack_ptr = _CPU_Interrupt_stack_high;
0062 }
0063
0064 _ISR_Nest_level++;
0065
0066 _ISR_Local_enable( level );
0067
0068
0069 if ( _ISR_Vector_table[ vector])
0070 (*_ISR_Vector_table[ vector ])( vector );
0071
0072 _ISR_Local_disable( level );
0073
0074 _Thread_Dispatch_enable( _Per_CPU_Get() );
0075
0076 _ISR_Nest_level--;
0077
0078 if ( _ISR_Nest_level == 0 )
0079
0080 stack_ptr = _old_stack_ptr;
0081
0082 _ISR_Local_enable( level );
0083
0084 if ( _ISR_Nest_level )
0085 return;
0086
0087 if ( !_Thread_Dispatch_is_enabled() ) {
0088 return;
0089 }
0090
0091 if ( _Thread_Dispatch_necessary ) {
0092 _Thread_Dispatch();
0093 }
0094 }