]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/m2/gm2-libs/RTint.def
Update copyright years.
[thirdparty/gcc.git] / gcc / m2 / gm2-libs / RTint.def
1 (* RTint.def provides users of the COROUTINES library with the.
2
3 Copyright (C) 2009-2023 Free Software Foundation, Inc.
4 Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
5
6 This file is part of GNU Modula-2.
7
8 GNU Modula-2 is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
11 any later version.
12
13 GNU Modula-2 is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
17
18 Under Section 7 of GPL version 3, you are granted additional
19 permissions described in the GCC Runtime Library Exception, version
20 3.1, as published by the Free Software Foundation.
21
22 You should have received a copy of the GNU General Public License and
23 a copy of the GCC Runtime Library Exception along with this program;
24 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
25 <http://www.gnu.org/licenses/>. *)
26
27 DEFINITION MODULE RTint ;
28
29 (* Provides users of the COROUTINES library with the
30 ability to create interrupt sources based on
31 file descriptors and timeouts. *)
32
33 FROM SYSTEM IMPORT ADDRESS ;
34
35 TYPE
36 DispatchVector = PROCEDURE (CARDINAL, CARDINAL, ADDRESS) ;
37
38
39 (*
40 InitInputVector - returns an interrupt vector which is associated
41 with the file descriptor, fd.
42 *)
43
44 PROCEDURE InitInputVector (fd: INTEGER; pri: CARDINAL) : CARDINAL ;
45
46
47 (*
48 InitOutputVector - returns an interrupt vector which is associated
49 with the file descriptor, fd.
50 *)
51
52 PROCEDURE InitOutputVector (fd: INTEGER; pri: CARDINAL) : CARDINAL ;
53
54
55 (*
56 InitTimeVector - returns an interrupt vector associated with
57 the relative time.
58 *)
59
60 PROCEDURE InitTimeVector (micro, secs: CARDINAL; pri: CARDINAL) : CARDINAL ;
61
62
63 (*
64 ReArmTimeVector - reprimes the vector, vec, to deliver an interrupt
65 at the new relative time.
66 *)
67
68 PROCEDURE ReArmTimeVector (vec: CARDINAL; micro, secs: CARDINAL) ;
69
70
71 (*
72 GetTimeVector - assigns, micro, and, secs, with the remaining
73 time before this interrupt will expire.
74 This value is only updated when a Listen
75 occurs.
76 *)
77
78 PROCEDURE GetTimeVector (vec: CARDINAL; VAR micro, secs: CARDINAL) ;
79
80
81 (*
82 AttachVector - adds the pointer, p, to be associated with the interrupt
83 vector. It returns the previous value attached to this
84 vector.
85 *)
86
87 PROCEDURE AttachVector (vec: CARDINAL; p: ADDRESS) : ADDRESS ;
88
89
90 (*
91 IncludeVector - includes, vec, into the dispatcher list of
92 possible interrupt causes.
93 *)
94
95 PROCEDURE IncludeVector (vec: CARDINAL) ;
96
97
98 (*
99 ExcludeVector - excludes, vec, from the dispatcher list of
100 possible interrupt causes.
101 *)
102
103 PROCEDURE ExcludeVector (vec: CARDINAL) ;
104
105
106 (*
107 Listen - will either block indefinitely (until an interrupt)
108 or alteratively will test to see whether any interrupts
109 are pending.
110 If a pending interrupt was found then, call, is called
111 and then this procedure returns.
112 It only listens for interrupts > pri.
113 *)
114
115 PROCEDURE Listen (untilInterrupt: BOOLEAN;
116 call: DispatchVector;
117 pri: CARDINAL) ;
118
119
120 (*
121 Init - allows the user to force the initialize order.
122 *)
123
124 PROCEDURE Init ;
125
126
127 END RTint.