From 650076e9de07ae3fecaa94ac72a45390ab1ae68b Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Fri, 10 Dec 1993 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1993-12-10 --- carrera/fns.h | 1 + carrera/l.s | 8 +++++++- carrera/main.c | 24 ++++++++++-------------- carrera/mmu.c | 3 +-- port/dev.c | 4 ++-- 5 files changed, 21 insertions(+), 19 deletions(-) diff --git a/carrera/fns.h b/carrera/fns.h index 9b19ae28deb4f09f99043ceef4d130bd639af428..c4b2d79a0c32a06fd5d1fc38493bb07617f3a495 100644 --- a/carrera/fns.h +++ b/carrera/fns.h @@ -76,6 +76,7 @@ int puttlb(ulong, ulong, ulong); void puttlbx(int, ulong, ulong, ulong, int); void* pxalloc(ulong); void* pxspanalloc(ulong, int, ulong); +void rdbginit(void); ulong rdcount(void); int readlog(ulong, char*, ulong); void restfpregs(FPsave*, ulong); diff --git a/carrera/l.s b/carrera/l.s index 04675a9f373a83e1b39b177c0702b62734984df6..788831e28fe1a7f0d226de0b814ae365349b2f2c 100644 --- a/carrera/l.s +++ b/carrera/l.s @@ -212,7 +212,7 @@ TEXT getrandom(SB),$0 WAIT RET -TEXT puttlbxx(SB), $0 +TEXT puttlbx(SB), $0 MOVW 4(FP), R2 MOVW 8(FP), R3 @@ -750,6 +750,9 @@ tas1: * we avoid using R4, R5, R6, and R7 so gotopc can call us without saving them */ TEXT icflush(SB), $-4 /* icflush(virtaddr, count) */ +MOVW $0xA0090008, R10 +MOVW $2001, R9 +MOVW R9, (R10) MOVW M(STATUS), R10 WAIT MOVW 4(FP), R9 @@ -779,6 +782,9 @@ icflush1: /* primary cache line size is 16 bytes */ WAIT WAIT WAIT +MOVW $0xA0090008, R10 +MOVW $2002, R9 +MOVW R9, (R10) RET TEXT dcflush(SB), $-4 /* dcflush(virtaddr, count) */ diff --git a/carrera/main.c b/carrera/main.c index 32f29c7d1fd15b96073b5590c99eefc20b5cdb42..e1ce6d800322dce38a52dc31ae97d05015b38073 100644 --- a/carrera/main.c +++ b/carrera/main.c @@ -6,8 +6,6 @@ #include "io.h" #include "init.h" -int junk[32]; - /* * args passed by boot process */ @@ -33,6 +31,9 @@ Softtlb stlb[MAXMACH][STLBSIZE]; Conf conf; FPsave initfp; +extern uchar rdbgcode[]; +extern ulong rdbglen; + void main(void) { @@ -57,6 +58,7 @@ main(void) chandevreset(); swapinit(); userinit(); + rdbginit(); schedinit(); } @@ -206,18 +208,6 @@ ioinit(int mapeisa) /* IO(uchar, EisaLatch) = 0; /**/ } -void puttlbxx(int, ulong, ulong, ulong, int); -void puttlbx(int a, ulong b, ulong c, ulong d, int e) -{ - static int done[4]; - - if(((c|d)&PTEVALID) && a < 4){ - if(done[a]++) - puttlbx(a, b, c, d, e); - } - puttlbxx(a, b, c, d, e); -} - /* * Pull the ethernet address out of NVRAM */ @@ -419,3 +409,9 @@ buzz(int f, int d) USED(f); USED(d); } + +void +rdbginit(void) +{ + memmove((void*)0xA001C000, rdbgcode, rdbglen); +} diff --git a/carrera/mmu.c b/carrera/mmu.c index 6a88b288fde9328ce44559626bf09643c7f6d865..dd76ceaa34e590bd177fa80ca4bee4657672dbff 100644 --- a/carrera/mmu.c +++ b/carrera/mmu.c @@ -130,7 +130,6 @@ kunmap(KMap *k) s = splhi(); if(decref(k) == 0) { -puttlb((k->virt & ~BY2PG) | TLBPID(tlbvirt()), k->phys0 & ~PTEVALID, k->phys1 & ~PTEVALID); k->virt = 0; k->phys0 = 0; k->phys1 = 0; @@ -306,7 +305,7 @@ extern ulong tlbvirt(void); print("entry->virt %lux pg->va %lux\n", entry->virt, pg->va); panic("icflush not in TLB"); } -if(pg->va == 0x19000) { +if(0 && pg->va == 0x19000) { print("xx>> virt %lux phys0 %lux phys1 %lux\n", tlb[0],tlb[1],tlb[2]); } icflush((void*)pg->va, BY2PG); diff --git a/port/dev.c b/port/dev.c index f2d0774fe5b65c225eaa290a6e22d1ddaddb2d7e..19098574a7cfa220f3d1829778d4ad826788ef4a 100644 --- a/port/dev.c +++ b/port/dev.c @@ -47,8 +47,8 @@ devdir(Chan *c, Qid qid, char *n, long length, char *user, long perm, Dir *db) db->mtime = kerndate; db->hlength = 0; db->length = length; - strncpy(db->uid, user, NAMELEN); - strncpy(db->gid, eve, NAMELEN); + memmove(db->uid, user, NAMELEN); + memmove(db->gid, eve, NAMELEN); } int