Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
interrupt_offload.c File Reference

Data Structures

struct  interrupt_param
 

Macros

#define STACK_SIZE   1024
 
#define NUM_WORK   4
 

Enumerations

enum  { TEST_OFFLOAD_MULTI_JOBS , TEST_OFFLOAD_IDENTICAL_JOBS }
 

Functions

static K_THREAD_STACK_DEFINE (wq_stack, 1024)
 
static K_THREAD_STACK_DEFINE (tstack, 1024)
 
static void entry_offload_job (struct k_work *work)
 
void isr_handler (const void *param)
 
static void init_dyn_interrupt (void)
 
static void trigger_offload_interrupt (const bool real_irq, void *work)
 
static void t_running (void *p1, void *p2, void *p3)
 
static void init_env (int real_irq)
 
static void run_test_offload (int case_type, int real_irq)
 
 ZTEST (interrupt_feature, test_isr_offload_job_multiple)
 Test interrupt offload work to multiple jobs.
 
 ZTEST (interrupt_feature, test_isr_offload_job_identi)
 Test interrupt offload work to identical jobs.
 
 ZTEST (interrupt_feature, test_isr_offload_job)
 Test interrupt offload work by dynamic interrupt.
 

Variables

static struct k_work offload_work [4]
 
static struct k_work_q wq_queue
 
static struct k_thread tdata
 
static struct k_sem sync_sem
 
static struct k_sem end_sem
 
static bool wait_for_end
 
static atomic_t submit_success
 
static atomic_t offload_job_cnt
 
static bool offload_job_prio_higher
 
static volatile int orig_t_keep_run
 
static int vector_num
 
static struct interrupt_param irq_param
 

Macro Definition Documentation

◆ NUM_WORK

#define NUM_WORK   4

◆ STACK_SIZE

#define STACK_SIZE   1024

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
TEST_OFFLOAD_MULTI_JOBS 
TEST_OFFLOAD_IDENTICAL_JOBS 

Function Documentation

◆ entry_offload_job()

static void entry_offload_job ( struct k_work work)
static

◆ init_dyn_interrupt()

static void init_dyn_interrupt ( void  )
static

◆ init_env()

static void init_env ( int  real_irq)
static

◆ isr_handler()

void isr_handler ( const void *  param)

◆ K_THREAD_STACK_DEFINE() [1/2]

static K_THREAD_STACK_DEFINE ( tstack  ,
1024   
)
static

◆ K_THREAD_STACK_DEFINE() [2/2]

static K_THREAD_STACK_DEFINE ( wq_stack  ,
1024   
)
static

◆ run_test_offload()

static void run_test_offload ( int  case_type,
int  real_irq 
)
static

◆ t_running()

static void t_running ( void *  p1,
void *  p2,
void *  p3 
)
static

◆ trigger_offload_interrupt()

static void trigger_offload_interrupt ( const bool  real_irq,
void *  work 
)
static

◆ ZTEST() [1/3]

ZTEST ( interrupt_feature  ,
test_isr_offload_job   
)

Test interrupt offload work by dynamic interrupt.

Validate isr can offload workload to work queue, and the offload jobs could execute immediately base on it's priority. We test this by dynamic interrupt.

◆ ZTEST() [2/3]

ZTEST ( interrupt_feature  ,
test_isr_offload_job_identi   
)

Test interrupt offload work to identical jobs.

Validate isr can offload workload to work queue, and all the offload jobs use the same thread entry, and:

  • If the priority of the original thread < offload job, offload jobs could execute immediately.
  • If the priority of the original thread >= offload job, offload jobs will not execute immediately.

We test this by irq_offload().

◆ ZTEST() [3/3]

ZTEST ( interrupt_feature  ,
test_isr_offload_job_multiple   
)

Test interrupt offload work to multiple jobs.

Validate isr can offload workload to multi work queue, and:

  • If the priority of the original thread < offload job, offload jobs could execute immediately.
  • If the priority of the original thread >= offload job, offload jobs will not execute immediately.

We test this by irq_offload().

Variable Documentation

◆ end_sem

struct k_sem end_sem
static

◆ irq_param

struct interrupt_param irq_param
static

◆ offload_job_cnt

atomic_t offload_job_cnt
static

◆ offload_job_prio_higher

bool offload_job_prio_higher
static

◆ offload_work

struct k_work offload_work[4]
static

◆ orig_t_keep_run

volatile int orig_t_keep_run
static

◆ submit_success

atomic_t submit_success
static

◆ sync_sem

struct k_sem sync_sem
static

◆ tdata

struct k_thread tdata
static

◆ vector_num

int vector_num
static

◆ wait_for_end

bool wait_for_end
static

◆ wq_queue

struct k_work_q wq_queue
static