Greetings!,

  I've been using the inline asm function David posted to the list a few
weeks ago.  It works great and avoids the assembly function call to a
single instruction ( tsc ) I had been using before.

I can't get it to reside in a header file which is included by two source
files that compiled and linked together to produce a single executable.
I get a redefinition error from gcc.  Actually, if I paste the code into
any two files which are linked together later, an error occurs.  Anyone
have any idea how to get the __inline__ function to work in multiple
source files which result in one binary?

Best regards,
Wayne  

/*
.- David Olofson -------------------------------------------.
`--------------------------------------> [EMAIL PROTECTED] -'
 __inline__ unsigned long long int rdtsc(void)
{
        unsigned long long int x;
        __asm__ volatile (".byte 0x0f, 0x31" : "=A" (x));
        return x;
}



--<<< We are committed to exceeding requirements >>>----->-+
C.W. Wright,[EMAIL PROTECTED],      Ph:757-824-1698
http://lidar.wff.nasa.gov                  Fax:603-925-6886      
NASA, Goddard Space Flight Center
Building N-159 Room E117, Code 972,Wallops Flight Facility
Wallops Island, Va. 23337   Telecommute phone: 410-742-7333
-------+-<-------------------------------------------------


-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to