]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/m2/mc-boot/GRTint.h
Update copyright years.
[thirdparty/gcc.git] / gcc / m2 / mc-boot / GRTint.h
CommitLineData
1eee94d3
GM
1/* do not edit automatically generated by mc from RTint. */
2/* RTint.def provides users of the COROUTINES library with the.
3
a945c346 4Copyright (C) 2009-2024 Free Software Foundation, Inc.
1eee94d3
GM
5Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
6
7This file is part of GNU Modula-2.
8
9GNU Modula-2 is free software; you can redistribute it and/or modify
10it under the terms of the GNU General Public License as published by
11the Free Software Foundation; either version 3, or (at your option)
12any later version.
13
14GNU Modula-2 is distributed in the hope that it will be useful, but
15WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17General Public License for more details.
18
19Under Section 7 of GPL version 3, you are granted additional
20permissions described in the GCC Runtime Library Exception, version
213.1, as published by the Free Software Foundation.
22
23You should have received a copy of the GNU General Public License and
24a copy of the GCC Runtime Library Exception along with this program;
25see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
26<http://www.gnu.org/licenses/>. */
27
28
29#if !defined (_RTint_H)
30# define _RTint_H
31
32#include "config.h"
33#include "system.h"
34# ifdef __cplusplus
35extern "C" {
36# endif
431c0669 37#include <stdbool.h>
1eee94d3
GM
38# if !defined (PROC_D)
39# define PROC_D
40 typedef void (*PROC_t) (void);
41 typedef struct { PROC_t proc; } PROC;
42# endif
43
44# include "GSYSTEM.h"
45
46# if defined (_RTint_C)
47# define EXTERN
48# else
49# define EXTERN extern
50# endif
51
52typedef struct RTint_DispatchVector_p RTint_DispatchVector;
53
54typedef void (*RTint_DispatchVector_t) (unsigned int, unsigned int, void *);
55struct RTint_DispatchVector_p { RTint_DispatchVector_t proc; };
56
57
58/*
59 InitInputVector - returns an interrupt vector which is associated
60 with the file descriptor, fd.
61*/
62
63EXTERN unsigned int RTint_InitInputVector (int fd, unsigned int pri);
64
65/*
66 InitOutputVector - returns an interrupt vector which is associated
67 with the file descriptor, fd.
68*/
69
70EXTERN unsigned int RTint_InitOutputVector (int fd, unsigned int pri);
71
72/*
73 InitTimeVector - returns an interrupt vector associated with
74 the relative time.
75*/
76
77EXTERN unsigned int RTint_InitTimeVector (unsigned int micro, unsigned int secs, unsigned int pri);
78
79/*
80 ReArmTimeVector - reprimes the vector, vec, to deliver an interrupt
81 at the new relative time.
82*/
83
84EXTERN void RTint_ReArmTimeVector (unsigned int vec, unsigned int micro, unsigned int secs);
85
86/*
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
90 occurs.
91*/
92
93EXTERN void RTint_GetTimeVector (unsigned int vec, unsigned int *micro, unsigned int *secs);
94
95/*
96 AttachVector - adds the pointer, p, to be associated with the interrupt
97 vector. It returns the previous value attached to this
98 vector.
99*/
100
62ed1066 101EXTERN void * RTint_AttachVector (unsigned int vec, void * ptr);
1eee94d3
GM
102
103/*
104 IncludeVector - includes, vec, into the dispatcher list of
105 possible interrupt causes.
106*/
107
108EXTERN void RTint_IncludeVector (unsigned int vec);
109
110/*
111 ExcludeVector - excludes, vec, from the dispatcher list of
112 possible interrupt causes.
113*/
114
115EXTERN void RTint_ExcludeVector (unsigned int vec);
116
117/*
118 Listen - will either block indefinitely (until an interrupt)
119 or alteratively will test to see whether any interrupts
120 are pending.
121 If a pending interrupt was found then, call, is called
122 and then this procedure returns.
123 It only listens for interrupts > pri.
124*/
125
431c0669 126EXTERN void RTint_Listen (bool untilInterrupt, RTint_DispatchVector call, unsigned int pri);
1eee94d3
GM
127
128/*
129 Init - allows the user to force the initialize order.
130*/
131
132EXTERN void RTint_Init (void);
133# ifdef __cplusplus
134}
135# endif
136
137# undef EXTERN
138#endif