37#ifndef _RTEMS_TMTEST27
38#error "This is an RTEMS internal file you must not include directly."
49#define MUST_WAIT_FOR_INTERRUPT 1
51static bool riscv_tm27_can_use_mtime;
60 irq = RISCV_INTERRUPT_VECTOR_TIMER;
65 irq = RISCV_INTERRUPT_VECTOR_SOFTWARE;
67 riscv_tm27_can_use_mtime =
true;
70 rtems_interrupt_entry_initialize(
71 &riscv_tm27_interrupt_entry,
80 &riscv_tm27_interrupt_entry
84static inline void Cause_tm27_intr(
void )
86 if ( riscv_tm27_can_use_mtime ) {
91 cpu_self = _Per_CPU_Get();
92 cpu_self->cpu_per_cpu.clint_mtimecmp->val_64 = 0;
99static inline void Clear_tm27_intr(
void )
101 if ( riscv_tm27_can_use_mtime ) {
106 cpu_self = _Per_CPU_Get();
107 cpu_self->cpu_per_cpu.clint_mtimecmp->val_64 = UINT64_MAX;
114static inline void Lower_tm27_intr(
void )
122 irq = RISCV_INTERRUPT_VECTOR_SOFTWARE;
125 _Assert( riscv_tm27_can_use_mtime );
This header file provides the interfaces of the Assert Handler.
rtems_status_code rtems_interrupt_entry_install(rtems_vector_number vector, rtems_option options, rtems_interrupt_entry *entry)
Installs the interrupt entry at the interrupt vector.
Definition: irq-generic.c:264
ISR_Vector_number rtems_vector_number
This integer type represents interrupt vector numbers.
Definition: intr.h:102
#define RTEMS_INTERRUPT_SHARED
This interrupt handler install option allows that the interrupt handler may share the interrupt vecto...
Definition: intr.h:960
rtems_status_code rtems_interrupt_vector_is_enabled(rtems_vector_number vector, bool *enabled)
Checks if the interrupt vector is enabled.
Definition: irq-enable-disable.c:69
#define rtems_interrupt_local_disable(_isr_cookie)
Disables the maskable interrupts on the current processor.
Definition: intr.h:427
ISR_Level rtems_interrupt_level
This integer type represents interrupt levels.
Definition: intr.h:111
rtems_status_code rtems_interrupt_raise(rtems_vector_number vector)
Raises the interrupt vector.
Definition: irq-raise-clear.c:59
void(* rtems_interrupt_handler)(void *)
Interrupt handler routines shall have this type.
Definition: intr.h:1030
rtems_status_code rtems_interrupt_vector_enable(rtems_vector_number vector)
Enables the interrupt vector.
Definition: irq-enable-disable.c:85
#define rtems_interrupt_local_enable(_isr_cookie)
Restores the previous interrupt level on the current processor.
Definition: intr.h:468
rtems_status_code rtems_interrupt_clear(rtems_vector_number vector)
Clears the interrupt vector.
Definition: irq-raise-clear.c:92
#define _Assert(_e)
Assertion similar to assert() controlled via RTEMS_DEBUG instead of NDEBUG and static analysis runs.
Definition: assert.h:96
#define _ISR_Set_level(_new_level)
Set current interrupt level.
Definition: isrlevel.h:159
This header file provides interfaces of the Interrupt Manager implementation.
rtems_interrupt_entry * bsp_interrupt_dispatch_table[]
Each member of this table references the first installed entry at the corresponding interrupt vector ...
Definition: irq-generic.c:47
This header file provides the interfaces of the Per-CPU Information.
Per CPU Core Structure.
Definition: percpu.h:384
This structure represents an interrupt entry.
Definition: intr.h:1070