BRISCITS  0.1
RISC "Real-Time" Scheduler
Data Structures | Functions | Variables
brisc_sched.h File Reference
#include <brisc_thread.h>

Go to the source code of this file.

Data Structures

struct  brisc_scheduler
 

Functions

struct brisc_scheduler __attribute__ ((aligned(8)))
 
volatile brisc_thread_t * b_thread_state (uint8_t id)
 
cpu_reg_t b_thread_schedule_next (void)
 determine which thread gets this time slice. More...
 

Variables

uint8_t thread_id
 
int8_t lock
 
int8_t prio
 
brisc_systick_t systick
 
void(* systick_fn )(void)
 
void(* yield_fn )(void)
 
brisc_thread_t threads [BRISC_THREAD_MAX]
 
volatile brisc_scheduler_t brisc_scheduler_state
 

Function Documentation

struct brisc_scheduler __attribute__ ( (aligned(8))  )
cpu_reg_t b_thread_schedule_next ( void  )

determine which thread gets this time slice.


Returns
the context (stack pointer) to the thread to allocate this time slice to.

Definition at line 41 of file brisc_sched.c.

volatile brisc_thread_t* b_thread_state ( uint8_t  id)

Returns
the thread context for a given thread descriptor

Definition at line 63 of file brisc_sched.c.

Variable Documentation

volatile brisc_scheduler_t brisc_scheduler_state

Definition at line 37 of file brisc_sched.c.

int8_t lock

Scheduler lock, prevents other threads from being scheduled

Definition at line 79 of file brisc_sched.h.

int8_t prio

Remaining prio remaining in current thread

Definition at line 80 of file brisc_sched.h.

brisc_systick_t systick

Systick counter, typical 1 millisecond

Definition at line 81 of file brisc_sched.h.

void(* systick_fn) (void)

Optional callback from systick ISR

Definition at line 82 of file brisc_sched.h.

uint8_t thread_id

Definition at line 78 of file brisc_sched.h.

brisc_thread_t threads[BRISC_THREAD_MAX]

Thread queue, threads which have a valid prio may be scheduled to run

Definition at line 87 of file brisc_sched.h.

void(* yield_fn) (void)

Optional callback from yield ISR

Definition at line 83 of file brisc_sched.h.