lkml.org 
[lkml]   [2011]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 07/15] x86: add xadd helper macro
On 08/22/2011 04:43 PM, Jeremy Fitzhardinge wrote:
> On 08/22/2011 04:29 PM, H. Peter Anvin wrote:
>> On 08/22/2011 04:15 PM, Jeremy Fitzhardinge wrote:
>>> From: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
>>>
>>> Add a common xadd implementation.
>>>
>>> This has the side effect of generating a bad instruction if you try to
>>> use it on a 64-bit value on a 32-bit system - but don't do that.
>>>
>> It would be better to barf at that point, so we get the error with a C
>> line... also, there needs to be a default clause with
>> __compiletime_error() in it.
>
> OK, but the "standard of care" here is the old "calling undefined
> function" link error; getting a bad asm instruction is a little more
> helpful, in a sense. But agreed on the default: case. I'll see if I
> can fix up xadd and cmpxchg to fail better as well.
>

__compiletime_error() is better than either, obviously...

-hpa

--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.



\
 
 \ /
  Last update: 2011-08-23 06:45    [W:0.065 / U:1.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site