File indexing completed on 2025-05-11 08:23:42
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
0036
0037 #ifndef _RTEMS_TMTEST27
0038 #error "This is an RTEMS internal file you must not include directly."
0039 #endif
0040
0041 #ifndef LIBBSP_ARM_SHARED_ARM_GIC_TM27_H
0042 #define LIBBSP_ARM_SHARED_ARM_GIC_TM27_H
0043
0044 #include <bsp.h>
0045 #include <bsp/irq.h>
0046
0047 #include <rtems/score/assert.h>
0048
0049 #define MUST_WAIT_FOR_INTERRUPT 1
0050
0051 #ifndef ARM_GIC_TM27_IRQ_LOW
0052 #define ARM_GIC_TM27_IRQ_LOW ARM_GIC_IRQ_SGI_12
0053 #endif
0054
0055 #ifndef ARM_GIC_TM27_IRQ_HIGH
0056 #define ARM_GIC_TM27_IRQ_HIGH ARM_GIC_IRQ_SGI_13
0057 #endif
0058
0059 #define TM27_INTERRUPT_VECTOR_DEFAULT ARM_GIC_TM27_IRQ_LOW
0060
0061 #define ARM_GIC_TM27_PRIO_LOW 0x80
0062
0063 #define ARM_GIC_TM27_PRIO_HIGH 0x00
0064
0065 static inline void Install_tm27_vector( rtems_interrupt_handler handler )
0066 {
0067 static rtems_interrupt_entry entry_low;
0068 static rtems_interrupt_entry entry_high;
0069 rtems_status_code sc;
0070
0071 rtems_interrupt_entry_initialize(
0072 &entry_low,
0073 handler,
0074 NULL,
0075 "tm27 low"
0076 );
0077 sc = rtems_interrupt_entry_install(
0078 ARM_GIC_TM27_IRQ_LOW,
0079 RTEMS_INTERRUPT_UNIQUE,
0080 &entry_low
0081 );
0082 _Assert_Unused_variable_equals( sc, RTEMS_SUCCESSFUL );
0083
0084 sc = rtems_interrupt_set_priority(
0085 ARM_GIC_TM27_IRQ_LOW,
0086 ARM_GIC_TM27_PRIO_LOW
0087 );
0088 _Assert_Unused_variable_equals( sc, RTEMS_SUCCESSFUL );
0089
0090 rtems_interrupt_entry_initialize(
0091 &entry_high,
0092 handler,
0093 NULL,
0094 "tm27 high"
0095 );
0096 sc = rtems_interrupt_entry_install(
0097 ARM_GIC_TM27_IRQ_HIGH,
0098 RTEMS_INTERRUPT_UNIQUE,
0099 &entry_high
0100 );
0101 _Assert_Unused_variable_equals( sc, RTEMS_SUCCESSFUL );
0102
0103 sc = rtems_interrupt_set_priority(
0104 ARM_GIC_TM27_IRQ_HIGH,
0105 ARM_GIC_TM27_PRIO_HIGH
0106 );
0107 _Assert_Unused_variable_equals( sc, RTEMS_SUCCESSFUL );
0108 }
0109
0110 static inline void Cause_tm27_intr(void)
0111 {
0112 rtems_status_code sc;
0113
0114 sc = rtems_interrupt_raise_on(
0115 ARM_GIC_TM27_IRQ_LOW,
0116 _SMP_Get_current_processor()
0117 );
0118 _Assert_Unused_variable_equals( sc, RTEMS_SUCCESSFUL );
0119 }
0120
0121 static inline void Clear_tm27_intr(void)
0122 {
0123
0124 }
0125
0126 static inline void Lower_tm27_intr(void)
0127 {
0128 rtems_status_code sc;
0129
0130 sc = rtems_interrupt_raise_on(
0131 ARM_GIC_TM27_IRQ_HIGH,
0132 _SMP_Get_current_processor()
0133 );
0134 _Assert_Unused_variable_equals( sc, RTEMS_SUCCESSFUL );
0135 }
0136
0137 #endif