rip away illusion of portability in ALIGN
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Thu, 20 Feb 1992 09:45:51 +0000 (01:45 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Thu, 20 Feb 1992 09:45:51 +0000 (01:45 -0800)
SCCS-vsn: sys/vax/include/param.h 7.21
SCCS-vsn: sys/tahoe/include/param.h 7.10
SCCS-vsn: sys/hp300/include/param.h 7.9
SCCS-vsn: sys/i386/include/param.h 5.9

usr/src/sys/hp300/include/param.h
usr/src/sys/i386/include/param.h
usr/src/sys/tahoe/include/param.h
usr/src/sys/vax/include/param.h

index eb3c59c..49d1891 100644 (file)
@@ -11,7 +11,7 @@
  *
  * from: Utah $Hdr: machparam.h 1.11 89/08/14$
  *
  *
  * from: Utah $Hdr: machparam.h 1.11 89/08/14$
  *
- *     @(#)param.h     7.8 (Berkeley) %G%
+ *     @(#)param.h     7.9 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
 #define        MACHINE "hp300"
 
 /*
 #define        MACHINE "hp300"
 
 /*
- * 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.
+ * 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.
  */
  */
-#define        ALIGN(p)        (((u_int)(p) + (sizeof(int) - 1)) &~ (sizeof(int) - 1))
+#define        ALIGN(p)        (((u_int)(p) + 3) &~ 3)
 
 #define        NBPG            4096            /* bytes/page */
 #define        PGOFSET         (NBPG-1)        /* byte offset into page */
 
 #define        NBPG            4096            /* bytes/page */
 #define        PGOFSET         (NBPG-1)        /* byte offset into page */
index 360da94..91cf8a2 100644 (file)
@@ -7,7 +7,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)param.h     5.8 (Berkeley) %G%
+ *     @(#)param.h     5.9 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
 #define MACHINE "i386"
 
 /*
 #define MACHINE "i386"
 
 /*
- * 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.
+ * 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.
  */
  */
-#define        ALIGN(p)        (((u_int)(p) + (sizeof(int) - 1)) &~ (sizeof(int) - 1))
+#define        ALIGN(p)        (((u_int)(p) + 3) &~ 3)
 
 #define        NBPG            4096            /* bytes/page */
 #define        PGOFSET         (NBPG-1)        /* byte offset into page */
 
 #define        NBPG            4096            /* bytes/page */
 #define        PGOFSET         (NBPG-1)        /* byte offset into page */
index 05cb86c..ffa8086 100644 (file)
@@ -7,7 +7,7 @@
  *
  * %sccs.include.proprietary.c%
  *
  *
  * %sccs.include.proprietary.c%
  *
- *     @(#)param.h     7.9 (Berkeley) %G%
+ *     @(#)param.h     7.10 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
 #define        MACHINE "tahoe"
 
 /*
 #define        MACHINE "tahoe"
 
 /*
- * 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.
+ * 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.
  */
  */
-#define        ALIGN(p)        (((u_int)(p) + (sizeof(int) - 1)) &~ (sizeof(int) - 1))
+#define        ALIGN(p)        (((u_int)(p) + 3) &~ 3)
 
 #define        NBPG            1024            /* bytes/page */
 #define        PGOFSET         (NBPG-1)        /* byte offset into page */
 
 #define        NBPG            1024            /* bytes/page */
 #define        PGOFSET         (NBPG-1)        /* byte offset into page */
index 949d531..fd04afd 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.proprietary.c%
  *
  *
  * %sccs.include.proprietary.c%
  *
- *     @(#)param.h     7.20 (Berkeley) %G%
+ *     @(#)param.h     7.21 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
 #define        MACHINE "vax"
 
 /*
 #define        MACHINE "vax"
 
 /*
- * 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.
+ * 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.
  */
  */
-#define        ALIGN(p)        (((u_int)(p) + (sizeof(int) - 1)) &~ (sizeof(int) - 1))
+#define        ALIGN(p)        (((u_int)(p) + 3) &~ 3)
 
 #define        KERNBASE        0x80000000      /* start of kernel virtual */
 #define        BTOPKERNBASE    ((u_long)KERNBASE >> PGSHIFT)
 
 #define        KERNBASE        0x80000000      /* start of kernel virtual */
 #define        BTOPKERNBASE    ((u_long)KERNBASE >> PGSHIFT)