Re: Why read and write port's take wrong types
- From: "Don Burn" <burn@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 26 Sep 2007 16:42:45 -0400
Because on some architectures it is a write of a char to a "memory address"
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
"Jon Slaughter" <Jon_Slaughter@xxxxxxxxxxx> wrote in message
news:JnzKi.1308$hI7.788@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
"Don Burn" <burn@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:ec3aGpHAIHA.748@xxxxxxxxxxxxxxxxxxxxxxx
Sorry, but you are thinking normal PC with 80x86. Remember Windows NT
and later variants were written for multiple processors and designs.
There have been architectures that map I/O ports into high memory and do
similar things. Using a PUCHAR is the safe approach for this.
ok, I can understand that in some cases the assembly code isn't
equivalent.
But why the PUCHAR instead of PUSHORT? The address is a ushort so why not
call it that? When I see
in the help something like
The WRITE_PORT_UCHAR macro writes a byte to the specified port address.
VOID WRITE_PORT_UCHAR( IN PUCHAR Port, IN UCHAR Value );
and used like WRITE_PORT_UCHAR((PUCHAR)Something, 34);
It makes me think that its only using the lower byte of Something for the
address. Of course since my ports are above 255 then it gives me a bad
feeling. But I know it works so internally it must be treating it as a
USHORT like its suppose to. I don't understand why they just didn't make
it a PUSHORT in the first place?
.
- References:
- Why read and write port's take wrong types
- From: Jon Slaughter
- Re: Why read and write port's take wrong types
- From: Don Burn
- Re: Why read and write port's take wrong types
- From: Jon Slaughter
- Why read and write port's take wrong types
- Prev by Date: Re: Why read and write port's take wrong types
- Next by Date: Move the content between the allocations in the display miniport driver
- Previous by thread: Re: Why read and write port's take wrong types
- Next by thread: Re: Why read and write port's take wrong types
- Index(es):
Relevant Pages
|