Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
arm_thread_arch.c File Reference
#include <zephyr/ztest.h>
#include <zephyr/arch/cpu.h>
#include <cmsis_core.h>
#include <zephyr/kernel_structs.h>
#include <zephyr/sys/barrier.h>
#include <offsets_short_arch.h>
#include <ksched.h>

Macros

#define PRIORITY   0
 
#define BASEPRI_MODIFIED_1   0x20
 
#define BASEPRI_MODIFIED_2   0x40
 
#define SWAP_RETVAL   0x1234
 
#define EXC_RETURN_FTYPE   (0x00000010UL)
 
#define FPSCR_MASK   (0xffffffffU)
 
#define ALT_THREAD_OPTIONS   K_FP_REGS
 

Functions

static K_THREAD_STACK_DEFINE (alt_thread_stack, 1024)
 
static void load_callee_saved_regs (const _callee_saved_t *regs)
 
static void verify_callee_saved (const _callee_saved_t *src, const _callee_saved_t *dst)
 
static void load_fp_callee_saved_regs (const volatile struct _preempt_float *regs)
 
static void verify_fp_callee_saved (const struct _preempt_float *src, const struct _preempt_float *dst)
 
static void alt_thread_entry (void *p1, void *p2, void *p3)
 
static int __noinline arch_swap_wrapper (void)
 
void test_arm_thread_swap (void)
 Test the ARM thread swap mechanism.
 

Variables

static struct k_thread alt_thread
 
bool volatile switch_flag
 
struct k_threadp_ztest_thread
 
_callee_saved_t ztest_thread_callee_saved_regs_container
 
int ztest_swap_return_val
 
const _callee_saved_t ztest_thread_callee_saved_regs_init
 
struct _preempt_float ztest_thread_fp_callee_saved_regs
 

Macro Definition Documentation

◆ ALT_THREAD_OPTIONS

#define ALT_THREAD_OPTIONS   K_FP_REGS

◆ BASEPRI_MODIFIED_1

#define BASEPRI_MODIFIED_1   0x20

◆ BASEPRI_MODIFIED_2

#define BASEPRI_MODIFIED_2   0x40

◆ EXC_RETURN_FTYPE

#define EXC_RETURN_FTYPE   (0x00000010UL)

◆ FPSCR_MASK

#define FPSCR_MASK   (0xffffffffU)

◆ PRIORITY

#define PRIORITY   0

◆ SWAP_RETVAL

#define SWAP_RETVAL   0x1234

Function Documentation

◆ alt_thread_entry()

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

◆ arch_swap_wrapper()

static int __noinline arch_swap_wrapper ( void )
static

◆ K_THREAD_STACK_DEFINE()

static K_THREAD_STACK_DEFINE ( alt_thread_stack ,
1024  )
static

◆ load_callee_saved_regs()

static void load_callee_saved_regs ( const _callee_saved_t * regs)
static

◆ load_fp_callee_saved_regs()

static void load_fp_callee_saved_regs ( const volatile struct _preempt_float * regs)
static

◆ verify_callee_saved()

static void verify_callee_saved ( const _callee_saved_t * src,
const _callee_saved_t * dst )
static

◆ verify_fp_callee_saved()

static void verify_fp_callee_saved ( const struct _preempt_float * src,
const struct _preempt_float * dst )
static

Variable Documentation

◆ alt_thread

struct k_thread alt_thread
static

◆ p_ztest_thread

struct k_thread* p_ztest_thread

◆ switch_flag

bool volatile switch_flag

◆ ztest_swap_return_val

int ztest_swap_return_val

◆ ztest_thread_callee_saved_regs_container

_callee_saved_t ztest_thread_callee_saved_regs_container

◆ ztest_thread_callee_saved_regs_init

const _callee_saved_t ztest_thread_callee_saved_regs_init
Initial value:
= {.v1 = 0x12345678,
.v2 = 0x23456789,
.v3 = 0x3456789a,
.v4 = 0x456789ab,
.v5 = 0x56789abc,
.v6 = 0x6789abcd,
.v7 = 0x789abcde,
.v8 = 0x89abcdef}

◆ ztest_thread_fp_callee_saved_regs

struct _preempt_float ztest_thread_fp_callee_saved_regs
Initial value:
= {
.s16 = 0x11111111,
.s17 = 0x22222222,
.s18 = 0x33333333,
.s19 = 0x44444444,
.s20 = 0x55555555,
.s21 = 0x66666666,
.s22 = 0x77777777,
.s23 = 0x88888888,
.s24 = 0x99999999,
.s25 = 0xaaaaaaaa,
.s26 = 0xbbbbbbbb,
.s27 = 0xcccccccc,
.s28 = 0xdddddddd,
.s29 = 0xeeeeeeee,
.s30 = 0xffffffff,
.s31 = 0x00000000,
}