What this has to do with Linux I don't know, but:
It depends on your platform, some CPUs don't support
Advantages of MM io is you don't need special instructions and so can use
all the powerful addressing modes for IO. For e.g. you can define a
that corresponds to the IO space of the device and just read/write the
to control the device. Also for I/O mapped I/O you need extra pins in
that are driven by the I/O instruction.
The disadvantages are that the memory space is depleted.
Also it's harder to debug since any memory issues in your program (or others
on non MMU hardware) could be interacting with your device. Also the full
address size of the machine must be used for each instruction
the device and so is slower in this respect.
Note most of the modern RISC and all 68K CPUs have no I/O instructions.
Personally I like working with MM I/O hardware as it allows for
elegant programs IMHO.
Stephen Shirley wrote:
> I have to write a device driver for a chip which allows both port
>mapped and memory mapped i/o. Now I know that memory mapped is easier for
>the programmer (can use any instruction that can access memory, don't need
>to copy out data to look at it etc), but i was wondering was there any
>particular reasons why people would choose one over the other.
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!