tm.h
Go to the documentation of this file.
1
6/*
7 * The contents of this file are subject to the Mozilla Public License
8 * Version 1.0 (the "License"); you may not use this file except in
9 * compliance with the License. You may obtain a copy of the License
10 * at http://www.mozilla.org/MPL/
11 *
12 * Software distributed under the License is distributed on an "AS IS"
13 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 * the License for the specific language governing rights and
15 * limitations under the License.
16 *
17 * The Original Code is legOS code, released October 17, 1999.
18 *
19 * The Initial Developer of the Original Code is Markus L. Noga.
20 * Portions created by Markus L. Noga are Copyright (C) 1999
21 * Markus L. Noga. All Rights Reserved.
22 *
23 * Contributor(s): Markus L. Noga <markus@noga.de>
24 */
25
26#ifndef __sys_tm_h__
27#define __sys_tm_h__
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#include <config.h>
34
35#ifdef CONF_TM
36
37#include "../tm.h"
38
40//
41// Definitions
42//
44
45
46#define SP_RETURN_OFFSET 10
47
48#define IDLE_STACK_SIZE 128
49
51//
52// Variables
53//
55
56extern tdata_t td_single;
57
58extern tdata_t *ctid;
59
60extern volatile unsigned int nb_tasks;
61
62 // nb_system_tasks is maintained in execi and kill/killall
63 // T_KERNEL tasks are counted as they are started
64extern volatile unsigned int nb_system_tasks;
65
66 // tm_timeslice is from kernel/systime.c
67extern volatile unsigned char tm_timeslice;
68
69
71//
72// Functions
73//
75
77/* called in single tasking mode before task setup.
78*/
79extern void tm_init(void);
80
81
83
85extern void tm_start(void);
86
87
89
91extern void tm_switcher(void);
92
93
95
100extern size_t *tm_scheduler(size_t *old_sp);
101
102
104
106extern int tm_idle_task(int,char**);
107
108#endif // CONF_TM
109
110#ifdef __cplusplus
111}
112#endif
113
114#endif // __sys_tm_h__
115
kernel configuration file
task data structure
Definition tm.h:105
void tm_switcher(void)
the task switcher IRQ handler
volatile unsigned char tm_timeslice
task time slice
Definition systime.c:72
void tm_init(void)
init task management
volatile unsigned int nb_tasks
number of tasks
tdata_t td_single
single process process data
volatile unsigned int nb_system_tasks
void tm_start(void)
start task management
int tm_idle_task(int, char **)
the idle task
size_t * tm_scheduler(size_t *old_sp)
the process scheduler
tdata_t * ctid
ptr to current process data

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

Generated for brickOS Kernel Developer by doxygen 1.9.8