| plan 9 kernel history: overview | file list | diff list |
1990/1012/gnot/clock.c (diff list | history)
| 1990/03091/sys/src/9/gnot/clock.c:98,105 – 1990/0312/sys/src/9/gnot/clock.c:98,107 (short | long) | ||
| 1990/03091 | SYNCREG[1] = 0x5F; /* clear interrupt */ m->ticks++; p = m->proc; | |
| 1990/0312 | if(p){ p->pc = ur->pc; | |
| 1990/03091 | p->time[p->insyscall]++; | |
| 1990/0312 | } | |
| 1990/03091 | if(canlock(&m->alarmlock)){ if(m->alarm){ a = m->alarm; | |
| 1990/0312/sys/src/9/gnot/clock.c:117,125 – 1990/0321/sys/src/9/gnot/clock.c:117,126 (short | long) | ||
| 1990/03091 | } unlock(&m->alarmlock); } | |
| 1990/0321 | kbdclock(); | |
| 1990/03091 | if((ur->sr&SPL(7)) == 0){ spllo(); if(p && p->state==Running) | |
| 1990/0321 | checksched(); | |
| 1990/03091 | } } | |
| 1990/0321/sys/src/9/gnot/clock.c:118,123 – 1990/0504/sys/src/9/gnot/clock.c:118,124 (short | long) | ||
| 1990/03091 | unlock(&m->alarmlock); } | |
| 1990/0321 | kbdclock(); | |
| 1990/0504 | mouseclock(); | |
| 1990/03091 | if((ur->sr&SPL(7)) == 0){ spllo(); if(p && p->state==Running) | |
| 1990/0504/sys/src/9/gnot/clock.c:17,23 – 1990/06111/sys/src/9/gnot/clock.c:17,23 (short | long) | ||
| 1990/03091 | if(ms < 0) ms = 0; a = newalarm(); | |
| 1990/06111 | a->dt = MS2TK(ms); | |
| 1990/03091 | a->f = f; a->arg = arg; s = splhi(); | |
| 1990/06111/sys/src/9/gnot/clock.c:121,127 – 1990/0703/sys/src/9/gnot/clock.c:121,130 (short | long) | ||
| 1990/0504 | mouseclock(); | |
| 1990/03091 | if((ur->sr&SPL(7)) == 0){ spllo(); | |
| 1990/0703 | if(p && p->state==Running){ | |
| 1990/0321 | checksched(); | |
| 1990/0703 | if(u->nnote && (ur->sr&SUPER)==0) notify(ur); } | |
| 1990/03091 | } } | |
| 1990/0703/sys/src/9/gnot/clock.c:87,99 – 1990/0728/sys/src/9/gnot/clock.c:87,101 (short | long) | ||
| 1990/03091 | ; } | |
| 1990/0728 | #define NA 10 | |
| 1990/03091 | void clock(Ureg *ur) { | |
| 1990/0728 | int i, n; | |
| 1990/03091 | Alarm *a; void (*f)(void*); Proc *p; | |
| 1990/0728 | Alarm *alist[NA]; | |
| 1990/03091 | SYNCREG[1] = 0x5F; /* clear interrupt */ m->ticks++; | |
| 1990/0703/sys/src/9/gnot/clock.c:106,121 – 1990/0728/sys/src/9/gnot/clock.c:108,129 | ||
| 1990/03091 | if(m->alarm){ a = m->alarm; a->dt--; | |
| 1990/0728 | for(n = 0; a && a->dt<=0 && n<NA; n++){ alist[n] = a; | |
| 1990/03091 | delete(&m->alarm, 0, a); | |
| 1990/0728 | unlock(&m->alarmlock); /* execute alarm functions outside the lock */ for(i = 0; i < n; i++){ f = alist[i]->f; /* avoid race with cancel */ if(f) (*f)(alist[i]); alist[i]->busy = 0; } } else unlock(&m->alarmlock); | |
| 1990/03091 | } | |
| 1990/0321 | kbdclock(); | |
| 1990/0504 | mouseclock(); | |
| 1990/0728/sys/src/9/gnot/clock.c:102,108 – 1990/1004/sys/src/9/gnot/clock.c:102,109 (short | long) | ||
| 1990/03091 | p = m->proc; | |
| 1990/0312 | if(p){ p->pc = ur->pc; | |
| 1990/03091 |
| |
| 1990/1004 | if (p->state==Running) p->time[p->insyscall]++; | |
| 1990/0312 | } | |
| 1990/03091 | if(canlock(&m->alarmlock)){ if(m->alarm){ | |
| 1990/0728/sys/src/9/gnot/clock.c:127,138 – 1990/1004/sys/src/9/gnot/clock.c:128,136 | ||
| 1990/03091 | } | |
| 1990/0321 | kbdclock(); | |
| 1990/0504 | mouseclock(); | |
| 1990/03091 |
| |
| 1990/0703 |
| |
| 1990/0321 |
| |
| 1990/0703 |
| |
| 1990/1004 | if((ur->sr&SPL(7)) == 0 && p && p->state==Running){ sched(); if(u->nnote && (ur->sr&SUPER)==0) notify(ur); | |
| 1990/03091 | } } | |
| 1990/1004/sys/src/9/gnot/clock.c:14,23 – 1990/1012/sys/src/9/gnot/clock.c:14,23 (short | long) | ||
| 1990/03091 | { Alarm *a, *w, *pw; ulong s; | |
| 1990/06111 | a->dt = MS2TK(ms); | |
| 1990/1012 | if(a->dt < 0) a->dt = 0; | |
| 1990/03091 | a->f = f; a->arg = arg; s = splhi(); | |
| 1990/1012/sys/src/9/gnot/clock.c:106,119 – 1990/1106/sys/src/9/gnot/clock.c:106,120 (short | long) | ||
| 1990/1004 | p->time[p->insyscall]++; | |
| 1990/0312 | } | |
| 1990/03091 | if(canlock(&m->alarmlock)){ | |
| 1990/0728 |
| |
| 1990/1106 | a = m->alarm; if(a){ for(n=0; a && a->dt<=0 && n<NA; n++){ | |
| 1990/0728 | alist[n] = a; | |
| 1990/03091 | delete(&m->alarm, 0, a); a = m->alarm; } | |
| 1990/1106 | if(a) a->dt--; | |
| 1990/0728 | unlock(&m->alarmlock); /* execute alarm functions outside the lock */ | |
| 1990/1106/sys/src/9/gnot/clock.c:7,82 – 1990/1211/sys/src/9/gnot/clock.c:7,13 (short | long) | ||
| 1990/03091 | #include "ureg.h" | |
| 1990/06111 |
| |
| 1990/1012 |
| |
| 1990/03091 |
| |
| 1990/1106/sys/src/9/gnot/clock.c:87,101 – 1990/1211/sys/src/9/gnot/clock.c:18,27 | ||
| 1990/03091 | ; } | |
| 1990/0728 |
| |
| 1990/03091 | void clock(Ureg *ur) { | |
| 1990/0728 |
| |
| 1990/03091 |
| |
| 1990/0728 |
| |
| 1990/03091 | SYNCREG[1] = 0x5F; /* clear interrupt */ m->ticks++; | |
| 1990/1106/sys/src/9/gnot/clock.c:105,132 – 1990/1211/sys/src/9/gnot/clock.c:31,37 | ||
| 1990/1004 | if (p->state==Running) p->time[p->insyscall]++; | |
| 1990/0312 | } | |
| 1990/03091 |
| |
| 1990/1106 |
| |
| 1990/0728 |
| |
| 1990/03091 |
| |
| 1990/1106 |
| |
| 1990/0728 |
| |
| 1990/03091 |
| |
| 1990/1211 | checkalarms(); | |
| 1990/0321 | kbdclock(); | |
| 1990/0504 | mouseclock(); | |
| 1990/1004 | if((ur->sr&SPL(7)) == 0 && p && p->state==Running){ | |
| 1990/1211/sys/src/9/gnot/clock.c:35,41 – 1990/1227/sys/src/9/gnot/clock.c:35,42 (short | long) | ||
| 1990/0321 | kbdclock(); | |
| 1990/0504 | mouseclock(); | |
| 1990/1004 | if((ur->sr&SPL(7)) == 0 && p && p->state==Running){ | |
| 1990/1227 | if(anyready()) sched(); | |
| 1990/1004 | if(u->nnote && (ur->sr&SUPER)==0) notify(ur); | |
| 1990/03091 | } | |
| 1990/1227/sys/src/9/gnot/clock.c:35,42 – 1991/0614/sys/src/9/gnot/clock.c:35,46 (short | long) | ||
| 1990/0321 | kbdclock(); | |
| 1990/0504 | mouseclock(); | |
| 1990/1004 | if((ur->sr&SPL(7)) == 0 && p && p->state==Running){ | |
| 1990/1227 |
| |
| 1991/0614 | if(anyready()){ if(p->hasspin) p->hasspin = 0; else sched(); } | |
| 1990/1004 | if(u->nnote && (ur->sr&SUPER)==0) notify(ur); | |
| 1990/03091 | } | |
| 1991/0614/sys/src/9/gnot/clock.c:41,47 – 1991/0710/sys/src/9/gnot/clock.c:41,50 (short | long) | ||
| 1991/0614 | else sched(); } | |
| 1990/1004 |
| |
| 1991/0710 | if((ur->sr&SUPER) == 0){ (*(ulong*)(USTKTOP-BY2WD)) += TK2MS(1); /* profiling clock */ if(u->nnote) notify(ur); } | |
| 1990/03091 | } } | |
| 1991/0710/sys/src/9/gnot/clock.c:34,39 – 1991/1003/sys/src/9/gnot/clock.c:34,40 (short | long) | ||
| 1990/1211 | checkalarms(); | |
| 1990/0321 | kbdclock(); | |
| 1990/0504 | mouseclock(); | |
| 1991/1003 | duartclock(); | |
| 1990/1004 | if((ur->sr&SPL(7)) == 0 && p && p->state==Running){ | |
| 1991/0614 | if(anyready()){ if(p->hasspin) | |
| 1991/1003/sys/src/9/gnot/clock.c:35,40 – 1991/1007/sys/src/9/gnot/clock.c:35,41 (short | long) | ||
| 1990/0321 | kbdclock(); | |
| 1990/0504 | mouseclock(); | |
| 1991/1003 | duartclock(); | |
| 1991/1007 | kproftimer(ur->pc); | |
| 1990/1004 | if((ur->sr&SPL(7)) == 0 && p && p->state==Running){ | |
| 1991/0614 | if(anyready()){ if(p->hasspin) | |
| 1991/1007/sys/src/9/gnot/clock.c:45,50 – 1991/1108/sys/src/9/gnot/clock.c:45,52 (short | long) | ||
| 1991/0614 | } | |
| 1991/0710 | if((ur->sr&SUPER) == 0){ (*(ulong*)(USTKTOP-BY2WD)) += TK2MS(1); /* profiling clock */ | |
| 1991/1108 | if(u->p->procctl) procctl(u->p); | |
| 1991/0710 | if(u->nnote) notify(ur); } | |
| 1991/1108/sys/src/9/gnot/clock.c:22,28 – 1991/1112/sys/src/9/gnot/clock.c:22,33 (short | long) | ||
| 1990/03091 | clock(Ureg *ur) { Proc *p; | |
| 1991/1112 | int user; | |
| 1990/03091 | ||
| 1991/1112 | user = (ur->sr&SUPER) == 0; if(user) u->dbgreg = ur; | |
| 1990/03091 | SYNCREG[1] = 0x5F; /* clear interrupt */ m->ticks++; p = m->proc; | |
| 1991/1108/sys/src/9/gnot/clock.c:43,54 – 1991/1112/sys/src/9/gnot/clock.c:48,56 | ||
| 1991/0614 | else sched(); } | |
| 1991/0710 |
| |
| 1991/1112 | if(user){ | |
| 1991/0710 | (*(ulong*)(USTKTOP-BY2WD)) += TK2MS(1); /* profiling clock */ | |
| 1991/1108 |
| |
| 1991/0710 |
| |
| 1991/1112 | notify(ur); | |
| 1991/0710 | } | |
| 1990/03091 | } } | |
| 1991/1112/sys/src/9/gnot/clock.c:22,28 – 1991/1113/sys/src/9/gnot/clock.c:22,28 (short | long) | ||
| 1990/03091 | clock(Ureg *ur) { Proc *p; | |
| 1991/1112 |
| |
| 1991/1113 | int user, nrun = 0; | |
| 1990/03091 | ||
| 1991/1112 | user = (ur->sr&SUPER) == 0; if(user) | |
| 1991/1112/sys/src/9/gnot/clock.c:32,41 – 1991/1113/sys/src/9/gnot/clock.c:32,44 | ||
| 1990/03091 | m->ticks++; p = m->proc; | |
| 1990/0312 | if(p){ | |
| 1991/1113 | nrun = 1; | |
| 1990/0312 | p->pc = ur->pc; | |
| 1990/1004 | if (p->state==Running) p->time[p->insyscall]++; | |
| 1990/0312 | } | |
| 1991/1113 | nrun = (nrdy+nrun)*1000; MACHP(0)->load = (MACHP(0)->load*19+nrun)/20; | |
| 1990/1211 | checkalarms(); | |
| 1990/0321 | kbdclock(); | |
| 1990/0504 | mouseclock(); | |
| 1991/1113/sys/src/9/gnot/clock.c:1,5 – 1992/0321/sys/src/9/gnot/clock.c:1,5 (short | long) | ||
|
Move lib.h to ../port.
rsc Fri Mar 4 12:44:25 2005 | ||
| 1990/03091 | #include "u.h" | |
| 1992/0321 | #include "../port/lib.h" | |
| 1990/03091 | #include "mem.h" #include "dat.h" #include "fns.h" | |
| 1992/0321/sys/src/9/gnot/clock.c:10,16 – 1992/0711/sys/src/9/gnot/clock.c:10,15 (short | long) | ||
| 1990/03091 | void delay(int ms) { | |
| 1992/0711/sys/src/9/gnot/clock.c:24,31 – 1992/0805/sys/src/9/gnot/clock.c:24,33 (short | long) | ||
| 1991/1113 | int user, nrun = 0; | |
| 1990/03091 | ||
| 1991/1112 | user = (ur->sr&SUPER) == 0; | |
| 1992/0805 | if(user){ | |
| 1991/1112 | u->dbgreg = ur; | |
| 1992/0805 | u->p->pc = ur->pc; } | |
| 1991/1112 | ||
| 1990/03091 | SYNCREG[1] = 0x5F; /* clear interrupt */ m->ticks++; | |
| 1992/0805/sys/src/9/gnot/clock.c:42,49 – 1993/0226/sys/src/9/gnot/clock.c:42,49 (short | long) | ||
| 1991/1113 | MACHP(0)->load = (MACHP(0)->load*19+nrun)/20; | |
| 1990/1211 | checkalarms(); | |
| 1990/0321 | kbdclock(); | |
| 1990/0504 |
| |
| 1991/1003 | duartclock(); | |
| 1993/0226 | mouseclock(); | |
| 1991/1007 | kproftimer(ur->pc); | |
| 1990/1004 | if((ur->sr&SPL(7)) == 0 && p && p->state==Running){ | |
| 1991/0614 | if(anyready()){ | |
| 1993/0226/sys/src/9/gnot/clock.c:1,60 – 1993/0501/sys/src/9/gnot/clock.c:0 (short | long) | ||
|
Deleted.
rsc Mon Mar 7 10:21:34 2005 | ||
| 1990/03091 |
| |
| 1992/0321 |
| |
| 1990/03091 |
| |
| 1991/1113 |
| |
| 1990/03091 | ||
| 1991/1112 |
| |
| 1992/0805 |
| |
| 1991/1112 |
| |
| 1992/0805 |
| |
| 1991/1112 | ||
| 1990/03091 |
| |
| 1990/0312 |
| |
| 1991/1113 |
| |
| 1990/0312 |
| |
| 1990/1004 |
| |
| 1990/0312 |
| |
| 1991/1113 |
| |
| 1990/1211 |
| |
| 1990/0321 |
| |
| 1991/1003 |
| |
| 1993/0226 |
| |
| 1991/1007 |
| |
| 1990/1004 |
| |
| 1991/0614 |
| |
| 1991/1112 |
| |
| 1991/0710 |
| |
| 1991/1112 |
| |
| 1991/0710 |
| |
| 1990/03091 |
| |