1 /* do not edit automatically generated by mc from RTint. */
2 /* RTint.def provides users of the COROUTINES library with the.
4 Copyright (C) 2009-2025 Free Software Foundation, Inc.
5 Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
7 This file is part of GNU Modula-2.
9 GNU Modula-2 is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
14 GNU Modula-2 is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
19 Under Section 7 of GPL version 3, you are granted additional
20 permissions described in the GCC Runtime Library Exception, version
21 3.1, as published by the Free Software Foundation.
23 You should have received a copy of the GNU General Public License and
24 a copy of the GCC Runtime Library Exception along with this program;
25 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
26 <http://www.gnu.org/licenses/>. */
29 #if !defined (_RTint_H)
38 # if !defined (PROC_D)
40 typedef void (*PROC_t
) (void);
41 typedef struct { PROC_t proc
; } PROC
;
46 # if defined (_RTint_C)
49 # define EXTERN extern
52 typedef struct RTint_DispatchVector_p RTint_DispatchVector
;
54 typedef void (*RTint_DispatchVector_t
) (unsigned int, unsigned int, void *);
55 struct RTint_DispatchVector_p
{ RTint_DispatchVector_t proc
; };
59 InitInputVector - returns an interrupt vector which is associated
60 with the file descriptor, fd.
63 EXTERN
unsigned int RTint_InitInputVector (int fd
, unsigned int pri
);
66 InitOutputVector - returns an interrupt vector which is associated
67 with the file descriptor, fd.
70 EXTERN
unsigned int RTint_InitOutputVector (int fd
, unsigned int pri
);
73 InitTimeVector - returns an interrupt vector associated with
77 EXTERN
unsigned int RTint_InitTimeVector (unsigned int micro
, unsigned int secs
, unsigned int pri
);
80 ReArmTimeVector - reprimes the vector, vec, to deliver an interrupt
81 at the new relative time.
84 EXTERN
void RTint_ReArmTimeVector (unsigned int vec
, unsigned int micro
, unsigned int secs
);
87 GetTimeVector - assigns, micro, and, secs, with the remaining
88 time before this interrupt will expire.
89 This value is only updated when a Listen
93 EXTERN
void RTint_GetTimeVector (unsigned int vec
, unsigned int *micro
, unsigned int *secs
);
96 AttachVector - adds the pointer, p, to be associated with the interrupt
97 vector. It returns the previous value attached to this
101 EXTERN
void * RTint_AttachVector (unsigned int vec
, void * ptr
);
104 IncludeVector - includes, vec, into the dispatcher list of
105 possible interrupt causes.
108 EXTERN
void RTint_IncludeVector (unsigned int vec
);
111 ExcludeVector - excludes, vec, from the dispatcher list of
112 possible interrupt causes.
115 EXTERN
void RTint_ExcludeVector (unsigned int vec
);
118 Listen - will either block indefinitely (until an interrupt)
119 or alteratively will test to see whether any interrupts
121 If a pending interrupt was found then, call, is called
122 and then this procedure returns.
123 It only listens for interrupts > pri.
126 EXTERN
void RTint_Listen (bool untilInterrupt
, RTint_DispatchVector call
, unsigned int pri
);
129 Init - allows the user to force the initialize order.
132 EXTERN
void RTint_Init (void);