Re: Any difference of WRITE_PORT_USHORT(p, v) and directly *p=v?
- From: "Dean Ramsier" <ramsiernospam@xxxxxxxxxx>
- Date: Thu, 7 Sep 2006 09:16:07 -0400
Depends on your CPU. Generically, PORT != REGISTER. There are macros for
both ports and registers. On x86 architectures for example there is IO
space (which uses ports) and memory space (which uses registers). Other
architectures do not have IO space, and the macros both do the same thing.
The REGISTER macros do *p=v, and ensure that the volatile keyword is
properly used. As long as you are writing to memory space, the approaches
should be identical (make sure to use volatile).
Note that it is possible, although uncommon, for an OEM to have modified the
macros to handle specific nonstandard hardware issues on a particular
platform. In that case, the macro does not necessarily do *p=v.
--
Dean Ramsier - eMVP
BSQUARE Corporation
"Boku" <Boku@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5A6C18F0-9A35-44E9-A307-810BB5164950@xxxxxxxxxxxxxxxx
Hi, Thanks~
So if I wanna write mmaped register file, is it the same or better to use
WRITE_PORT() or the other one?
"Ulrich Eckhardt" wrote:
Boku wrote:
As the title, is the operation same or different?
Or if wanna use *p = v, does it need any operation before using the
assignment?
It's different, writing to memory is something other than writing to an
ioport. On some systems it might be the same though, because those don't
have ioports.
Uli
.
- References:
- Re: Any difference of WRITE_PORT_USHORT(p, v) and directly *p=v?
- From: Ulrich Eckhardt
- Re: Any difference of WRITE_PORT_USHORT(p, v) and directly *p=v?
- Prev by Date: Re: Any difference of WRITE_PORT_USHORT(p, v) and directly *p=v?
- Next by Date: Re: Validated Wireless LAN Driver on WinCE
- Previous by thread: Re: Any difference of WRITE_PORT_USHORT(p, v) and directly *p=v?
- Next by thread: Re: Validated Wireless LAN Driver on WinCE
- Index(es):
Relevant Pages
|