/sys/lib/acid/kernel: fix imagecache() and procenv()

This commit is contained in:
cinap_lenrek 2012-10-09 03:52:18 +02:00
parent e52677328b
commit 14817c4991

View file

@ -27,7 +27,6 @@ defn path(p) {
} }
// print Image cache contents // print Image cache contents
// requires include("/sys/src/9/xxx/segment.acid")
IHASHSIZE = 64; IHASHSIZE = 64;
defn imagecacheline(h) { defn imagecacheline(h) {
while h != 0 do { while h != 0 do {
@ -41,7 +40,7 @@ defn imagecache() {
local i; local i;
i=0; loop 1,IHASHSIZE do { i=0; loop 1,IHASHSIZE do {
imagecacheline(imagealloc.free[i]); imagecacheline(imagealloc.hash[i]);
i = i+1; i = i+1;
} }
} }
@ -182,17 +181,17 @@ defn proc(p) {
defn procenv(p) { defn procenv(p) {
complex Proc p; complex Proc p;
local e, v; local i, e, v;
e = p.egrp; e = p.egrp;
complex Egrp e; complex Egrp e;
v = e.ent; i=0; loop 1,e.nent do {
while v != 0 do { v = e.ent[i];
i = i+1;
complex Evalue v; complex Evalue v;
print(*(v.name\s), "="); print(*(v.name\s), "=");
printstringn(v.value, v.len); printstringn(v.value, v.len);
print("\n"); print("\n");
v = v.link;
} }
} }
@ -379,5 +378,6 @@ if (map()[2]) != {} then { // map has more than two elements -> active proc
} }
needacid("proc"); needacid("proc");
needacid("chan"); needacid("chan");
needacid("segment");
} }
} }