"M. Warner Losh" wrote:
> 
> You are better off defining a series of macros that do proper
> bus_space_readN/bus_space_writeN for each of the fields in the
> register set.  This will ensure that your driver works unaltered on
> other architectures.
> 
> Directly accessing memory mapped devices is a bad idea.  While it
> works on i386, there are some platforms that have special alignment
> constraints that the underlying hardware doesn't always follow.

As an example, I/O devices on the SPARC architecture are almost always
placed in an "alternate address space" which means they have to be
accessed using different instructions (LDA/STA) than those that access
memory (LD/ST).  Attempting memory I/O to devices on SPARC is doomed 
to failure.  It's a whole new (portable) world, folks...

-- 
            "Where am I, and what am I doing in this handbasket?"

Wes Peters                                                         Softweyr LLC
[EMAIL PROTECTED]                                           http://softweyr.com/

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to