Subversion Repositories shark

Rev

Rev 2 | 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
 ------------
24
 CVS :        $Id: npp.h,v 1.1.1.1 2002-03-29 14:12:51 pj Exp $
25
 
26
 File:        $File$
27
 Revision:    $Revision: 1.1.1.1 $
28
 Last update: $Date: 2002-03-29 14:12:51 $
29
 ------------
30
 
31
 This file contains the Non Preemptive Protocol (NPP)
32
 
33
 Title:
34
   NPP (Non Preemptive Protocol)
35
 
36
 Resource Models Accepted:
37
   None
38
 
39
 Description:
40
   This module implement the Non Preemptive Protocol.
41
   When a task aquire a critical section, it become non-preemptable.
42
 
43
   A NPP mutex is created passing the NPP_mutexattr structure to mutex_init.
44
 
45
 Exceptions raised:
46
   XMUTEX_OWNER_KILLED
47
     This exception is raised when a task ends and it owns one or more
48
     mutexes
49
 
50
 Restrictions & special features:
51
   - This module is NOT Posix compliant
52
   - This module can manage any number of NPP mutexes.
53
   - if a task uses a NPP mutex, it can use only this type of mutex.
54
   - If a task ends (because it reaches the end of the body or because it
55
     is killed by someone) and it owns some mutex, an exception is raised.
56
   - if a mutex unlock is called on a mutex not previously
57
     locked or previously locked by another task an error is returned
58
   - A NPP mutex can be statically allocated. To do this, the init function
59
     have to define a macro that puts this information in the mutex
60
     descriptor: mutexlevel = <NPP resource level>; opt = NULL;
61
     for example, if the NPP module is registered at level 1, the macro is
62
     like:
63
     #define MUTEX_INITIALIZER {1,(void *)NULL}
64
 
65
**/
66
 
67
/*
68
 * Copyright (C) 2000 Paolo Gai
69
 *
70
 * This program is free software; you can redistribute it and/or modify
71
 * it under the terms of the GNU General Public License as published by
72
 * the Free Software Foundation; either version 2 of the License, or
73
 * (at your option) any later version.
74
 *
75
 * This program is distributed in the hope that it will be useful,
76
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
77
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
78
 * GNU General Public License for more details.
79
 *
80
 * You should have received a copy of the GNU General Public License
81
 * along with this program; if not, write to the Free Software
82
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
83
 *
84
 */
85
 
86
 
87
 
88
#ifndef __NPP_H__
89
#define __NPP_H__
90
 
91
void NPP_register_module(void);
92
 
93
#endif