| 1 | /* |
|---|
| 2 | * Copyright (C) 2009, 2010, 2011 Lockless Inc., Steven Von Fuerst. |
|---|
| 3 | * |
|---|
| 4 | * This library is free software: you can redistribute it and/or modify |
|---|
| 5 | * it under the terms of the GNU General Public License as published by |
|---|
| 6 | * the Free Software Foundation, either version 3 of the License, or |
|---|
| 7 | * (at your option) any later version. |
|---|
| 8 | * |
|---|
| 9 | * This library is distributed in the hope that it will be useful, |
|---|
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 12 | * GNU General Public License for more details. |
|---|
| 13 | * |
|---|
| 14 | * You should have received a copy of the GNU General Public License |
|---|
| 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|---|
| 16 | */ |
|---|
| 17 | |
|---|
| 18 | /* Coompiler specific details - gcc */ |
|---|
| 19 | #ifndef LL_GCC_H |
|---|
| 20 | #define LL_GCC_H |
|---|
| 21 | |
|---|
| 22 | #include <pthread.h> |
|---|
| 23 | |
|---|
| 24 | #define __thread__ __thread __attribute__ ((tls_model ("initial-exec"))) |
|---|
| 25 | |
|---|
| 26 | #define HAVE_PTHREADS |
|---|
| 27 | #define HAVE_SYS_SELECT |
|---|
| 28 | #define HAVE_SYS_SOCKET |
|---|
| 29 | #define HAVE_NETINET_IN |
|---|
| 30 | #define HAVE_SYS_MMAN |
|---|
| 31 | |
|---|
| 32 | #define cache_align __attribute__((aligned(64))) |
|---|
| 33 | #define noinline __attribute__((__noinline__)) |
|---|
| 34 | #define prefetch(x) __builtin_prefetch(x) |
|---|
| 35 | #define barrier() asm volatile("": : :"memory") |
|---|
| 36 | #define forget(v) asm volatile("": "=m"(v) :"m"(v)) |
|---|
| 37 | #define mfence(v) asm volatile("mfence\n": : :"memory") |
|---|
| 38 | #define cpu_relax() asm volatile("rep; nop\n": : :"memory") |
|---|
| 39 | #define likely(x) __builtin_expect(!!(x), 1) |
|---|
| 40 | #define unlikely(x) __builtin_expect(!!(x), 0) |
|---|
| 41 | #define gcc_used __attribute__((used)) |
|---|
| 42 | #define _hide_ __attribute__((visibility("hidden"))) |
|---|
| 43 | |
|---|
| 44 | #define GCC_ASM |
|---|
| 45 | |
|---|
| 46 | #include <err.h> |
|---|
| 47 | |
|---|
| 48 | #endif /* LL_GCC_H */ |
|---|