summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/eigccx86.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/eigccx86.h')
-rw-r--r--src/emu/eigccx86.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/emu/eigccx86.h b/src/emu/eigccx86.h
index 4be2f3ee474..2d9107c55d8 100644
--- a/src/emu/eigccx86.h
+++ b/src/emu/eigccx86.h
@@ -644,4 +644,28 @@ _atomic_decrement32(INT32 volatile *ptr)
return result - 1;
}
+
+
+/***************************************************************************
+ INLINE TIMING FUNCTIONS
+***************************************************************************/
+
+/*-------------------------------------------------
+ get_profile_ticks - return a tick counter
+ from the processor that can be used for
+ profiling. It does not need to run at any
+ particular rate.
+-------------------------------------------------*/
+
+#define get_profile_ticks _get_profile_ticks
+INLINE INT64 ATTR_UNUSED ATTR_FORCE_INLINE _get_profile_ticks(void)
+{
+ UINT64 result;
+ __asm__ __volatile__ (
+ "rdtsc"
+ : "=A" (result)
+ );
+ return (INT64) (result & U64(0x7fffffffffffffff));
+}
+
#endif /* __EIGCCX86__ */