Module Name:    src
Committed By:   kamil
Date:           Sat May 26 18:18:19 UTC 2018

Modified Files:
        src/sys/compat/netbsd32: netbsd32_sysctl.c

Log Message:
Handle vm.maxaddress in compat_netbsd32(8)

Return VM_MAXUSER_ADDRESS32 instead of the 64-bit specific address.

Use CTLTYPE_INT instead of CTLTYPE_LONG in order to retain the same integer
type between 64-bit native kernel and 32-bit emulated program.

There probably should be CTLTYPE_LONG32 available for this purpose.

On NetBSD/i386:
vm.maxaddress=bfeff000

On NetBSD/amd64:
vm.maxaddress=7fbfdfeff000

On NetBSD/amd64 running i386 program:
vm.maxaddress=fffff000

A 32-bit program on the 64-bit kernel can use larger user space, this
difference is on purpose and expected.

Sponsored by <The NetBSD Foundation>


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/compat/netbsd32/netbsd32_sysctl.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/compat/netbsd32/netbsd32_sysctl.c
diff -u src/sys/compat/netbsd32/netbsd32_sysctl.c:1.38 src/sys/compat/netbsd32/netbsd32_sysctl.c:1.39
--- src/sys/compat/netbsd32/netbsd32_sysctl.c:1.38	Tue Oct 31 16:10:25 2017
+++ src/sys/compat/netbsd32/netbsd32_sysctl.c	Sat May 26 18:18:19 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_sysctl.c,v 1.38 2017/10/31 16:10:25 kre Exp $	*/
+/*	$NetBSD: netbsd32_sysctl.c,v 1.39 2018/05/26 18:18:19 kamil Exp $	*/
 
 /*
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysctl.c,v 1.38 2017/10/31 16:10:25 kre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysctl.c,v 1.39 2018/05/26 18:18:19 kamil Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ddb.h"
@@ -147,6 +147,12 @@ netbsd32_sysctl_init(void)
 		       netbsd32_sysctl_vm_loadavg, 0, NULL,
 		       sizeof(struct netbsd32_loadavg),
 		       CTL_VM, VM_LOADAVG, CTL_EOL);
+	sysctl_createv(&netbsd32_clog, 0, &_root, NULL,
+		       CTLFLAG_PERMANENT|CTLFLAG_IMMEDIATE,
+		       CTLTYPE_INT, "maxaddress",
+		       SYSCTL_DESCR("Maximum user address"),
+		       NULL, VM_MAXUSER_ADDRESS32, NULL, 0,
+		       CTL_VM, VM_MAXADDRESS, CTL_EOL);
 
 	sysctl_createv(&netbsd32_clog, 0, &_root, NULL,
 		       CTLFLAG_PERMANENT,

Reply via email to