shithub: riscv

Download patch

ref: b7b68668cff380eb5414aeaa914be11acd87e30c
parent: cd170777496fbf57ed923f8640437464e286a1e1
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Wed Feb 12 15:04:07 EST 2014

acid: fix acid/network, fix address formats from X to A

--- a/sys/lib/acid/network
+++ b/sys/lib/acid/network
@@ -9,7 +9,7 @@
 
 defn
 ipdev(n) {
-	_ipfs(*(ipfs+4*n));
+	_ipfs(ipfs[n]);
 }
 
 // the funny _foo/foo pairs exist so that if we get
@@ -21,11 +21,11 @@
 	complex Fs fs;
 	local i;
 
-	print("ipfs(", fs\X, ")  #I", fs.dev\D, "\n");
+	print("ipfs(", fs\A, ")  #I", fs.dev\D, "\n");
 	i=0;
 	_ni = _ni+1;
 	while i < fs.np do {
-		_proto(*(fs.p+i*4));
+		_proto(fs.p[i]);
 		i = i + 1;
 	}
 	_ni = _ni-1;
@@ -42,15 +42,15 @@
 	local c;
 	complex Proto p;
 	_ni();
-	print("proto(", p\X, ") ", *(p.name\s), "\n");
+	print("proto(", p\A, ") ", *(p.name\s), "\n");
 	_ni = _ni+1;
 	local i;
 	i = 0;
 	while i < p.nc do {
-		c = *(p.conv+i*4);
+		c = p.conv[i];
 		complex Conv c;
 		if c != 0 && c.inuse then 
-			_conv(*(p.conv+i*4));
+			_conv(c);
 		i = i + 1;
 	}
 	_ni = _ni - 1;
@@ -69,7 +69,7 @@
 	local p;
 	p = c.p;
 	complex Proto p;
-	print("conv(", c\X, ") ", *(p.name\s), "/", c.x\D, " ", 
+	print("conv(", c\A, ") ", *(p.name\s), "/", c.x\D, " ", 
 		iptostr(*(c.laddr+12)), "!", c.lport\D, " ", iptostr(*(c.raddr+12)), 
 		"!", c.rport\D, " rq ", qtostr(c.rq), " wq ", qtostr(c.wq), 
 		" eq ", qtostr(c.eq), "\n");
@@ -93,7 +93,7 @@
 {
 	complex Queue q;
 
-	return "queue("+itoa(q, "%lux")+") ["+itoa(q.len, "%d")+","+itoa(q.dlen, "%d")+","+itoa(qblocks(q), "%d")+"]";
+	return "queue("+itoa(q, "%ux")+") ["+itoa(q.len, "%d")+","+itoa(q.dlen, "%d")+","+itoa(qblocks(q), "%d")+"]";
 }
 
 defn
@@ -118,7 +118,7 @@
 	complex Queue q;
 	local b;
 
-	print("queue(", q\X, ") len ", q.len\D, " dlen ", q.dlen\D, " limit ", q.limit\D, " nblocks ", qblocks(q)\D);
+	print("queue(", q\A, ") len ", q.len\D, " dlen ", q.dlen\D, " limit ", q.limit\D, " nblocks ", qblocks(q)\D);
 	if q.state & Qstarve then 
 		print(" starve");
 	if q.state & Qmsg then
@@ -154,7 +154,7 @@
 	complex Block b;
 
 	_ni();
-	print("block(", b\X, ") base ", b.base\X, " rp ", b.rp\X, "/", b.rp-b.base\D, " wp ", b.wp\X, "/", b.wp-b.base\D, " lim ", b.lim\X, "/", b.lim-b.base\D, "\n");
+	print("block(", b\A, ") base ", b.base, " rp ", b.rp, "/", b.rp-b.base\D, " wp ", b.wp, "/", b.wp-b.base\D, " lim ", b.lim, "/", b.lim-b.base\D, "\n");
 }
 
 defn
--- a/sys/lib/acid/port
+++ b/sys/lib/acid/port
@@ -11,8 +11,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);
@@ -25,8 +25,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);
@@ -33,11 +33,6 @@
 	_stk(pc, sp, linkreg(addr), 1);
 }
 
-defn labstk(l)				// trace from a label
-{
-	_stk(*(l+4), *l, linkreg(0), 0);
-}
-
 defn params(param)
 {
 	while param do {
@@ -313,7 +308,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;
 	}
 }
@@ -390,7 +385,7 @@
 
 	addr = fmt(addr, 'i');
 	loop 1,_asmlines do {
-		print(fmt(addr, 'a'), " ", fmt(addr, 'X'));
+		print(fmt(addr, 'a'), " ", fmt(addr, 'A'));
 		print("\t", @addr++, "\n");
 		if bound != {} && addr > bound[1] then {
 			lasmaddr = addr;
@@ -510,7 +505,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);
 	}
 }