Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
main.c File Reference
#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]
 

Macro Definition Documentation

◆ IRQ_FLAGS

#define IRQ_FLAGS   0

◆ IRQ_LINE

#define IRQ_LINE (   offset)    (TEST_NUM_IRQS - ((offset) + 1))

◆ ISR1_OFFSET

#define ISR1_OFFSET   0

◆ ISR2_OFFSET

#define ISR2_OFFSET   1

◆ ISR3_ARG

#define ISR3_ARG   0xb01dface

◆ ISR3_OFFSET

#define ISR3_OFFSET   2

◆ ISR4_ARG

#define ISR4_ARG   0xca55e77e

◆ ISR4_OFFSET

#define ISR4_OFFSET   3

◆ ISR5_ARG

#define ISR5_ARG   0xf0ccac1a

◆ ISR5_OFFSET

#define ISR5_OFFSET   4

◆ ISR6_ARG

#define ISR6_ARG   0xba5eba11

◆ ISR6_OFFSET

#define ISR6_OFFSET   5

◆ TABLE_INDEX

#define TABLE_INDEX (   offset)    (TEST_IRQ_TABLE_SIZE - ((offset) + 1))

◆ TEST_IRQ_TABLE_SIZE

#define TEST_IRQ_TABLE_SIZE
Value:
#define CONFIG_NUM_IRQS
Definition irq.h:104
#define TEST_NUM_IRQS
Definition main.c:96
#define IRQ_TABLE_SIZE
Definition sw_isr_table.h:286

◆ TEST_NUM_IRQS

#define TEST_NUM_IRQS   CONFIG_NUM_IRQS

◆ TRIG_CHECK_SIZE

#define TRIG_CHECK_SIZE   6

Function Documentation

◆ gen_isr_table_setup()

static void * gen_isr_table_setup ( void  )
static

◆ isr3()

void isr3 ( const void *  param)

◆ isr4()

void isr4 ( const void *  param)

◆ isr5()

void isr5 ( const void *  param)

◆ isr6()

void isr6 ( const void *  param)

◆ test_irq()

__no_optimization int test_irq ( int  offset)

◆ ZTEST() [1/3]

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.

See also
IRQ_DIRECT_CONNECT(), irq_enable()

◆ ZTEST() [2/3]

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.

See also
IRQ_CONNECT(), irq_enable()

◆ ZTEST() [3/3]

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.

See also
irq_connect_dynamic(), irq_enable()

◆ ZTEST_SUITE()

ZTEST_SUITE ( gen_isr_table  ,
NULL  ,
gen_isr_table_setup  ,
NULL  ,
NULL  ,
NULL   
)

Variable Documentation

◆ trigger_check

volatile int trigger_check[6]
static