tm.h File Reference

Interface: task management. More...

#include <config.h>
#include <mem.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 PRIO_LOWEST   1
 The lowest possible task priority. More...
 
#define PRIO_NORMAL   10
 The priority of most tasks. More...
 
#define PRIO_HIGHEST   20
 The highest possible task priority. More...
 
#define T_DEAD   0
 task states More...
 
#define T_ZOMBIE   1
 terminated, cleanup pending More...
 
#define T_WAITING   2
 waiting for an event More...
 
#define T_SLEEPING   3
 sleeping. wants to run. More...
 
#define T_RUNNING   4
 running More...
 
#define T_KERNEL   (1 << 0)
 task flags More...
 
#define T_USER   (1 << 1)
 user task More...
 
#define T_IDLE   (1 << 2)
 idle task More...
 
#define T_SHUTDOWN   (1 << 7)
 shutdown requested More...
 
#define DEFAULT_STACK_SIZE   512
 that's enough. More...
 
#define shutdown_requested()   ((ctid->tflags & T_SHUTDOWN) != 0)
 test to see if task has been asked to shutdown More...
 

Typedefs

typedef volatile unsigned char tstate_t
 task state type More...
 
typedef volatile unsigned char tflags_t
 task flags type More...
 
typedef unsigned char priority_t
 task priority type More...
 
typedef unsigned long wakeup_t
 wakeup data area type More...
 
typedef signed int tid_t
 task id type More...
 

Variables

tdata_t * ctid
 

Detailed Description

Interface: task management.

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

Defines types and flags used in task management.

Definition in file tm.h.

Macro Definition Documentation

◆ DEFAULT_STACK_SIZE

#define DEFAULT_STACK_SIZE   512

that's enough.

Definition at line 81 of file tm.h.

◆ PRIO_HIGHEST

#define PRIO_HIGHEST   20

The highest possible task priority.

Definition at line 55 of file tm.h.

◆ PRIO_LOWEST

#define PRIO_LOWEST   1

The lowest possible task priority.

Definition at line 51 of file tm.h.

◆ PRIO_NORMAL

#define PRIO_NORMAL   10

The priority of most tasks.

Definition at line 53 of file tm.h.

◆ shutdown_requested

#define shutdown_requested ( )    ((ctid->tflags & T_SHUTDOWN) != 0)

test to see if task has been asked to shutdown

Check task shutdown flag. If set, the task should shutdown as soon as possible. If clear, continue running.

Definition at line 134 of file tm.h.

◆ T_DEAD

#define T_DEAD   0

task states

Todo:
the following comments on the defined may cause problems in when used in macros/expressions, etc. FixEm?

dead and gone, stack freed

Definition at line 65 of file tm.h.

◆ T_IDLE

#define T_IDLE   (1 << 2)

idle task

Definition at line 77 of file tm.h.

◆ T_KERNEL

#define T_KERNEL   (1 << 0)

task flags

kernel task

Definition at line 75 of file tm.h.

◆ T_RUNNING

#define T_RUNNING   4

running

Definition at line 69 of file tm.h.

◆ T_SHUTDOWN

#define T_SHUTDOWN   (1 << 7)

shutdown requested

Definition at line 78 of file tm.h.

◆ T_SLEEPING

#define T_SLEEPING   3

sleeping. wants to run.

Definition at line 68 of file tm.h.

◆ T_USER

#define T_USER   (1 << 1)

user task

Definition at line 76 of file tm.h.

◆ T_WAITING

#define T_WAITING   2

waiting for an event

Definition at line 67 of file tm.h.

◆ T_ZOMBIE

#define T_ZOMBIE   1

terminated, cleanup pending

Definition at line 66 of file tm.h.

Typedef Documentation

◆ priority_t

typedef unsigned char priority_t

task priority type

Definition at line 48 of file tm.h.

◆ tflags_t

typedef volatile unsigned char tflags_t

task flags type

Definition at line 46 of file tm.h.

◆ tid_t

typedef signed int tid_t

task id type

In effect, the kernel simply typecasts *tdata_t to tid_t.

Definition at line 143 of file tm.h.

◆ tstate_t

typedef volatile unsigned char tstate_t

task state type

Definition at line 45 of file tm.h.

◆ wakeup_t

typedef unsigned long wakeup_t

wakeup data area type

Definition at line 57 of file tm.h.

Variable Documentation

◆ ctid

tdata_t* ctid
extern

brickOS is released under the Mozilla Public License.
Original code copyright 1998-2005 by the authors.

Generated for brickOS C by doxygen 1.9.4