Module Name: src
Committed By: martin
Date: Sun Jun 14 16:20:44 UTC 2015
Modified Files:
src/sys/arch/sparc/stand/ofwboot: loadfile_machdep.c
Log Message:
Fix available length calculation in kvamap_extract when reusing existing
mappings.
To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \
src/sys/arch/sparc/stand/ofwboot/loadfile_machdep.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/arch/sparc/stand/ofwboot/loadfile_machdep.c
diff -u src/sys/arch/sparc/stand/ofwboot/loadfile_machdep.c:1.13 src/sys/arch/sparc/stand/ofwboot/loadfile_machdep.c:1.14
--- src/sys/arch/sparc/stand/ofwboot/loadfile_machdep.c:1.13 Mon Apr 21 18:10:40 2014
+++ src/sys/arch/sparc/stand/ofwboot/loadfile_machdep.c Sun Jun 14 16:20:44 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: loadfile_machdep.c,v 1.13 2014/04/21 18:10:40 palle Exp $ */
+/* $NetBSD: loadfile_machdep.c,v 1.14 2015/06/14 16:20:44 martin Exp $ */
/*-
* Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -136,13 +136,13 @@ kvamap_extract(vaddr_t va, vsize_t len,
if (kvamap[i].start == NULL)
break;
if ((kvamap[i].start <= va) && (va < kvamap[i].end)) {
- uint64_t va_len = kvamap[i].end - va + kvamap[i].start;
+ uint64_t va_len = kvamap[i].end - va;
len = (va_len < len) ? len - va_len : 0;
*new_va = kvamap[i].end;
}
}
- return (len);
+ return len;
}
/*