From 8311e9fcb42ba723355050fb5b899a4c329c60e0 Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Sat, 11 May 2013 14:41:03 -0400 Subject: [PATCH] ck_pr: Update GCC port and change ck_pr dependency path. The compiler-specific ck_pr is now unconditionally included. It currently implements things like compiler barriers. --- include/gcc/ck_pr.h | 31 +++++++++++++++++-------------- include/gcc/ppc/ck_pr.h | 5 +++++ include/gcc/ppc64/ck_pr.h | 5 +++++ include/gcc/sparcv9/ck_pr.h | 5 +++++ 4 files changed, 32 insertions(+), 14 deletions(-) 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. */