Re: How to accesss memory map io register?



hsphuah@xxxxxxx wrote:
I have a problem. I have mapped my memory io register but I do not know
how to read and update a particular io register.

See

READ_REGISTER_UCHAR
READ_REGISTER_USHORT
READ_REGISTER_ULONG
WRITE_REGISTER_UCHAR
WRITE_REGISTER_USHORT
WRITE_REGISTER_ULONG

Note: The "REGISTER" variants are used to access memory-mapped I/O
space (x86 MOV instructions) whereas the "PORT" variants are used to
access x86 I/O ports (x86 IN and OUT instructions).

This is usually subject for confusion. The I/O port space is a special
address space in the x86 that is independent of the I/O memory space.
I/O registers can exist in both port and memory I/O space. See also

"Accessing Hardware Registers"
http://www.wd-3.com/archive/PioAccess.htm

The DDK documentation on the aforementioned functions (macros) is here:

http://msdn.microsoft.com/library/
> Win32 and COM Development
> Windows Driver Kit
> General Driver Development Information
> General Driver Architecture
> Kernel-Mode Driver Architecture
> Reference
> Driver Support Routines
> Summary of Kernel-Mode Support Routines
> Memory
> Device Memory Access

mmadd = MmUnmapIoSpace(pdx->pMmAdd, 5);

This function has no return value (void). Also, You are probaly talking
about MmMapIoSpace(), not "Unmap".

Stephan

.



Relevant Pages

  • Re: KMDF Fakemodem not working
    ... I'm using the `Windows Vista and Windows Server Longhorn x86 Checked Build ... install the fakemodem with devcon: ... INf in the sample should tell you how to use devcon to install the driver. ... Why do I need to choose a COM port? ...
    (microsoft.public.development.device.drivers)
  • Re: Thread and send or receive data time managemennt
    ... You can't do I/O using an I/O port unless you have a device driver. ... There are some things that are not worth doing, and writing parallel port drivers ...
    (microsoft.public.vc.mfc)
  • [PATCH] PCI legacy I/O port free driver - Making Intel e1000 driver legacy I/O port free
    ... interfaces for PCI device drivers to tell the kernel which resource ... I/O port or MMIO. ... I've made a patch which makes Intel e1000 driver legacy I/O port ...
    (Linux-Kernel)
  • [PATCH] PCI legacy I/O port free driver - Making Emulex lpfc driver legacy I/O port free
    ... interfaces for PCI device drivers to tell the kernel which resource ... I/O port or MMIO. ... I've made a patch which makes Emulex lpfc driver legacy I/O port ...
    (Linux-Kernel)
  • Re: LOCK prefix
    ... > what if two processors simultaneously write/read to the same IO port? ... The aligned I/O transactions are basically atomic, however, although ... synchronization, you're probably looking at a blue-screen (insert your ... OS to never reentrantly call your driver, ...
    (comp.lang.asm.x86)

Quantcast