Zephyr Project API  3.3.0
A Scalable Open Source RTOS
main.c File Reference
#include <zephyr/tc_util.h>
#include <zephyr/ztest.h>
#include <zephyr/kernel.h>
#include <zephyr/spinlock.h>

Macros

#define CPU1_STACK_SIZE   1024
 

Functions

 K_THREAD_STACK_DEFINE (cpu1_stack, 1024)
 
 ZTEST (spinlock, test_spinlock_basic)
 Test basic spinlock. More...
 
void bounce_once (int id)
 
void cpu1_fn (void *p1, void *p2, void *p3)
 
 ZTEST (spinlock, test_spinlock_bounce)
 Test spinlock with bounce. More...
 
 ZTEST (spinlock, test_spinlock_mutual_exclusion)
 Test basic mutual exclusion using interrupt masking. More...
 
 ZTEST_SUITE (spinlock, NULL, NULL, NULL, NULL, NULL)
 

Variables

struct k_thread cpu1_thread
 
static struct k_spinlock bounce_lock
 
volatile int bounce_owner
 
volatile int bounce_done
 

Macro Definition Documentation

◆ CPU1_STACK_SIZE

#define CPU1_STACK_SIZE   1024

Function Documentation

◆ bounce_once()

void bounce_once ( int  id)

◆ cpu1_fn()

void cpu1_fn ( void *  p1,
void *  p2,
void *  p3 
)

◆ K_THREAD_STACK_DEFINE()

K_THREAD_STACK_DEFINE ( cpu1_stack  ,
1024   
)

◆ ZTEST_SUITE()

ZTEST_SUITE ( spinlock  ,
NULL  ,
NULL  ,
NULL  ,
NULL  ,
NULL   
)

Variable Documentation

◆ bounce_done

volatile int bounce_done

◆ bounce_lock

struct k_spinlock bounce_lock
static

◆ bounce_owner

volatile int bounce_owner

◆ cpu1_thread

struct k_thread cpu1_thread