From 6042a76341cc12d66d4e262c735d829d2128e8d3 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sat, 6 Feb 1993 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1993-02-06 --- pc/dat.h | 1 - pc/devvga.c | 5 ++++- pc/main.c | 1 - port/devarp.c | 15 ++++++++++----- port/devboot.c | 1 + power/conf.h | 4 ---- power/dat.h | 4 ---- power/l.s | 9 ++------- power/main.c | 9 +++------ ss/dat.h | 4 ---- ss/main.c | 4 ---- 11 files changed, 20 insertions(+), 37 deletions(-) diff --git a/pc/dat.h b/pc/dat.h index 5f35aedd73a15c0cae5c79260b6919dcb2b99787..2828a30835d3def6aa7536efbc3975e4548a02ae 100644 --- a/pc/dat.h +++ b/pc/dat.h @@ -76,7 +76,6 @@ struct Conf ulong base0; /* base of bank 0 */ ulong base1; /* base of bank 1 */ ulong copymode; /* 0 is copy on write, 1 is copy on reference */ - ulong arp; /* Arp table size */ ulong nfloppy; /* number of floppy drives */ ulong nhard; /* number of hard drives */ ulong ldepth; /* screen depth */ diff --git a/pc/devvga.c b/pc/devvga.c index e9763bfb8bfe770bb4a5ae3fba900e26ad1182fc..1bc407339ab3513001c5fd599042dfbf603155e4 100644 --- a/pc/devvga.c +++ b/pc/devvga.c @@ -652,10 +652,13 @@ atipage(int page) outb(extreg, 0xb2); outb(extreg+1, v); } +/* + * The following assumes that the new mode registers have been selected. + */ static void tridentpage(int page) { - srout(0x0e, (srin(0xe)&0xf0) | page^0x02); + srout(0x0e, (srin(0x0e)&0xf0) | page^0x02); } static void tsengpage(int page) diff --git a/pc/main.c b/pc/main.c index 7398b5273c762ee66cacb61322bdc591e700cda0..0ac06890bfb7dcc265edbdd2d53e9abbdbc76009 100644 --- a/pc/main.c +++ b/pc/main.c @@ -290,7 +290,6 @@ confinit(void) conf.nswap = conf.nproc*80; conf.nimage = 50; conf.copymode = 0; /* copy on write */ - conf.arp = 32; conf.nfloppy = 2; conf.nhard = 2; } diff --git a/port/devarp.c b/port/devarp.c index fd9595c117b0b3a6bd90634373093fb5dc17f3e1..c4cd97c9c5b7e9de7a2aeb9e36ad40b367cc5e06 100644 --- a/port/devarp.c +++ b/port/devarp.c @@ -66,6 +66,11 @@ Dirtab arptab[]={ }; #define Narptab (sizeof(arptab)/sizeof(Dirtab)) +enum +{ + Narp= 64, /* size of arp cache */ +}; + /* * create a 2-level directory */ @@ -97,10 +102,10 @@ arpreset(void) { Arpcache *ap, *ep; - arp = xalloc(sizeof(Arpcache) * conf.arp); + arp = xalloc(sizeof(Arpcache) * Narp); arphash = (Arpcache **)xalloc(sizeof(Arpcache *) * Arphashsize); - ep = &arp[conf.arp]; + ep = &arp[Narp]; for(ap = arp; ap < ep; ap++) { ap->frwd = ap+1; ap->prev = ap-1; @@ -110,7 +115,7 @@ arpreset(void) arp[0].prev = 0; arplruhead = arp; - ap = &arp[conf.arp-1]; + ap = &arp[Narp-1]; ap->frwd = 0; arplrutail = ap; newqinfo(&arpinfo); @@ -211,7 +216,7 @@ arpread(Chan *c, void *a, long n, ulong offset) switch((int)(c->qid.path&~CHDIR)){ case arpdataqid: bytes = c->offset; - while(bytes < conf.arp*ARP_ENTRYLEN && n) { + while(bytes < Narp*ARP_ENTRYLEN && n) { ap = &arp[bytes/ARP_ENTRYLEN]; part = bytes%ARP_ENTRYLEN; @@ -388,7 +393,7 @@ arpflush(void) { Arpcache *ap, *ep; - ep = &arp[conf.arp]; + ep = &arp[Narp]; for(ap = arp; ap < ep; ap++) ap->status = ARP_FREE; } diff --git a/port/devboot.c b/port/devboot.c index e13656e8c705bf1a4af8a3a043edf7fdfa03da7b..9af499b0a6e8991965649bea9a68c696ae600bad 100644 --- a/port/devboot.c +++ b/port/devboot.c @@ -114,6 +114,7 @@ bootwrite(Chan *c, void *buf, long n, ulong offset) case Qboot: pc = *(ulong*)buf; splhi(); + icflush(0, 64*1024); gotopc(pc); } error(Ebadarg); diff --git a/power/conf.h b/power/conf.h index 6153f757ada7064914fbbcde5bc951dcd55ed379..c367b599ea88bf6ed77eedd3af51719ad4a594c6 100644 --- a/power/conf.h +++ b/power/conf.h @@ -10,10 +10,6 @@ Conftab conftab[] = { {"base0", &conf.base0 }, {"base1", &conf.base1 }, {"copymode", &conf.copymode }, - {"ipif", &conf.ipif }, - {"ip", &conf.ip }, - {"arp", &conf.arp }, - {"frag", &conf.frag }, {"debugger", &conf.debugger }, { 0, 0 }, }; diff --git a/power/dat.h b/power/dat.h index 64f0f370a9945794fd170501b3e5aba5b3d254ed..6614d21bee2f0ebcc8002376734ccab8a3bdbdbb 100644 --- a/power/dat.h +++ b/power/dat.h @@ -46,10 +46,6 @@ struct Conf ulong base0; /* base of bank 0 */ ulong base1; /* base of bank 1 */ ulong copymode; /* 0 is copy on write, 1 is copy on reference */ - ulong ipif; /* Ip protocol interfaces */ - ulong ip; /* Ip conversations per interface */ - ulong arp; /* Arp table size */ - ulong frag; /* Ip fragment assemble queue size */ ulong debugger; /* use processor 1 as a kernel debugger */ }; diff --git a/power/l.s b/power/l.s index 09fb41d20624d3c02e2663a46e48293955ec84ec..cb21aa9f08dc3e002c564c12ae9ba53bd7c74d19 100644 --- a/power/l.s +++ b/power/l.s @@ -181,18 +181,13 @@ TEXT getcallerpc(SB), $0 MOVW 0(SP), R1 RET -TEXT gotopc(SB), $8 +TEXT gotopc(SB), $-4 - MOVW R1, 0(FP) /* save arguments for later */ - MOVW $(64*1024), R7 - MOVW R7, 8(SP) - JAL icflush(SB) - MOVW 0(FP), R7 MOVW _argc(SB), R4 MOVW _argv(SB), R5 MOVW _env(SB), R6 MOVW R0, 4(SP) - JMP (R7) + JMP (R1) TEXT puttlb(SB), $4 diff --git a/power/main.c b/power/main.c index b304287780a893b3ca39d2a0020b7cb7ffdd1a32..ac9f760ef32badcf15fbd9c5ca0034bfff99dc98 100644 --- a/power/main.c +++ b/power/main.c @@ -519,6 +519,8 @@ confinit(void) conf.npage1 = 0; conf.base1 = 0; + conf.nproc = 128 + 3*i; + ktop = PGROUND((ulong)end); ktop = PADDR(ktop); conf.npage0 -= ktop/BY2PG; @@ -537,14 +539,9 @@ confinit(void) /* * set minimal default values */ - conf.nmach = 2; - conf.nproc = 100; + conf.nmach = 1; conf.nswap = 262144; conf.nimage = 200; - conf.ipif = 8; - conf.ip = 64; - conf.arp = 32; - conf.frag = 32; confread(); diff --git a/ss/dat.h b/ss/dat.h index 31be1fb4561feb212237ba60a282f40f8045bb86..4a4caf45f0848e2d9d82cfa6f14f3949cbafee3b 100644 --- a/ss/dat.h +++ b/ss/dat.h @@ -85,10 +85,6 @@ struct Conf ulong nswap; /* number of swap blocks */ ulong upages; /* number of user pages */ int copymode; /* 0 is copy on write, 1 is copy on reference */ - ulong ipif; /* Ip protocol interfaces */ - ulong ip; /* Ip conversations per interface */ - ulong arp; /* Arp table size */ - ulong frag; /* Ip fragment assemble queue size */ }; diff --git a/ss/main.c b/ss/main.c index bf9ddac314fb7c535c8e19ab616682a1788a85ff..508ef96ef6453c3e4c66f757c3fb63ef7bf085b0 100644 --- a/ss/main.c +++ b/ss/main.c @@ -477,10 +477,6 @@ confinit(void) conf.nswap = 16*MB/BY2PG; conf.nimage = 50; conf.copymode = 0; /* copy on write */ - conf.ipif = 8; - conf.ip = 64; - conf.arp = 32; - conf.frag = 32; if(cpuserver) conf.nproc = 500; }