Subversion Repositories shark

Rev

Rev 38 | Rev 922 | 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
 ------------
79 pj 24
 CVS :        $Id: var.h,v 1.4 2003-03-13 13:36:28 pj Exp $
2 pj 25
 
26
 File:        $File$
79 pj 27
 Revision:    $Revision: 1.4 $
28
 Last update: $Date: 2003-03-13 13:36:28 $
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>
79 pj 60
#include "ll/sys/cdefs.h"
2 pj 61
 
79 pj 62
__BEGIN_DECLS
63
 
2 pj 64
/*---------------------------------------------------------------------*/
65
/* Kernel global variables: system queues & clock counters ...         */
66
/*---------------------------------------------------------------------*/
67
 
68
extern proc_des      proc_table[];     /*+ Process descriptor table   +*/
38 pj 69
 
2 pj 70
extern level_des    *level_table[];    /*+ Level descriptor table     +*/
38 pj 71
/* for a description of the following fields, look in kernel/kern.c */
72
extern size_t level_size[];
73
extern int level_used[];
74
extern int level_first;
75
extern int level_last;
76
extern int level_free;
77
extern int level_next[];
78
extern int level_prev[];
79
 
2 pj 80
extern resource_des *resource_table[]; /*+ Resource descriptor table  +*/
81
 
82
 
83
extern PID exec;              /*+ task suggested by the scheduler     +*/
84
extern PID exec_shadow;       /*+ task really executed                +*/
85
 
29 pj 86
extern IQUEUE freedesc;        /*+ Free descriptor handled as a queue  +*/
2 pj 87
 
88
extern TIME  sys_tick;        /*+ System tick (in usec)               +*/
89
extern struct timespec schedule_time;
90
                              /*+ Time at witch the last scheduler()
91
                                  was called                          +*/
92
 
93
extern int   cap_timer;       /*+ the capacity event posted when the
94
                                  task starts                         +*/
95
extern struct timespec cap_lasttime;
96
                              /*+ the time at whitch the capacity
97
                                  event is posted. Normally, it is
98
                                  equal to schedule_time              +*/
99
 
100
extern DWORD res_levels;      /*+ Resource levels active in the system +*/
101
 
102
extern int task_counter;      /*+ Application task counter. It represent
103
                                  the number of Application tasks in the
104
                                  system. When all Application Tasks end,
105
                                  also the system ends.                +*/
106
 
107
extern int system_counter;    /*+ System task counter. It represent
108
                                  the number of System tasks in the
109
                                  system with the NO_KILL flag reset.
110
                                  When all Application Tasks end,
111
                                  the system waits for the end of the
112
                                  system tasks and then it ends.       +*/
113
 
114
 
115
extern int mustexit;          /*+ This variable is set by the system
116
                                  call sys_end() or sys_abort().
117
                                  When a sys_end() or sys_abort is called
118
                                  into an event handler,
119
                                  we don't have to change context in the
120
                                  reschedule(). +*/
121
 
122
int calling_runlevel_func;    /*+ this variable is set to 1 into
123
                                  call_runlevel_func (look at init.c)
124
                                  ad it is used because the task_activate
125
                                  (look at activate.c) must work in a
126
                                  different way when the system is in the
127
                                  global_context +*/
128
 
79 pj 129
__END_DECLS
2 pj 130
#endif /* __VAR_H__ */