Subversion Repositories shark

Rev

Rev 29 | Blame | Compare with Previous | Last modification | View Log | RSS feed

/*
 * Project: S.Ha.R.K.
 *
 * Coordinators:
 *   Giorgio Buttazzo    <giorgio@sssup.it>
 *   Paolo Gai           <pj@gandalf.sssup.it>
 *
 * Authors     :
 *   Paolo Gai           <pj@gandalf.sssup.it>
 *   Massimiliano Giorgi <massy@gandalf.sssup.it>
 *   Luca Abeni          <luca@gandalf.sssup.it>
 *   (see the web pages for full authors list)
 *
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
 *
 * http://www.sssup.it
 * http://retis.sssup.it
 * http://shark.sssup.it
 */



/**
 ------------
 CVS :        $Id: var.h,v 1.2 2002-11-11 08:36:01 pj Exp $

 File:        $File$
 Revision:    $Revision: 1.2 $
 Last update: $Date: 2002-11-11 08:36:01 $
 ------------

Kernel global variables

**/


/*
 * Copyright (C) 2000 Paolo Gai
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */


#ifndef __KERNEL_VAR_H__
#define __KERNEL_VAR_H__

#include <ll/ll.h>
#include <sys/types.h>
#include <kernel/descr.h>

/*---------------------------------------------------------------------*/
/* Kernel global variables: system queues & clock counters ...         */
/*---------------------------------------------------------------------*/

extern proc_des      proc_table[];     /*+ Process descriptor table   +*/
extern level_des    *level_table[];    /*+ Level descriptor table     +*/
extern resource_des *resource_table[]; /*+ Resource descriptor table  +*/


extern PID exec;              /*+ task suggested by the scheduler     +*/
extern PID exec_shadow;       /*+ task really executed                +*/

extern IQUEUE freedesc;        /*+ Free descriptor handled as a queue  +*/

extern TIME  sys_tick;        /*+ System tick (in usec)               +*/
extern struct timespec schedule_time;
                              /*+ Time at witch the last scheduler()
                                  was called                          +*/


extern int   cap_timer;       /*+ the capacity event posted when the
                                  task starts                         +*/

extern struct timespec cap_lasttime;
                              /*+ the time at whitch the capacity
                                  event is posted. Normally, it is
                                  equal to schedule_time              +*/


extern DWORD sched_levels;    /*+ Schedule levels active in the system +*/
extern DWORD res_levels;      /*+ Resource levels active in the system +*/

extern int task_counter;      /*+ Application task counter. It represent
                                  the number of Application tasks in the
                                  system. When all Application Tasks end,
                                  also the system ends.                +*/


extern int system_counter;    /*+ System task counter. It represent
                                  the number of System tasks in the
                                  system with the NO_KILL flag reset.
                                  When all Application Tasks end,
                                  the system waits for the end of the
                                  system tasks and then it ends.       +*/



extern int mustexit;          /*+ This variable is set by the system
                                  call sys_end() or sys_abort().
                                  When a sys_end() or sys_abort is called
                                  into an event handler,
                                  we don't have to change context in the
                                  reschedule(). +*/


int calling_runlevel_func;    /*+ this variable is set to 1 into
                                  call_runlevel_func (look at init.c)
                                  ad it is used because the task_activate
                                  (look at activate.c) must work in a
                                  different way when the system is in the
                                  global_context +*/


#endif /* __VAR_H__ */