Subject: anyone has a turbochannel alpha?
To: None <port-alpha@netbsd.org>
From: Matthias Drochner <M.Drochner@fz-juelich.de>
List: port-alpha
Date: 06/02/2005 15:02:01
This is a multipart MIME message.

--==_Exmh_1732430539000
Content-Type: text/plain; charset=us-ascii


Hi -
fixing a -Wshadow warning I found that the code writing bytes/shorts
to sparse address space looks strange.
Possibly, it has never worked correctly.
The appended patch makes the code work as appearently intended.
Is anyone able to test this, or has some documentation to verify?

(I'll be AFK from tomorrow till June 19.)

best regards
Matthias



--==_Exmh_1732430539000
Content-Type: text/plain ; name="tc.txt"; charset=us-ascii
Content-Description: tc.txt
Content-Disposition: attachment; filename="tc.txt"

--- tc_bus_mem.c.~1.25.~	Tue Sep  4 11:49:47 2001
+++ tc_bus_mem.c	Thu Jun  2 14:07:03 2005
@@ -523,7 +523,7 @@ tc_mem_write_1(v, memh, off, val)
 {
 
 	if ((memh & TC_SPACE_SPARSE) != 0) {
-		volatile u_int64_t *p, v;
+		volatile u_int64_t *p, qv;
 		u_int64_t shift, msk;
 
 		shift = off & 0x3;
@@ -532,9 +532,9 @@ tc_mem_write_1(v, memh, off, val)
 		p = (u_int64_t *)(memh + (off << 1));
 
 		msk = ~(0x1 << shift) & 0xf;
-		v = (msk << 32) | (((u_int64_t)val) << (shift * 8));
+		qv = (msk << 32) | (((u_int64_t)val) << (shift * 8));
 
-		*p = val;
+		*p = qv;
 	} else {
 		volatile u_int8_t *p;
 
@@ -553,7 +553,7 @@ tc_mem_write_2(v, memh, off, val)
 {
 
 	if ((memh & TC_SPACE_SPARSE) != 0) {
-		volatile u_int64_t *p, v;
+		volatile u_int64_t *p, qv;
 		u_int64_t shift, msk;
 
 		shift = off & 0x2;
@@ -562,9 +562,9 @@ tc_mem_write_2(v, memh, off, val)
 		p = (u_int64_t *)(memh + (off << 1));
 
 		msk = ~(0x3 << shift) & 0xf;
-		v = (msk << 32) | (((u_int64_t)val) << (shift * 8));
+		qv = (msk << 32) | (((u_int64_t)val) << (shift * 8));
 
-		*p = val;
+		*p = qv;
 	} else {
 		volatile u_int16_t *p;
 
@@ -602,7 +602,7 @@ tc_mem_write_8(v, memh, off, val)
 	volatile u_int64_t *p;
 
 	if ((memh & TC_SPACE_SPARSE) != 0)
-		panic("tc_mem_read_8 not implemented for sparse space");
+		panic("tc_mem_write_8 not implemented for sparse space");
 
 	p = (u_int64_t *)(memh + off);
 	*p = val;

--==_Exmh_1732430539000--