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

This test case verifies the correctness of irq_offload(), an important routine used in many other test cases for running a function in interrupt context, on the IRQ stack. More...

#include <zephyr/kernel.h>
#include <zephyr/ztest.h>
#include <zephyr/kernel_structs.h>
#include <zephyr/irq_offload.h>

Macros

#define SENTINEL_VALUE   0xDEADBEEF
 

Functions

 K_THREAD_STACK_DEFINE (offload_stack, 384+CONFIG_TEST_EXTRA_STACK_SIZE)
 
static void offload_function (const void *param)
 
 ZTEST (irq_offload, test_irq_offload)
 Verify thread context.
 
void nestoff_offload (const void *parameter)
 
static void nestoff_timer_fn (struct k_timer *timer)
 
static void offload_thread_fn (void *p0, void *p1, void *p2)
 
 ZTEST (common_1cpu, test_nested_irq_offload)
 
void * common_setup (void)
 
 ZTEST_SUITE (irq_offload, NULL, common_setup, NULL, NULL, NULL)
 

Variables

volatile uint32_t sentinel
 
struct k_thread offload_thread
 
static struct k_timer nestoff_timer
 
static bool timer_executed
 
static bool nested_executed
 

Detailed Description

This test case verifies the correctness of irq_offload(), an important routine used in many other test cases for running a function in interrupt context, on the IRQ stack.

Macro Definition Documentation

◆ SENTINEL_VALUE

#define SENTINEL_VALUE   0xDEADBEEF

Function Documentation

◆ K_THREAD_STACK_DEFINE()

K_THREAD_STACK_DEFINE ( offload_stack  ,
384+  CONFIG_TEST_EXTRA_STACK_SIZE 
)

◆ nestoff_offload()

void nestoff_offload ( const void *  parameter)

◆ nestoff_timer_fn()

static void nestoff_timer_fn ( struct k_timer *  timer)
static

◆ offload_function()

static void offload_function ( const void *  param)
static

◆ offload_thread_fn()

static void offload_thread_fn ( void *  p0,
void *  p1,
void *  p2 
)
static

◆ ZTEST() [1/2]

ZTEST ( common_1cpu  ,
test_nested_irq_offload   
)

◆ ZTEST() [2/2]

ZTEST ( irq_offload  ,
test_irq_offload   
)

Verify thread context.

Check whether offloaded running function is in interrupt context, on the IRQ stack or not.

TESTPOINT: Offload to IRQ context

◆ ZTEST_SUITE()

ZTEST_SUITE ( irq_offload  ,
NULL  ,
common_setup  ,
NULL  ,
NULL  ,
NULL   
)

Variable Documentation

◆ nested_executed

bool nested_executed
static

◆ nestoff_timer

struct k_timer nestoff_timer
static

◆ offload_thread

struct k_thread offload_thread

◆ sentinel

volatile uint32_t sentinel

◆ timer_executed

bool timer_executed
static