Browse Source

Remove remaining vestiges of broken NIX optimistic semaphores.

I think I got them all, it boots and runs fine.

Any day you can remove a whole file is a good day. It's the smell
of victory.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Ronald G. Minnich 7 years ago
parent
commit
e52c2e2d8e
3 changed files with 0 additions and 47 deletions
  1. 0 21
      sys/src/9/port/portdat.h
  2. 0 1
      sys/src/9/port/portfns.h
  3. 0 25
      sys/src/9/port/segment.c

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

@@ -55,9 +55,7 @@ typedef struct RWlock	RWlock;
 typedef struct Sched	Sched;
 typedef struct Schedq	Schedq;
 typedef struct Segment	Segment;
-typedef struct Sem	Sem;
 typedef struct Sema	Sema;
-typedef struct Sems	Sems;
 typedef struct Timer	Timer;
 typedef struct Timers	Timers;
 typedef struct Uart	Uart;
@@ -498,23 +496,6 @@ struct Sema
 	Sema*	prev;
 };
 
-/* NIX semaphores */
-struct Sem
-{
-	Lock l;
-	int*	np;		/* user-level semaphore */
-	Proc**	q;
-	int	nq;
-	Sem*	next;		/* in list of semaphores for this Segment */
-};
-
-/* NIX semaphores */
-struct Sems
-{
-	Sem**	s;
-	int	ns;
-};
-
 /* Zero copy per-segment information (locked using Segment.lk) */
 struct Zseg
 {
@@ -560,7 +541,6 @@ struct Segment
 	Pte	*ssegmap[SSEGMAPSIZE];
 	Lock	semalock;
 	Sema	sema;
-	Sems	sems;
 	Zseg	zseg;
 };
 
@@ -938,7 +918,6 @@ struct Proc
 	/* NIX */
 	Mach	*ac;
 	Page	*acpml4;
-	Sem	*waitsem;
 	int	prepagemem;
 	Nixpctl *nixpctl;	/* NIX queue based system calls */
 

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

@@ -349,7 +349,6 @@ void		schedinit(void);
 int32_t		seconds(void);
 Segment*	seg(Proc*, uintptr_t, int);
 void		segclock(uintptr_t);
-Sem*		segmksem(Segment*, int*);
 void		segpage(Segment*, Page*);
 char*		seprintmark(char *, char *, Watermark *);
 uintmem		segppn(Segment*, uintmem);

+ 0 - 25
sys/src/9/port/segment.c

@@ -90,29 +90,6 @@ newseg(int type, uintptr_t base, uint64_t size)
 	return s;
 }
 
-#define	NHASH 101
-#define SHASH(np)	(PTR2UINT(np)%NHASH)
-
-Sem*
-segmksem(Segment *sg, int *np)
-{
-	Sem *s, **l;
-
-	qlock(&sg->lk);
-	if(sg->sems.s == nil)
-		sg->sems.s = mallocz(NHASH * sizeof(Sem*), 1);
-	for(l = &sg->sems.s[SHASH(np)]; (s = *l) != nil; l = &s->next)
-		if(s->np == np){
-			qunlock(&sg->lk);
-			return s;
-		}
-	s = mallocz(sizeof *s, 1);
-	s->np = np;
-	*l = s;
-	qunlock(&sg->lk);
-	return s;
-}
-
 void
 putseg(Segment *s)
 {
@@ -155,8 +132,6 @@ putseg(Segment *s)
 		free(s->map);
 	if(s->profile != 0)
 		free(s->profile);
-	if(s->sems.s != nil)
-		free(s->sems.s);
 	if(s->type&SG_ZIO)
 		freezseg(s);
 	free(s);