rtmintrin.h revision 263508
177999Sache/*===---- rtmintrin.h - RTM intrinsics -------------------------------------===
277999Sache *
377999Sache * Permission is hereby granted, free of charge, to any person obtaining a copy
477999Sache * of this software and associated documentation files (the "Software"), to deal
577999Sache * in the Software without restriction, including without limitation the rights
677999Sache * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
777999Sache * copies of the Software, and to permit persons to whom the Software is
877999Sache * furnished to do so, subject to the following conditions:
977999Sache *
1077999Sache * The above copyright notice and this permission notice shall be included in
1177999Sache * all copies or substantial portions of the Software.
1277999Sache *
1377999Sache * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1477999Sache * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1577999Sache * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1677999Sache * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1777999Sache * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1877999Sache * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1977999Sache * THE SOFTWARE.
2077999Sache *
2177999Sache *===-----------------------------------------------------------------------===
2277999Sache */
2377999Sache
2477999Sache#ifndef __IMMINTRIN_H
2577999Sache#error "Never use <rtmintrin.h> directly; include <immintrin.h> instead."
2677999Sache#endif
2777999Sache
2877999Sache#ifndef __RTMINTRIN_H
2977999Sache#define __RTMINTRIN_H
3077999Sache
3177999Sache#define _XBEGIN_STARTED   (~0u)
3277999Sache#define _XABORT_EXPLICIT  (1 << 0)
3377999Sache#define _XABORT_RETRY     (1 << 1)
3477999Sache#define _XABORT_CONFLICT  (1 << 2)
3577999Sache#define _XABORT_CAPACITY  (1 << 3)
3677999Sache#define _XABORT_DEBUG     (1 << 4)
3777999Sache#define _XABORT_NESTED    (1 << 5)
3877999Sache#define _XABORT_CODE(x)   (((x) >> 24) & 0xFF)
3977999Sache
4077999Sachestatic __inline__ unsigned int __attribute__((__always_inline__, __nodebug__))
4177999Sache_xbegin(void)
4277999Sache{
4377999Sache  return __builtin_ia32_xbegin();
4477999Sache}
4577999Sache
4677999Sachestatic __inline__ void __attribute__((__always_inline__, __nodebug__))
4777999Sache_xend(void)
4877999Sache{
4977999Sache  __builtin_ia32_xend();
5077999Sache}
5177999Sache
5277999Sache#define _xabort(imm) __builtin_ia32_xabort((imm))
5377999Sache
5477999Sache#endif /* __RTMINTRIN_H */
5577999Sache