random cleanup. removed unused stuff, and comments about long-gone bits. Reference: /n/atom/patch/applied/nixportfixes Date: Thu Jun 12 04:55:07 CES 2014 Signed-off-by: quanstro@quanstro.net --- /sys/src/nix/port/sysproc.c Thu Jun 12 04:54:31 2014 +++ /sys/src/nix/port/sysproc.c Thu Jun 12 04:54:34 2014 @@ -193,7 +193,7 @@ p->mp = up->mp; wm = up->wired; - if(wm) + if(wm != nil) procwired(p, wm->machno); p->color = up->color; ready(p); @@ -525,9 +525,6 @@ } } - /* Text. Shared. Attaches to cache image if possible - * but prepaged if EXAC - */ img = attachimage(SG_TEXT|SG_RONLY, chan, up->color, UTZERO, textlim); s = img->s; up->seg[TSEG] = s; --- /sys/src/nix/port/segment.c Thu Jun 12 04:54:36 2014 +++ /sys/src/nix/port/segment.c Thu Jun 12 04:54:37 2014 @@ -99,7 +99,6 @@ { Pte **pp, **emap; Image *i; - extern void freezseg(Segment*); if(s == 0) return; --- /sys/src/nix/port/portclock.c Thu Jun 12 04:54:39 2014 +++ /sys/src/nix/port/portclock.c Thu Jun 12 04:54:40 2014 @@ -269,9 +269,7 @@ t = ticks; hz = HZ; t *= 1000L; - t = t/hz; - ticks = t; - return ticks; + return t/hz; } ulong --- /sys/src/nix/port/edf.c Thu Jun 12 04:54:43 2014 +++ /sys/src/nix/port/edf.c Thu Jun 12 04:54:45 2014 @@ -19,8 +19,6 @@ static long now; /* Low order 32 bits of time in µs */ /* Statistics stuff */ -ulong nilcount; -ulong scheds; ulong edfnrun; int misseddeadlines; @@ -79,7 +77,8 @@ return fmtstrcpy(f, buf); } -long edfcycles; +uvlong edfcycles; +static uvlong edfenter; Edf* edflock(Proc *p) @@ -91,9 +90,7 @@ ilock(&thelock); if((e = p->edf) && (e->flags & Admitted)){ locksetpc(&thelock, getcallerpc(&p)); -#ifdef EDFCYCLES - edfcycles -= lcycles(); -#endif + cycles(&edfenter); now = µs(); return e; } @@ -104,10 +101,10 @@ void edfunlock(void) { + uvlong t; -#ifdef EDFCYCLES - edfcycles += lcycles(); -#endif + cycles(&t); + edfcycles += t-edfenter; edfnrun++; iunlock(&thelock); } --- /sys/src/nix/port/devsd.c Thu Jun 12 04:54:49 2014 +++ /sys/src/nix/port/devsd.c Thu Jun 12 04:54:51 2014 @@ -1275,7 +1275,7 @@ if(unit->sectors){ if(unit->dev->ifc->rctl == nil) l += snprint(p+l, m-l, - "geometry %llud %lud\n", + "geometry %llud %ud\n", unit->sectors, unit->secsize); pp = unit->part; for(i = 0; i < unit->npart; i++){