diff --git a/include/trick/exec_proto.h b/include/trick/exec_proto.h index d536c79e..607c16e5 100644 --- a/include/trick/exec_proto.h +++ b/include/trick/exec_proto.h @@ -74,6 +74,7 @@ extern "C" { int exec_set_version_date_tag(const char * tag) ; int exec_set_build_date(const char * date) ; int exec_set_current_version(const char * version) ; + void exec_set_rt_nap_stats(long long clock_time_before_rt_nap, long long clock_time_after_rt_nap) ; int exec_freeze(void) ; int exec_run(void) ; diff --git a/trick_source/sim_services/Clock/Clock.cpp b/trick_source/sim_services/Clock/Clock.cpp index 0b762415..020550d6 100644 --- a/trick_source/sim_services/Clock/Clock.cpp +++ b/trick_source/sim_services/Clock/Clock.cpp @@ -10,7 +10,6 @@ PROGRAMMERS: #include "trick/Clock.hh" #include "trick/exec_proto.h" -#include "trick/exec_proto.hh" #include "trick/release.h" Trick::Clock * the_clock = NULL ; @@ -93,7 +92,7 @@ long long Trick::Clock::clock_spin(long long req_time) { time_before_rt_nap = wall_clock_time() ; RELEASE(); time_after_rt_nap = wall_clock_time() ; - exec_get_exec_cpp()->set_rt_nap_stats(time_before_rt_nap, time_after_rt_nap) ; + exec_set_rt_nap_stats(time_before_rt_nap, time_after_rt_nap) ; } curr_time = clock_time(); } diff --git a/trick_source/sim_services/Clock/test/Makefile b/trick_source/sim_services/Clock/test/Makefile index fe58b277..5142578a 100644 --- a/trick_source/sim_services/Clock/test/Makefile +++ b/trick_source/sim_services/Clock/test/Makefile @@ -21,7 +21,7 @@ BASE_OBJECTS = ../object_${TRICK_HOST_CPU}/Clock.o\ ../object_${TRICK_HOST_CPU}/clock_c_intf.o -GETTIMEOFDAY_CLOCK_OBJECTS = ${BASE_OBJECTS} GetTimeOfDayClock_test.o ../object_${TRICK_HOST_CPU}/GetTimeOfDayClock.o exec_get_rt_nap_stub.o +GETTIMEOFDAY_CLOCK_OBJECTS = ${BASE_OBJECTS} GetTimeOfDayClock_test.o ../object_${TRICK_HOST_CPU}/GetTimeOfDayClock.o exec_get_rt_nap_stub.o exec_set_rt_nap_stats.o # All tests produced by this Makefile. Remember to add new tests you # created to the list. diff --git a/trick_source/sim_services/Executive/Executive_c_intf.cpp b/trick_source/sim_services/Executive/Executive_c_intf.cpp index 8e88f0c0..86198868 100644 --- a/trick_source/sim_services/Executive/Executive_c_intf.cpp +++ b/trick_source/sim_services/Executive/Executive_c_intf.cpp @@ -737,6 +737,17 @@ extern "C" const char * exec_get_current_version() { return NULL ; } +/** + * @relates Trick::Executive + * @copydoc Trick::Executive::set_rt_nap_stats + * C wrapper for Trick::Executive::set_rt_nap_stats + */ +extern "C" void exec_set_rt_nap_stats(long long clock_time_before_rt_nap, long long clock_time_after_rt_nap) { + if ( the_exec != NULL ) { + the_exec->set_rt_nap_stats(clock_time_before_rt_nap, clock_time_before_rt_nap) ; + } +} + /** * @relates Trick::Executive * @userdesc Raise a signal on the main thread to terminate the simuation immediately.