Subversion Repositories shark

Rev

Rev 801 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
794 trimarchi 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
 ------------
807 trimarchi 24
 CVS :        $Id: pistar.h,v 1.3 2004-09-03 12:43:02 trimarchi Exp $
794 trimarchi 25
 
26
 File:        $File$
807 trimarchi 27
 Revision:    $Revision: 1.3 $
28
 Last update: $Date: 2004-09-03 12:43:02 $
794 trimarchi 29
 ------------
30
 
31
 This file contains the Priority Inheritance (PI) Protocol
32
 
33
 Title:
34
   PI (Priority Inheritance protocol)
35
 
36
 Resource Models Accepted:
37
   None
38
 
39
 Description:
40
   This module implement the Priority Inheritance Protocol.
41
   The priority inheritance is made using the shadow field of the
42
   task descriptor. No difference is made upon the task model of the
43
   tasks that use PISTAR mutexes.
44
 
45
   A PISTAR mutex is created passing the PISTAR_mutexattr structure to mutex_init.
46
 
47
 Exceptions raised:
48
   XMUTEX_OWNER_KILLED
49
     This exception is raised when a task ends and it owns one or more
50
     mutexes
51
 
52
 Restrictions & special features:
53
   - This module is NOT Posix compliant
54
   - This module can manage any number of PISTAR mutexes.
55
   - If a task ends (because it reaches the end of the body or because it
56
     is killed by someone) and it owns some mutex, an exception is raised.
57
   - if a mutex unlock is called on a mutex not previously
58
     locked or previously locked by another task an exception is raised
59
   - A PISTAR mutex can be statically allocated. To do this, the init function
60
     have to define a macro that puts this information in the mutex
61
     descriptor: mutexlevel = <PISTAR resource level>; opt = NULL;
62
     for example, if the PISTAR module is registered at level 1, the macro is
63
     like:
64
     #define MUTEX_INITIALIZER {1,NULL}
65
 
66
**/
67
 
68
/*
69
 * Copyright (C) 2000 Paolo Gai
70
 *
71
 * This program is free software; you can redistribute it and/or modify
72
 * it under the terms of the GNU General Public License as published by
73
 * the Free Software Foundation; either version 2 of the License, or
74
 * (at your option) any later version.
75
 *
76
 * This program is distributed in the hope that it will be useful,
77
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
78
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
79
 * GNU General Public License for more details.
80
 *
81
 * You should have received a copy of the GNU General Public License
82
 * along with this program; if not, write to the Free Software
83
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
84
 *
85
 */
86
 
87
 
88
 
89
#ifndef __PISTAR_H__
90
#define __PISTAR_H__
91
 
92
#include <kernel/types.h>
93
#include "ll/sys/cdefs.h"
94
 
95
__BEGIN_DECLS
96
 
97
RLEVEL PISTAR_register_module(void);
98
 
807 trimarchi 99
int PISTAR_lock(RLEVEL l, mutex_t *m, TIME wcet);
801 trimarchi 100
 
807 trimarchi 101
 
794 trimarchi 102
__END_DECLS
103
#endif