From owner-svn-src-head@FreeBSD.ORG Sun Jul 5 17:45:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D98AE106566C; Sun, 5 Jul 2009 17:45:48 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5B738FC15; Sun, 5 Jul 2009 17:45:48 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n65HjmV8055801; Sun, 5 Jul 2009 17:45:48 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n65Hjmdi055792; Sun, 5 Jul 2009 17:45:48 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907051745.n65Hjmdi055792@svn.freebsd.org> From: Sam Leffler Date: Sun, 5 Jul 2009 17:45:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195376 - in head/sys: amd64/include arm/include i386/include ia64/include mips/include powerpc/include sparc64/include sun4v/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 17:45:49 -0000 Author: sam Date: Sun Jul 5 17:45:48 2009 New Revision: 195376 URL: http://svn.freebsd.org/changeset/base/195376 Log: Cleanup ALIGNED_POINTER: o add to platforms where it was missing (arm, i386, powerpc, sparc64, sun4v) o define as "1" on amd64 and i386 where there is no restriction o make the type returned consistent with ALIGN o remove _ALIGNED_POINTER o make associated comments consistent Reviewed by: bde, imp, marcel Approved by: re (kensmith) Modified: head/sys/amd64/include/param.h head/sys/arm/include/param.h head/sys/i386/include/param.h head/sys/ia64/include/param.h head/sys/mips/include/param.h head/sys/powerpc/include/param.h head/sys/sparc64/include/param.h head/sys/sun4v/include/param.h Modified: head/sys/amd64/include/param.h ============================================================================== --- head/sys/amd64/include/param.h Sun Jul 5 16:55:57 2009 (r195375) +++ head/sys/amd64/include/param.h Sun Jul 5 17:45:48 2009 (r195376) @@ -47,12 +47,6 @@ * Round p (pointer or byte index) up to a correctly-aligned value * for all data types (int, long, ...). The result is u_long and * must be cast to any desired pointer type. - * - * ALIGNED_POINTER is a boolean macro that checks whether an address - * is valid to fetch data elements of type t from on this architecture. - * This does not reflect the optimal alignment, just the possibility - * (within reasonable limits). - * */ #ifndef _ALIGNBYTES #define _ALIGNBYTES (sizeof(long) - 1) @@ -60,9 +54,6 @@ #ifndef _ALIGN #define _ALIGN(p) (((u_long)(p) + _ALIGNBYTES) &~ _ALIGNBYTES) #endif -#ifndef _ALIGNED_POINTER -#define _ALIGNED_POINTER(p,t) ((((u_long)(p)) & (sizeof(t)-1)) == 0) -#endif #ifndef _NO_NAMESPACE_POLLUTION @@ -87,7 +78,13 @@ #define ALIGNBYTES _ALIGNBYTES #define ALIGN(p) _ALIGN(p) -#define ALIGNED_POINTER(p,t) _ALIGNED_POINTER(p,t) +/* + * ALIGNED_POINTER is a boolean macro that checks whether an address + * is valid to fetch data elements of type t from on this architecture. + * This does not reflect the optimal alignment, just the possibility + * (within reasonable limits). + */ +#define ALIGNED_POINTER(p, t) 1 /* * CACHE_LINE_SIZE is the compile-time maximum cache line size for an Modified: head/sys/arm/include/param.h ============================================================================== --- head/sys/arm/include/param.h Sun Jul 5 16:55:57 2009 (r195375) +++ head/sys/arm/include/param.h Sun Jul 5 17:45:48 2009 (r195376) @@ -80,6 +80,13 @@ #define ALIGNBYTES _ALIGNBYTES #define ALIGN(p) _ALIGN(p) +/* + * ALIGNED_POINTER is a boolean macro that checks whether an address + * is valid to fetch data elements of type t from on this architecture. + * This does not reflect the optimal alignment, just the possibility + * (within reasonable limits). + */ +#define ALIGNED_POINTER(p, t) ((((unsigned)(p)) & (sizeof(t)-1)) == 0) /* * CACHE_LINE_SIZE is the compile-time maximum cache line size for an Modified: head/sys/i386/include/param.h ============================================================================== --- head/sys/i386/include/param.h Sun Jul 5 16:55:57 2009 (r195375) +++ head/sys/i386/include/param.h Sun Jul 5 17:45:48 2009 (r195376) @@ -73,6 +73,13 @@ #define ALIGNBYTES _ALIGNBYTES #define ALIGN(p) _ALIGN(p) +/* + * ALIGNED_POINTER is a boolean macro that checks whether an address + * is valid to fetch data elements of type t from on this architecture. + * This does not reflect the optimal alignment, just the possibility + * (within reasonable limits). + */ +#define ALIGNED_POINTER(p, t) 1 /* * CACHE_LINE_SIZE is the compile-time maximum cache line size for an Modified: head/sys/ia64/include/param.h ============================================================================== --- head/sys/ia64/include/param.h Sun Jul 5 16:55:57 2009 (r195375) +++ head/sys/ia64/include/param.h Sun Jul 5 17:45:48 2009 (r195376) @@ -46,12 +46,6 @@ * Round p (pointer or byte index) up to a correctly-aligned value for all * data types (int, long, ...). The result is u_long and must be cast to * any desired pointer type. - * - * ALIGNED_POINTER is a boolean macro that checks whether an address - * is valid to fetch data elements of type t from on this architecture. - * This does not reflect the optimal alignment, just the possibility - * (within reasonable limits). - * */ #ifndef _ALIGNBYTES #define _ALIGNBYTES 15 @@ -59,9 +53,6 @@ #ifndef _ALIGN #define _ALIGN(p) (((u_long)(p) + _ALIGNBYTES) &~ _ALIGNBYTES) #endif -#ifndef _ALIGNED_POINTER -#define _ALIGNED_POINTER(p,t) ((((u_long)(p)) & (sizeof(t)-1)) == 0) -#endif #ifndef _NO_NAMESPACE_POLLUTION @@ -84,20 +75,15 @@ #define MAXCPU 1 #endif +#define ALIGNBYTES _ALIGNBYTES +#define ALIGN(p) _ALIGN(p) /* - * Round p (pointer or byte index) up to a correctly-aligned value for all - * data types (int, long, ...). The result is u_long and must be cast to - * any desired pointer type. - * * ALIGNED_POINTER is a boolean macro that checks whether an address * is valid to fetch data elements of type t from on this architecture. * This does not reflect the optimal alignment, just the possibility * (within reasonable limits). - * */ -#define ALIGNBYTES _ALIGNBYTES -#define ALIGN(p) _ALIGN(p) -#define ALIGNED_POINTER(p,t) _ALIGNED_POINTER(p,t) +#define ALIGNED_POINTER(p,t) ((((u_long)(p)) & (sizeof(t)-1)) == 0) /* * CACHE_LINE_SIZE is the compile-time maximum cache line size for an Modified: head/sys/mips/include/param.h ============================================================================== --- head/sys/mips/include/param.h Sun Jul 5 16:55:57 2009 (r195375) +++ head/sys/mips/include/param.h Sun Jul 5 17:45:48 2009 (r195376) @@ -84,10 +84,16 @@ */ #define _ALIGNBYTES 7 #define _ALIGN(p) (((u_int)(p) + _ALIGNBYTES) &~ _ALIGNBYTES) -#define ALIGNED_POINTER(p, t) ((((u_int32_t)(p)) & (sizeof (t) - 1)) == 0) #define ALIGNBYTES _ALIGNBYTES #define ALIGN(p) _ALIGN(p) +/* + * ALIGNED_POINTER is a boolean macro that checks whether an address + * is valid to fetch data elements of type t from on this architecture. + * This does not reflect the optimal alignment, just the possibility + * (within reasonable limits). + */ +#define ALIGNED_POINTER(p, t) ((((unsigned)(p)) & (sizeof (t) - 1)) == 0) /* * CACHE_LINE_SIZE is the compile-time maximum cache line size for an Modified: head/sys/powerpc/include/param.h ============================================================================== --- head/sys/powerpc/include/param.h Sun Jul 5 16:55:57 2009 (r195375) +++ head/sys/powerpc/include/param.h Sun Jul 5 17:45:48 2009 (r195376) @@ -78,6 +78,13 @@ #define ALIGNBYTES _ALIGNBYTES #define ALIGN(p) _ALIGN(p) +/* + * ALIGNED_POINTER is a boolean macro that checks whether an address + * is valid to fetch data elements of type t from on this architecture. + * This does not reflect the optimal alignment, just the possibility + * (within reasonable limits). + */ +#define ALIGNED_POINTER(p, t) ((((unsigned)(p)) & (sizeof (t) - 1)) == 0) /* * CACHE_LINE_SIZE is the compile-time maximum cache line size for an Modified: head/sys/sparc64/include/param.h ============================================================================== --- head/sys/sparc64/include/param.h Sun Jul 5 16:55:57 2009 (r195375) +++ head/sys/sparc64/include/param.h Sun Jul 5 17:45:48 2009 (r195376) @@ -70,6 +70,13 @@ #define ALIGNBYTES _ALIGNBYTES #define ALIGN(p) _ALIGN(p) +/* + * ALIGNED_POINTER is a boolean macro that checks whether an address + * is valid to fetch data elements of type t from on this architecture. + * This does not reflect the optimal alignment, just the possibility + * (within reasonable limits). + */ +#define ALIGNED_POINTER(p, t) ((((u_long)(p)) & (sizeof (t) - 1)) == 0) /* * CACHE_LINE_SIZE is the compile-time maximum cache line size for an Modified: head/sys/sun4v/include/param.h ============================================================================== --- head/sys/sun4v/include/param.h Sun Jul 5 16:55:57 2009 (r195375) +++ head/sys/sun4v/include/param.h Sun Jul 5 17:45:48 2009 (r195376) @@ -70,6 +70,13 @@ #define ALIGNBYTES _ALIGNBYTES #define ALIGN(p) _ALIGN(p) +/* + * ALIGNED_POINTER is a boolean macro that checks whether an address + * is valid to fetch data elements of type t from on this architecture. + * This does not reflect the optimal alignment, just the possibility + * (within reasonable limits). + */ +#define ALIGNED_POINTER(p, t) ((((u_long)(p)) & (sizeof (t) - 1)) == 0) /* * CACHE_LINE_SIZE is the compile-time maximum cache line size for an