changeset 172:6ba4c9d86232 false_sharing

VMS_defs.h: defines for aligning
author Merten Sach <msach@mailbox.tu-berlin.de>
date Tue, 20 Dec 2011 15:08:29 +0100
parents 5161414caa3e
children bfaebdf60df3
files VMS_defs.h
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- a/VMS_defs.h	Tue Dec 20 15:04:06 2011 +0100
     1.2 +++ b/VMS_defs.h	Tue Dec 20 15:08:29 2011 +0100
     1.3 @@ -10,6 +10,15 @@
     1.4  #define	_VMS_DEFS_H
     1.5  #define _GNU_SOURCE
     1.6  
     1.7 +//===============================  Hardware  ===================================
     1.8 +// This aligns the variable to a 256 byte boundary, therefore padding the gaps.
     1.9 +// This is apparently not true for data on the stack. Which is I guess not an
    1.10 +// issue because they are only used in the cores own coreloop
    1.11 +#define CACHELINE_SIZE 256
    1.12 +#define __align_to_cacheline__ __attribute__ ((aligned(CACHELINE_SIZE)))
    1.13 +//aligns a pointer to cacheline. The memory area has to contain at least
    1.14 +//CACHELINE_SIZE bytes more then needed
    1.15 +//#define __align_adress(ptr) (void*)(((uintptr_t)(ptr))&((uintptr_t)(!0x0FF)))+256
    1.16  
    1.17  //===============================  Debug  ===================================
    1.18  //