lkml.org 
[lkml]   [2010]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [thiscpuops upgrade 09/10] x86: this_cpu_cmpxchg and this_cpu_cmpxchg_double operations
From
Date
Le mardi 23 novembre 2010 à 17:51 -0600, Christoph Lameter a écrit :
> pièce jointe document texte brut (this_cpu_cmpxchg_x86)
> Provide support as far as the hardware capabilities of the x86 cpus
> allow.
>
> Signed-off-by: Christoph Lameter <cl@linux.com>

> +
> +#define percpu_cmpxchg16b(pcp, o1, o2, n1, n2) \
> +({ \
> + char __ret; \
> + typeof(o1) __o1 = o1; \
> + typeof(o1) __n1 = n1; \
> + typeof(o2) __o2 = o2; \
> + typeof(o2) __n2 = n2; \
> + asm("cmpxchg16b "__percpu_arg(1)"\n\tsetz %0\n\t" \
> + : "=a"(__ret), "=m" (*pcp) \
> + : "b"(__n1), "c"(__n2), "a"(__o1), "d"(__o2)); \
> + __ret; \
> +})

I thought some x86_64 cpus dont have cmpxchg16b ?

You have to check cx16 feature flag or implement a fallback ?




--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-11-24 01:43    [W:0.610 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site