Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Jul 2009 19:06:15 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r195580 - projects/mips/sys/mips/include
Message-ID:  <200907101906.n6AJ6F3T029299@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Fri Jul 10 19:06:15 2009
New Revision: 195580
URL: http://svn.freebsd.org/changeset/base/195580

Log:
  Fixed aligned macros...
  
  # I'm not sure bde will like this, but I want to commit it for others to review
  # as well. :)

Modified:
  projects/mips/sys/mips/include/param.h

Modified: projects/mips/sys/mips/include/param.h
==============================================================================
--- projects/mips/sys/mips/include/param.h	Fri Jul 10 19:04:32 2009	(r195579)
+++ projects/mips/sys/mips/include/param.h	Fri Jul 10 19:06:15 2009	(r195580)
@@ -80,11 +80,11 @@
 /*
  * Round p (pointer or byte index) up to a correctly-aligned value for all
  * data types (int, long, ...).	  The result is u_int and must be cast to
- * any desired pointer type.
+ * any desired pointer type. XXX u_int isn't big enough to hod a pointer.
  */
 #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	_ALIGN(p)	(((uintptr_t)(p) + _ALIGNBYTES) &~ _ALIGNBYTES)
+#define	ALIGNED_POINTER(p, t)	((((uintptr_t)(p)) & (sizeof (t) - 1)) == 0)
 
 #define	ALIGNBYTES	_ALIGNBYTES
 #define	ALIGN(p)	_ALIGN(p)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907101906.n6AJ6F3T029299>