Module Name:    src
Committed By:   mrg
Date:           Mon Jan 30 05:42:54 UTC 2012

Modified Files:
        src/sys/kern: kern_malloc.c

Log Message:
make sure that the 'struct malloc' header on allocations is properly
aligned to (ALIGNBYTES+1).  this ensures that the memory that malloc(9)
returns is correctly aligned for the platform.  this change has an
effect on hppa, ia64, sparc and sparc64.

necessary on sparc for 8-byte load/store instructions.  with this my
SS20 boots multiuser again.


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 src/sys/kern/kern_malloc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/kern_malloc.c
diff -u src/sys/kern/kern_malloc.c:1.136 src/sys/kern/kern_malloc.c:1.137
--- src/sys/kern/kern_malloc.c:1.136	Mon Jan 30 01:56:47 2012
+++ src/sys/kern/kern_malloc.c	Mon Jan 30 05:42:54 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_malloc.c,v 1.136 2012/01/30 01:56:47 rmind Exp $	*/
+/*	$NetBSD: kern_malloc.c,v 1.137 2012/01/30 05:42:54 mrg Exp $	*/
 
 /*
  * Copyright (c) 1987, 1991, 1993
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_malloc.c,v 1.136 2012/01/30 01:56:47 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_malloc.c,v 1.137 2012/01/30 05:42:54 mrg Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -93,7 +93,7 @@ kmutex_t malloc_lock;
 struct malloc_header {
 	/* Total size, include the header. */
 	size_t		mh_size;
-};
+} __aligned(ALIGNBYTES+1);
 
 /*
  * Allocate a block of memory

Reply via email to