summaryrefslogtreecommitdiff
path: root/ace/OS.cpp
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-02-23 18:08:32 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-02-23 18:08:32 +0000
commit98675c8190548c2cf8be6e64c9c1a8994de3515b (patch)
tree34e30b3e0452421bf852fb5efb25fe4ee859ccea /ace/OS.cpp
parent1753ee810df55341d932dc2f3fe6a61f6f31c731 (diff)
downloadATCD-98675c8190548c2cf8be6e64c9c1a8994de3515b.tar.gz
uninlined ACE_OS::gethrtime () on linux because it depends on location of local variables on the stack
Diffstat (limited to 'ace/OS.cpp')
-rw-r--r--ace/OS.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/ace/OS.cpp b/ace/OS.cpp
index 9ab48a4cf36..2043b08cd7f 100644
--- a/ace/OS.cpp
+++ b/ace/OS.cpp
@@ -294,6 +294,26 @@ ACE_Countdown_Time::~ACE_Countdown_Time (void)
this->stop ();
}
+#if defined (ACE_HAS_PENTIUM) && defined (linux)
+ACE_hrtime_t
+ACE_OS::gethrtime (void)
+{
+ // ACE_TRACE ("ACE_OS::gethrtime");
+
+ // See comments for ACE_WIN32 version of ACE_OS::gethrtime () in OS.i.
+ //
+ // This function can't be inline because it depends on the location
+ // of the following variables on the stack.
+ unsigned long least, most;
+
+ asm ("rdtsc");
+ asm ("movl %eax, -4(%ebp)"); // least
+ asm ("movl %edx, -8(%ebp)"); // most
+
+ return (unsigned long long) most << 32 | least;
+}
+#endif /* ACE_HAS_PENTIUM && linux */
+
#if defined(ACE_MT_SAFE) && defined(ACE_LACKS_NETDB_REENTRANT_FUNCTIONS)
int ACE_OS::netdb_mutex_inited_ = 0;