[PATCH 6/9] Use proper membar instructions on SPARC

Michael macallan at netbsd.org
Thu Aug 13 10:13:59 PDT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

On Aug 13, 2009, at 11:55 AM, Matt Turner wrote:

> On Thu, Aug 13, 2009 at 5:00 AM, David Miller<davem at davemloft.net>  
> wrote:
>> From: Matt Turner <mattst88 at gmail.com>
>> Date: Thu, 13 Aug 2009 02:28:53 -0400
>>
>>> On Thu, Aug 13, 2009 at 1:51 AM, David Miller<davem at davemloft.net>  
>>> wrote:
>>>> From: Matt Turner <mattst88 at gmail.com>
>>>> Date: Thu, 13 Aug 2009 01:45:39 -0400
>>>>
>>>>> Cc: David S. Miller <davem at davemloft.net>
>>>>> Cc: Alan Coopersmith <alan.coopersmith at sun.com>
>>>>> Signed-off-by: Matt Turner <mattst88 at gmail.com>
>>>>
>>>> This breaks 32-bit sparc.
>>>>
>>>> It will cause the binaries built to be tagged as needing v8plus  
>>>> or v9
>>>> instructions.  They therefore won't execute or load on a 32-bit  
>>>> sparc
>>>> system.
>>>>
>>>> That's why I encoded the membars using explicit instruction  
>>>> constants,
>>>> rather than using the usual mnemonics.
>>>
>>> Surely gcc defines a macro we can check for? Something like  
>>> __sparcv9
>>> or __arch64__? What is preferred?
>>
>> The correct test is something like:
>>
>> #if defined(__sparc__) && defined(__arch64__)
>>
>
> Please review the attached patch. Thanks for the input.

testing for __arch64__ will only tell you if you're running a 64bit  
binary, it won't be set when running a 32bit binary on a 64bit  
machine. You want to test for __sparc_v9__.

have fun
Michael

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iQEVAwUBSoRJ18pnzkX8Yg2nAQI2PAf/Zf+yVEJ3ea4iyvVguAy2511a1HOD1jkZ
LDnOP/uN4B7OVk5h3u1Qmcfp2XfWkgqvcb7/FsgQknIjCBUedZwvHOAj2Ll5yys5
3K/Q0Ph8bXqViVjayX/HvSXA57afSHwvNkltbnRPxOxlvh89YJMrWdTJPQv/Ouf4
mvumGh9gwhdTBXnvvmkpxT9Z3o4jgf9ORtI5VHZC1UY04d46LGUB5mUGskYZRCS3
17QcXLhdFLqRZ7xaMy2lw4ZbrTlne9IGK3bd+ehZt9kpRAyPu6Ew4wS8PkGWTCZE
JNSONoQ9OUZQqbCtWecBdYDE08cv/pyHfDxblQCLEg/BilGeDko0hw==
=eHVK
-----END PGP SIGNATURE-----


More information about the xorg-devel mailing list