[concurrency-interest] tsc register

Vitaly Davidovich vitalyd at gmail.com
Sat Jan 14 00:31:38 EST 2012


For your 2nd issue try replacing "movl" with "movq".
On Jan 13, 2012 11:39 PM, "Blair Zajac" <blair at orcaware.com> wrote:

>
> On Jan 12, 2012, at 9:17 PM, David Holmes wrote:
>
> > If you want to check TSC stability check out this test program by Ingo
> Molnar:
> >
> > http://people.redhat.com/mingo/time-warp-test/time-warp-test.c
>
> I cannot get this to compile on a 64-bit Ubuntu 11.10 system.  The first
> error is fixed by passing 0755 to open():
>
> $ gcc -Wall -O2 -o time-warp-test time-warp-test.c -lrt
> In file included from /usr/include/fcntl.h:252:0,
>                 from time-warp-test.c:24:
> In function ‘open’,
>    inlined from ‘setup_shared_var’ at time-warp-test.c:127:5:
> /usr/include/x86_64-linux-gnu/bits/fcntl2.h:51:24: error: call to
> ‘__open_missing_mode’ declared with attribute error: open with O_CREAT in
> second argument needs 3 arguments
>
> The second error I don't know how to get around, since I don't know
> assembler:
>
> $ gcc -Wall -O2 -o time-warp-test time-warp-test.c -lrt
> time-warp-test.c: Assembler messages:
> time-warp-test.c:169: Error: incorrect register `%rax' used with `l' suffix
> time-warp-test.c:169: Error: incorrect register `%rax' used with `l' suffix
>
> This is the code, but changing the '#if 0' to '#if 1' gets a similar error.
>
> static inline void unlock(unsigned long *flag)
> {
> #if 0
>        __asm__ __volatile__(
>                "lock; btrl $0,%0\n"
>                             : "=g"(*flag) :: "memory");
>        __asm__ __volatile__("rep; nop");
> #else
>        __asm__ __volatile__("movl $0,%0; rep; nop" : "=g"(*flag) ::
> "memory");
> #endif
> }
>
> Blair
>
>
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20120114/042361f7/attachment.html>


More information about the Concurrency-interest mailing list