eal/x86: fix clang build with -O0
authorDamjan Marion <damarion@cisco.com>
Fri, 3 Jun 2016 08:15:23 +0000 (10:15 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 3 Jun 2016 08:18:27 +0000 (10:18 +0200)
commitf243d9b04b4bf17d7ccdae179fa43b04d8a87317
tree0d32c59e4da373cf576f8fcc872d5787ae62f1bb
parentc8c33ad7f94c59d1c0676af0cfd61207b3e808db
eal/x86: fix clang build with -O0

Clang seems to have a bug with asm inside inline function rte_xabort():

rte_rtm.h:56:15: error: invalid operand for inline asm constraint 'i'
        asm volatile(".byte 0xc6,0xf8,%P0" :: "i" (status) : "memory");
                     ^

It is seen only when building with EXTRA_CFLAGS=-O0.

The workaround is to replace the inline function by a macro.

Fixes: ba7468997ea6 ("spinlock: add HTM lock elision for x86")

Signed-off-by: Damjan Marion <damarion@cisco.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
lib/librte_eal/common/include/arch/x86/rte_rtm.h