Re: Any difference of WRITE_PORT_USHORT(p, v) and directly *p=v?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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




.



Relevant Pages

  • Re: split register sets
    ... the porting of the register file ... the number of bits in the instruction dedicated to denoting ... Register files with 6 or fewer ports can be made to fit an 18-wire ... Instruction set design issues: ...
    (comp.arch)
  • Re: Unassigned register decode
    ... with the exception of the very first package containing ... file for the new design now breaks things for the old design which still ... Ummm....the reason one has read/write ports in a design in the first place ... register list length are not limited by something in the package. ...
    (comp.lang.vhdl)
  • Re: Peripheral Trouble!
    ... unsure of ports though - do I have any user ports - are these the ... you want to print data coming from a camera. ... a register so that you can read it from the microprocessor. ... I have altered the ucf file, mpd, mhs... ...
    (comp.arch.fpga)
  • Two probably impractical register file ideas
    ... have the more significant bits be in a register file partition ... with half as many ports. ... for the upper bits be accessible twice within the long cycle ... of bank conflicts, so the number of read ports might be ...
    (comp.arch)
  • Coding style question
    ... I have question if next style of macros definitions ... prevents mistakes, when field defined for one register ... is used with incorrect register by mistake. ... is some commonly available alternative in Linux kernel ...
    (Linux-Kernel)