FreeRTOS port on GAP8/RISC-V
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
event_kernel.c File Reference

Data Structures

struct  pmsis_event_scheduler_t
 
struct  pmsis_event_kernel
 

Macros

#define DBG_PRINTF(...)
 

Functions

static int pmsis_event_lock_cl_to_fc (struct pmsis_event_kernel *evt_kernel)
 
static void pmsis_event_unlock_cl_to_fc (struct pmsis_event_kernel *evt_kernel, int irq_prev)
 
static struct pmsis_event_kernelpmsis_event_wrap_get_kernel (struct pmsis_event_kernel_wrap *wrap)
 
void pmsis_event_lock_cl_to_fc_init (struct pmsis_event_kernel_wrap *wrap)
 
static void pmsis_event_wrap_set_kernel (struct pmsis_event_kernel_wrap *wrap, struct pmsis_event_kernel *event_kernel)
 
static struct
pmsis_event_scheduler * 
pmsis_event_wrap_get_scheduler (struct pmsis_event_kernel_wrap *wrap)
 
static void pmsis_event_wrap_set_scheduler (struct pmsis_event_kernel_wrap *wrap, struct pmsis_event_scheduler *sched)
 
void pmsis_event_kernel_mutex_release (struct pmsis_event_kernel_wrap *wrap)
 
static void pmsis_event_release (struct pi_task *event)
 
static void pmsis_event_pop (struct pmsis_event_kernel *event_kernel, struct pi_task **event)
 
int pmsis_event_push (struct pmsis_event_kernel_wrap *wrap, pi_task_t *event)
 
int pmsis_event_kernel_init (struct pmsis_event_kernel_wrap **wrap, void(*event_kernel_entry)(void *))
 
static void pmsis_event_kernel_exec_event (struct pmsis_event_kernel *kernel, struct pi_task *event)
 
void pmsis_event_kernel_main (void *arg)
 
void pmsis_event_kernel_destroy (struct pmsis_event_kernel_wrap **wrap)
 
struct pmsis_event_kernel_wrap * pmsis_event_get_default_scheduler (void)
 
void pmsis_event_set_default_scheduler (struct pmsis_event_kernel_wrap *wrap)
 
void pmsis_event_destroy_default_scheduler (struct pmsis_event_kernel_wrap *wrap)
 

Variables

PI_FC_L1 struct
pmsis_event_kernel_wrap * 
default_sched
 
static char g_event_kernel_name_s []
 

Macro Definition Documentation

Function Documentation

void pmsis_event_destroy_default_scheduler ( struct pmsis_event_kernel_wrap *  wrap)
struct pmsis_event_kernel_wrap* pmsis_event_get_default_scheduler ( void  )
static void pmsis_event_kernel_exec_event ( struct pmsis_event_kernel kernel,
struct pi_task *  event 
)
static
int pmsis_event_kernel_init ( struct pmsis_event_kernel_wrap **  wrap,
void(*)(void *)  event_kernel_entry 
)

Prepare the event kernel structure and task In particular, create inner private structure And setup synchronization mutexes

References g_event_kernel_name_s, pi_malloc(), pmsis_event_wrap_set_scheduler(), pmsis_task_create(), PMSIS_TASK_EVENT_KERNEL_PRIORITY, and printf.

Referenced by __os_native_kickoff(), and pi_cluster_open().

void pmsis_event_kernel_mutex_release ( struct pmsis_event_kernel_wrap *  wrap)
static int pmsis_event_lock_cl_to_fc ( struct pmsis_event_kernel evt_kernel)
inlinestatic

References disable_irq().

void pmsis_event_lock_cl_to_fc_init ( struct pmsis_event_kernel_wrap *  wrap)
static void pmsis_event_pop ( struct pmsis_event_kernel event_kernel,
struct pi_task **  event 
)
inlinestatic

pop an event from the event FIFO, returns NULL if none available MAY SLEEP

References DBG_PRINTF, pmsis_event_kernel::event_sched_sem, pi_sem_take(), and pmsis_event_kernel::scheduler.

Referenced by pmsis_event_kernel_main().

static void pmsis_event_release ( struct pi_task *  event)
inlinestatic

Release an active event from the FIFO list and push it on the free list if allocated_event_nb > max_event_nb the event will be freed instead

Get an event from the scheduler free list Returns NULL if none available

References DBG_PRINTF, disable_irq(), pi_task_release(), and restore_irq().

Referenced by pmsis_event_kernel_exec_event().

void pmsis_event_set_default_scheduler ( struct pmsis_event_kernel_wrap *  wrap)

References DBG_PRINTF, and default_sched.

Referenced by __os_native_kickoff().

static void pmsis_event_unlock_cl_to_fc ( struct pmsis_event_kernel evt_kernel,
int  irq_prev 
)
inlinestatic

References restore_irq().

static struct pmsis_event_scheduler* pmsis_event_wrap_get_scheduler ( struct pmsis_event_kernel_wrap *  wrap)
static
static void pmsis_event_wrap_set_kernel ( struct pmsis_event_kernel_wrap *  wrap,
struct pmsis_event_kernel event_kernel 
)
inlinestatic
static void pmsis_event_wrap_set_scheduler ( struct pmsis_event_kernel_wrap *  wrap,
struct pmsis_event_scheduler *  sched 
)
inlinestatic

Variable Documentation

char g_event_kernel_name_s[]
static

Referenced by pmsis_event_kernel_init().