pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/emulators/mmix Fix PR pkg/32721



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d30146d5ffbe
branches:  trunk
changeset: 507675:d30146d5ffbe
user:      tonio <tonio%pkgsrc.org@localhost>
date:      Mon Feb 06 16:10:14 2006 +0000

description:
Fix PR pkg/32721
Apply the suggested solution: rename wait() to mmix_wait() in mmix-pipe.w
to avoid name clash

diffstat:

 emulators/mmix/Makefile         |    4 +-
 emulators/mmix/distinfo         |    3 +-
 emulators/mmix/patches/patch-ab |  884 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 888 insertions(+), 3 deletions(-)

diffs (truncated from 913 to 300 lines):

diff -r 03b9a641f787 -r d30146d5ffbe emulators/mmix/Makefile
--- a/emulators/mmix/Makefile   Mon Feb 06 15:59:58 2006 +0000
+++ b/emulators/mmix/Makefile   Mon Feb 06 16:10:14 2006 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.20 2006/02/05 23:09:02 joerg Exp $
+# $NetBSD: Makefile,v 1.21 2006/02/06 16:10:14 tonio Exp $
 
 DISTNAME=      mmix-20030622
-PKGREVISION=   2
+PKGREVISION=   3
 CATEGORIES=    emulators devel lang
 MASTER_SITES=  http://www-cs-faculty.stanford.edu/~knuth/programs/
 
diff -r 03b9a641f787 -r d30146d5ffbe emulators/mmix/distinfo
--- a/emulators/mmix/distinfo   Mon Feb 06 15:59:58 2006 +0000
+++ b/emulators/mmix/distinfo   Mon Feb 06 16:10:14 2006 +0000
@@ -1,6 +1,7 @@
-$NetBSD: distinfo,v 1.6 2005/02/23 18:49:19 agc Exp $
+$NetBSD: distinfo,v 1.7 2006/02/06 16:10:14 tonio Exp $
 
 SHA1 (mmix-20030622.tar.gz) = 6e953ba5767879b96e08f9eb58a4a0a900a56f43
 RMD160 (mmix-20030622.tar.gz) = 288e1d6779264077ff3e7a431af461e9e33142c5
 Size (mmix-20030622.tar.gz) = 304746 bytes
 SHA1 (patch-aa) = 927eabd1b0d1180fb909ca943b511fa325601c7e
