git: 9front

Download patch

ref: 5c9350f32e4d754b7b6f6cacd841bec64999d944
parent: ed88bbce6290246ed6a93ba4a7fdb137a6e466ba
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Sun May 26 21:17:11 EDT 2013

kernel: dont copy fpsave on fork, simplify freeing waitq in pexit(), remove unused semlock from Proc sturcure

--- a/sys/src/9/pc/trap.c
+++ b/sys/src/9/pc/trap.c
@@ -734,10 +734,6 @@
 	scallnr = ureg->ax;
 	up->scallnr = scallnr;
 
-	if(scallnr == RFORK && up->fpstate == FPactive){
-		fpsave(&up->fpsave);
-		up->fpstate = FPinactive;
-	}
 	spllo();
 
 	up->nerrlab = 0;
--- a/sys/src/9/port/portdat.h
+++ b/sys/src/9/port/portdat.h
@@ -421,7 +421,6 @@
 	Pte	**map;
 	int	mapsize;
 	Pte	*ssegmap[SSEGMAPSIZE];
-	Lock	semalock;
 	Sema	sema;
 	ulong	mark;		/* portcountrefs */
 };
--- a/sys/src/9/port/proc.c
+++ b/sys/src/9/port/proc.c
@@ -1067,7 +1067,7 @@
 	Proc *p;
 	Segment **s, **es;
 	long utime, stime;
-	Waitq *wq, *f, *next;
+	Waitq *wq;
 	Fgrp *fgrp;
 	Egrp *egrp;
 	Rgrp *rgrp;
@@ -1178,9 +1178,9 @@
 	wakeup(&up->waitr);
 	unlock(&up->exl);
 
-	for(f = up->waitq; f; f = next) {
-		next = f->next;
-		free(f);
+	while((wq = up->waitq) != 0){
+		up->waitq = wq->next;
+		free(wq);
 	}
 
 	/* release debuggers */
@@ -1374,7 +1374,6 @@
 	p->kp = 1;
 	p->noswap = 1;
 
-	p->fpsave = up->fpsave;
 	p->scallnr = up->scallnr;
 	p->s = up->s;
 	p->nerrlab = 0;
--