Zephyr API Documentation
3.0.0
A Scalable Open Source RTOS
|
|
3.0.0 |
#include <ztest.h>
#include <kernel_structs.h>
#include <arch/cpu.h>
#include <irq_offload.h>
#include <sys_clock.h>
#include <soc.h>
Data Structures | |
struct | ISR_INFO |
struct | timeout_order |
Macros | |
#define | THREAD_STACKSIZE (512 + CONFIG_TEST_EXTRA_STACKSIZE) |
#define | THREAD_STACKSIZE2 (384 + CONFIG_TEST_EXTRA_STACKSIZE) |
#define | THREAD_PRIORITY 4 |
#define | THREAD_SELF_CMD 0 |
#define | EXEC_CTX_TYPE_CMD 1 |
#define | UNKNOWN_COMMAND -1 |
#define | HAS_POWERSAVE_INSTRUCTION |
#define | NUM_TIMEOUT_THREADS ARRAY_SIZE(timeouts) |
Typedefs | |
typedef int(* | disable_int_func) (int) |
typedef void(* | enable_int_func) (int) |
Functions | |
static | K_THREAD_STACK_DEFINE (thread_stack1,(512+CONFIG_TEST_EXTRA_STACKSIZE)) |
static | K_THREAD_STACK_DEFINE (thread_stack2,(512+CONFIG_TEST_EXTRA_STACKSIZE)) |
static | K_THREAD_STACK_DEFINE (thread_stack3,(512+CONFIG_TEST_EXTRA_STACKSIZE)) |
static void | test_kernel_cpu_idle (void) |
Test cpu idle function. More... | |
static void | test_kernel_cpu_idle_atomic (void) |
Test cpu idle function. More... | |
static void | isr_handler (const void *data) |
Handler to perform various actions from within an ISR context. More... | |
static void | isr_handler_trigger (void) |
static void | kernel_init_objects (void) |
Initialize kernel objects. More... | |
int | irq_lock_wrapper (int unused) |
A wrapper for irq_lock() More... | |
void | irq_unlock_wrapper (int imask) |
A wrapper for irq_unlock() More... | |
int | irq_disable_wrapper (int irq) |
A wrapper for irq_disable() More... | |
void | irq_enable_wrapper (int irq) |
A wrapper for irq_enable() More... | |
static void | test_kernel_interrupts (void) |
Test routines for disabling and enabling interrupts. More... | |
static void | test_kernel_timer_interrupts (void) |
Test routines for disabling and enabling interrupts (disable timer) More... | |
static void | test_kernel_ctx_thread (void) |
Test some context routines. More... | |
static void | thread_helper (void *arg1, void *arg2, void *arg3) |
Entry point to the thread's helper. More... | |
static void | k_yield_entry (void *arg0, void *arg1, void *arg2) |
Entry point to thread started by another thread. More... | |
static void | kernel_thread_entry (void *_thread_id, void *arg1, void *arg2) |
static | K_THREAD_STACK_ARRAY_DEFINE (timeout_stacks, ARRAY_SIZE(timeouts),(384+CONFIG_TEST_EXTRA_STACKSIZE)) |
static void | busy_wait_thread (void *mseconds, void *arg2, void *arg3) |
static void | thread_sleep (void *delta, void *arg2, void *arg3) |
static void | delayed_thread (void *num, void *arg2, void *arg3) |
static void | test_busy_wait (void) |
Test timouts. More... | |
static void | test_k_sleep (void) |
Test timouts. More... | |
void | test_k_yield (void) |
Test the k_yield() routine. More... | |
void | test_kernel_thread (void) |
Test kernel thread creation. More... | |
void | test_main (void) |
Variables | |
static struct k_sem | sem_thread |
static struct k_timer | timer |
static struct k_sem | reply_timeout |
struct k_fifo | timeout_order_fifo |
static int | thread_evidence |
static struct k_thread | thread_data1 |
static struct k_thread | thread_data2 |
static struct k_thread | thread_data3 |
static ISR_INFO | isr_info |
struct timeout_order | timeouts [] |
static struct k_thread | timeout_threads [ARRAY_SIZE(timeouts)] |
#define EXEC_CTX_TYPE_CMD 1 |
#define HAS_POWERSAVE_INSTRUCTION |
#define NUM_TIMEOUT_THREADS ARRAY_SIZE(timeouts) |
#define THREAD_PRIORITY 4 |
#define THREAD_SELF_CMD 0 |
#define THREAD_STACKSIZE (512 + CONFIG_TEST_EXTRA_STACKSIZE) |
#define THREAD_STACKSIZE2 (384 + CONFIG_TEST_EXTRA_STACKSIZE) |
#define UNKNOWN_COMMAND -1 |
typedef int(* disable_int_func) (int) |
typedef void(* enable_int_func) (int) |
|
static |
|
static |
int irq_disable_wrapper | ( | int | irq | ) |
A wrapper for irq_disable()
void irq_enable_wrapper | ( | int | irq | ) |
A wrapper for irq_enable()
int irq_lock_wrapper | ( | int | unused | ) |
A wrapper for irq_lock()
void irq_unlock_wrapper | ( | int | imask | ) |
A wrapper for irq_unlock()
|
static |
Handler to perform various actions from within an ISR context.
This routine is the ISR handler for isr_handler_trigger(). It performs the command requested in <isr_info.command>.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Entry point to thread started by another thread.
This routine is the entry point to the thread started by the thread.
|
static |
Initialize kernel objects.
This routine initializes the kernel objects used in this module's tests.
|
static |
|
static |
Test timouts.
|
static |
Test timouts.
void test_k_yield | ( | void | ) |
Test the k_yield() routine.
Tests the k_yield() routine. It starts another thread (thus also testing k_thread_create()) and checks that behavior of k_yield() against the a higher priority thread, a lower priority thread, and another thread of equal priority.
|
static |
Test cpu idle function.
Test Objectve:
Testing techniques
Prerequisite Condition:
Input Specifications:
Test Procedure:
Expected Test Result:
Pass/Fail criteria:
Assumptions and Constraints
|
static |
Test cpu idle function.
Test the k_cpu_idle() routine.
Test Objectve:
Testing techniques
Prerequisite Condition:
Input Specifications:
Test Procedure:
Expected Test Result:
Pass/Fail criteria:
Assumptions and Constraints
This tests the k_cpu_idle() routine. The first thing it does is align to a tick boundary. The only source of interrupts while the test is running is expected to be the tick clock timer which should wake the CPU. Thus after each call to k_cpu_idle(), the tick count should be one higher.
|
static |
Test some context routines.
Test Objectve:
Testing techniques
Prerequisite Condition:
Input Specifications:
Test Procedure:
Expected Test Result:
Pass/Fail criteria:
Assumptions and Constraints
|
static |
Test routines for disabling and enabling interrupts.
Test Objective:
Testing techniques:
Prerequisite Conditions:
Input Specifications:
Test Procedure:
Expected Test Result:
Pass/Fail Criteria:
Assumptions and Constraints:
void test_kernel_thread | ( | void | ) |
Test kernel thread creation.
|
static |
Test routines for disabling and enabling interrupts (disable timer)
Test Objective:
Testing techniques:
Prerequisite Conditions:
Input Specifications:
Test Procedure:
Expected Test Result:
Pass/Fail Criteria:
Assumptions and Constraints:
void test_main | ( | void | ) |
|
static |
Entry point to the thread's helper.
This routine is the entry point to the thread's helper thread. It is used to help test the behavior of the k_yield() routine.
arg1 | unused |
arg2 | unused |
arg3 | unused |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
struct k_fifo timeout_order_fifo |
|
static |
struct timeout_order timeouts[] |
|
static |