Rev 29 | Rev 79 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | pj | 1 | /* |
2 | * Project: S.Ha.R.K. |
||
3 | * |
||
4 | * Coordinators: |
||
5 | * Giorgio Buttazzo <giorgio@sssup.it> |
||
6 | * Paolo Gai <pj@gandalf.sssup.it> |
||
7 | * |
||
8 | * Authors : |
||
9 | * Paolo Gai <pj@gandalf.sssup.it> |
||
10 | * Massimiliano Giorgi <massy@gandalf.sssup.it> |
||
11 | * Luca Abeni <luca@gandalf.sssup.it> |
||
12 | * (see the web pages for full authors list) |
||
13 | * |
||
14 | * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
||
15 | * |
||
16 | * http://www.sssup.it |
||
17 | * http://retis.sssup.it |
||
18 | * http://shark.sssup.it |
||
19 | */ |
||
20 | |||
21 | |||
22 | /** |
||
23 | ------------ |
||
38 | pj | 24 | CVS : $Id: var.h,v 1.3 2003-01-07 17:12:19 pj Exp $ |
2 | pj | 25 | |
26 | File: $File$ |
||
38 | pj | 27 | Revision: $Revision: 1.3 $ |
28 | Last update: $Date: 2003-01-07 17:12:19 $ |
||
2 | pj | 29 | ------------ |
30 | |||
31 | Kernel global variables |
||
32 | |||
33 | **/ |
||
34 | |||
35 | /* |
||
36 | * Copyright (C) 2000 Paolo Gai |
||
37 | * |
||
38 | * This program is free software; you can redistribute it and/or modify |
||
39 | * it under the terms of the GNU General Public License as published by |
||
40 | * the Free Software Foundation; either version 2 of the License, or |
||
41 | * (at your option) any later version. |
||
42 | * |
||
43 | * This program is distributed in the hope that it will be useful, |
||
44 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
45 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
46 | * GNU General Public License for more details. |
||
47 | * |
||
48 | * You should have received a copy of the GNU General Public License |
||
49 | * along with this program; if not, write to the Free Software |
||
50 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
51 | * |
||
52 | */ |
||
53 | |||
54 | #ifndef __KERNEL_VAR_H__ |
||
55 | #define __KERNEL_VAR_H__ |
||
56 | |||
57 | #include <ll/ll.h> |
||
58 | #include <sys/types.h> |
||
59 | #include <kernel/descr.h> |
||
60 | |||
61 | /*---------------------------------------------------------------------*/ |
||
62 | /* Kernel global variables: system queues & clock counters ... */ |
||
63 | /*---------------------------------------------------------------------*/ |
||
64 | |||
65 | extern proc_des proc_table[]; /*+ Process descriptor table +*/ |
||
38 | pj | 66 | |
2 | pj | 67 | extern level_des *level_table[]; /*+ Level descriptor table +*/ |
38 | pj | 68 | /* for a description of the following fields, look in kernel/kern.c */ |
69 | extern size_t level_size[]; |
||
70 | extern int level_used[]; |
||
71 | extern int level_first; |
||
72 | extern int level_last; |
||
73 | extern int level_free; |
||
74 | extern int level_next[]; |
||
75 | extern int level_prev[]; |
||
76 | |||
2 | pj | 77 | extern resource_des *resource_table[]; /*+ Resource descriptor table +*/ |
78 | |||
79 | |||
80 | extern PID exec; /*+ task suggested by the scheduler +*/ |
||
81 | extern PID exec_shadow; /*+ task really executed +*/ |
||
82 | |||
29 | pj | 83 | extern IQUEUE freedesc; /*+ Free descriptor handled as a queue +*/ |
2 | pj | 84 | |
85 | extern TIME sys_tick; /*+ System tick (in usec) +*/ |
||
86 | extern struct timespec schedule_time; |
||
87 | /*+ Time at witch the last scheduler() |
||
88 | was called +*/ |
||
89 | |||
90 | extern int cap_timer; /*+ the capacity event posted when the |
||
91 | task starts +*/ |
||
92 | extern struct timespec cap_lasttime; |
||
93 | /*+ the time at whitch the capacity |
||
94 | event is posted. Normally, it is |
||
95 | equal to schedule_time +*/ |
||
96 | |||
97 | extern DWORD res_levels; /*+ Resource levels active in the system +*/ |
||
98 | |||
99 | extern int task_counter; /*+ Application task counter. It represent |
||
100 | the number of Application tasks in the |
||
101 | system. When all Application Tasks end, |
||
102 | also the system ends. +*/ |
||
103 | |||
104 | extern int system_counter; /*+ System task counter. It represent |
||
105 | the number of System tasks in the |
||
106 | system with the NO_KILL flag reset. |
||
107 | When all Application Tasks end, |
||
108 | the system waits for the end of the |
||
109 | system tasks and then it ends. +*/ |
||
110 | |||
111 | |||
112 | extern int mustexit; /*+ This variable is set by the system |
||
113 | call sys_end() or sys_abort(). |
||
114 | When a sys_end() or sys_abort is called |
||
115 | into an event handler, |
||
116 | we don't have to change context in the |
||
117 | reschedule(). +*/ |
||
118 | |||
119 | int calling_runlevel_func; /*+ this variable is set to 1 into |
||
120 | call_runlevel_func (look at init.c) |
||
121 | ad it is used because the task_activate |
||
122 | (look at activate.c) must work in a |
||
123 | different way when the system is in the |
||
124 | global_context +*/ |
||
125 | |||
126 | #endif /* __VAR_H__ */ |