From 583f14fd6c6aa06582b63d1b1707633e5b1cf834 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Thu, 11 Oct 2012 13:54:08 +0800 Subject: [PATCH] cachealign: Fix __VM_CACHELINE_ALIGN With-Input-from: dillon@ --- sys/sys/cdefs.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 8d5e8d7..086a957 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -76,8 +76,9 @@ * header, but currently, we do need such a hierarchy. */ #define __VM_CACHELINE_SIZE 64 +#define __VM_CACHELINE_MASK (__VM_CACHELINE_SIZE - 1) #define __VM_CACHELINE_ALIGN(n) \ - (((n) + __VM_CACHELINE_SIZE - 1) / __VM_CACHELINE_SIZE) + (((n) + __VM_CACHELINE_MASK) & ~__VM_CACHELINE_MASK) /* * The __CONCAT macro is used to concatenate parts of symbol names, e.g. -- 1.7.7.2