Subversion Repositories shark

Rev

Rev 2 | 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
 ------------
24
 CVS :        $Id: hartport.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 Hartik 3.3.0's port primitives
32
 
33
 Title:
34
   HARTPORT (Hartik Ports)
35
 
36
 Resource Models Accepted:
37
   None
38
 
39
 Description:
40
   This module contains a port library compatible with the Hartik one.
41
 
42
 Exceptions raised:
43
   None
44
 
45
 Restrictions & special features:
46
   - This module is NOT Posix compliant
47
 
48
 Author:        Giuseppe Lipari
49
 Date:  9/5/96
50
 Revision:      2.0
51
 Date:  14/3/97
52
 
53
**/
54
 
55
/*
56
 * Copyright (C) 2000 Paolo Gai
57
 *
58
 * This program is free software; you can redistribute it and/or modify
59
 * it under the terms of the GNU General Public License as published by
60
 * the Free Software Foundation; either version 2 of the License, or
61
 * (at your option) any later version.
62
 *
63
 * This program is distributed in the hope that it will be useful,
64
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
65
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
66
 * GNU General Public License for more details.
67
 *
68
 * You should have received a copy of the GNU General Public License
69
 * along with this program; if not, write to the Free Software
70
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
71
 *
72
 */
73
 
74
#ifndef __PORT_H__
75
#define __PORT_H__
76
 
77
#include <modules/sem.h>
78
#include <ll/ll.h>
79
 
80
/* $HEADER-    */
81
//#ifndef __HW_DEP_H__
82
//#include "hw_dep.h"
83
//#endif
84
/* $HEADER+    */
85
 
86
typedef short PORT;
87
 
88
#define MAX_PORT        15U           /*+ Maximum number of ports      +*/
89
#define MAX_PORT_INT    30U           /*+ Max num. of port connections +*/
90
#define MAX_PORT_NAME   20U           /*+ Maximum port name length     +*/
91
#define MAX_HASH_ENTRY  MAX_PORT      /*+ More port stuff              +*/
92
 
93
 
94
#define STREAM          1
95
#define MAILBOX         2
96
#define STICK           3
97
 
98
#define READ            0
99
#define WRITE           1
100
 
101
 
102
 
103
/*+ This function must be inserted in the __hartik_register_levels__ +*/
104
void HARTPORT_init(void);
105
 
106
 
107
/* Debugging functions */
108
void print_port(void);
109
void port_write(PORT p);
110
 
111
/* User level port primitives */
112
PORT port_create(char *name, int dim_mes, int num_mes, BYTE type, BYTE access);
113
PORT port_connect(char *name, int dim_mes, BYTE type, BYTE access);
114
void port_delete(PORT p);
115
void port_disconnect(PORT p);
116
 
117
WORD port_send(PORT p,void *m,BYTE wait);
118
WORD port_receive(PORT p,void *m,BYTE wait);
119
 
120
#endif /* __PORT_H__ */
121