| plan 9 kernel history: overview | file list | diff list |
1990/1226/gnot/lock.c (diff list | history)
| 1990/03091/sys/src/9/gnot/lock.c:66,71 – 1990/0312/sys/src/9/gnot/lock.c:66,77 (short | long) | ||
| 1990/03091 | sched(); } | |
| 1990/0312 | int canqlock(QLock *q) { return canlock(&q->use); } | |
| 1990/03091 | void qunlock(QLock *q) { | |
| 1990/0312/sys/src/9/gnot/lock.c:4,9 – 1990/0403/sys/src/9/gnot/lock.c:4,18 (short | long) | ||
| 1990/03091 | #include "dat.h" #include "fns.h" | |
| 1990/0403 | #define PCOFF -2 /* * N.B. Ken's compiler generates a TAS instruction for the sequence: * * if(l->key >= 0){ * l->key |= 0x80; * ... */ | |
| 1990/03091 | void lock(Lock *l) { | |
| 1990/0312/sys/src/9/gnot/lock.c:12,35 – 1990/0403/sys/src/9/gnot/lock.c:21,49 | ||
| 1990/03091 | /* * Try the fast grab first */ | |
| 1990/0403 | if(l->key >= 0){ l->key |= 0x80; l->pc = ((ulong*)&i)[PCOFF]; | |
| 1990/03091 | return; } for(i=0; i<10000000; i++) | |
| 1990/0403 | if(l->key >= 0){ l->key |= 0x80; l->pc = ((ulong*)&i)[PCOFF]; | |
| 1990/03091 | return; } | |
| 1990/0403 | l->key = 0; panic("lock loop %lux pc %lux held by pc %lux\n", l, ((ulong*)&i)[PCOFF], l->pc); | |
| 1990/03091 | } int canlock(Lock *l) { | |
| 1990/0403 | int i; if(l->key >= 0){ l->key |= 0x80; l->pc = ((ulong*)&i)[PCOFF]; | |
| 1990/03091 | return 1; } return 0; | |
| 1990/0312/sys/src/9/gnot/lock.c:39,45 – 1990/0403/sys/src/9/gnot/lock.c:53,59 | ||
| 1990/03091 | unlock(Lock *l) { l->pc = 0; | |
| 1990/0403 | l->key = 0; | |
| 1990/03091 | } void | |
| 1990/0403/sys/src/9/gnot/lock.c:76,81 – 1990/05313/sys/src/9/gnot/lock.c:76,82 (short | long) | ||
| 1990/03091 | q->tail = u->p; u->p->qnext = 0; u->p->state = Queueing; | |
| 1990/05313 | u->p->qlock = q; /* DEBUG */ | |
| 1990/03091 | unlock(&q->queue); sched(); } | |
| 1990/05313/sys/src/9/gnot/lock.c:12,17 – 1990/0601/sys/src/9/gnot/lock.c:12,19 (short | long) | ||
| 1990/0403 | * if(l->key >= 0){ * l->key |= 0x80; * ... | |
| 1990/0601 | * * DO NOT TAKE THE ADDRESS OF l->key or the TAS will disappear. | |
| 1990/0403 | */ | |
| 1990/03091 | void lock(Lock *l) | |
| 1990/05313/sys/src/9/gnot/lock.c:31,37 – 1990/0601/sys/src/9/gnot/lock.c:33,39 | ||
| 1990/0403 | l->key |= 0x80; l->pc = ((ulong*)&i)[PCOFF]; | |
| 1990/03091 | return; | |
| 1990/0601 | } | |
| 1990/0403 | l->key = 0; panic("lock loop %lux pc %lux held by pc %lux\n", l, ((ulong*)&i)[PCOFF], l->pc); | |
| 1990/03091 | } | |
| 1990/0601/sys/src/9/gnot/lock.c:4,10 – 1990/0617/sys/src/9/gnot/lock.c:4,10 (short | long) | ||
| 1990/03091 | #include "dat.h" #include "fns.h" | |
| 1990/0403 |
| |
| 1990/0617 | #define PCOFF -1 | |
| 1990/0403 | /* * N.B. Ken's compiler generates a TAS instruction for the sequence: | |
| 1990/0601/sys/src/9/gnot/lock.c:25,37 – 1990/0617/sys/src/9/gnot/lock.c:25,37 | ||
| 1990/03091 | */ | |
| 1990/0403 | if(l->key >= 0){ l->key |= 0x80; | |
| 1990/0617 | l->pc = ((ulong*)&l)[PCOFF]; | |
| 1990/03091 | return; } for(i=0; i<10000000; i++) | |
| 1990/0403 | if(l->key >= 0){ l->key |= 0x80; | |
| 1990/0617 | l->pc = ((ulong*)&l)[PCOFF]; | |
| 1990/03091 | return; | |
| 1990/0601 | } | |
| 1990/0403 | l->key = 0; | |
| 1990/0601/sys/src/9/gnot/lock.c:41,51 – 1990/0617/sys/src/9/gnot/lock.c:41,49 | ||
| 1990/03091 | int canlock(Lock *l) { | |
| 1990/0403 |
| |
| 1990/0617 | l->pc = ((ulong*)&l)[PCOFF]; | |
| 1990/03091 | return 1; } return 0; | |
| 1990/0617/sys/src/9/gnot/lock.c:35,41 – 1990/0619/sys/src/9/gnot/lock.c:35,42 (short | long) | ||
| 1990/03091 | return; | |
| 1990/0601 | } | |
| 1990/0403 | l->key = 0; | |
| 1990/0619 | dumpstack(); panic("lock loop %lux pc %lux held by pc %lux\n", l, ((ulong*)&l)[PCOFF], l->pc); | |
| 1990/03091 | } int | |
| 1990/0619/sys/src/9/gnot/lock.c:94,99 – 1990/0623/sys/src/9/gnot/lock.c:94,100 (short | long) | ||
| 1990/03091 | Proc *p; lock(&q->queue); | |
| 1990/0623 | u->p->qlock = 0; | |
| 1990/03091 | if(q->head){ p = q->head; q->head = p->qnext; | |
| 1990/0623/sys/src/9/gnot/lock.c:18,40 – 1990/0705/sys/src/9/gnot/lock.c:18,41 (short | long) | ||
| 1990/03091 | void lock(Lock *l) { | |
| 1990/0705 | Lock *ll = l; /* do NOT take the address of l */ | |
| 1990/03091 | int i; /* * Try the fast grab first */ | |
| 1990/0403 |
| |
| 1990/0617 |
| |
| 1990/0705 | if(ll->key >= 0){ ll->key |= 0x80; ll->pc = ((ulong*)&l)[PCOFF]; | |
| 1990/03091 | return; } for(i=0; i<10000000; i++) | |
| 1990/0403 |
| |
| 1990/0617 |
| |
| 1990/0705 | if(ll->key >= 0){ ll->key |= 0x80; ll->pc = ((ulong*)&l)[PCOFF]; | |
| 1990/03091 | return; | |
| 1990/0601 | } | |
| 1990/0403 |
| |
| 1990/0705 | ll->key = 0; | |
| 1990/0619 | dumpstack(); panic("lock loop %lux pc %lux held by pc %lux\n", l, ((ulong*)&l)[PCOFF], l->pc); | |
| 1990/03091 | } | |
| 1990/0623/sys/src/9/gnot/lock.c:42,50 – 1990/0705/sys/src/9/gnot/lock.c:43,52 | ||
| 1990/03091 | int canlock(Lock *l) { | |
| 1990/0403 |
| |
| 1990/0617 |
| |
| 1990/0705 | Lock *ll = l; /* do NOT take the address of l */ if(ll->key >= 0){ ll->key |= 0x80; ll->pc = ((ulong*)&l)[PCOFF]; | |
| 1990/03091 | return 1; } return 0; | |
| 1990/0705/sys/src/9/gnot/lock.c:18,24 – 1990/1226/sys/src/9/gnot/lock.c:18,24 (short | long) | ||
| 1990/03091 | void lock(Lock *l) { | |
| 1990/0705 |
| |
| 1990/1226 | Lock *ll = l; /* do NOT take the address of ll */ | |
| 1990/03091 | int i; /* | |
| 1990/0705/sys/src/9/gnot/lock.c:43,49 – 1990/1226/sys/src/9/gnot/lock.c:43,49 | ||
| 1990/03091 | int canlock(Lock *l) { | |
| 1990/0705 |
| |
| 1990/1226 | Lock *ll = l; /* do NOT take the address of ll */ | |
| 1990/0705 | if(ll->key >= 0){ ll->key |= 0x80; ll->pc = ((ulong*)&l)[PCOFF]; | |
| 1990/1226/sys/src/9/gnot/lock.c:36,43 – 1991/0109/sys/src/9/gnot/lock.c:36,42 (short | long) | ||
| 1990/03091 | return; | |
| 1990/0601 | } | |
| 1990/0705 | ll->key = 0; | |
| 1990/0619 |
| |
| 1991/0109 | print("lock loop %lux pc %lux held by pc %lux\n", l, ((ulong*)&l)[PCOFF], l->pc); | |
| 1990/03091 | } int | |
| 1991/0109/sys/src/9/gnot/lock.c:95,101 – 1991/0311/sys/src/9/gnot/lock.c:95,102 (short | long) | ||
| 1990/03091 | Proc *p; lock(&q->queue); | |
| 1990/0623 |
| |
| 1991/0311 | if(u) u->p->qlock = 0; | |
| 1990/03091 | if(q->head){ p = q->head; q->head = p->qnext; | |
| 1991/0311/sys/src/9/gnot/lock.c:57,111 – 1991/0428/sys/src/9/gnot/lock.c:57,59 (short | long) | ||
| 1990/03091 | l->pc = 0; | |
| 1990/0403 | l->key = 0; | |
| 1990/03091 | } | |
| 1990/05313 |
| |
| 1990/03091 |
| |
| 1990/0312 |
| |
| 1990/03091 |
| |
| 1991/0311 |
| |
| 1990/03091 |
| |
| 1991/0428/sys/src/9/gnot/lock.c:3,8 – 1991/0606/sys/src/9/gnot/lock.c:3,9 (short | long) | ||
| 1990/03091 | #include "mem.h" #include "dat.h" #include "fns.h" | |
| 1991/0606 | #include "errno.h" | |
| 1990/03091 | ||
| 1990/0617 | #define PCOFF -1 | |
| 1990/0403 | ||
| 1991/0428/sys/src/9/gnot/lock.c:56,59 – 1991/0606/sys/src/9/gnot/lock.c:57,66 | ||
| 1990/03091 | { l->pc = 0; | |
| 1990/0403 | l->key = 0; | |
| 1991/0606 | } void mklockseg(Seg *s) { error(Esegaddr); | |
| 1990/03091 | } | |
| 1991/0606/sys/src/9/gnot/lock.c:64,66 – 1991/0608/sys/src/9/gnot/lock.c:64,71 (short | long) | ||
| 1991/0606 | { error(Esegaddr); | |
| 1990/03091 | } | |
| 1991/0608 | Page* lkpage(Orig* o, ulong va) { } | |
| 1991/0608/sys/src/9/gnot/lock.c:28,33 – 1991/0614/sys/src/9/gnot/lock.c:28,35 (short | long) | ||
| 1990/0705 | if(ll->key >= 0){ ll->key |= 0x80; ll->pc = ((ulong*)&l)[PCOFF]; | |
| 1991/0614 | if(u && u->p) u->p->hasspin = 1; | |
| 1990/03091 | return; } for(i=0; i<10000000; i++) | |
| 1991/0608/sys/src/9/gnot/lock.c:34,39 – 1991/0614/sys/src/9/gnot/lock.c:36,43 | ||
| 1990/0705 | if(ll->key >= 0){ ll->key |= 0x80; ll->pc = ((ulong*)&l)[PCOFF]; | |
| 1991/0614 | if(u && u->p) u->p->hasspin = 1; | |
| 1990/03091 | return; | |
| 1990/0601 | } | |
| 1990/0705 | ll->key = 0; | |
| 1991/0608/sys/src/9/gnot/lock.c:47,52 – 1991/0614/sys/src/9/gnot/lock.c:51,58 | ||
| 1990/0705 | if(ll->key >= 0){ ll->key |= 0x80; ll->pc = ((ulong*)&l)[PCOFF]; | |
| 1991/0614 | if(u && u->p) u->p->hasspin = 1; | |
| 1990/03091 | return 1; } return 0; | |
| 1991/0608/sys/src/9/gnot/lock.c:57,62 – 1991/0614/sys/src/9/gnot/lock.c:63,70 | ||
| 1990/03091 | { l->pc = 0; | |
| 1990/0403 | l->key = 0; | |
| 1991/0614 | if(u && u->p) u->p->hasspin = 0; | |
| 1991/0606 | } void | |
| 1991/0614/sys/src/9/gnot/lock.c:66,79 – 1991/0705/sys/src/9/gnot/lock.c:66,68 (short | long) | ||
| 1991/0614 | if(u && u->p) u->p->hasspin = 0; | |
| 1991/0606 | } | |
| 1990/03091 |
| |
| 1991/0608 |
| |
| 1991/0705/sys/src/9/gnot/lock.c:7,61 – 1991/0723/sys/src/9/gnot/lock.c:7,51 (short | long) | ||
| 1990/03091 | ||
| 1990/0617 | #define PCOFF -1 | |
| 1990/0403 |
| |
| 1990/0601 |
| |
| 1990/0403 |
| |
| 1990/03091 | void lock(Lock *l) { | |
| 1990/1226 |
| |
| 1990/03091 | int i; /* * Try the fast grab first */ | |
| 1990/0705 |
| |
| 1991/0723 | if(tas(&l->key) == 0){ | |
| 1991/0614 | if(u && u->p) u->p->hasspin = 1; | |
| 1991/0723 | l->pc = ((ulong*)&l)[PCOFF]; | |
| 1990/03091 | return; } | |
| 1990/0705 |
| |
| 1991/0723 | for(i = 0; i < 1000; i++){ sched(); if (tas(&l->key) == 0){ | |
| 1991/0614 | if(u && u->p) u->p->hasspin = 1; | |
| 1991/0723 | l->pc = ((ulong*)&l)[PCOFF]; | |
| 1990/03091 | return; | |
| 1990/0601 | } | |
| 1990/0705 |
| |
| 1991/0109 |
| |
| 1991/0723 | } i = l->key; l->key = 0; panic("lock loop 0x%lux key 0x%lux pc 0x%lux held by pc 0x%lux\n", l, i, ((ulong*)&l)[PCOFF], l->pc); | |
| 1990/03091 | } int canlock(Lock *l) { | |
| 1990/1226 |
| |
| 1990/0705 |
| |
| 1991/0614 |
| |
| 1990/03091 |
| |
| 1991/0723 | if(tas(&l->key)) return 0; l->pc = ((ulong*)&l)[PCOFF]; if(u && u->p) u->p->hasspin = 1; return 1; | |
| 1990/03091 | } void | |
| 1991/0723/sys/src/9/gnot/lock.c:16,30 – 1991/0820/sys/src/9/gnot/lock.c:16,31 (short | long) | ||
| 1990/03091 | * Try the fast grab first */ | |
| 1991/0723 | if(tas(&l->key) == 0){ | |
| 1991/0614 |
| |
| 1991/0820 | if(u) | |
| 1991/0614 | u->p->hasspin = 1; | |
| 1991/0723 | l->pc = ((ulong*)&l)[PCOFF]; | |
| 1990/03091 | return; } | |
| 1991/0723 |
| |
| 1991/0820 | for(i = 0; i < 100000; i++){ if(u && u->p->state == Running) sched(); | |
| 1991/0723 | if (tas(&l->key) == 0){ | |
| 1991/0614 |
| |
| 1991/0820 | if(u) | |
| 1991/0614 | u->p->hasspin = 1; | |
| 1991/0723 | l->pc = ((ulong*)&l)[PCOFF]; | |
| 1990/03091 | return; | |
| 1991/0820/sys/src/9/gnot/lock.c:12,29 – 1991/0821/sys/src/9/gnot/lock.c:12,18 (short | long) | ||
| 1990/03091 | { int i; | |
| 1991/0723 |
| |
| 1991/0820 |
| |
| 1991/0614 |
| |
| 1991/0723 |
| |
| 1990/03091 |
| |
| 1991/0820 |
| |
| 1991/0821 | for(i = 0; i < 1000000; i++){ | |
| 1991/0723 | if (tas(&l->key) == 0){ | |
| 1991/0820 | if(u) | |
| 1991/0614 | u->p->hasspin = 1; | |
| 1991/0820/sys/src/9/gnot/lock.c:30,35 – 1991/0821/sys/src/9/gnot/lock.c:19,26 | ||
| 1991/0723 | l->pc = ((ulong*)&l)[PCOFF]; | |
| 1990/03091 | return; | |
| 1990/0601 | } | |
| 1991/0821 | if(u && u->p->state == Running) sched(); | |
| 1991/0723 | } i = l->key; l->key = 0; | |
| 1991/0821/sys/src/9/gnot/lock.c:3,9 – 1992/0111/sys/src/9/gnot/lock.c:3,9 (short | long) | ||
| 1990/03091 | #include "mem.h" #include "dat.h" #include "fns.h" | |
| 1991/0606 |
| |
| 1992/0111 | #include "../port/error.h" | |
| 1990/03091 | ||
| 1990/0617 | #define PCOFF -1 | |
| 1990/0403 | ||
| 1992/0111/sys/src/9/gnot/lock.c:1,50 – 1992/0222/sys/src/9/gnot/lock.c:0 (short | long) | ||
|
Deleted.
rsc Mon Mar 7 10:21:48 2005 | ||
| 1990/03091 |
| |
| 1992/0111 |
| |
| 1990/03091 | ||
| 1990/0617 |
| |
| 1990/0403 | ||
| 1990/03091 |
| |
| 1991/0821 |
| |
| 1991/0723 |
| |
| 1991/0820 |
| |
| 1991/0614 |
| |
| 1991/0723 |
| |
| 1990/03091 |
| |
| 1990/0601 |
| |
| 1991/0821 |
| |
| 1991/0723 |
| |
| 1990/03091 |
| |
| 1991/0723 |
| |
| 1990/03091 |
| |
| 1990/0403 |
| |
| 1991/0614 |
| |
| 1991/0606 |
| |