ISIX-RTOS - small operating system for ARM microcontrollers 1.2
Defines | Functions | Variables

scheduler.c File Reference

#include <isix/config.h>
#include <isix/printk.h>
#include <isix/types.h>
#include <prv/scheduler.h>
#include <isix/task.h>
#include <isix/memory.h>
#include <prv/list.h>
#include <prv/semaphore.h>
#include <prv/irqtimers.h>
#include <prv/multiple_objects.h>
Include dependency graph for scheduler.c:

Go to the source code of this file.

Defines

#define ISIX_DEBUG_SCHEDULER   ISIX_DBG_OFF
#define isix_printk(...)

Functions

void isix_bug (void)
 Halt system when critical error is found.
void isixp_enter_critical (void)
void isixp_exit_critical (void)
void isixp_schedule (void)
void isixp_schedule_time (void)
static task_ready_talloc_task_ready_t (void)
static void free_task_ready_t (task_ready_t *prio)
int isixp_add_task_to_ready_list (task_t *task)
void isixp_delete_task_from_ready_list (task_t *task)
void isixp_add_task_to_waiting_list (task_t *task, tick_t timeout)
void isixp_add_task_to_sem_list (list_entry_t *sem_list, task_t *task)
void isixp_add_task_to_delete_list (task_t *task)
static void cleanup_tasks (void)
 ISIX_TASK_FUNC (idle_task, p)
tick_t isix_get_jiffies (void)
void isix_init (prio_t num_priorities)
void isix_start_scheduler (void)
 Start the scheduler.
prio_t isix_get_min_priority (void)
bool isix_is_scheduler_active (void)

Variables

volatile bool isix_scheduler_running
task_t *volatile isix_current_task = NULL
static volatile unsigned short critical_count = 0
static list_entry_t ready_task
static list_entry_t wait_tasks [2]
static list_entry_tp_waiting_task
static list_entry_tpov_waiting_task
static list_entry_t dead_task
static list_entry_t free_prio_elem
static volatile tick_t jiffies
static volatile unsigned number_of_task_deleted
static volatile prio_t number_of_priorities

Define Documentation

#define ISIX_DEBUG_SCHEDULER   ISIX_DBG_OFF

Definition at line 13 of file scheduler.c.

#define isix_printk (   ...)

Function Documentation

static task_ready_t* alloc_task_ready_t ( void  ) [static]
static void cleanup_tasks ( void  ) [inline, static]
static void free_task_ready_t ( task_ready_t prio) [inline, static]

Definition at line 225 of file scheduler.c.

References task_ready_struct::inode, isix_printk, and list_insert_end().

Referenced by isixp_delete_task_from_ready_list().

void isix_bug ( void  )
tick_t isix_get_jiffies ( void  )

Get current sytem ticks

Returns:
Number of system tick from system startup

Definition at line 401 of file scheduler.c.

References jiffies.

Referenced by add_vtimer_to_list(), and isix_wait().

prio_t isix_get_min_priority ( void  )

Function return the minimal available priority

Returns:
Number of minimal available priority

Definition at line 461 of file scheduler.c.

References number_of_priorities.

Referenced by isix_task_create(), isixp_task_change_prio(), and isixp_wakeup_multiple_waiting_tasks().

void isix_init ( prio_t  num_priorities)
bool isix_is_scheduler_active ( void  )

Functtion return scheduling state

Returns:
True if scheduler is running

Definition at line 467 of file scheduler.c.

References isix_scheduler_running.

void isix_start_scheduler ( void  )

Start the scheduler.

Definition at line 449 of file scheduler.c.

References isix_scheduler_running, jiffies, and isix::port_start_first_task().

ISIX_TASK_FUNC ( idle_task  ,
 
)

Definition at line 384 of file scheduler.c.

References cleanup_tasks(), isix::isix_yield(), and isix::port_idle_cpu().

void isixp_add_task_to_delete_list ( task_t *  task)
int isixp_add_task_to_ready_list ( task_t *  task)
void isixp_add_task_to_sem_list ( list_entry_t sem_list,
task_t *  task 
)
void isixp_add_task_to_waiting_list ( task_t *  task,
tick_t  timeout 
)
void isixp_delete_task_from_ready_list ( task_t *  task)
void isixp_enter_critical ( void  )
void isixp_exit_critical ( void  )
void isixp_schedule ( void  )
void isixp_schedule_time ( void  )

Variable Documentation

volatile unsigned short critical_count = 0 [static]

Definition at line 27 of file scheduler.c.

Referenced by isixp_enter_critical(), and isixp_exit_critical().

Definition at line 43 of file scheduler.c.

Definition at line 47 of file scheduler.c.

task_t* volatile isix_current_task = NULL
volatile bool isix_scheduler_running
volatile tick_t jiffies [static]
volatile prio_t number_of_priorities [static]

Definition at line 58 of file scheduler.c.

Referenced by isix_get_min_priority(), isix_init(), and isixp_add_task_to_ready_list().

volatile unsigned number_of_task_deleted [static]

Definition at line 54 of file scheduler.c.

Referenced by cleanup_tasks(), and isixp_add_task_to_delete_list().

Definition at line 38 of file scheduler.c.

Referenced by isixp_schedule_time().

Definition at line 39 of file scheduler.c.

Referenced by isixp_schedule_time().

Definition at line 31 of file scheduler.c.

list_entry_t wait_tasks[2] [static]

Definition at line 35 of file scheduler.c.

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines