* gx sim prototype tweaks
[binutils-gdb.git] / sim / ppc / events.h
blobfc81263b4685ef3663d48e905dc3ae9f9abc2c4a
1 /* This file is part of the program psim.
3 Copyright (C) 1994-1995, Andrew Cagney <cagney@highland.com.au>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 #ifndef _EVENTS_H_
23 #define _EVENTS_H_
25 #ifndef INLINE_EVENTS
26 #define INLINE_EVENTS
27 #endif
30 typedef struct _event_queue event_queue;
31 typedef void *event_entry_tag;
33 typedef void event_handler
34 (event_queue *queue,
35 void *data);
37 INLINE_EVENTS event_queue *event_queue_create
38 (void);
41 /* (de)Schedule things to happen in the future. */
43 INLINE_EVENTS event_entry_tag event_queue_schedule
44 (event_queue *queue,
45 signed64 delta_time,
46 event_handler *handler,
47 void *data);
49 INLINE_EVENTS event_entry_tag event_queue_schedule_after_signal
50 (event_queue *queue,
51 signed64 delta_time,
52 event_handler *handler,
53 void *data);
55 INLINE_EVENTS void event_queue_deschedule
56 (event_queue *queue,
57 event_entry_tag event_to_remove);
60 /* progress time. In to parts so that if something is pending, the
61 caller has a chance to save any cached state */
63 INLINE_EVENTS int event_queue_tick
64 (event_queue *queue);
66 INLINE_EVENTS void event_queue_process
67 (event_queue *events);
70 /* local concept of time */
72 INLINE_EVENTS signed64 event_queue_time
73 (event_queue *queue);
75 #endif /* _EVENTS_H_ */