New upstream version 18.11-rc3
[deb_dpdk.git] / lib / librte_eal / common / include / arch / x86 / rte_rtm.h
index d935641..eb0f8e8 100644 (file)
@@ -1,25 +1,15 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2012,2013 Intel Corporation
+ */
+
 #ifndef _RTE_RTM_H_
 #define _RTE_RTM_H_ 1
 
-/*
- * Copyright (c) 2012,2013 Intel Corporation
- * Author: Andi Kleen
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that: (1) source code distributions
- * retain the above copyright notice and this paragraph in its entirety, (2)
- * distributions including binary code include the above copyright notice and
- * this paragraph in its entirety in the documentation or other materials
- * provided with the distribution
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
 
 /* Official RTM intrinsics interface matching gcc/icc, but works
    on older gcc compatible compilers and binutils. */
 
+#include <rte_common.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -50,11 +40,10 @@ void rte_xend(void)
         asm volatile(".byte 0x0f,0x01,0xd5" ::: "memory");
 }
 
-static __attribute__((__always_inline__)) inline
-void rte_xabort(const unsigned int status)
-{
-       asm volatile(".byte 0xc6,0xf8,%P0" :: "i" (status) : "memory");
-}
+/* not an inline function to workaround a clang bug with -O0 */
+#define rte_xabort(status) do { \
+       asm volatile(".byte 0xc6,0xf8,%P0" :: "i" (status) : "memory"); \
+} while (0)
 
 static __attribute__((__always_inline__)) inline
 int rte_xtest(void)