# HG changeset patch # User Noah Evans # Date 1307433355 0 # Node ID a190075dcebe024485223221b3bf7ed5a97029ff # Parent fe4562cb325e009955324bf228ed22345eb1234e daily push: Mon Jun 6 09:55:49 CET 2011 diff -r fe4562cb325e -r a190075dcebe src/9kron/TODO --- a/src/9kron/TODO Thu Jun 02 15:30:20 2011 +0000 +++ b/src/9kron/TODO Tue Jun 07 07:55:55 2011 +0000 @@ -1,11 +1,5 @@ -- finishing testing/merging the new interface (rfork|procctl) - esoriano -- 2M pages - nemo - >128M physical memory - ron - counters - paurea - smp for regular kernel - send multiple sipis to cores - change core roles diff -r fe4562cb325e -r a190075dcebe src/9kron/k8/acore.c --- a/src/9kron/k8/acore.c Thu Jun 02 15:30:20 2011 +0000 +++ b/src/9kron/k8/acore.c Tue Jun 07 07:55:55 2011 +0000 @@ -41,6 +41,23 @@ ACVctl *acvctl[256]; /* + * Check if the AC kernel (mach) stack has more than 4*KiB free. + * Do not call panic, the stack is gigantic. + */ +static void +acstackok(void) +{ + char dummy; + char *sstart; + + sstart = (char *)m - PGSZ - 4*PTPGSZ - MACHSTKSZ; + if(&dummy < sstart + 4*KiB){ + print("ac kernel stack overflow, cpu%d stopped\n", m->machno); + DONE(); + } +} + +/* * Main scheduling loop done by the application core. * Some of functions run will not return. * The system call handler will reset the stack and @@ -48,11 +65,13 @@ * We loop because some functions may return and we should * wait for another call. */ + void acsched(void) { acmmuswitch(); for(;;){ + acstackok(); m->load = 0; while(*m->icc->fn == nil) ; diff -r fe4562cb325e -r a190075dcebe src/9kron/k8/fns.h --- a/src/9kron/k8/fns.h Thu Jun 02 15:30:20 2011 +0000 +++ b/src/9kron/k8/fns.h Tue Jun 07 07:55:55 2011 +0000 @@ -25,6 +25,8 @@ int dbgprint(char*, ...); int decref(Ref*); void delay(int); +void dumpmmu(Proc*); +void dumpptepg(int lvl,uintptr pa); #define evenaddr(x) /* x86 doesn't care */ int fpudevprocio(Proc*, void*, long, uintptr, int); void fpuinit(void); @@ -35,6 +37,7 @@ void fpusysprocsetup(Proc*); void fpusysrfork(Ureg*); void fpusysrforkchild(Proc*, Proc*); +Mach* getac(Proc *, int); char* getconf(char*); void halt(void); void hardhalt(void); @@ -64,6 +67,7 @@ int ioalloc(int, int, int, char*); int ioreserve(int, int, int, char*); int iprint(char*, ...); +void iprintva(char *tag, uintptr pa); int isaconfig(char*, int, ISAConf*); void kbdenable(void); void kbdinit(void); @@ -114,8 +118,8 @@ void pcisetioe(Pcidev*); void pcisetmwi(Pcidev*); int pcisetpms(Pcidev*, int); -int pickac(Proc *, int); void printcpufreq(void); +void putac(Mach*); void runapcore(int); int screenprint(char*, ...); /* debugging */ void sfence(void); @@ -124,7 +128,7 @@ u64int spllo(void); void splx(u64int); void splxpc(u64int); -void stopac(Proc *); +void stopac(void); void syncclock(void); void syscall(int scallnr, Ureg* ureg); void* sysexecregs(uintptr, ulong, ulong); @@ -227,3 +231,9 @@ * sipi.c */ extern void sipi(void); + +/* + * debug + */ +void HERE(void); +void DONE(void); diff -r fe4562cb325e -r a190075dcebe src/9kron/k8/l64v.s --- a/src/9kron/k8/l64v.s Thu Jun 02 15:30:20 2011 +0000 +++ b/src/9kron/k8/l64v.s Tue Jun 07 07:55:55 2011 +0000 @@ -289,7 +289,6 @@ JNZ _semainc MOVL BX, AX - CMPL AX, $0 /* overflow if -ve or 0 */ RET /* @@ -306,7 +305,6 @@ JNZ _semadec MOVL BX, AX - RET TEXT adec(SB), 1, $-4 /* int adec(int*); */ diff -r fe4562cb325e -r a190075dcebe src/9kron/k8/main.c --- a/src/9kron/k8/main.c Thu Jun 02 15:30:20 2011 +0000 +++ b/src/9kron/k8/main.c Tue Jun 07 07:55:55 2011 +0000 @@ -182,6 +182,23 @@ } void +DONE(void) +{ + print("DONE\n"); + prflush(); + delay(10000); + ndnr(); +} + +void +HERE(void) +{ + print("here\n"); + prflush(); + delay(5000); +} + +void main(u32int ax, u32int bx) { vlong hz; @@ -225,7 +242,7 @@ active.exiting = 0; fmtinit(); - print("\nPlan 9\n"); + print("\nNIX with 4K pages\n"); if(vflag){ print("&ax = %#p, ax = %#ux, bx = %#ux\n", &ax, ax, bx); multiboot(ax, bx, vflag); @@ -320,6 +337,7 @@ ksetenv("service", "cpu", 0); else ksetenv("service", "terminal", 0); + ksetenv("pgsz", "4096", 0); confsetenv(); poperror(); } @@ -446,9 +464,8 @@ conf.nproc = 100 + ((conf.npage*BY2PG)/MB)*5; if(cpuserver) conf.nproc *= 3; - if(conf.nproc > 2000) -// conf.nproc = 2000; -conf.nproc = 1000; + if(conf.nproc > 1000) + conf.nproc = 1000; conf.nimage = 200; conf.nswap = conf.nproc*80; conf.nswppo = 4096; diff -r fe4562cb325e -r a190075dcebe src/9kron/k8/mem.h --- a/src/9kron/k8/mem.h Thu Jun 02 15:30:20 2011 +0000 +++ b/src/9kron/k8/mem.h Tue Jun 07 07:55:55 2011 +0000 @@ -36,6 +36,11 @@ #define STACKALIGN(sp) ((sp) & ~(BY2SE-1)) /* bug: assure with alloc */ /* + * 2M pages (user segments alignment only) + */ +#define BIGPGSZ (2ULL*MiB) + +/* * Time */ #define HZ (100) /* clock frequency */ @@ -49,7 +54,7 @@ * Kernel is at ?? */ #define UTZERO (0+2*MiB) /* first address in user text */ -#define UTROUND(t) ROUNDUP((t), 2*MiB) +#define UTROUND(t) ROUNDUP((t), BIGPGSZ) #define USTKTOP 0x00007ffffffff000ull #define USTKSIZE (16*1024*1024) /* size of user stack */ #define TSTKTOP (USTKTOP-USTKSIZE) /* end of new stack in sysexec */ @@ -80,7 +85,6 @@ #define getpgcolor(a) 0 - /* * Oh, give it a fucking rest, will you. */ diff -r fe4562cb325e -r a190075dcebe src/9kron/k8/mkfile --- a/src/9kron/k8/mkfile Thu Jun 02 15:30:20 2011 +0000 +++ b/src/9kron/k8/mkfile Tue Jun 07 07:55:55 2011 +0000 @@ -2,7 +2,8 @@ CONFLIST=k8aoe k8cpu k8root HACK=`{ bind -c ../libc /sys/src/libc;\ - bind ../include/libc.h /sys/include/libc.h} + unmount /sys/include>[2]/dev/null;\ + bind -b ../include /sys/include} objtype=amd64 >((((l)-1)*9)+12)) & ((1<>((((lvl)-1)*9)+12)) & ((1<pml4 is always the same. * sched->procsave->flushtbl zeroes the entries in pml4 up to - * pml4->daddr (which is the number of entries used by the user). + * pml4->daddr (which is the number of entries used by the user, or + * the index in the upper page table for this entry) * the new process will fault and we populate again the page table * as needed. * + * mmuptp[0] is used to keep a free list of pages. + * mmuptp[1-3] are used to keep PT pages for each level + * 4K pages: pml4 -> lvl3 -> lvl2 -> lvl1 ->pg + * 2M pages: pml4 -> lvl3 -> lvl2 -> pg + * * Therefore, we can't use pml4 in other processors. Each one * has to play the same trick at least, using its own pml4. * For NIX, we have to fill up the pml4 of the application core * so it wont fault. */ +void +iprintva(char *s, uintptr addr) +{ + iprint("%s = %#ullx = %#ullx:%#ullx:%#ullx:%#ullx:%#ullx", s, addr, + (addr >> (12+9+9+9)) & 0x1FF, + (addr >> (12+9+9)) & 0x1FF, + (addr >> (12+9)) & 0x1FF, + (addr >> 12) & 0x1FF, + addr & 0xFFF); +} void mmuinit(void) @@ -35,7 +51,9 @@ if(m->machno == 0) page = &mach0pml4; else{ - /* NIX: KLUDGE: Has to go when each mach is using its own page table */ + /* NIX: KLUDGE: Has to go when each mach is using + * its own page table + */ p = UINT2PTR(m->stack); p += MACHSTKSZ; memmove(p, UINT2PTR(mach0pml4.va), PTPGSZ); @@ -110,6 +128,56 @@ m->pml4->daddr = 0; } +static void +tabs(int n) +{ + int i; + + for(i = 0; i < n; i++) + print(" "); +} + +void +dumpptepg(int lvl, uintptr pa) +{ + PTE *pte; + int tab, i; + + tab = 4 - lvl; + pte = UINT2PTR(KADDR(pa)); + for(i = 0; i < PTPGSZ/sizeof(PTE); i++) + if(pte[i] & PteP){ + tabs(tab); + print("l%d[%#05x]:\t%#ullx\n", lvl, i, pte[i]); + if(lvl == 3 && i == 0x1FF){ + /* don't print lvl 2 kernel entries */ + tabs(tab+1); + print("...kern...\n"); + continue; + } + if(lvl > 2 || (lvl == 2 && (pte[i]&PtePS) == 0)) + dumpptepg(lvl-1, PPN(pte[i])); + } + print("\n"); +} + +void +dumpmmu(Proc *p) +{ + int i; + Page *pg; + + print("proc %#p\n", p); + for(i = 3; i > 0; i--){ + print("mmuptp[%d]:\n", i); + for(pg = p->mmuptp[i]; pg != nil; pg = pg->next) + print("\tva %#ullx ppn %#ullx d %#ulx\n", + pg->va, pg->pa, pg->daddr); + } + print("pml4 %#ullx\n", m->pml4->pa); + dumpptepg(4, m->pml4->pa); +} + void mmuswitch(Proc* proc) { diff -r fe4562cb325e -r a190075dcebe src/9kron/k8/pmcio.c --- a/src/9kron/k8/pmcio.c Thu Jun 02 15:30:20 2011 +0000 +++ b/src/9kron/k8/pmcio.c Tue Jun 07 07:55:55 2011 +0000 @@ -188,7 +188,7 @@ return ns; } -int +u64int pmcgetctr(u32int regno) { return rdmsr(regno + PerfCtrbase); diff -r fe4562cb325e -r a190075dcebe src/9kron/k8/syscall.c --- a/src/9kron/k8/syscall.c Thu Jun 02 15:30:20 2011 +0000 +++ b/src/9kron/k8/syscall.c Tue Jun 07 07:55:55 2011 +0000 @@ -125,6 +125,9 @@ uintptr sp; NFrame *nf; + /* + * Calls procctl splhi, see comment in procctl for the reasoning. + */ if(up->procctl) procctl(up); if(up->nnote == 0) @@ -266,6 +269,7 @@ systab[scallnr].f(&ar0, (va_list)up->arg); if(scallnr == SYSR1){ /* + * BUG: must go when ron binaries go. * NIX: Returning from execac(). * This means that the process is back to the * time sharing core. However, the process did diff -r fe4562cb325e -r a190075dcebe src/9kron/k8/tcore.c --- a/src/9kron/k8/tcore.c Thu Jun 02 15:30:20 2011 +0000 +++ b/src/9kron/k8/tcore.c Tue Jun 07 07:55:55 2011 +0000 @@ -12,7 +12,6 @@ Lock nixaclock; /* NIX AC lock; held while assigning procs to cores */ - /* * NIX support for the time sharing core. */ @@ -20,14 +19,15 @@ extern void actrapret(void); extern void acsysret(void); -int -pickac(Proc *p, int core) +Mach* +getac(Proc *p, int core) { int i; Mach *mp; + mp = nil; if(core == 0) - panic("can't pickac for a TC"); + panic("can't getac for a TC"); lock(&nixaclock); if(waserror()){ unlock(&nixaclock); @@ -43,7 +43,6 @@ error("core is not an AC"); Found: mp->proc = p; - p->ac = mp; }else{ for(i = 1; i < MAXMACH; i++){ mp = sys->machptr[i]; @@ -55,7 +54,7 @@ } unlock(&nixaclock); poperror(); - return core; + return mp; } /* @@ -64,10 +63,9 @@ * or we must be prepared for nesting them, which we are not. * This is important for note handling, because postnote() * assumes that it's ok to send an IPI to an AC, no matter its - * state. + * state. The /proc interface also assumes that. * */ - void intrac(Proc *p) { @@ -86,23 +84,32 @@ } void -stopac(Proc *p) +putac(Mach *m) +{ + mfence(); + m->proc = nil; +} + +void +stopac(void) { Mach *mp; - mp = p->ac; + mp = up->ac; if(mp == nil) return; - if(mp->proc != p) + if(mp->proc != up) panic("stopac"); lock(&nixaclock); - p->ac = nil; + up->ac = nil; mp->proc = nil; unlock(&nixaclock); -// send ipi to p->ac, it would rerun squidboy(), and -// wait for us to give it a function to run. + /* TODO: + * send sipi to up->ac, it would rerun squidboy(), and + * wait for us to give it a function to run. + */ } /* @@ -232,26 +239,19 @@ case ICCTRAP: s = splhi(); m->cr2 = up->ac->cr2; -iprint("runacore: entering icctrap %ulld cr2 %#ullx ureg %#p\n", ureg->type, m->cr2, ureg); DBG("runacore: trap %ulld cr2 %#ullx ureg %#p\n", ureg->type, m->cr2, ureg); switch(ureg->type){ case IdtIPI: if(up->procctl || up->nnote) notify(up->dbgreg); - if(up->ac == nil){ - /* - * to procctl, then syscall, to - * be back in the TC - */ -iprint("runacore: returning, from icctrap ipi\n"); - return; - } + if(up->ac == nil) + goto ToTC; kexit(up->dbgreg); break; - case IdtPF: case IdtNM: case IdtMF: + case IdtXF: /* these are handled in the AC; * If we get here, they left in m->icc->data * a note to be posted to the process. @@ -274,24 +274,23 @@ DBG("runacore: syscall ax %#ullx ureg %#p\n", ureg->ax, ureg); cr3put(m->pml4->pa); -iprint("runacore: syscall %#ullx \n", ureg->ax); syscall(ureg->ax, ureg); flush = 1; fn = acsysret; - if(up->ac == nil){ - /* - * to procctl, then syscall, to - * be back in the TC - */ -iprint("runacore: returning, from syscall\n"); - return; - } + if(up->ac == nil) + goto ToTC; break; default: panic("runacore: unexpected rc = %d", rc); } rc = runac(up->ac, fn, flush, nil, 0); } +ToTC: + /* + * to procctl, then syscall, to + * be back in the TC + */ + DBG("runacore: up %#p: return\n", up); } extern ACVctl *acvctl[]; diff -r fe4562cb325e -r a190075dcebe src/9kron/libc/9sys/upsem.c --- a/src/9kron/libc/9sys/upsem.c Thu Jun 02 15:30:20 2011 +0000 +++ b/src/9kron/libc/9sys/upsem.c Tue Jun 07 07:55:55 2011 +0000 @@ -42,7 +42,7 @@ typesok(); n = ainc(s); dprint(2, "upsem: %#p = %d\n", s, n); - if(n < 0){ + if(n <= 0){ ainc(&c.kup); semwakeup(s); }else diff -r fe4562cb325e -r a190075dcebe src/9kron/libc/port/mkfile --- a/src/9kron/libc/port/mkfile Thu Jun 02 15:30:20 2011 +0000 +++ b/src/9kron/libc/port/mkfile Tue Jun 07 07:55:55 2011 +0000 @@ -31,7 +31,6 @@ getcallerpc.c\ getfields.c\ getuser.c\ - getcore.c\ hangup.c\ hypot.c\ lnrand.c\ diff -r fe4562cb325e -r a190075dcebe src/9kron/port/devproc.c --- a/src/9kron/port/devproc.c Thu Jun 02 15:30:20 2011 +0000 +++ b/src/9kron/port/devproc.c Tue Jun 07 07:55:55 2011 +0000 @@ -1546,21 +1546,23 @@ break; case CMcore: core = atoi(cb->f[1]); - if(core < 0 || core >= MAXMACH) + if(core >= MAXMACH) error("wrong core number"); else if(core == 0){ - if(p->ac != nil){ - p->procctl = Proc_totc; - if(p != up && p->state == Exotic){ - /* see the comment in postnote */ - intrac(p); - } - }else - error("the proc is not running in an ac"); + if(p->ac == nil) + error("not running in an ac"); + p->procctl = Proc_totc; + if(p != up && p->state == Exotic){ + /* see the comment in postnote */ + intrac(p); + } }else{ if(p->ac != nil) - error("proc already running in an ac"); - pickac(p, core); + error("running in an ac"); + if(core < 0) + p->ac = getac(p, -1); + else + p->ac = getac(p, core); p->procctl = Proc_toac; p->prepagemem = 1; } diff -r fe4562cb325e -r a190075dcebe src/9kron/port/page.c --- a/src/9kron/port/page.c Thu Jun 02 15:30:20 2011 +0000 +++ b/src/9kron/port/page.c Tue Jun 07 07:55:55 2011 +0000 @@ -16,7 +16,6 @@ struct Palloc palloc; struct Palloc bigpalloc; -#define BIGPGSZ (2ULL*MiB) #define BIGPGSHFT 21U #define BIGPGROUND(x) ROUNDUP((x), BIGPGSZ) #define PGSPERBIG (BIGPGSZ/PGSZ) @@ -69,11 +68,13 @@ palloc.user++; } palloc.tail = lastp; -print("pm %d base %#ullx npgs %#ulx\n", i, pm->base, pm->npage); base = BIGPGROUND(pm->base); print("bigbase %#ullx\n", base); -if(0) +if(1){ +USED(bigp); +USED(pmp0); +}else for(j = (base-pm->base)/PGSZ; j + PGSPERBIG < pm->npage; ){ /* * unlink all pages within a big page. @@ -294,7 +295,7 @@ } /* First try for our colour */ - for(p = palloc.head; p; p = p->next) + for(p = pp->head; p; p = p->next) if(p->color == color) break; diff -r fe4562cb325e -r a190075dcebe src/9kron/port/pmc.h --- a/src/9kron/port/pmc.h Thu Jun 02 15:30:20 2011 +0000 +++ b/src/9kron/port/pmc.h Tue Jun 07 07:55:55 2011 +0000 @@ -27,7 +27,7 @@ int pmcgetctl(Pmc *p, u32int regno); int pmcdescstr(char *str, int nstr); int pmcctlstr(char *str, int nstr, Pmc *p); -int pmcgetctr(u32int regno); +u64int pmcgetctr(u32int regno); int pmcsetctr(u64int v, u32int regno); int pmcanyenab(void); diff -r fe4562cb325e -r a190075dcebe src/9kron/port/proc.c --- a/src/9kron/port/proc.c Thu Jun 02 15:30:20 2011 +0000 +++ b/src/9kron/port/proc.c Tue Jun 07 07:55:55 2011 +0000 @@ -78,7 +78,7 @@ break; case Moribund: up->state = Dead; - stopac(up); + stopac(); edfstop(up); if (up->edf) free(up->edf); @@ -103,13 +103,19 @@ sched(); } +/* + * Check if the stack has more than 4*KiB free. + * Do not call panic, the stack is gigantic. + */ static void stackok(void) { char dummy; - if(&dummy < (char*)up->kstack + 4*KiB) - panic("kernel stack overflow"); + if(&dummy < (char*)up->kstack + 4*KiB){ + print("tc kernel stack overflow, cpu%d stopped\n", m->machno); + DONE(); + } } /* @@ -989,7 +995,7 @@ broken.p[broken.n++] = p; qunlock(&broken); - stopac(up); + stopac(); edfstop(up); p->state = Broken; p->psstate = 0; @@ -1174,7 +1180,7 @@ lock(&procalloc); lock(&palloc); - stopac(up); + stopac(); edfstop(up); up->state = Moribund; sched(); @@ -1436,12 +1442,16 @@ * by moving to a core, but never returns (unless * the process gets moved back to a TC.) */ + spllo(); runacore(); return; case Proc_totc: p->procctl = 0; - stopac(p); + if(p != up) + panic("procctl: stopac: p != up"); + spllo(); + stopac(); return; } } diff -r fe4562cb325e -r a190075dcebe src/9kron/port/segment.c --- a/src/9kron/port/segment.c Thu Jun 02 15:30:20 2011 +0000 +++ b/src/9kron/port/segment.c Tue Jun 07 07:55:55 2011 +0000 @@ -202,7 +202,7 @@ Page **pg; if(p->va < s->base || p->va >= s->top) - panic("segpage"); + panic("segpage: p->va < s->base || p->va >= s->top"); soff = p->va - s->base; pte = &s->map[soff/PTEMAPMEM]; diff -r fe4562cb325e -r a190075dcebe src/9kron/port/syscallfmt.c --- a/src/9kron/port/syscallfmt.c Thu Jun 02 15:30:20 2011 +0000 +++ b/src/9kron/port/syscallfmt.c Tue Jun 07 07:55:55 2011 +0000 @@ -61,7 +61,7 @@ void *v; vlong vl; uintptr p; - int i[2], len; + int i[2], len, **ip; char *a, **argv; fmtstrinit(&fmt); @@ -109,6 +109,22 @@ l = va_arg(list, unsigned long); fmtprint(&fmt, "%#lud ", l); break; + case EXECAC: + i[0] = va_arg(list, int); + fmtprint(&fmt, "%d", i[0]); + a = va_arg(list, char*); + fmtuserstring(&fmt, a, " "); + argv = va_arg(list, char**); + evenaddr(PTR2UINT(argv)); + for(;;){ + a = *(char**)validaddr(argv, sizeof(char**), 0); + if(a == nil) + break; + fmtprint(&fmt, " "); + fmtuserstring(&fmt, a, ""); + argv++; + } + break; case EXEC: a = va_arg(list, char*); fmtuserstring(&fmt, a, ""); @@ -230,6 +246,17 @@ i[0] = va_arg(list, int); fmtprint(&fmt, "%#p %d", v, i[0]); break; + case SEMSLEEP: + case SEMWAKEUP: + v = va_arg(list, int*); + fmtprint(&fmt, "%#p", v); + break; + case SEMALT: + ip = va_arg(list, int**); + i[0] = va_arg(list, int); + validaddr(ip, sizeof(int*)*i[0], 0); + fmtprint(&fmt, "%#p %d", ip, i[0]); + break; case SEEK: v = va_arg(list, vlong*); i[0] = va_arg(list, int); @@ -327,6 +354,7 @@ fmtprint(&fmt, " = %ld", ar0->l); break; case EXEC: + case EXECAC: case SEGBRK: case SEGATTACH: case RENDEZVOUS: diff -r fe4562cb325e -r a190075dcebe src/9kron/port/sysproc.c --- a/src/9kron/port/sysproc.c Thu Jun 02 15:30:20 2011 +0000 +++ b/src/9kron/port/sysproc.c Tue Jun 07 07:55:55 2011 +0000 @@ -80,7 +80,7 @@ if(flag & (RFPREPAGE|RFCPREPAGE)) up->prepagemem = flag&RFPREPAGE; if(flag & RFCORE){ - pickac(up, -1); + up->ac = getac(up, -1); up->procctl = Proc_toac; }else if(flag & RFCCORE){ if(up->ac != nil) @@ -95,7 +95,7 @@ if(flag & RFCORE){ if(!waserror()){ - pickac(p, -1); + p->ac = getac(p, -1); p->procctl = Proc_toac; poperror(); }else{ @@ -278,6 +278,7 @@ chan = nil; mp = nil; if(waserror()){ + DBG("execac: failing: %s\n", up->errstr); if(file) free(file); if(elem) @@ -286,14 +287,17 @@ cclose(chan); if(core > 0 && mp != nil) mp->proc = nil; + if(core != 0) + up->ac = nil; nexterror(); } if(core != 0) - pickac(up, core); + up->ac = getac(up, core); argc = 0; file = validnamedup(ufile, 1); + DBG("execac: up %#p file %s\n", up, file); chan = namec(file, Aopen, OEXEC, 0); kstrdup(&elem, up->genbuf); @@ -607,9 +611,11 @@ up->procctl = Proc_toac; up->prepagemem = 1; } -for(i = 0; i < nelem(up->seg); i++) -if(up->seg[i] != nil) -print("after execac: seg %d %#ullx %#ullx\n", i, up->seg[i]->base, up->seg[i]->top); + + DBG("execac up %#p done\n" + "textsz %lx datasz %lx bsssz %lx hdrsz %lx\n" + "textlim %ullx datalim %ullx bsslim %ullx\n", up, + textsz, datasz, bsssz, hdrsz, textlim, datalim, bsslim); } void diff -r fe4562cb325e -r a190075dcebe src/9kron/port/syssem.c --- a/src/9kron/port/syssem.c Thu Jun 02 15:30:20 2011 +0000 +++ b/src/9kron/port/syssem.c Tue Jun 07 07:55:55 2011 +0000 @@ -142,7 +142,6 @@ DBG("semalt up %#p ss[0] %#p\n", up, ss[0]->np); r = -1; for(i = 0; i < n; i++){ - DBG("semalt1 %#p\n", up); s = ss[i]; n = semadec(s->np); if(n >= 0){