Browse Source

Continue to de-anonymize. Five a day.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Ronald G. Minnich 8 years ago
parent
commit
8699867eae
4 changed files with 22 additions and 22 deletions
  1. 1 1
      sys/src/9/port/devcons.c
  2. 11 11
      sys/src/9/port/devfdmux.c
  3. 3 3
      sys/src/9/port/devmntn.c
  4. 7 7
      sys/src/9/port/devuart.c

+ 1 - 1
sys/src/9/port/devcons.c

@@ -51,7 +51,7 @@ static	Consdev	consdevs[Nconsdevs] =			/* keep this order */
 
 static struct
 {
-	QLock;
+	QLock QLock;
 
 	int	raw;		/* true if we shouldn't process input */
 	Ref	ctl;		/* number of opens to the control file */

+ 11 - 11
sys/src/9/port/devfdmux.c

@@ -22,7 +22,7 @@
 typedef struct Fdmux	Fdmux;
 struct Fdmux
 {
-	QLock;
+	QLock QLock;
 	Fdmux	*next;
 	int	ref;
 	uint32_t	path;
@@ -39,7 +39,7 @@ struct Fdmux
 
 struct
 {
-	Lock;
+	Lock Lock;
 	uint32_t	path;
 } fdmuxalloc;
 
@@ -119,9 +119,9 @@ fdmuxattach(char *spec)
 		exhausted("memory");
 	}
 
-	lock(&fdmuxalloc);
+	lock(&fdmuxalloc.Lock);
 	p->path = ++fdmuxalloc.path;
-	unlock(&fdmuxalloc);
+	unlock(&fdmuxalloc.Lock);
 
 	mkqid(&c->qid, FDMUXQID(2*p->path, Qdir), 0, QTDIR);
 	c->aux = p;
@@ -172,7 +172,7 @@ fdmuxwalk(Chan *c, Chan *nc, char **name, int nname)
 	wq = devwalk(c, nc, name, nname, fdmuxdir, NFDMUXDIR, fdmuxgen);
 	if(wq != nil && wq->clone != nil && wq->clone != c){
 		p = c->aux;
-		qlock(p);
+		qlock(&p->QLock);
 		p->ref++;
 		if(c->flag & COPEN){
 			print("channel open in fdmuxwalk\n");
@@ -185,7 +185,7 @@ fdmuxwalk(Chan *c, Chan *nc, char **name, int nname)
 				break;
 			}
 		}
-		qunlock(p);
+		qunlock(&p->QLock);
 	}
 	return wq;
 }
@@ -235,7 +235,7 @@ fdmuxopen(Chan *c, int omode)
 	}
 
 	p = c->aux;
-	qlock(p);
+	qlock(&p->QLock);
 	switch(FDMUXTYPE(c->qid.path)){
 	case Qdata0:
 		p->qref[0]++;
@@ -244,7 +244,7 @@ fdmuxopen(Chan *c, int omode)
 		p->qref[1]++;
 		break;
 	}
-	qunlock(p);
+	qunlock(&p->QLock);
 
 	c->mode = openmode(omode);
 	c->flag |= COPEN;
@@ -266,7 +266,7 @@ fdmuxclose(Chan *c)
 		p->dead = 1;
 	 */
 
-	qlock(p);
+	qlock(&p->QLock);
 
 	if(c->flag & COPEN){
 		/*
@@ -297,12 +297,12 @@ fdmuxclose(Chan *c)
 	 */
 	p->ref--;
 	if(p->ref == 0){
-		qunlock(p);
+		qunlock(&p->QLock);
 		free(p->q[0]);
 		free(p->q[1]);
 		free(p);
 	} else
-		qunlock(p);
+		qunlock(&p->QLock);
 }
 
 static int32_t

+ 3 - 3
sys/src/9/port/devmntn.c

@@ -54,7 +54,7 @@ enum
 
 struct Mntalloc
 {
-	Lock;
+	Lock Lock;
 	Mnt*	list;		/* Mount devices in use */
 	Mnt*	mntfree;	/* Free list */
 	Mntrpc*	rpcfree;
@@ -489,9 +489,9 @@ mntchann(void)
         Chan *c;
 
         c = devattach('N', 0);
-        lock(&mntalloc);
+        lock(&mntalloc.Lock);
         c->devno = mntalloc.id++;
-        unlock(&mntalloc);
+        unlock(&mntalloc.Lock);
 
         if(c->mchan)
                 panic("mntchan non-zero %#p", c->mchan);

+ 7 - 7
sys/src/9/port/devuart.c

@@ -44,7 +44,7 @@ static int uartndir;
 static Timer *uarttimer;
 
 struct Uartalloc {
-	Lock;
+	Lock Lock;
 	Uart *elist;	/* list of enabled interfaces */
 } uartalloc;
 
@@ -98,7 +98,7 @@ uartenable(Uart *p)
 		uartctl(p, "b9600");
 	(*p->phys->enable)(p, 1);
 
-	lock(&uartalloc);
+	lock(&uartalloc.Lock);
 	for(l = &uartalloc.elist; *l; l = &(*l)->elist){
 		if(*l == p)
 			break;
@@ -108,7 +108,7 @@ uartenable(Uart *p)
 		uartalloc.elist = p;
 	}
 	p->enabled = 1;
-	unlock(&uartalloc);
+	unlock(&uartalloc.Lock);
 
 	return p;
 }
@@ -120,7 +120,7 @@ uartdisable(Uart *p)
 
 	(*p->phys->disable)(p);
 
-	lock(&uartalloc);
+	lock(&uartalloc.Lock);
 	for(l = &uartalloc.elist; *l; l = &(*l)->elist){
 		if(*l == p){
 			*l = p->elist;
@@ -128,7 +128,7 @@ uartdisable(Uart *p)
 		}
 	}
 	p->enabled = 0;
-	unlock(&uartalloc);
+	unlock(&uartalloc.Lock);
 }
 
 static void
@@ -692,7 +692,7 @@ uartclock(void)
 {
 	Uart *p;
 
-	lock(&uartalloc);
+	lock(&uartalloc.Lock);
 	for(p = uartalloc.elist; p; p = p->elist){
 
 		if(p->phys->poll != nil)
@@ -722,5 +722,5 @@ uartclock(void)
 			iunlock(&p->tlock);
 		}
 	}
-	unlock(&uartalloc);
+	unlock(&uartalloc.Lock);
 }