Zephyr Project API 3.7.0
A Scalable Open Source RTOS
|
#include <zephyr/kernel.h>
#include <zephyr/ztest.h>
#include <zephyr/irq.h>
#include <zephyr/irq_multilevel.h>
#include <zephyr/tc_util.h>
#include <zephyr/sw_isr_table.h>
#include <zephyr/interrupt_util.h>
#include <zephyr/sys/barrier.h>
Macros | |
#define | ISR1_OFFSET 0 |
#define | ISR2_OFFSET 1 |
#define | ISR3_OFFSET 2 |
#define | ISR4_OFFSET 3 |
#define | ISR5_OFFSET 4 |
#define | ISR6_OFFSET 5 |
#define | TEST_NUM_IRQS CONFIG_NUM_IRQS |
#define | TEST_IRQ_TABLE_SIZE |
#define | IRQ_LINE(offset) (TEST_NUM_IRQS - ((offset) + 1)) |
#define | TABLE_INDEX(offset) (TEST_IRQ_TABLE_SIZE - ((offset) + 1)) |
#define | TRIG_CHECK_SIZE 6 |
#define | ISR3_ARG 0xb01dface |
#define | ISR4_ARG 0xca55e77e |
#define | ISR5_ARG 0xf0ccac1a |
#define | ISR6_ARG 0xba5eba11 |
#define | IRQ_FLAGS 0 |
Functions | |
void | isr3 (const void *param) |
void | isr4 (const void *param) |
void | isr5 (const void *param) |
void | isr6 (const void *param) |
__no_optimization int | test_irq (int offset) |
ZTEST (gen_isr_table, test_build_time_direct_interrupt) | |
test to validate direct interrupt | |
ZTEST (gen_isr_table, test_build_time_interrupt) | |
test to validate gen_isr_table and interrupt | |
ZTEST (gen_isr_table, test_run_time_interrupt) | |
test to validate gen_isr_table and dynamic interrupt | |
static void * | gen_isr_table_setup (void) |
ZTEST_SUITE (gen_isr_table, NULL, gen_isr_table_setup, NULL, NULL, NULL) | |
Variables | |
static volatile int | trigger_check [6] |
#define IRQ_FLAGS 0 |
#define IRQ_LINE | ( | offset | ) | (TEST_NUM_IRQS - ((offset) + 1)) |
#define ISR1_OFFSET 0 |
#define ISR2_OFFSET 1 |
#define ISR3_ARG 0xb01dface |
#define ISR3_OFFSET 2 |
#define ISR4_ARG 0xca55e77e |
#define ISR4_OFFSET 3 |
#define ISR5_ARG 0xf0ccac1a |
#define ISR5_OFFSET 4 |
#define ISR6_ARG 0xba5eba11 |
#define ISR6_OFFSET 5 |
#define TABLE_INDEX | ( | offset | ) | (TEST_IRQ_TABLE_SIZE - ((offset) + 1)) |
#define TEST_IRQ_TABLE_SIZE |
#define TEST_NUM_IRQS CONFIG_NUM_IRQS |
#define TRIG_CHECK_SIZE 6 |
|
static |
void isr3 | ( | const void * | param | ) |
void isr4 | ( | const void * | param | ) |
void isr5 | ( | const void * | param | ) |
void isr6 | ( | const void * | param | ) |
__no_optimization int test_irq | ( | int | offset | ) |
ZTEST | ( | gen_isr_table | , |
test_build_time_direct_interrupt | |||
) |
test to validate direct interrupt
initialize two direct interrupt handler using IRQ_DIRECT_CONNECT api at build time. For ‘direct’ interrupts, address of handler function will be placed in the irq vector table. And each entry contains the pointer to isr and the corresponding parameters.
At the end according to architecture, we manually trigger the interrupt. And all irq handler should get called.
ZTEST | ( | gen_isr_table | , |
test_build_time_interrupt | |||
) |
test to validate gen_isr_table and interrupt
initialize two normal interrupt handler using IRQ_CONNECT api at build time. For 'regular' interrupts, the address of the common software isr table is placed in the irq vector table, and software ISR table is an array of struct _isr_table_entry. And each entry contains the pointer to isr and the corresponding parameters.
At the end according to architecture, we manually trigger the interrupt. And all irq handler should get called.
ZTEST | ( | gen_isr_table | , |
test_run_time_interrupt | |||
) |
test to validate gen_isr_table and dynamic interrupt
initialize two dynamic interrupt handler using irq_connect_dynamic api at run time. For dynamic interrupts, the address of the common software isr table is also placed in the irq vector table. Software ISR table is an array of struct _isr_table_entry. And each entry contains the pointer to isr and the corresponding parameters.
At the end according to architecture, we manually trigger the interrupt. And all irq handler should get called.
ZTEST_SUITE | ( | gen_isr_table | , |
NULL | , | ||
gen_isr_table_setup | , | ||
NULL | , | ||
NULL | , | ||
NULL | |||
) |
|
static |