Subversion Repositories shark

Rev

Rev 567 | 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: HARTIK (HA-rd R-eal TI-me K-ernel)
3
 *
4
 * Coordinators: Giorgio Buttazzo <giorgio@sssup.it>
5
 *               Gerardo Lamastra <gerardo@sssup.it>
6
 *
7
 * Authors     : Paolo Gai <pj@hartik.sssup.it>
8
 * (see authors.txt for full list of hartik's authors)
9
 *
10
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
11
 *
12
 * http://www.sssup.it
13
 * http://retis.sssup.it
14
 * http://hartik.sssup.it
15
 */
16
 
17
/**
18
 ------------
571 giacomo 19
 CVS :        $Id: const.h,v 1.6 2004-04-19 15:25:38 giacomo Exp $
2 pj 20
 
21
 File:        $File$
571 giacomo 22
 Revision:    $Revision: 1.6 $
23
 Last update: $Date: 2004-04-19 15:25:38 $
2 pj 24
 ------------
25
 
26
 System constants:
27
 
28
   - Customizable constants
29
 
30
   - Non-Customizable constants
31
 
32
 IMPORTANT!!!
33
 This file is used also at assembly level,to have unique
34
 defintion and avoid mess!
35
 
36
**/
37
 
38
/*
39
 * Copyright (C) 2000 Paolo Gai
40
 *
41
 * This program is free software; you can redistribute it and/or modify
42
 * it under the terms of the GNU General Public License as published by
43
 * the Free Software Foundation; either version 2 of the License, or
44
 * (at your option) any later version.
45
 *
46
 * This program is distributed in the hope that it will be useful,
47
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
48
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
49
 * GNU General Public License for more details.
50
 *
51
 * You should have received a copy of the GNU General Public License
52
 * along with this program; if not, write to the Free Software
53
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
54
 *
55
 */
56
 
57
#ifndef __KERNEL_CONST_H__
58
#define __KERNEL_CONST_H__
59
 
60
#include <ll/i386/tss-ctx.h>
61
 
62
/* -------------------------------------------------------------------- */
63
/* These constant can be freely changed to customize the kernel         */
64
/* -------------------------------------------------------------------- */
65
 
66
/* Tasks, functions, interrupts, exceptions */
67
#define MAX_PROC          TSSMax-1      /*+ Maximum number of tasks
68
                                            Change the value in
69
                                            ll/i386/tss-ctx.h!!!
70
                                            -1 because there is the
71
                                            global context!!!            +*/
72
#define MAX_RUNLEVEL_FUNC 40            /*+ Runlevel functions +*/
73
#define STACK_SIZE      4096U           /*+ Stack size in bytes          +*/
74
#define JET_TABLE_DIM     20U           /*+ Max n. of Jet entries        +*/
75
#define MAX_CANCPOINTS    20U           /*+ maximum number of cancellation
76
                                            points (look at kill.c) +*/
77
#define MAX_SIGINTPOINTS  20U           /*+ maximum number of signal
78
                                            interruptable points         +*/
79
 
80
/* Levels and modules */
419 giacomo 81
#define MAX_SCHED_LEVEL   30U           /*+ Max Schedule levels          +*/
2 pj 82
#define MAX_RES_LEVEL     8U            /*+ Max Resource levels          +*/
83
#define MAX_LEVELNAME     20U           /*+ Level Name Max Lenght        +*/
84
#define MAX_MODULENAME    20U           /*+ Resource Module Name Max L.  +*/
85
#define MAX_TASKNAME      20U           /*+ Task Name Max Length         +*/
86
 
87
/* Resource and communication */
88
#define MAX_CPRINT_BUF 512U           /*+ Length of cprintf() buffer   +*/
89
 
90
 
91
/* -------------------------------------------------------------------- */
92
/* End of user customazable constants                                   */
93
/* -------------------------------------------------------------------- */
94
 
95
 
96
/*+ this is the bandwidth used in the on-line guarantee algorithm
97
    the value means x/MAX_BANDWIDTH free bandwidth... +*/
98
#define MAX_BANDWIDTH MAX_DWORD
99
 
100
 
101
 
102
/*+ STATUS attributes are divided in 2 sets:
103
    - kernel status set (FREE, EXE, SLEEP, IDLE)
104
    - scheduling modules status set (the remainings status! READY...)
105
      the values are in the range [MODULE_STATUS_BASE, APER_STATUS_BASE-1]
106
    - aperiodic servers status set
107
      the minimum value is APER_STATUS_BASE
108
      The statuses must be separated because an aperiodic server may,
109
      for example put an event that checks a task state;
110
+*/
111
 
112
#define FREE            0
113
#define EXE             1
114
#define SLEEP           2
115
#define WAIT_JOIN       3
116
#define WAIT_COND       4
117
#define WAIT_SIG        5
118
#define WAIT_SEM        6
119
#define WAIT_NANOSLEEP  7
120
#define WAIT_SIGSUSPEND 8
121
#define WAIT_MQSEND     9
122
#define WAIT_MQRECEIVE 10
123
 
124
/*+ base status for scheduling levels +*/
125
#define MODULE_STATUS_BASE  128
126
 
127
/*+ base status for aperiodic servers +*/
128
#define APER_STATUS_BASE   1024
129
 
130
/*+ base status for libraries +*/
131
#define LIB_STATUS_BASE    2048
132
 
133
/*+ return value for killed tasks; it is equal to PTHREAD_CANCELED!!! +*/
134
#define TASK_CANCELED  (void *)1
135
 
136
/*+ Set the cancellation state of the task +*/
137
#define TASK_CANCEL_ENABLE  KILL_ENABLED
138
#define TASK_CANCEL_DISABLE 0
139
 
140
/*+ Set the cancellation type of the task +*/
141
#define TASK_CANCEL_DEFERRED     KILL_DEFERRED
142
#define TASK_CANCEL_ASYNCHRONOUS 0
143
 
144
/* C stuff */
145
 
146
 
147
#ifndef NIL
148
#define NIL     -1                      /*+ integer unvalid value   +*/
149
#endif
150
 
151
/*+ Blocking attribute for semaphore, port & keyboard operations +*/
152
#define BLOCK           1
153
#define NON_BLOCK       0
154
 
155
#define DEFAULT (DWORD)-1
156
 
157
/*+ sys_atrunlevel status bit values: used to signal that the function
158
    has to be called +*/
38 pj 159
#define RUNLEVEL_STARTUP     0 /*+ startup in real mode                  +*/
2 pj 160
#define RUNLEVEL_INIT        1 /*+ init time                             +*/
38 pj 161
#define RUNLEVEL_RUNNING     2 /*+ system is running!!!                  +*/
162
#define RUNLEVEL_SHUTDOWN    3 /*+ shutting down the system              +*/
163
#define RUNLEVEL_BEFORE_EXIT 4 /*+ before the kernel has been terminated +*/
164
#define RUNLEVEL_AFTER_EXIT  5 /*+ after the kernel has been terminated  +*/
123 giacomo 165
#define RUNLEVEL_MASK        0x7 /*+ a mask used into kernel/init.c      +*/
2 pj 166
#define NO_AT_ABORT          8 /*+ only when sys_end is called           +*/
167
 
168
#endif /* __CONST_H__ */
169