summaryrefslogtreecommitdiff
path: root/os/mpc/faultpower.c
diff options
context:
space:
mode:
authorKonstantin Kirik (snegovick) <snegovick@uprojects.org>2025-12-28 12:27:31 +0300
committerKonstantin Kirik (snegovick) <snegovick@uprojects.org>2025-12-28 12:27:31 +0300
commit78ee7d5717807e6ac779293d0d3c78341de6130a (patch)
treea43e3b0f61318ac45e6d907c7cc5bad2c6d7f497 /os/mpc/faultpower.c
parentbdaf46cf45bbb59261da245d548a179d95a42768 (diff)
Move existing boards into subdits split per arch
Diffstat (limited to 'os/mpc/faultpower.c')
-rw-r--r--os/mpc/faultpower.c49
1 files changed, 0 insertions, 49 deletions
diff --git a/os/mpc/faultpower.c b/os/mpc/faultpower.c
deleted file mode 100644
index 6d3b163b..00000000
--- a/os/mpc/faultpower.c
+++ /dev/null
@@ -1,49 +0,0 @@
-#include "u.h"
-#include "../port/lib.h"
-#include "mem.h"
-#include "dat.h"
-#include "fns.h"
-#include "ureg.h"
-#include "io.h"
-
-enum
-{
- MC_IFETCH = (1<<30),
- MC_STORE = (1<<11), /* bit 23 if X-form, bit 3 if D-form => write */
- DSI_STORE = (1<<25),
- DSI_PROT = (1<<27),
-};
-
-void
-faultpower(Ureg *ur)
-{
- ulong addr;
- char buf[ERRMAX];
- int read, i;
-
- addr = ur->pc; /* assume instr. exception */
- read = 1;
- i = ur->cause >> 8;
- if(i == CDSI || i == CDTLBE || i == CMCHECK && (ur->status&MC_IFETCH) == 0) { /* data access error including machine check load/store */
- addr = getdar();
- if(getdsisr() & (DSI_STORE|MC_STORE))
- read = 0;
- } else if(i == CDMISS) /* DTLB miss */
- addr = getdepn() & ~0x3FF; /* can't distinguish read/write, but Inferno doesn't care */
-/*
-print("fault %lux %lux %lux %d\n", ur->pc, ur->cause, addr, read);
-print("imiss %lux dmiss %lux hash1 %lux dcmp %lux hash2 %lux\n",
- getimiss(), getdmiss(), gethash1(), getdcmp(), gethash2());
-print("up %lux %lux %lux\n", m->upage, m->upage->virt, m->upage->phys);
-*/
-
- up->dbgreg = ur; /* For remote ACID */
-
- spllo();
- sprint(buf, "trap: fault %s pc=0x%lux addr=0x%lux",
- read ? "read" : "write", ur->pc, addr);
- if(up->type == Interp)
- disfault(ur, buf);
- dumpregs(ur);
- panic("fault: %s\n", buf);
-}