Skip to content

Commit

Permalink
define CACHE_LINE_SIZE in arch_*.h
Browse files Browse the repository at this point in the history
Signed-off-by: Mathieu Desnoyers <[email protected]>
  • Loading branch information
Mathieu Desnoyers committed Sep 29, 2009
1 parent 49d7d15 commit b4e52e3
Show file tree
Hide file tree
Showing 16 changed files with 8 additions and 39 deletions.
4 changes: 2 additions & 2 deletions tests/api_ppc.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

#define CONFIG_PPC64

#define CACHE_LINE_SIZE 128
/*#define CACHE_LINE_SIZE 128 */
#define ____cacheline_internodealigned_in_smp \
__attribute__((__aligned__(1 << 7)))

Expand Down Expand Up @@ -665,7 +665,7 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
*/

#ifndef CACHE_LINE_SIZE
#define CACHE_LINE_SIZE 128
/* #define CACHE_LINE_SIZE 128 */
#endif /* #ifndef CACHE_LINE_SIZE */

/*
Expand Down
2 changes: 1 addition & 1 deletion tests/api_x86.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
* Machine parameters.
*/

#define CACHE_LINE_SIZE 64
/* #define CACHE_LINE_SIZE 64 */
#define ____cacheline_internodealigned_in_smp \
__attribute__((__aligned__(1 << 6)))

Expand Down
3 changes: 0 additions & 3 deletions tests/test_mutex.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@

#include <urcu/arch.h>

/* Make this big enough to include the POWER5+ L3 cacheline size of 256B */
#define CACHE_LINE_SIZE 4096

/* hardcoded number of CPUs */
#define NR_CPUS 16384

Expand Down
3 changes: 0 additions & 3 deletions tests/test_perthreadlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@

#include <urcu/arch.h>

/* Make this big enough to include the POWER5+ L3 cacheline size of 256B */
#define CACHE_LINE_SIZE 4096

/* hardcoded number of CPUs */
#define NR_CPUS 16384

Expand Down
3 changes: 0 additions & 3 deletions tests/test_perthreadlock_timing.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@

#include <urcu/arch.h>

/* Make this big enough to include the POWER5+ L3 cacheline size of 256B */
#define CACHE_LINE_SIZE 4096

#if defined(_syscall0)
_syscall0(pid_t, gettid)
#elif defined(__NR_gettid)
Expand Down
3 changes: 0 additions & 3 deletions tests/test_qsbr.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@

#include <urcu/arch.h>

/* Make this big enough to include the POWER5+ L3 cacheline size of 256B */
#define CACHE_LINE_SIZE 4096

/* hardcoded number of CPUs */
#define NR_CPUS 16384

Expand Down
3 changes: 0 additions & 3 deletions tests/test_qsbr_gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@

#include <urcu/arch.h>

/* Make this big enough to include the POWER5+ L3 cacheline size of 256B */
#define CACHE_LINE_SIZE 4096

/* hardcoded number of CPUs */
#define NR_CPUS 16384

Expand Down
3 changes: 0 additions & 3 deletions tests/test_qsbr_timing.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
#include <sys/syscall.h>
#include <urcu/arch.h>

/* Make this big enough to include the POWER5+ L3 cacheline size of 256B */
#define CACHE_LINE_SIZE 4096

#if defined(_syscall0)
_syscall0(pid_t, gettid)
#elif defined(__NR_gettid)
Expand Down
3 changes: 0 additions & 3 deletions tests/test_rwlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@

#include <urcu/arch.h>

/* Make this big enough to include the POWER5+ L3 cacheline size of 256B */
#define CACHE_LINE_SIZE 4096

/* hardcoded number of CPUs */
#define NR_CPUS 16384

Expand Down
3 changes: 0 additions & 3 deletions tests/test_rwlock_timing.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
#include <pthread.h>
#include <urcu/arch.h>

/* Make this big enough to include the POWER5+ L3 cacheline size of 256B */
#define CACHE_LINE_SIZE 4096

#if defined(_syscall0)
_syscall0(pid_t, gettid)
#elif defined(__NR_gettid)
Expand Down
3 changes: 0 additions & 3 deletions tests/test_urcu.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@

#include <urcu/arch.h>

/* Make this big enough to include the POWER5+ L3 cacheline size of 256B */
#define CACHE_LINE_SIZE 4096

/* hardcoded number of CPUs */
#define NR_CPUS 16384

Expand Down
3 changes: 0 additions & 3 deletions tests/test_urcu_defer.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@

#include <urcu/arch.h>

/* Make this big enough to include the POWER5+ L3 cacheline size of 256B */
#define CACHE_LINE_SIZE 4096

/* hardcoded number of CPUs */
#define NR_CPUS 16384

Expand Down
3 changes: 0 additions & 3 deletions tests/test_urcu_gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@

#include <urcu/arch.h>

/* Make this big enough to include the POWER5+ L3 cacheline size of 256B */
#define CACHE_LINE_SIZE 4096

/* hardcoded number of CPUs */
#define NR_CPUS 16384

Expand Down
3 changes: 0 additions & 3 deletions tests/test_urcu_timing.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
#include <sys/syscall.h>
#include <urcu/arch.h>

/* Make this big enough to include the POWER5+ L3 cacheline size of 256B */
#define CACHE_LINE_SIZE 4096

#if defined(_syscall0)
_syscall0(pid_t, gettid)
#elif defined(__NR_gettid)
Expand Down
3 changes: 3 additions & 0 deletions urcu/arch_ppc.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
#define CONFIG_HAVE_FENCE 1
#define CONFIG_HAVE_MEM_COHERENCY

/* Include size of POWER5+ L3 cache lines: 256 bytes */
#define CACHE_LINE_SIZE 256

#ifndef BITS_PER_LONG
#define BITS_PER_LONG (__SIZEOF_LONG__ * 8)
#endif
Expand Down
2 changes: 2 additions & 0 deletions urcu/arch_x86.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#define CONFIG_HAVE_FENCE 1
#define CONFIG_HAVE_MEM_COHERENCY

#define CACHE_LINE_SIZE 128

#ifndef BITS_PER_LONG
#define BITS_PER_LONG (__SIZEOF_LONG__ * 8)
#endif
Expand Down

0 comments on commit b4e52e3

Please sign in to comment.