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
30 extern "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 
50 //
52 // Variables
53 //
55 
56 extern tdata_t td_single;
57 
58 extern tdata_t *ctid;
59 
60 extern 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
64 extern volatile unsigned int nb_system_tasks;
65 
66  // tm_timeslice is from kernel/systime.c
67 extern volatile unsigned char tm_timeslice;
68 
69 
71 //
72 // Functions
73 //
75 
77 /* called in single tasking mode before task setup.
78 */
79 extern void tm_init(void);
80 
81 
83 
85 extern void tm_start(void);
86 
87 
89 
91 extern void tm_switcher(void);
92 
93 
95 
100 extern size_t *tm_scheduler(size_t *old_sp);
101 
102 
104 
106 extern 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 
size_t * tm_scheduler(size_t *old_sp)
the process scheduler
volatile unsigned int nb_tasks
number of tasks
kernel configuration file
volatile unsigned int nb_system_tasks
tdata_t * ctid
ptr to current process data
tdata_t td_single
single process process data
int tm_idle_task(int, char **)
the idle task
volatile unsigned char tm_timeslice
task time slice
Definition: systime.c:72
void tm_init(void)
init task management
task data structure
Definition: tm.h:105
void tm_switcher(void)
the task switcher IRQ handler
void tm_start(void)
start task management

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

Generated on Sun Jun 29 2014 23:26:59 for brickOS Kernel Developer by doxygen 1.8.7