No bus_space_read_8 on x86 ?
Carl Delsey
carl.r.delsey at intel.com
Wed Oct 10 21:44:17 UTC 2012
Sorry for the slow response. I was dealing with a bit of a family
emergency. Responses inline below.
On 10/09/12 08:54, John Baldwin wrote:
> On Monday, October 08, 2012 4:59:24 pm Warner Losh wrote:
>> On Oct 5, 2012, at 10:08 AM, John Baldwin wrote:
<snip>
>>> I think cxgb* already have an implementation. For amd64 we should certainly
>>> have bus_space_*_8(), at least for SYS_RES_MEMORY. I think they should fail
>>> for SYS_RES_IOPORT. I don't think we can force a compile-time error though,
>>> would just have to return -1 on reads or some such?
Yes. Exactly what I was thinking.
>> I believe it was because bus reads weren't guaranteed to be atomic on i386.
>> don't know if that's still the case or a concern, but it was an intentional omission.
> True. If you are on a 32-bit system you can read the two 4 byte values and
> then build a 64-bit value. For 64-bit platforms we should offer bus_read_8()
> however.
I believe there is still no way to perform a 64-bit read on a i386 (or
at least without messing with SSE instructions), but if you have to read
a 64-bit register, you are stuck with doing two 32-bit reads and
concatenating them. I figure we may as well provide an implementation
for those who have to do that as well as the implementation for 64-bit.
Anyhow, it sounds like we are basically in agreement. I'll put together
a patch and send it out for review.
Thanks,
Carl
More information about the freebsd-hackers
mailing list