Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Dec 1995 16:30:14 -0800
From:      David Greenman <davidg@Root.COM>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        CVS-committers@freefall.freebsd.org, cvs-sys@freefall.freebsd.org
Subject:   Re: cvs commit: src/sys/i386/isa if_ed.c 
Message-ID:  <199512160030.QAA02036@corbin.Root.COM>
In-Reply-To: Your message of "Sat, 16 Dec 95 10:43:56 %2B1100." <199512152343.KAA04105@godzilla.zeta.org.au> 

next in thread | previous in thread | raw e-mail | index | archive | help
>>>In this case, I think the casts only work because the hardware ignores
>>>some bits in the address (bits 14-15 of 0-31 for 16K cards and bits
>>>13-15 for 8K cards?).  Conversions of the form
>>>
>>>	(int)(buf - base)
>>>	((int)buf) & 0x3fff
>>>
>>>would be more obviously correct, but might be slower.
>
>>   That's not quite correct. The offset within the NIC memory segment is a 16
>>bit number but is written out a byte at a time. The fact that only the lower
>>two bytes are written out *implies* a masking of the upper bits. This is both
>>intended and correct. I chose to fix the problem the way I did to avoid
>
>Yes, the top 16 bits are masked by not writing out the bytes for them.
>Bits 14-15 aren't masked.  Consider a board with 16K of memory address
>0xd4000.  Then address 0xd4000 corresponds to offset 0 but offset 0x4000
>is written out.  This apparently works because bits 14-15 are ignored by
>the h/w.  It wouldn't work for a board with 32K of memory at address
>0xd4000 but this is unlikely to be supported since it would take a gate
>or two more to decode.  It wouldn't work if the board used bits 14-15
>for something else.  To determine the correctnes of the cast, you have
>to look at the manuals for all supported boards (a growing list :-) and
>and see if those bits are specified as "don't care".

   No, you apparantly don't understand what's happening in there. In the PIO
case, the "base" is 0 and the offset is just an offset relative to zero. The
upper bits will never be non-zero.

-DG



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199512160030.QAA02036>