Rev 961 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
961 | 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 2005-02-25 10:53:41 pj Exp $ |
||
25 | |||
26 | File: $File$ |
||
27 | Revision: $Revision: 1.1 $ |
||
28 | Last update: $Date: 2005-02-25 10:53:41 $ |
||
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 <sem/sem/sem.h> |
||
78 | #include <ll/ll.h> |
||
79 | |||
80 | #include "ll/sys/cdefs.h" |
||
81 | |||
82 | __BEGIN_DECLS |
||
83 | |||
84 | /* $HEADER- */ |
||
85 | //#ifndef __HW_DEP_H__ |
||
86 | //#include "hw_dep.h" |
||
87 | //#endif |
||
88 | /* $HEADER+ */ |
||
89 | |||
90 | typedef short PORT; |
||
91 | |||
92 | #define MAX_PORT 15U /*+ Maximum number of ports +*/ |
||
93 | #define MAX_PORT_INT 30U /*+ Max num. of port connections +*/ |
||
94 | #define MAX_PORT_NAME 20U /*+ Maximum port name length +*/ |
||
95 | #define MAX_HASH_ENTRY MAX_PORT /*+ More port stuff +*/ |
||
96 | |||
97 | |||
98 | #define STREAM 1 |
||
99 | #define MAILBOX 2 |
||
100 | #define STICK 3 |
||
101 | |||
102 | #define READ 0 |
||
103 | #define WRITE 1 |
||
104 | |||
105 | |||
106 | |||
107 | /*+ This function must be inserted in the __hartik_register_levels__ +*/ |
||
108 | void HARTPORT_init(void); |
||
109 | |||
110 | |||
111 | /* Debugging functions */ |
||
112 | void print_port(void); |
||
113 | void port_write(PORT p); |
||
114 | |||
115 | /* User level port primitives */ |
||
116 | PORT port_create(char *name, int dim_mes, int num_mes, BYTE type, BYTE access); |
||
117 | PORT port_connect(char *name, int dim_mes, BYTE type, BYTE access); |
||
118 | void port_delete(PORT p); |
||
119 | void port_disconnect(PORT p); |
||
120 | |||
121 | WORD port_send(PORT p,void *m,BYTE wait); |
||
122 | WORD port_receive(PORT p,void *m,BYTE wait); |
||
123 | |||
124 | __END_DECLS |
||
125 | #endif /* __PORT_H__ */ |
||
126 |