shithub: riscv

Download patch

ref: 0b95485db79d3033cacd42038f0cf575e430e066
parent: 02fef73b8f09679bcd230d002e748bd945541372
author: cinap_lenrek <[email protected]>
date: Sun Feb 2 04:59:54 EST 2014

kernel: use uintptr when appropriate in syssegflush()

--- a/sys/src/9/port/segment.c
+++ b/sys/src/9/port/segment.c
@@ -713,10 +713,9 @@
 syssegflush(va_list list)
 {
 	Segment *s;
-	ulong len, l;
+	ulong len, chunk, l;
 	Pte *pte;
-	int chunk, ps, pe;
-	uintptr addr;
+	uintptr ps, pe, addr;
 
 	addr = va_arg(list, uintptr);
 	len = va_arg(list, ulong);
@@ -738,7 +737,7 @@
 		pe = PTEMAPMEM;
 		if(pe-ps > l){
 			pe = ps + l;
-			pe = (pe+BY2PG-1)&~(BY2PG-1);
+			pe = PGROUND(pe);
 		}
 		if(pe == ps) {
 			qunlock(&s->lk);