Browse Source

Plan 9 from Bell Labs 2003-03-19

David du Colombier 21 years ago
parent
commit
57595fea54

+ 3 - 3
dist/replica/plan9.db

@@ -5268,8 +5268,8 @@ sys/src/9/port/page.c - 664 sys sys 1014931177 8086
 sys/src/9/port/parse.c - 664 sys sys 1014931177 2026
 sys/src/9/port/pgrp.c - 664 sys sys 1032052809 3925
 sys/src/9/port/portclock.c - 664 sys sys 1047260623 3835
-sys/src/9/port/portdat.h - 664 sys sys 1047260623 21132
-sys/src/9/port/portfns.h - 664 sys sys 1047260622 10601
+sys/src/9/port/portdat.h - 664 sys sys 1047995947 21197
+sys/src/9/port/portfns.h - 664 sys sys 1047995955 10620
 sys/src/9/port/portmkfile - 664 sys sys 1039753335 2372
 sys/src/9/port/print.c - 664 sys sys 1014931178 227
 sys/src/9/port/proc.c - 664 sys sys 1047952847 24170
@@ -5282,7 +5282,7 @@ sys/src/9/port/sd.h - 664 sys sys 1018386997 2702
 sys/src/9/port/segment.c - 664 sys sys 1032990942 13776
 sys/src/9/port/swap.c - 664 sys sys 1020284484 6986
 sys/src/9/port/sysfile.c - 664 sys sys 1014931179 15822
-sys/src/9/port/sysproc.c - 664 sys sys 1026847551 15145
+sys/src/9/port/sysproc.c - 664 sys sys 1047995943 15125
 sys/src/9/port/systab.h - 664 sys sys 1014931179 3044
 sys/src/9/port/taslock.c - 664 sys sys 1036813005 2896
 sys/src/9/port/thwack.c - 664 sys sys 1014931179 7253

+ 3 - 0
dist/replica/plan9.log

@@ -18615,3 +18615,6 @@
 1047952838 4 c sys/src/9/ip/ipv6.c - 664 sys sys 1047951328 14433
 1047952838 5 c sys/src/9/port/devproc.c - 664 sys sys 1047952847 23450
 1047952838 6 c sys/src/9/port/proc.c - 664 sys sys 1047952847 24170
+1047996055 0 c sys/src/9/port/portdat.h - 664 sys sys 1047995947 21197
+1047996055 1 c sys/src/9/port/portfns.h - 664 sys sys 1047995955 10620
+1047996055 2 c sys/src/9/port/sysproc.c - 664 sys sys 1047995943 15125

+ 1 - 0
sys/src/9/port/portdat.h

@@ -658,6 +658,7 @@ struct Proc
 	ulong	basepri;	/* base priority level */
 	uchar	fixedpri;	/* priority level deson't change */
 	int	quanta;		/* quanta left */
+	uchar	yield;		/* non-zero if the process just did a sleep(0) */
 	ulong	readytime;	/* time process came ready */
 	ulong	movetime;	/* last time process switched processors */
 	int	preempted;	/* true if this process hasn't finished the interrupt

+ 1 - 0
sys/src/9/port/portfns.h

@@ -366,6 +366,7 @@ void		xinit(void);
 int		xmerge(void*, void*);
 void*		xspanalloc(ulong, int, ulong);
 void		xsummary(void);
+void		yield(void);
 Segment*	data2txt(Segment*);
 Segment*	dupseg(Segment**, int, int);
 Segment*	newseg(int, ulong, ulong);

+ 1 - 2
sys/src/9/port/sysproc.c

@@ -540,8 +540,7 @@ syssleep(ulong *arg)
 
 	n = arg[0];
 	if(n <= 0) {
-		up->priority = 0;
-		sched();
+		yield();
 		return 0;
 	}
 	if(n < TK2MS(1))