2000-06-25 Stephane Carrez <Stephane.Carrez@worldnet.fr>
authorAndrew Cagney <cagney@redhat.com>
Thu, 27 Jul 2000 11:37:34 +0000 (11:37 +0000)
committerAndrew Cagney <cagney@redhat.com>
Thu, 27 Jul 2000 11:37:34 +0000 (11:37 +0000)
        * sim-events.c (sim_events_remain_time): New function returning
        the time that remains before the event is raised.
        * hw-events.c (hw_event_remain_time): Likewise.
        * sim-events.h (sim_events_remain_time): Declare.
        * hw-events.h (hw_event_remain_time): Declare.

sim/common/ChangeLog
sim/common/hw-events.c
sim/common/hw-events.h
sim/common/sim-events.c
sim/common/sim-events.h

index 1a1206605873786900f6048c1db133cc65f682e7..eb07b9204b117e5c1c251ddea936fe6b7e850030 100644 (file)
@@ -1,5 +1,12 @@
 Thu Jul 27 20:37:47 2000  Andrew Cagney  <cagney@b1.cygnus.com>
 
+       From 2000-06-25 Stephane Carrez <Stephane.Carrez@worldnet.fr>:
+       * sim-events.c (sim_events_remain_time): New function returning
+       the time that remains before the event is raised.
+       * hw-events.c (hw_event_remain_time): Likewise.
+       * sim-events.h (sim_events_remain_time): Declare.
+       * hw-events.h (hw_event_remain_time): Declare.
+
        From 2000-06-25 Stephane Carrez <Stephane.Carrez@worldnet.fr>:
        * sim-hw.c: Use <errno.h> instead of <sys/errno.h>
        (OPTION_HW_LIST): New option --hw-list to list the devices.
index 31c5a4026ab3350d9915fecc26c951e197b1511b..f60dfa32e6a1ac203451b1218d937264fdf066b0 100644 (file)
@@ -164,6 +164,15 @@ hw_event_queue_time (struct hw *me)
   return sim_events_time (hw_system (me));
 }
 
+/* Returns the time that remains before the event is raised. */
+signed64
+hw_event_remain_time (struct hw *me, struct hw_event *event)
+{
+  signed64 t;
+
+  t = sim_events_remain_time (hw_system (me), event->real);
+  return t;
+}
 
 /* Only worry about this compling on ANSI systems.
    Build with `make test-hw-events' in sim/<cpu> directory*/
index a9b6f8b5dc0c77530e1a356968fb66d931e6bea5..29e10fac080a1102c78cdcfa3241a39559a0b1ec 100644 (file)
@@ -58,4 +58,8 @@ void hw_event_queue_deschedule
 signed64 hw_event_queue_time
 (struct hw *me);
 
+/* Returns the time that remains before the event is raised. */
+signed64 hw_event_remain_time
+(struct hw *me, struct hw_event *event);
+
 #endif
index fa294a7e1478f9771b30815da90e6f089d796fac..1866b2dccd7aa9db7cbc5b52a4986bc6e676151c 100644 (file)
@@ -379,6 +379,19 @@ sim_events_elapsed_time (SIM_DESC sd)
 }
 
 
+/* Returns the time that remains before the event is raised. */
+INLINE_SIM_EVENTS\
+(signed64)
+sim_events_remain_time (SIM_DESC sd, sim_event *event)
+{
+  if (event == 0)
+    return 0;
+  
+  return (event->time_of_event - sim_events_time (sd));
+}
+
+
+
 STATIC_INLINE_SIM_EVENTS\
 (void)
 update_time_from_event (SIM_DESC sd)
index 3bae3dfbdefe282babda51bc062a7e0988504b2b..55b2b740c918d334651747d21df071880840fbbe 100644 (file)
@@ -268,4 +268,10 @@ INLINE_SIM_EVENTS\
 (unsigned long) sim_events_elapsed_time
 (SIM_DESC sd);
 
+/* Returns the time that remains before the event is raised. */
+INLINE_SIM_EVENTS\
+(signed64) sim_events_remain_time
+(SIM_DESC sd, sim_event *event);
+
+
 #endif
This page took 0.029803 seconds and 4 git commands to generate.