svn commit: r200625 - in stable/7/sys: amd64/include arm/include i386/include ia64/include powerpc/include sparc64/include sun4v/include

Marius Strobl marius at FreeBSD.org
Thu Dec 17 07:36:41 UTC 2009


Author: marius
Date: Thu Dec 17 07:36:40 2009
New Revision: 200625
URL: http://svn.freebsd.org/changeset/base/200625

Log:
  MFC: r195376
  
  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:	sam (MFC to stable/7)

Modified:
  stable/7/sys/amd64/include/param.h
  stable/7/sys/arm/include/param.h
  stable/7/sys/i386/include/param.h
  stable/7/sys/ia64/include/param.h
  stable/7/sys/powerpc/include/param.h
  stable/7/sys/sparc64/include/param.h
  stable/7/sys/sun4v/include/param.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/amd64/include/param.h
==============================================================================
--- stable/7/sys/amd64/include/param.h	Thu Dec 17 07:18:06 2009	(r200624)
+++ stable/7/sys/amd64/include/param.h	Thu Dec 17 07:36:40 2009	(r200625)
@@ -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
 
 
 /* Size of the level 1 page table units */

Modified: stable/7/sys/arm/include/param.h
==============================================================================
--- stable/7/sys/arm/include/param.h	Thu Dec 17 07:18:06 2009	(r200624)
+++ stable/7/sys/arm/include/param.h	Thu Dec 17 07:36:40 2009	(r200625)
@@ -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)
 
 #define	PAGE_SHIFT	12
 #define	PAGE_SIZE	(1 << PAGE_SHIFT)	/* Page size */

Modified: stable/7/sys/i386/include/param.h
==============================================================================
--- stable/7/sys/i386/include/param.h	Thu Dec 17 07:18:06 2009	(r200624)
+++ stable/7/sys/i386/include/param.h	Thu Dec 17 07:36:40 2009	(r200625)
@@ -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
 
 #define PAGE_SHIFT	12		/* LOG2(PAGE_SIZE) */
 #define PAGE_SIZE	(1<<PAGE_SHIFT)	/* bytes/page */

Modified: stable/7/sys/ia64/include/param.h
==============================================================================
--- stable/7/sys/ia64/include/param.h	Thu Dec 17 07:18:06 2009	(r200624)
+++ stable/7/sys/ia64/include/param.h	Thu Dec 17 07:36:40 2009	(r200625)
@@ -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)
 
 #ifndef LOG2_PAGE_SIZE
 #define	LOG2_PAGE_SIZE		13		/* 8K pages by default. */

Modified: stable/7/sys/powerpc/include/param.h
==============================================================================
--- stable/7/sys/powerpc/include/param.h	Thu Dec 17 07:18:06 2009	(r200624)
+++ stable/7/sys/powerpc/include/param.h	Thu Dec 17 07:36:40 2009	(r200625)
@@ -75,6 +75,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)
 
 #define	PAGE_SHIFT	12
 #define	PAGE_SIZE	(1 << PAGE_SHIFT)	/* Page size */

Modified: stable/7/sys/sparc64/include/param.h
==============================================================================
--- stable/7/sys/sparc64/include/param.h	Thu Dec 17 07:18:06 2009	(r200624)
+++ stable/7/sys/sparc64/include/param.h	Thu Dec 17 07:36:40 2009	(r200625)
@@ -72,6 +72,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)
 
 #define	PAGE_SHIFT_8K	13
 #define	PAGE_SIZE_8K	(1L<<PAGE_SHIFT_8K)

Modified: stable/7/sys/sun4v/include/param.h
==============================================================================
--- stable/7/sys/sun4v/include/param.h	Thu Dec 17 07:18:06 2009	(r200624)
+++ stable/7/sys/sun4v/include/param.h	Thu Dec 17 07:36:40 2009	(r200625)
@@ -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)
 
 #define	PAGE_SHIFT_8K	13
 #define	PAGE_SIZE_8K	(1L<<PAGE_SHIFT_8K)


More information about the svn-src-all mailing list