File indexing completed on 2025-05-11 08:24:08
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
0033
0034
0035 #ifndef _RTEMS_TMTEST27
0036 #error "This is an RTEMS internal file you must not include directly."
0037 #endif
0038
0039 #ifndef __tm27_h
0040 #define __tm27_h
0041
0042 #include <bsp.h>
0043 #include <bsp/irq-generic.h>
0044
0045 #if defined(RTEMS_SMP)
0046 #include <rtems/score/smpimpl.h>
0047 #endif
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057 #define SIS_USE_SYNCHRONOUS_TRAP 0
0058
0059
0060
0061
0062
0063 #if (SIS_USE_SYNCHRONOUS_TRAP == 1)
0064
0065 #define TEST_VECTOR SPARC_SYNCHRONOUS_TRAP( 0x90 )
0066
0067 #define MUST_WAIT_FOR_INTERRUPT 1
0068
0069 #define TM27_USE_VECTOR_HANDLER
0070
0071 #define Install_tm27_vector( handler ) \
0072 set_vector( (handler), TEST_VECTOR, 1 );
0073
0074 #define Cause_tm27_intr() \
0075 __asm__ volatile( "ta 0x10; nop " );
0076
0077 #define Clear_tm27_intr()
0078
0079 #define Lower_tm27_intr()
0080
0081
0082
0083
0084
0085 #else
0086
0087 extern uint32_t Interrupt_nest;
0088
0089 #define TEST_INTERRUPT_SOURCE 5
0090 #define TEST_INTERRUPT_SOURCE2 6
0091 #define MUST_WAIT_FOR_INTERRUPT 1
0092 #define TM27_INTERRUPT_VECTOR_DEFAULT TEST_INTERRUPT_SOURCE
0093
0094 static inline void Install_tm27_vector( rtems_interrupt_handler handler )
0095 {
0096 static rtems_interrupt_entry entry_low;
0097 static rtems_interrupt_entry entry_high;
0098
0099 #if defined(RTEMS_SMP)
0100 bsp_interrupt_set_affinity(
0101 TEST_INTERRUPT_SOURCE,
0102 _SMP_Get_online_processors()
0103 );
0104 bsp_interrupt_set_affinity(
0105 TEST_INTERRUPT_SOURCE2,
0106 _SMP_Get_online_processors()
0107 );
0108 #endif
0109
0110 rtems_interrupt_entry_initialize(
0111 &entry_low,
0112 handler,
0113 NULL,
0114 "tm27 low"
0115 );
0116 (void) rtems_interrupt_entry_install(
0117 TEST_INTERRUPT_SOURCE,
0118 RTEMS_INTERRUPT_SHARED,
0119 &entry_low
0120 );
0121 rtems_interrupt_entry_initialize(
0122 &entry_high,
0123 handler,
0124 NULL,
0125 "tm27 high"
0126 );
0127 (void) rtems_interrupt_entry_install(
0128 TEST_INTERRUPT_SOURCE2,
0129 RTEMS_INTERRUPT_SHARED,
0130 &entry_high
0131 );
0132 }
0133
0134 static inline void Cause_tm27_intr( void )
0135 {
0136 rtems_vector_number vector;
0137
0138 vector = TEST_INTERRUPT_SOURCE + ( Interrupt_nest >> 1 );
0139 #if defined(RTEMS_SMP)
0140 (void) rtems_interrupt_raise_on( vector, rtems_scheduler_get_processor() );
0141 #else
0142 (void) rtems_interrupt_raise( vector );
0143 #endif
0144 nop();
0145 nop();
0146 nop();
0147 }
0148
0149 static inline void Clear_tm27_intr( void )
0150 {
0151 (void) rtems_interrupt_clear( TEST_INTERRUPT_SOURCE );
0152 }
0153
0154 #define Lower_tm27_intr()
0155
0156 #endif
0157
0158 #endif