vx32

Local 9vx git repository for patches.
git clone git://r-36.net/vx32
Log | Files | Refs

proc.ed (2531B)


      1 1i
      2 #define	WANT_M
      3 .
      4 /edf.*Admitted/,/edfrecord/d
      5 /edfstop/,/edf = nil/d
      6 ,s/(!p->edf)/(1)/
      7 ,s/edfready(p)/0/g
      8 /edflock/,/edfunlock/+1d
      9 g/edfstop(up)/d
     10 ,s/(p = procalloc.free)/(&)/
     11 ,s/lock(runq)/lock(\&runq->lk)/
     12 ,s/lock(\&procalloc)/lock(\&procalloc.lk)/
     13 ,s/lock(r)/lock(\&r->lk)/
     14 /^newproc/ s/^//
     15 /^	return p/i
     16 	vxnewproc(p);
     17 .
     18 /^twakeup/ s/Ureg\*,/Ureg *ureg,/
     19 ,s/up->tt/up->timer.tt/g
     20 ,s/up->tns/up->timer.tns/g
     21 ,s/up->tf/up->timer.tf/g
     22 ,s/up->timer.tfn/up->tfn/g
     23 ,s/up->ta/up->timer.ta/g
     24 ,s/up->tmode/up->timer.tmode/g
     25 ,s/timeradd(up)/timeradd(\&up->timer)/g
     26 ,s/timerdel(up)/timerdel(\&up->timer)/g
     27 ,s/up->twhen/up->timer.twhen/g
     28 ,s/lock(p->rgrp)/lock(\&p->rgrp->ref.lk)/
     29 ,s/Lock;/Lock lk;/g
     30 ,s/lock(\&broken)/lock(\&broken.lk)/g
     31 ,s/MACHP(0)->ticks/msec()/g
     32 ,s/lock(\&palloc)/lock(\&palloc.lk)/g
     33 ,s/ref(p->dot)/ref(\&p->dot->ref)/g
     34 ,s/ref(kpgrp)/ref(\&kpgrp->ref)/g
     35 g/"edf.h"/d
     36 g/Edf/d
     37 ,s;\.Lock\.;.lk.;g
     38 /^schedinit/ s/^//
     39 /	setlabel(\&m->sched)/a
     40 	if(traceprocs)	// Plan 9 VX
     41 		print("schedinit %p %p %s\n", m, up, up ? up->text : "");
     42 .
     43 /^sched(void)/+3a
     44 	if(traceprocs)	// Plan 9 VX
     45 		print("sched %p %p [%s]\n", m, up, up ? up->text : "");
     46 .
     47 /if(setlabel(\&up->sched))/a
     48 			if(traceprocs)
     49 				print("sched %p %p: awake\n", m, up);
     50 .
     51 /^		}/a
     52 		if(traceprocs)
     53 			print("sched %p %p: entering scheduler\n", m, up);
     54 .
     55 /^	}/a
     56 	if(traceprocs)
     57 		print("sched %p %p: runproc", m, up);
     58 .
     59 ,s/m->ticks/msec()/g
     60 /^	mmuswitch(up)/i
     61 	if(traceprocs)
     62 		print("run %p %p [%s]\n", m, up, up->text);
     63 .
     64 /^ready/ s/^/_/
     65 /^runproc/ s/^/_/
     66 /never mind/+1a
     67 		if(traceprocs)
     68 			print("sleep %p %p: already happened\n", m, up);
     69 .
     70 /if(setlabel(\&up->sched))/a
     71 			if(traceprocs)
     72 				print("sleep %p %p: awake\n", m, up);
     73 .
     74 /} else {/a
     75 			if(traceprocs)
     76 				print("sleep %p %p: sleeping\n", m, up);
     77 .
     78 /p->fpsave = up->fpsave/,/p->dbgreg = 0/c
     79 	if(up){
     80 		p->fpsave = up->fpsave;
     81 		p->scallnr = up->scallnr;
     82 		p->s = up->s;
     83 		p->slash = up->slash;
     84 		p->dot = up->dot;
     85 		if(p->dot)
     86 			incref(&p->dot->ref);
     87 
     88 		memmove(p->note, up->note, sizeof(p->note));
     89 		p->nnote = up->nnote;
     90 		p->lastnote = up->lastnote;
     91 		p->notify = up->notify;
     92 	}
     93 
     94  	p->notified = 0;
     95  	p->ureg = 0;
     96  	p->dbgreg = 0;
     97 	p->nerrlab = 0;
     98 .
     99 /^	ready(p)/+1,/flushmmu/d
    100 /^newproc/ s/^//
    101 /p->procctl = 0;/c
    102 	if(up && up->procctl == Proc_tracesyscall)
    103 		p->procctl = Proc_tracesyscall;
    104 	else
    105 		p->procctl = 0;
    106 	p->syscalltrace = 0;
    107 .
    108 /up->alarm = 0;/i
    109 	if(up->syscalltrace)
    110 		free(up->syscalltrace);
    111 .
    112 /p = newproc();/i
    113 	extern int tracekdev;
    114 	if(tracekdev)
    115 		iprint("kproc %s\n", name);
    116 
    117 .