Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev conditionally elide conditional for rump.



details:   https://anonhg.NetBSD.org/src/rev/33aba16c6368
branches:  trunk
changeset: 320868:33aba16c6368
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Mar 03 19:26:12 2018 +0000

description:
conditionally elide conditional for rump.

diffstat:

 sys/dev/md.c |  16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r 7467ebd2f36a -r 33aba16c6368 sys/dev/md.c
--- a/sys/dev/md.c      Sat Mar 03 19:21:59 2018 +0000
+++ b/sys/dev/md.c      Sat Mar 03 19:26:12 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.79 2017/10/28 03:47:24 riastradh Exp $        */
+/*     $NetBSD: md.c,v 1.80 2018/03/03 19:26:12 christos Exp $ */
 
 /*
  * Copyright (c) 1995 Gordon W. Ross, Leo Weppelman.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: md.c,v 1.79 2017/10/28 03:47:24 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: md.c,v 1.80 2018/03/03 19:26:12 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_md.h"
@@ -633,8 +633,16 @@
        /* Sanity check addr, size. */
        end = (vaddr_t) ((char *)umd->md_addr + umd->md_size);
 
-       if ((end >= VM_MAXUSER_ADDRESS) ||
-               (end < ((vaddr_t) umd->md_addr)) )
+       if (
+#ifndef _RUMPKERNEL
+           /*
+            * On some architectures (e.g. powerpc) rump kernel provides
+            * "safe" low defaults which make this test fail since malloc
+            * does return higher addresses than the "safe" default.
+            */
+           (end >= VM_MAXUSER_ADDRESS) ||
+#endif
+           (end < ((vaddr_t) umd->md_addr)))
                return EINVAL;
 
        /* This unit is now configured. */



Home | Main Index | Thread Index | Old Index