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.
ck_pring
Samy Al Bahra 12 years ago
parent 137fb49951
commit 8311e9fcb4

@ -31,9 +31,20 @@
#error Do not include this file directly, use ck_pr.h
#endif
#include <ck_cc.h>
CK_CC_INLINE
static void ck_pr_barrier(void)
{
__asm__ __volatile__("" ::: "memory");
return;
}
#ifndef CK_F_PR
#define CK_F_PR
#include <stdbool.h>
#include <ck_stdint.h>
#include <ck_cc.h>
/*
* 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 */

@ -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

@ -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

@ -40,6 +40,11 @@
*/
#include "ck_f_pr.h"
/*
* Minimum interface requirement met.
*/
#define CK_F_PR
/*
* Order loads at the least.
*/

Loading…
Cancel
Save