diff options
| author | forsyth <forsyth@vitanuova.com> | 2010-05-03 15:47:59 +0100 |
|---|---|---|
| committer | forsyth <forsyth@vitanuova.com> | 2010-05-03 15:47:59 +0100 |
| commit | 773d7fd206e9623edfb12cd182dc5a115ec86950 (patch) | |
| tree | 9f1953e19a531cca9d2f0be969f902eddda1dca1 /lib/acid/amd64 | |
| parent | f8af978a60a0a00813e7a57f93d9a5ba4df44069 (diff) | |
20100503-1547
Diffstat (limited to 'lib/acid/amd64')
| -rw-r--r-- | lib/acid/amd64 | 123 |
1 files changed, 123 insertions, 0 deletions
diff --git a/lib/acid/amd64 b/lib/acid/amd64 new file mode 100644 index 00000000..c08edd1a --- /dev/null +++ b/lib/acid/amd64 @@ -0,0 +1,123 @@ +// amd64 + +defn acidinit() +{ + bplist = {}; + bpfmt = 'b'; + + srcpath = { + "./", + "/sys/src/libc/port/", + "/sys/src/libc/9sys/", + "/sys/src/libc/amd64/" + }; + + srcfiles = {}; // list of loaded files + srctext = {}; // the text of the files +} + +defn gpr() +{ + print("AX ", *AX, "\n"); + print("BX ", *BX, "\n"); + print("CX ", *CX, "\n"); + print("DX ", *DX, "\n"); + print("DI ", *DI, "\n"); + print("SI ", *SI, "\n"); + print("BP ", *BP, "\n"); + print("R8 ", *R8, "\n"); + print("R9 ", *R9, "\n"); + print("R10 ", *R10, "\n"); + print("R11 ", *R11, "\n"); + print("R12 ", *R12, "\n"); + print("R13 ", *R13, "\n"); + print("R14 ", *R14, "\n"); + print("R15 ", *R15, "\n"); +} + +defn spr() +{ + print("DS ", *DS, " ES ", *ES, " FS ", *FS, " GS ", *GS, "\n"); + print("TYPE ", *TYPE, "\n"); + print("ERROR ", *ERROR, "\n"); + print("PC ", *PC, "\n"); + print("CS ", *CS, "\n"); + print("FLAGS ", *FLAGS, "\n"); + print("SP ", *SP, "\n"); + print("SS ", *SS, "\n"); +} + +defn x87r() +{ + print("FCW ", *FCW, " FSW ", *FSW, " FTW ", *FTW, " FOP ", *FOP, "\n"); + print("RIP ", *RIP, " RDP ", *RDP, "\n"); + print("M0 ", *M0, "\n"); + print("M1 ", *M1, "\n"); + print("M2 ", *M2, "\n"); + print("M3 ", *M3, "\n"); + print("M4 ", *M4, "\n"); + print("M5 ", *M5, "\n"); + print("M6 ", *M6, "\n"); + print("M7 ", *M7, "\n"); +} + +defn xmmr() +{ + print("MXCSR ", *MXCSR, " MXCSRMASK ", *MXCSRMASK, "\n"); + print("X0 ", *X0, "\n"); + print("X1 ", *X1, "\n"); + print("X2 ", *X2, "\n"); + print("X3 ", *X3, "\n"); + print("X4 ", *X4, "\n"); + print("X5 ", *X5, "\n"); + print("X6 ", *X6, "\n"); + print("X7 ", *X7, "\n"); + print("X8 ", *X8, "\n"); + print("X9 ", *X9, "\n"); + print("X10 ", *X10, "\n"); + print("X11 ", *X11, "\n"); + print("X12 ", *X12, "\n"); + print("X13 ", *X13, "\n"); + print("X14 ", *X14, "\n"); + print("X15 ", *X15, "\n"); +} + +defn fpr() +{ + xmmr(); +} + +defn regs() +{ + gpr(); + spr(); +} + +defn pstop(pid) +{ + local l; + local pc; + + pc = *PC; + + print(pid,": ", reason(*TRAP), "\t"); + print(fmt(pc, 'a'), "\t", fmt(pc, 'i'), "\n"); + + if notes then { + if notes[0] != "sys: breakpoint" then { + print("Notes pending:\n"); + l = notes; + while l do { + print("\t", head l, "\n"); + l = tail l; + } + } + } +} + +defn stk() +{ + _stk(*PC, *SP, 0, 0); +} + +print("/sys/lib/acid/amd64"); |
