1 /* This file is part of the program psim.
3 Copyright (C) 1994-1997, 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 _SIM_EVENTS_H_
23 #define _SIM_EVENTS_H_
26 typedef void event_handler(void *data
);
28 typedef struct _event_entry event_entry
;
31 event_handler
*handler
;
32 signed64 time_of_event
;
36 typedef struct _event_queue event_queue
;
40 event_entry
*volatile held
;
41 event_entry
*volatile *volatile held_end
;
42 signed64 time_of_event
;
43 signed64 time_from_event
;
47 typedef struct event_entry
*event_entry_tag
;
53 (void) event_queue_init
60 (void) event_queue_trace
65 /* (de)Schedule things to happen in the future. */
68 (event_entry_tag
) event_queue_schedule
71 event_handler
*handler
,
75 (event_entry_tag
) event_queue_schedule_after_signal
78 event_handler
*handler
,
82 (void) event_queue_deschedule
84 event_entry_tag event_to_remove
);
87 /* progress time. Broken into two parts so that if something is
88 pending, the caller has a chance to save any cached state */
91 (int) event_queue_tick
95 (void) event_queue_process
99 /* local concept of time */
102 (signed64
) event_queue_time