File indexing completed on 2025-05-11 08:23:57
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 #ifndef _RTEMS_TMTEST27
0037 #error "This is an RTEMS internal file you must not include directly."
0038 #endif
0039
0040 #ifndef TMTESTS_TM27_H
0041 #define TMTESTS_TM27_H
0042
0043 #include <libcpu/powerpc-utility.h>
0044
0045 #include <bsp/irq.h>
0046 #include <bsp/qoriq.h>
0047
0048 #define MUST_WAIT_FOR_INTERRUPT 1
0049
0050 #define IPI_INDEX_LOW 1
0051
0052 #define IPI_INDEX_HIGH 2
0053
0054 static inline void Install_tm27_vector( rtems_interrupt_handler handler )
0055 {
0056 static rtems_interrupt_entry entry_low;
0057 static rtems_interrupt_entry entry_high;
0058 rtems_vector_number low = QORIQ_IRQ_IPI_0 + IPI_INDEX_LOW;
0059 rtems_vector_number high = QORIQ_IRQ_IPI_0 + IPI_INDEX_HIGH;
0060
0061 (void) rtems_interrupt_set_priority(low, 14);
0062 (void) rtems_interrupt_set_priority(high, 13);
0063
0064 rtems_interrupt_entry_initialize(
0065 &entry_low,
0066 handler,
0067 NULL,
0068 "tm17 low"
0069 );
0070 (void) rtems_interrupt_entry_install(
0071 low,
0072 RTEMS_INTERRUPT_UNIQUE,
0073 &entry_low
0074 );
0075
0076 rtems_interrupt_entry_initialize(
0077 &entry_high,
0078 handler,
0079 NULL,
0080 "tm17 high"
0081 );
0082 (void) rtems_interrupt_entry_install(
0083 high,
0084 RTEMS_INTERRUPT_UNIQUE,
0085 &entry_high
0086 );
0087 }
0088
0089 static inline void qoriq_tm27_cause(uint32_t ipi_index)
0090 {
0091 uint32_t self = ppc_processor_id();
0092
0093 qoriq.pic.per_cpu[self].ipidr[ipi_index].reg = UINT32_C(1) << self;
0094 }
0095
0096 static inline void Cause_tm27_intr(void)
0097 {
0098 qoriq_tm27_cause(IPI_INDEX_LOW);
0099 }
0100
0101 static inline void Clear_tm27_intr(void)
0102 {
0103
0104 }
0105
0106 static inline inline void Lower_tm27_intr(void)
0107 {
0108 qoriq_tm27_cause(IPI_INDEX_HIGH);
0109 }
0110
0111 #endif