diff --git a/include/gcc/ck_pr.h b/include/gcc/ck_pr.h index 505153d..aa92eb4 100644 --- a/include/gcc/ck_pr.h +++ b/include/gcc/ck_pr.h @@ -31,9 +31,20 @@ #error Do not include this file directly, use ck_pr.h #endif +#include + +CK_CC_INLINE +static void ck_pr_barrier(void) +{ + + __asm__ __volatile__("" ::: "memory"); + return; +} + +#ifndef CK_F_PR +#define CK_F_PR #include #include -#include /* * The following represent supported atomic operations. @@ -110,28 +121,20 @@ ck_pr_fence_load_depends(void) #define CK_PR_FENCE(T) \ CK_CC_INLINE static void \ ck_pr_fence_strict_##T(void) \ - { \ - __sync_synchronize(); \ - } \ - CK_CC_INLINE static void ck_pr_fence_##T(void) \ { \ __sync_synchronize(); \ } CK_PR_FENCE(load) +CK_PR_FENCE(load_load) +CK_PR_FENCE(load_store) CK_PR_FENCE(store) +CK_PR_FENCE(store_store) +CK_PR_FENCE(store_load) CK_PR_FENCE(memory) #undef CK_PR_FENCE -CK_CC_INLINE static void -ck_pr_barrier(void) -{ - - __asm__ __volatile__("" ::: "memory"); - return; -} - /* * Atomic compare and swap. */ @@ -275,5 +278,5 @@ CK_PR_UNARY_S(8, uint8_t) #undef CK_PR_UNARY_S #undef CK_PR_UNARY - +#endif /* !CK_F_PR */ #endif /* _CK_PR_GCC_H */ diff --git a/include/gcc/ppc/ck_pr.h b/include/gcc/ppc/ck_pr.h index 8b14772..1c53171 100644 --- a/include/gcc/ppc/ck_pr.h +++ b/include/gcc/ppc/ck_pr.h @@ -41,6 +41,11 @@ */ #include "ck_f_pr.h" +/* + * Minimum interface requirement met. + */ +#define CK_F_PR + /* * This bounces the hardware thread from low to medium * priority. I am unsure of the benefits of this approach diff --git a/include/gcc/ppc64/ck_pr.h b/include/gcc/ppc64/ck_pr.h index aebd2c9..a99e89c 100644 --- a/include/gcc/ppc64/ck_pr.h +++ b/include/gcc/ppc64/ck_pr.h @@ -40,6 +40,11 @@ */ #include "ck_f_pr.h" +/* + * Minimum interface requirement met. + */ +#define CK_F_PR + /* * This bounces the hardware thread from low to medium * priority. I am unsure of the benefits of this approach diff --git a/include/gcc/sparcv9/ck_pr.h b/include/gcc/sparcv9/ck_pr.h index fe6991a..ac2d243 100644 --- a/include/gcc/sparcv9/ck_pr.h +++ b/include/gcc/sparcv9/ck_pr.h @@ -40,6 +40,11 @@ */ #include "ck_f_pr.h" +/* + * Minimum interface requirement met. + */ +#define CK_F_PR + /* * Order loads at the least. */