brickOS Kernel Developer v0.9.0
tm.h File Reference

Internal Interface: task management. More...

#include <config.h>
#include "../tm.h"
Include dependency graph for tm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SP_RETURN_OFFSET   10
 return address offset on stack in words.
 
#define IDLE_STACK_SIZE   128
 should suffice for IRQ service
 

Functions

void tm_init (void)
 init task management
 
void tm_start (void)
 start task management
 
void tm_switcher (void)
 the task switcher IRQ handler
 
size_ttm_scheduler (size_t *old_sp)
 the process scheduler
 
int tm_idle_task (int, char **)
 the idle task
 

Variables

tdata_t td_single
 single process process data
 
tdata_tctid
 ptr to current process data
 
volatile unsigned int nb_tasks
 number of tasks
 
volatile unsigned int nb_system_tasks
 
volatile unsigned char tm_timeslice
 task time slice
 

Detailed Description

Internal Interface: task management.

Author
Markus L. Noga marku.nosp@m.s@no.nosp@m.ga.de

Definition in file tm.h.

Macro Definition Documentation

◆ IDLE_STACK_SIZE

#define IDLE_STACK_SIZE   128

should suffice for IRQ service

Definition at line 48 of file tm.h.

◆ SP_RETURN_OFFSET

#define SP_RETURN_OFFSET   10

return address offset on stack in words.

Definition at line 46 of file tm.h.

Function Documentation

◆ tm_idle_task()

int tm_idle_task ( int  ,
char **   
)
extern

the idle task

infinite sleep instruction to conserve power

◆ tm_init()

void tm_init ( void  )
extern

init task management

◆ tm_scheduler()

size_t * tm_scheduler ( size_t old_sp)
extern

the process scheduler

Parameters
old_spcurrent task's current stack pointer
Returns
new task's current stack pointer

actual context switches performed by tm_switcher (assembler wrapper)

◆ tm_start()

void tm_start ( void  )
extern

start task management

called in single tasking mode after task setup

◆ tm_switcher()

void tm_switcher ( void  )
extern

the task switcher IRQ handler

located in the assembler process module

Variable Documentation

◆ ctid

tdata_t* ctid
extern

ptr to current process data

◆ nb_system_tasks

volatile unsigned int nb_system_tasks
extern

◆ nb_tasks

volatile unsigned int nb_tasks
extern

number of tasks

◆ td_single

tdata_t td_single
extern

single process process data

◆ tm_timeslice

volatile unsigned char tm_timeslice
extern

task time slice

Definition at line 72 of file systime.c.

Referenced by systime_init(), and systime_set_timeslice().