shithub: riscv

Download patch

ref: b21482828b1597b5db66878611d50c0f70254af6
parent: 3133a2a4e70740906fd69abe6a2304f8bdedd448
parent: 00572496ce8e2e3919586a0ce3df1fc457220ae5
author: cinap_lenrek <[email protected]>
date: Fri Nov 6 12:28:29 EST 2015

merge

--- a/sys/src/9/port/fault.c
+++ b/sys/src/9/port/fault.c
@@ -237,10 +237,8 @@
 				return -1;
 			*pg = new;
 		}
-		goto common;
-
-	case SG_DATA:
-	common:			/* Demand load/pagein/copy on write */
+		/* wet floor */
+	case SG_DATA:			/* Demand load/pagein/copy on write */
 		if(pagedout(*pg))
 			pio(s, addr, soff, pg);
 
@@ -279,6 +277,7 @@
 			new->ref = 1;
 			*pg = new;
 		}
+		/* wet floor */
 	case SG_FIXED:			/* Never paged out */
 		if (checkaddr && addr == addr2check)
 			(*checkaddr)(addr, s, *pg);
@@ -301,7 +300,7 @@
 {
 	Segment *s;
 
-	if((long)len >= 0 && addr+len >= addr) {
+	if((long)len >= 0 && len <= -addr) {
 		for(;;) {
 			s = seg(up, addr, 0);
 			if(s == nil || (write && (s->type&SG_RONLY)))