+SHA1 (patch-ab) = 33753c745d8bfaae51f29ad059285d4573b2aa0d
diff -r 03b9a641f787 -r d30146d5ffbe emulators/mmix/patches/patch-ab
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/mmix/patches/patch-ab   Mon Feb 06 16:10:14 2006 +0000
@@ -0,0 +1,884 @@
+$NetBSD: patch-ab,v 1.1 2006/02/06 16:10:14 tonio Exp $
+
+--- mmix-pipe.w.orig   2003-06-16 00:18:12.000000000 +0200
++++ mmix-pipe.w
+@@ -2355,9 +2355,9 @@ it says |goto done|. It will not be sche
+ unless the |schedule| routine has been called since it began execution.
+ The |wait| macro is a convenient way to say ``Please schedule me to resume
+ again at the current |data->state|'' after a specified time; for example,
+-|wait(1)| will restart a coroutine on the next clock tick.
++|mmix_wait(1)| will restart a coroutine on the next clock tick.
+ 
+-@d wait(t)@+ {@+schedule(self,t,data->state);@+ goto done;@+}
++@d mmix_wait(t)@+ {@+schedule(self,t,data->state);@+ goto done;@+}
+ @d pass_after(t)  schedule(self+1,t,data->state)
+ @d sleep@+ {@+self->next=self;@+ goto done;@+} /* wait forever */
+ @d awaken(c,t)  schedule(c,t,c->ctl->state)
+@@ -2459,7 +2459,7 @@ if (data->ra.p) {
+   else if (data->need_ra) j+=10;
+ }
+ if (j<10) data->state=1;
+-if (j) wait(1); /* otherwise we fall through to case 1 */
++if (j) mmix_wait(1); /* otherwise we fall through to case 1 */
+ 
+ @ Simple register-to-register instructions like \.{ADD} are assumed to take
+ just one cycle, but others like \.{FADD} almost certainly require more time.
+@@ -2500,7 +2500,7 @@ if (data->i<=max_pipe_op) {@+register un
+   j=s[0]+data->denin;
+   if (s[1]) data->state=2; /* more than one stage */
+   else j+=data->denout;
+-  if (j>1) wait(j-1);
++  if (j>1) mmix_wait(j-1);
+ }
+ goto switch1;
+ 
+@@ -2509,7 +2509,7 @@ unit is |self+1|.
+ 
+ @<Pass |data| to the next stage of the pipeline@>=
+ pass_data:@+
+-if ((self+1)->next) wait(1); /* stall if the next stage is occupied */
++if ((self+1)->next) mmix_wait(1); /* stall if the next stage is occupied */
+ {@+register unsigned char *s=pipe_seq[data->i];
+   j=s[self->stage];
+   if (s[self->stage+1]==0) j+=data->denout,data->state=3;
+@@ -3766,7 +3766,7 @@ or~|Dcache|. The data to be written will
+ @<Cases for control of special coroutines@>=
+ case flush_to_mem: {@+register cache *c=(cache *)data->ptr_a;
+  switch (data->state) {
+-  case 0:@+ if (mem_lock) wait(1);
++  case 0:@+ if (mem_lock) mmix_wait(1);
+     data->state=1;
+   case 1: set_lock(self,mem_lock);
+     data->state=2;
+@@ -3796,7 +3796,7 @@ case flush_to_mem: {@+register cache *c=
+       i++;@+ off++;@+ addr.l+=8;
+     }
+   }
+-  wait(mem_addr_time+count*mem_write_time);
++  mmix_wait(mem_addr_time+count*mem_write_time);
+ }
+ 
+ @* Cache transfers. We have seen that the |Dcache->flusher| sends
+@@ -3819,23 +3819,23 @@ case flush_to_S: {@+register cache *c=(c
+   register int block_diff=Scache->bb-c->bb;
+   p=(cacheblock*)data->ptr_b;
+  switch (data->state) {
+-  case 0:@+ if (Scache->lock) wait(1);
++  case 0:@+ if (Scache->lock) mmix_wait(1);
+     data->state=1;
+   case 1: set_lock(self,Scache->lock);
+     data->ptr_b=(void*)cache_search(Scache,c->outbuf.tag);
+     if (data->ptr_b) data->state=4;
+     else if (Scache->mode & WRITE_ALLOC) data->state=(block_diff? 2: 3);
+     else data->state=6;
+-    wait(Scache->access_time);
++    mmix_wait(Scache->access_time);
+   case 2: @<Fill |Scache->inbuf| with clean memory data@>;
+   case 3: @<Allocate a slot |p| in the S-cache@>;
+     if (block_diff) @<Copy |Scache->inbuf| to slot |p|@>;         
+   case 4: copy_block(c,&(c->outbuf),Scache,p);
+     hit_set=cache_addr(Scache,c->outbuf.tag);@+ use_and_fix(Scache,p);
+                    /* |p| not moved */
+-    data->state=5;@+ wait(Scache->copy_in_time);
++    data->state=5;@+ mmix_wait(Scache->copy_in_time);
+   case 5:@+ if ((Scache->mode&WRITE_BACK)==0) { /* write-through */
+-      if (Scache->flusher.next) wait(1);
++      if (Scache->flusher.next) mmix_wait(1);
+       flush_cache(Scache,p,true);
+     }
+     goto terminate;
+@@ -3844,9 +3844,9 @@ case flush_to_S: {@+register cache *c=(c
+ }
+ 
+ @ @<Allocate a slot |p| in the S-cache@>=
+-if (Scache->filler.next) wait(1); /* perhaps an unnecessary precaution? */
++if (Scache->filler.next) mmix_wait(1); /* perhaps an unnecessary precaution? */
+ p=alloc_slot(Scache,c->outbuf.tag);
+-if (!p) wait(1);
++if (!p) mmix_wait(1);
+ data->ptr_b=(void*)p;
+ p->tag=c->outbuf.tag;@+ p->tag.l=c->outbuf.tag.l&(-Scache->bb);
+ 
+@@ -3857,7 +3857,7 @@ read them all and to charge only for rea
+ {@+register int count=block_diff>>3;
+   register int off,delay;
+   octa addr;
+-  if (mem_lock) wait(1);
++  if (mem_lock) mmix_wait(1);
+   addr.h=c->outbuf.tag.h;@+ addr.l=c->outbuf.tag.l&-Scache->bb;
+   off=(addr.l&0xffff)>>3;
+   for (j=0;j<Scache->bb>>3;j++)
+@@ -3866,7 +3866,7 @@ read them all and to charge only for rea
+   set_lock(&mem_locker,mem_lock);
+   delay=mem_addr_time+(int)((count+bus_words-1)/(bus_words))*mem_read_time;
+   startup(&mem_locker,delay);
+-  data->state=3;@+ wait(delay);
++  data->state=3;@+ mmix_wait(delay);
+ }  
+ 
+ @ @<Copy |Scache->inbuf| to slot |p|@>=
+@@ -3878,7 +3878,7 @@ read them all and to charge only for rea
+ @ Here we assume that the granularity is~8.
+ 
+ @<Handle write-around when flushing to the S-cache@>=
+-if (Scache->flusher.next) wait(1);
++if (Scache->flusher.next) mmix_wait(1);
+ Scache->outbuf.tag.h=c->outbuf.tag.h;
+ Scache->outbuf.tag.l=c->outbuf.tag.l&(-Scache->bb);
+ for (j=0;j<Scache->bb>>Scache->g;j++) Scache->outbuf.dirty[j]=false;
+@@ -3920,12 +3920,12 @@ case fill_from_mem: {@+register cache *c
+   case 1: release_lock(self,mem_lock);
+     data->state=2;
+   case 2:@+if (c!=Scache) {
+-      if (c->lock) wait(1);
++      if (c->lock) mmix_wait(1);
+       set_lock(self,c->lock);
+     }
+     if (cc) awaken(cc,c->copy_in_time); /* the second wakeup call */
+     load_cache(c,(cacheblock*)data->ptr_b);
+-    data->state=3;@+ wait(c->copy_in_time);
++    data->state=3;@+ mmix_wait(c->copy_in_time);
+   case 3: goto terminate;
+  }
+ }
+@@ -3939,8 +3939,8 @@ cycle, so that there will be two wakeup 
+   c->inbuf.tag=data->z.o;@+ c->inbuf.tag.l &= -c->bb;
+   count=c->bb>>3, off=(c->inbuf.tag.l&0xffff)>>3;
+   for (i=0;i<count;i++,off++) c->inbuf.data[i]=mem_hash[last_h].chunk[off];
+-  if (count<=bus_words) wait(1+mem_read_time)@;
+-  else wait((int)(count/bus_words)*mem_read_time);
++  if (count<=bus_words) mmix_wait(1+mem_read_time)@;
++  else mmix_wait((int)(count/bus_words)*mem_read_time);
+ }
+ 
+ @ The |fill_from_S| coroutine has the same conventions as |fill_from_mem|,
+@@ -3969,12 +3969,12 @@ case fill_from_S: {@+register cache *c=(
+       awaken(cc,Scache->access_time);
+     }
+   case 3: @<Copy data from |p| into |c->inbuf|@>;
+-    data->state=4;@+wait(Scache->access_time);
+-  case 4:@+ if (c->lock) wait(1);
++    data->state=4;@+mmix_wait(Scache->access_time);
++  case 4:@+ if (c->lock) mmix_wait(1);
+     set_lock(self,c->lock);
+     Scache->lock=NULL; /* we had been holding that lock */
+     load_cache(c,(cacheblock*)data->ptr_b);
+-    data->state=5;@+ wait(c->copy_in_time);
++    data->state=5;@+ mmix_wait(c->copy_in_time);
+   case 5:@+if (cc) awaken(cc,1); /* second wakeup call */
+     goto terminate;
+   }
+@@ -3987,9 +3987,9 @@ but we will point to |Scache->fill_lock|
+ because the present coroutine is not abortable.
+ 
+ @<Start the S-cache filler@>=
+-if (Scache->filler.next || mem_lock) wait(1);
++if (Scache->filler.next || mem_lock) mmix_wait(1);
+ p=alloc_slot(Scache,data->z.o);
+-if (!p) wait(1);
++if (!p) mmix_wait(1);
+ set_lock(&Scache->filler,mem_lock);
+ set_lock(self,Scache->fill_lock);
+ data->ptr_c=Scache->filler_ctl.ptr_b=(void *)p;
+@@ -4079,7 +4079,7 @@ case 10: goto terminate;
+ }
+ 
+ @ @<Cases 0 through 4, for the D-cache@>=
+-case 0:@+ if (Dcache->lock || (j=get_reader(Dcache)<0)) wait(1);
++case 0:@+ if (Dcache->lock || (j=get_reader(Dcache)<0)) mmix_wait(1);
+   startup(&Dcache->reader[j],Dcache->access_time);
+   set_lock(self,Dcache->lock);
+   i=j=0;
+@@ -4091,18 +4091,18 @@ Dclean_loop: p=(i<Dcache->cc? &(Dcache->
+   data->y.o.h=i, data->y.o.l=j;
+ Dclean: data->state=1;@+
+   data->ptr_b=(void*)p;@+
+-  wait(Dcache->access_time);
+-case 1:@+if (Dcache->flusher.next) wait(1);
++  mmix_wait(Dcache->access_time);
++case 1:@+if (Dcache->flusher.next) mmix_wait(1);
+   flush_cache(Dcache,p,data->x.o.h==0);
+   p->tag.h|=data->x.o.h;
+   release_lock(self,Dcache->lock);
+   data->state=2;@+
+-  wait(Dcache->copy_out_time);
++  mmix_wait(Dcache->copy_out_time);
+ case 2:@+ if (!clean_lock) goto done; /* premature termination */
+-  if (Dcache->flusher.next) wait(1);
++  if (Dcache->flusher.next) mmix_wait(1);
+   if (data->i!=sync) goto Sprep;
+   data->state=3;
+-case 3:@+ if (Dcache->lock || (j=get_reader(Dcache)<0)) wait(1);
++case 3:@+ if (Dcache->lock || (j=get_reader(Dcache)<0)) mmix_wait(1);
+   startup(&Dcache->reader[j],Dcache->access_time);
+   set_lock(self,Dcache->lock);
+   i=data->y.o.h, j=data->y.o.l;
+@@ -4110,10 +4110,10 @@ Dclean_inc: j++;
+   if (i<Dcache->cc && j==Dcache->aa) j=0, i++;
+   if (i==Dcache->cc && j==Dcache->vv) {
+     data->state=5;@+
+-    wait(Dcache->access_time);
++    mmix_wait(Dcache->access_time);
+   }
+   goto Dclean_loop;
+-case 4:@+ if (Dcache->lock || (j=get_reader(Dcache)<0)) wait(1);
++case 4:@+ if (Dcache->lock || (j=get_reader(Dcache)<0)) mmix_wait(1);
+   startup(&Dcache->reader[j],Dcache->access_time);
+   set_lock(self,Dcache->lock);
+   p=cache_search(Dcache,data->z.o);
+@@ -4122,12 +4122,12 @@ case 4:@+ if (Dcache->lock || (j=get_rea
+     if (is_dirty(Dcache,p)) goto Dclean;
+   }
+   data->state=9;@+
+-  wait(Dcache->access_time);
++  mmix_wait(Dcache->access_time);
+ 
+ @ @<Cases 5 through 9...@>=
+ case 5:@+ if (self->lockloc) *(self->lockloc)=NULL, self->lockloc=NULL;
+   if (!Scache) goto done;
+-  if (Scache->lock) wait(1);
++  if (Scache->lock) mmix_wait(1);
+   set_lock(self,Scache->lock);
+   i=j=0;
+ Sclean_loop: p=(i<Scache->cc? &(Scache->set[i][j]): &(Scache->victim[j]));
+@@ -4138,31 +4138,31 @@ Sclean_loop: p=(i<Scache->cc? &(Scache->
+   data->y.o.h=i, data->y.o.l=j;
+ Sclean: data->state=6;@+
+   data->ptr_b=(void*)p;@+
+-  wait(Scache->access_time);
+-case 6:@+if (Scache->flusher.next) wait(1);
++  mmix_wait(Scache->access_time);
++case 6:@+if (Scache->flusher.next) mmix_wait(1);
+   flush_cache(Scache,p,data->x.o.h==0);
+   p->tag.h|=data->x.o.h;
+   release_lock(self,Scache->lock);
+   data->state=7;@+
+-  wait(Scache->copy_out_time);
++  mmix_wait(Scache->copy_out_time);
+ case 7:@+ if (!clean_lock) goto done; /* premature termination */
+-  if (Scache->flusher.next) wait(1);
++  if (Scache->flusher.next) mmix_wait(1);
+   if (data->i!=sync) goto done;
+   data->state=8;
+-case 8:@+ if (Scache->lock) wait(1);
++case 8:@+ if (Scache->lock) mmix_wait(1);
+   set_lock(self,Scache->lock);
+   i=data->y.o.h, j=data->y.o.l;
+ Sclean_inc: j++;
+   if (i<Scache->cc && j==Scache->aa) j=0, i++;
+   if (i==Scache->cc && j==Scache->vv) {
+     data->state=10;@+
+-    wait(Scache->access_time);



Home | Main Index | Thread Index | Old Index