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")