shithub: riscv

Download patch

ref: 82a797da707881fa3188cab7424738cd07fe9c92
parent: ef647a54c006a2a748463c81132c22ecb01d2dac
author: cinap_lenrek <[email protected]>
date: Thu Apr 16 12:30:14 EDT 2015

kernel: leave shared, physical and fixed segments alone in killbig()

--- a/sys/src/9/port/proc.c
+++ b/sys/src/9/port/proc.c
@@ -1552,11 +1552,17 @@
 	kp->procctl = Proc_exitbig;
 	for(i = 0; i < NSEG; i++) {
 		s = kp->seg[i];
-		if(s != nil) {
-			qlock(s);
-			mfreeseg(s, s->base, (s->top - s->base)/BY2PG);
-			qunlock(s);
+		if(s == nil)
+			continue;
+		switch(s->type & SG_TYPE){
+		case SG_SHARED:
+		case SG_PHYSICAL:
+		case SG_FIXED:
+			continue;
 		}
+		qlock(s);
+		mfreeseg(s, s->base, (s->top - s->base)/BY2PG);
+		qunlock(s);
 	}
 	qunlock(&kp->seglock);
 }