Subject: Re: uvm_km_valloc_align() and USPACE (Re: CVS commit: syssrc)
To: None <soda@sra.co.jp>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: tech-kern
Date: 12/01/2000 02:10:35
In <200011290956.SAA02294@srapc342.sra.co.jp>
soda@sra.co.jp wrote:

> For me, adding a symbol like USPACE_ALIGNMENT and use the symbol
> for uvm_km_valloc_align seems to be the right thing.
> 
> The USPACE_ALIGNMENT on mips should be USPACE,
> and the value on other architectures should be NBPG.

Is the attached patch OK?
Now uvm_km_valloc() in uvm_km.c should be macro?
---
Izumi Tsutsui
tsutsui@ceres.dti.ne.jp

Index: kern/kern_fork.c
===================================================================
RCS file: /cvsroot/syssrc/sys/kern/kern_fork.c,v
retrieving revision 1.77
diff -u -r1.77 kern_fork.c
--- kern/kern_fork.c	2000/11/27 04:36:41	1.77
+++ kern/kern_fork.c	2000/11/30 17:02:27
@@ -65,6 +65,10 @@
 
 #include <uvm/uvm_extern.h>
 
+#ifndef USPACE_ALIGN
+#define USPACE_ALIGN	NBPG
+#endif
+
 int	nprocs = 1;		/* process 0 */
 
 /*ARGSUSED*/
@@ -145,7 +149,7 @@
 	 * kernel virtual address space.  The actual U-area pages will
 	 * be allocated and wired in vm_fork().
 	 */
-	uaddr = uvm_km_valloc_align(kernel_map, USPACE, USPACE);
+	uaddr = uvm_km_valloc_align(kernel_map, USPACE, USPACE_ALIGN);
 	if (__predict_false(uaddr == 0)) {
 		(void)chgproccnt(uid, -1);
 		nprocs--;
Index: arch/mips/include/mips_param.h
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/mips/include/mips_param.h,v
retrieving revision 1.20
diff -u -r1.20 mips_param.h
--- arch/mips/include/mips_param.h	2000/06/09 04:37:51	1.20
+++ arch/mips/include/mips_param.h	2000/11/30 17:02:27
@@ -13,7 +13,8 @@
 #define	SINCR		1		/* increment of stack/NBPG */
 
 #define	UPAGES		2		/* pages of u-area */
-#define USPACE          (UPAGES*NBPG)   /* size of u-area in bytes */
+#define USPACE		(UPAGES*NBPG)	/* size of u-area in bytes */
+#define USPACE_ALIGN	USPACE		/* alignment for u-area in bytes */
 
 #ifndef MSGBUFSIZE
 #define MSGBUFSIZE	NBPG		/* default message buffer size */