bring more acid libraries into line for full 64-bit support nb. asm() cheats by using 'X' instead of 'A'. this shouldn't be a problem for any current code, unless it is self modifying and using more than 4g of memory, or executing out of the stack. Reference: /n/atom/patch/applied/acidlib64 Date: Sat Feb 15 03:20:22 CET 2014 Signed-off-by: quanstro@quanstro.net --- /sys/lib/acid/port Sat Feb 15 03:19:02 2014 +++ /sys/lib/acid/port Sat Feb 15 03:19:03 2014 @@ -14,8 +14,8 @@ local pc, sp; complex Ureg addr; - pc = addr.pc\X; - sp = addr.sp\X; + pc = addr.pc\A; + sp = addr.sp\A; print("Note pc:", pc, " sp:", sp, " ", fmt(pc, 'a'), " "); pfl(pc); @@ -28,8 +28,8 @@ local pc, sp; complex Ureg addr; - pc = addr.pc\X; - sp = addr.sp\X; + pc = addr.pc\A; + sp = addr.sp\A; print("Note pc:", pc, " sp:", sp, " ", fmt(pc, 'a'), " "); pfl(pc); @@ -316,7 +316,7 @@ lst = bplist; while lst do { addr = head lst; - print("\t", fmt(addr, 'X'), " ", fmt(addr, 'a'), " ", fmt(addr, 'i'), "\n"); + print("\t", fmt(addr, 'A'), " ", fmt(addr, 'a'), " ", fmt(addr, 'i'), "\n"); lst = tail lst; } } @@ -393,7 +393,7 @@ addr = fmt(addr, 'i'); loop 1,_asmlines do { - print(fmt(addr, 'a'), " ", fmt(addr, 'X')); + print(fmt(addr, 'a'), " ", fmt(addr, 'X')); // sic. avoid A's 0s. print("\t", @addr++, "\n"); if bound != {} && addr > bound[1] then { lasmaddr = addr; @@ -513,7 +513,7 @@ { // see definition of dump in acid manual: it does n+1 iterations loop 0, n do { - print(fmt(addr, 'X'), ": "); + print(fmt(addr, 'A'), ": "); addr = mem(addr, fmt); } } --- /sys/lib/acid/thread Sat Feb 15 03:19:04 2014 +++ /sys/lib/acid/thread Sat Feb 15 03:19:05 2014 @@ -202,7 +202,7 @@ // print("=== thread scheduler stack\n"); // stk(); // } - // print("threadstks(", P\X, ")\n"); + // print("threadstks(", P\A, ")\n"); threadstks(P); P = P.next; print("\n"); @@ -257,7 +257,7 @@ T = (Thread)Tq.$head; while T != 0 do{ // print("=============================\n"); - // print(" thread(", T\X, ")\n"); + // print(" thread(", T\A, ")\n"); print("\t"); thread(T); threadstk(T); @@ -326,7 +326,7 @@ complex Tqueue Q; while Q != 0 do { - print(Q.$head\X, " "); + print(Q.$head\A, " "); Q = *(Q.$tail); } @@ -337,7 +337,7 @@ complex Channel C; local i, p; - print("channel ", C\X); + print("channel ", C\A); if C.freed then { print(" (moribund)"); } --- /sys/lib/acid/trump Sat Feb 15 03:19:06 2014 +++ /sys/lib/acid/trump Sat Feb 15 03:19:07 2014 @@ -40,7 +40,7 @@ lst = pcs; while lst do { if trumphexaddrs != 0 then - x = lst[0]\X; + x = lst[0]\A; else x = lst[0]\a; print(" src(", x, ");"); @@ -116,11 +116,11 @@ } defn trumpretval() { - if objtype=="386" then + if objtype=="386" || objtype=="amd64" then return *AX; if objtype=="mips" then return *R1; - if objtype=="power" || objtype=="alpha" then + if objtype=="power" || objtype=="alpha" || objtype=="arm" then return *R0; } @@ -147,17 +147,17 @@ bpdel(x[2]); ret = trumpretval(); if pc == mallocPC then - print(ret\X, " malloc ", arg0\D); + print(ret\A, " malloc ", arg0\D); if pc == malloczPC then - print(ret\X, " mallocz ", arg0\D); + print(ret\A, " mallocz ", arg0\D); if pc == freePC then - print(arg0\X, " free"); + print(arg0\A, " free"); if pc == reallocPC then - print(ret\X, " realloc ", arg0\X, " ", arg1\D); + print(ret\A, " realloc ", arg0\A, " ", arg1\D); if pc == sbrkallocPC then - print(ret\X, " sbrkalloc ", arg0\D); + print(ret\A, " sbrkalloc ", arg0\D); if pc == sbrkmergePC then - print("sbrkmerge ", arg0\X, " ", arg1\X, " = ", ret\D); + print("sbrkmerge ", arg0\A, " ", arg1\A, " = ", ret\D); printstack(); trumpflush(); } --- /sys/lib/acid/mach Sat Feb 15 03:19:08 2014 +++ /sys/lib/acid/mach Sat Feb 15 03:19:09 2014 @@ -12,9 +12,9 @@ defn mach(mach) { complex Mach mach; - print(mach\X, " ", mach.machno, " proc "); + print(mach\A, " ", mach.machno, " proc "); if mach.proc == 0 then - print(0\X, "\n"); + print(0\A, "\n"); else proc(mach.proc); }