pthread locking code - C vs. ASM
Gilles Carry
Gilles.Carry@bull.net
Tue Jan 22 08:26:00 GMT 2008
Mike Frysinger wrote:
> On Monday 21 January 2008, Gilles Carry wrote:
>
>>Is asm code supposed to do exactly the same as C code?
>
>
> of course ... things would be broken otherwise
>
>
>>I recently had a case when I wanted to modify pthread_cond_signal.c and it
>>did not compile because of unexisting syscall macros.
>
>
> you probably didnt include the right headers
Actually, pthread_cond_signal.c uses the macro lll_futex_wake_unlock
which is not defined for i386.
>
>>Should C code be the reference? Should asm be modified only when we are
>>sure C is ok? It is a problem when people change asm code without updating
>>the underlying C files.
>
>
> you should modify whatever your target platform uses
>
> then again, i'd wonder why you were mucking around the libc code in the first
> place ...
I'm not sure I get the meaning of your last remark.
-gilles
More information about the Libc-alpha
mailing list