From 981e0a49a2a6af4333a9a2f24c6b7376e86a502e Mon Sep 17 00:00:00 2001 From: Abel Mathew Date: Sat, 15 Sep 2012 15:18:06 -0400 Subject: [PATCH] ck_bag: Use CK_MD_VMA_BITS --- include/ck_bag.h | 6 +++--- src/ck_bag.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/ck_bag.h b/include/ck_bag.h index 8c08530..ee47f8d 100644 --- a/include/ck_bag.h +++ b/include/ck_bag.h @@ -75,7 +75,7 @@ struct ck_bag_block_info { /* * Determine whether pointer packing should be enabled. */ -#if defined(CK_BAG_PP) && defined(CK_MD_POINTER_PACK_ENABLE) +#if defined(CK_MD_POINTER_PACK_ENABLE) && defined(CK_MD_VMA_BITS) #define CK_BAG_PP #endif @@ -114,7 +114,7 @@ struct ck_bag_iterator { typedef struct ck_bag_iterator ck_bag_iterator_t; #ifdef CK_BAG_PP -#define CK_BAG_BLOCK_ENTRIES_MASK ((uintptr_t)0xFFFF << 48) +#define CK_BAG_BLOCK_ENTRIES_MASK ((uintptr_t)0xFFFF << CK_MD_VMA_BITS) #endif CK_CC_INLINE static struct ck_bag_block * @@ -140,7 +140,7 @@ ck_bag_block_count(struct ck_bag_block *block) { #ifdef CK_BAG_PP - return (uintptr_t)ck_pr_load_ptr(&block->next.ptr) >> 48; + return (uintptr_t)ck_pr_load_ptr(&block->next.ptr) >> CK_MD_VMA_BITS; #else return (uintptr_t)ck_pr_load_ptr(&block->next.n_entries); #endif diff --git a/src/ck_bag.c b/src/ck_bag.c index 6c7e36d..5d96e35 100644 --- a/src/ck_bag.c +++ b/src/ck_bag.c @@ -164,7 +164,7 @@ ck_bag_put_spmc(struct ck_bag *bag, void *entry) ck_pr_fence_store(); #ifdef CK_BAG_PP - next = ((uintptr_t)n_entries_block << 48); + next = ((uintptr_t)n_entries_block << CK_MD_VMA_BITS); #endif @@ -284,7 +284,7 @@ found: next_ptr = (uintptr_t)(void *)ck_bag_block_next(copy->next.ptr); #ifdef CK_BAG_PP - copy->next.ptr = (void *)(((uintptr_t)n_entries << 48) | next_ptr); + copy->next.ptr = (void *)(((uintptr_t)n_entries << CK_MD_VMA_BITS) | next_ptr); #else copy->next.n_entries = n_entries; copy->next.ptr = (struct ck_bag_block *)next_ptr;