M carrera/fns.h => carrera/fns.h +1 -0
@@ 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);
M carrera/l.s => carrera/l.s +7 -1
@@ 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) */
M carrera/main.c => carrera/main.c +10 -14
@@ 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);
+}
M carrera/mmu.c => carrera/mmu.c +1 -2
@@ 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);
M port/dev.c => port/dev.c +2 -2
@@ 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