* gjavah.c (main): Handle --output-class-directory argument.
[official-gcc.git] / libchill / rts.h
blobc741ac5122b74003351a60db6fb793ba3f1ab15b
1 /* GNU CHILL compiler regression test file
2 Copyright (C) 1992, 1993 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
20 /* As a special exception, if you link this library with other files,
21 some of which are compiled with GCC, to produce an executable,
22 this library does not by itself cause the resulting executable
23 to be covered by the GNU General Public License.
24 This exception does not however invalidate any other reasons why
25 the executable file might be covered by the GNU General Public License. */
27 #ifndef __rts_h_
28 #define __rts_h_
30 typedef enum
32 UNUSED,
33 Process,
34 Signal,
35 Buffer,
36 Event,
37 Synonym,
38 Exception,
39 LAST_AND_UNUSED,
40 } TaskingEnum;
42 typedef void (*EntryPoint) ();
44 typedef struct
46 char *name;
47 short *value;
48 int value_defined;
49 EntryPoint entry;
50 unsigned char /*TaskingEnum*/ type;
51 } TaskingStruct;
53 /* how an INSTANCE is implemented */
54 typedef struct
56 short ptype;
57 short pcopy;
58 } INSTANCE;
60 /* interface to underlaying os */
61 typedef enum
63 wait_wait,
64 wait_buffer_send,
65 wait_buffer_receive,
66 wait_buffer_free,
67 wait_event_delay,
68 wait_event_free,
69 } Delay_Reason;
71 extern INSTANCE __whoami ();
72 extern void *__xmalloc_ ();
74 #define THIS __whoami()
75 /* for easier changing to something different,
76 i.e. allocate_memory */
77 #define MALLOC(ADDR,SIZE) ADDR = __xmalloc_(SIZE)
78 #define FREE(ADDR) free (ADDR)
80 /* definitions for EVENTS */
81 typedef struct EVENTQUEUE
83 struct EVENTQUEUE *forward; /* next in the list */
84 struct EVENTQUEUE **listhead; /* pointer to EVENT location */
85 int priority; /* prio for DELAY or DELAY CASE */
86 INSTANCE this; /* specify the instance is delayed */
87 struct EVENTQUEUE *startlist; /* start of the list */
88 struct EVENTQUEUE *chain; /* list of all events in an DELAY CASE */
89 int is_continued; /* indicates a continue action on that event */
90 INSTANCE who_continued; /* indicates who continued */
91 } Event_Queue;
93 typedef struct
95 Event_Queue **ev;
96 unsigned long maxqueuelength;
97 } Event_Descr;
99 /* definitions for BUFFERS */
100 struct BUFFERQUEUE;
102 typedef struct BUFFER_WAIT_QUEUE
104 struct BUFFER_WAIT_QUEUE *forward;
105 struct BUFFERQUEUE **bufferaddr;
106 INSTANCE this;
107 struct BUFFER_WAIT_QUEUE *startlist;
108 struct BUFFER_WAIT_QUEUE *chain;
109 int is_sent;
110 INSTANCE who_sent; /* instance which have
111 send a buffer */
112 unsigned long datalen;
113 void *dataptr;
114 } Buffer_Wait_Queue;
116 typedef struct BUFFER_SEND_QUEUE
118 struct BUFFER_SEND_QUEUE *forward;
119 int priority;
120 INSTANCE this;
121 int is_delayed;
122 unsigned long datalen;
123 void *dataptr;
124 } Buffer_Send_Queue;
126 typedef struct BUFFERQUEUE
128 Buffer_Wait_Queue *waitqueue;
129 unsigned long waitqueuelength;
130 Buffer_Send_Queue *sendqueue;
131 unsigned long sendqueuelength;
132 } Buffer_Queue;
134 typedef struct
136 Buffer_Queue **buf;
137 unsigned long maxqueuelength;
138 } Buffer_Descr;
140 /* descriptor for data */
141 typedef struct
143 void *ptr;
144 int length;
145 } Data_Descr;
147 /* time format runtime delivers */
148 typedef struct
150 unsigned long secs;
151 unsigned long nanosecs;
152 } RtsTime;
154 extern void __rtstime (RtsTime *t);
155 extern int __delay_this (Delay_Reason reason, RtsTime *t, char *file, int lineno);
156 extern void __continue_that (INSTANCE ins, int prio, char *file, int lineno);
158 #endif /* __rts_h_ */