From fedc2f6e47886a536c87e7cad27f5d712e590664 Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Mon, 17 Sep 2012 13:40:12 -0400 Subject: [PATCH] ck_pr/sparcv9: Assume TSO by default. --- include/gcc/sparcv9/ck_pr.h | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/include/gcc/sparcv9/ck_pr.h b/include/gcc/sparcv9/ck_pr.h index 397c81c..051ad6a 100644 --- a/include/gcc/sparcv9/ck_pr.h +++ b/include/gcc/sparcv9/ck_pr.h @@ -32,6 +32,7 @@ #endif #include +#include /* * The following represent supported atomic operations. @@ -50,9 +51,24 @@ ck_pr_stall(void) return; } -/* - * We must assume RMO. - */ +#ifndef CK_MD_RMO + /* + * By default, we will assume TSO model is used on SPARCv9. + */ +#define CK_PR_FENCE(T, I) \ + CK_CC_INLINE static void \ + ck_pr_fence_strict_##T(void) \ + { \ + __asm__ __volatile__(I ::: "memory"); \ + } \ + CK_CC_INLINE static void ck_pr_fence_##T(void) \ + { \ + __asm__ __volatile__("" ::: "memory"); \ + } +#else + /* + * If RMO is forced, then do not assume TSO model. + */ #define CK_PR_FENCE(T, I) \ CK_CC_INLINE static void \ ck_pr_fence_strict_##T(void) \ @@ -63,6 +79,7 @@ ck_pr_stall(void) { \ __asm__ __volatile__(I ::: "memory"); \ } +#endif /* CK_MD_RMO */ CK_PR_FENCE(load_depends, "") CK_PR_FENCE(store, "membar #StoreStore")