memcpy to PCI Adapter

At one time I had used memcpy and the virtual address returned from
MmMapIoSpace to move data to a PCI adapter’s memory. Knowing that this works
for Intel x86 architectures but possibly not others, I switched to the
READ_REGISTER_BUFFER_UCHAR, but the performance dropped considerably since
memcpy optimizes for quad word transfers.

Is there a generic READ_REGISTER_BUFFER that mimics memcpy’s optimization
(this would be similar to memcpy_toio and memcpy_fromio in the Linux world)?
Does everyone have to recreate memcpy using the READ_REGISTER_BUFFER_*
routines?

You will of course get better performance using READ_REGISTER_BUFFER_ULONG,
right?

=====================
Mark Roddy

-----Original Message-----
From: cd [mailto:xxxxx@hotmail.com]
Sent: Thursday, July 01, 2004 9:27 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] memcpy to PCI Adapter

At one time I had used memcpy and the virtual address returned from
MmMapIoSpace to move data to a PCI adapter’s memory. Knowing that this works
for Intel x86 architectures but possibly not others, I switched to the
READ_REGISTER_BUFFER_UCHAR, but the performance dropped considerably since
memcpy optimizes for quad word transfers.

Is there a generic READ_REGISTER_BUFFER that mimics memcpy’s optimization
(this would be similar to memcpy_toio and memcpy_fromio in the Linux world)?
Does everyone have to recreate memcpy using the READ_REGISTER_BUFFER_*
routines?


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com

Whilst we’re nitpicking, I think in Intel x86 mode, memcpy would use DOUBLE
word, not QUAD word… Quad word is possible if using MMX or SSE (which
would also do double quads), but both of those extensions are “not allowed”
in kernel mode. So it would have to be 32-bit words as long as we’re talking
about 32-bit x86 processors.


Mats

-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: Thursday, July 01, 2004 4:06 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] memcpy to PCI Adapter

You will of course get better performance using
READ_REGISTER_BUFFER_ULONG,
right?

=====================
Mark Roddy

-----Original Message-----
From: cd [mailto:xxxxx@hotmail.com]
Sent: Thursday, July 01, 2004 9:27 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] memcpy to PCI Adapter

At one time I had used memcpy and the virtual address returned from
MmMapIoSpace to move data to a PCI adapter’s memory. Knowing
that this works
for Intel x86 architectures but possibly not others, I switched to the
READ_REGISTER_BUFFER_UCHAR, but the performance dropped
considerably since
memcpy optimizes for quad word transfers.

Is there a generic READ_REGISTER_BUFFER that mimics memcpy’s
optimization
(this would be similar to memcpy_toio and memcpy_fromio in
the Linux world)?
Does everyone have to recreate memcpy using the READ_REGISTER_BUFFER_*
routines?


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@3dlabs.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Of course, but my code assumes a generic memcpy routine. On other OSes,
memcpy like routines are provided. I just have to do it all myself for
Windows.

I just changed my OS code to use memcpy for x86 machines and a custom memcpy
using WRITE/READ_REGISTER* optimized for aligned source/destination on
non-x86 machines.

“Roddy, Mark” wrote in message news:xxxxx@ntdev…
> You will of course get better performance using
READ_REGISTER_BUFFER_ULONG,
> right?
>
>
>
> =====================
> Mark Roddy
>
> -----Original Message-----
> From: cd [mailto:xxxxx@hotmail.com]
> Sent: Thursday, July 01, 2004 9:27 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] memcpy to PCI Adapter
>
> At one time I had used memcpy and the virtual address returned from
> MmMapIoSpace to move data to a PCI adapter’s memory. Knowing that this
works
> for Intel x86 architectures but possibly not others, I switched to the
> READ_REGISTER_BUFFER_UCHAR, but the performance dropped considerably since
> memcpy optimizes for quad word transfers.
>
> Is there a generic READ_REGISTER_BUFFER that mimics memcpy’s optimization
> (this would be similar to memcpy_toio and memcpy_fromio in the Linux
world)?
> Does everyone have to recreate memcpy using the READ_REGISTER_BUFFER_*
> routines?
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@stratus.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
>

See Mats’ reply. memcpy on x86 uses 32bit transfers as does
READ_REGISTER_BUFFER_ULONG, so I don’t see what you are getting out of this
other than unportable code.

For host->device operations on an x86 architecture you are asking for
obscure timing related bugs by not using the HAL WRITE_REGISTER_* routines.

=====================
Mark Roddy

-----Original Message-----
From: cd [mailto:xxxxx@hotmail.com]
Sent: Thursday, July 01, 2004 11:16 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] memcpy to PCI Adapter

Of course, but my code assumes a generic memcpy routine. On other OSes,
memcpy like routines are provided. I just have to do it all myself for
Windows.

I just changed my OS code to use memcpy for x86 machines and a custom memcpy
using WRITE/READ_REGISTER* optimized for aligned source/destination on
non-x86 machines.

“Roddy, Mark” wrote in message news:xxxxx@ntdev…
> You will of course get better performance using
READ_REGISTER_BUFFER_ULONG,
> right?
>
>
>
> =====================
> Mark Roddy
>
> -----Original Message-----
> From: cd [mailto:xxxxx@hotmail.com]
> Sent: Thursday, July 01, 2004 9:27 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] memcpy to PCI Adapter
>
> At one time I had used memcpy and the virtual address returned from
> MmMapIoSpace to move data to a PCI adapter’s memory. Knowing that this
works
> for Intel x86 architectures but possibly not others, I switched to the
> READ_REGISTER_BUFFER_UCHAR, but the performance dropped considerably
> since memcpy optimizes for quad word transfers.
>
> Is there a generic READ_REGISTER_BUFFER that mimics memcpy’s
> optimization (this would be similar to memcpy_toio and memcpy_fromio
> in the Linux
world)?
> Does everyone have to recreate memcpy using the READ_REGISTER_BUFFER_*
> routines?
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@stratus.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com

Ah, but memcpy is generic in the sense that it’s able to copy 1, 3, 46, 48,
64, 908 and 1024 bytes all the same. It just does 4-byte at a time copies
when the length, source and destination allows it (which in x86-case is as
long as remaining length > 4 bytes).

A copy routine built along these lines using READ_REGISTER_BUFFER_ULONG
could be used too:

void memcpy_from_BUFFER(void *src, void *dest, size_t len)
{
READ_REGISTER_BUFFER_ULONG((PULONG)src, (PULONG)dest, (len >> 2));
if (len & 3)
{
UCHAR *src1, *dest1;
src1 = (UCHAR *src) + (len & ~3);
dest1 = (UCHAR *dest) + (len & ~3);
READ_REGISTER_BUFFER_UCHAR(src1, dest1, len & 3);
}
}

And of course, using WRITE_REGISTER_BUFFER_XXXX if you want to get the data
written in the opposite direction. The only problem with this would be on
machines that do not support unaligned addresses, in which case you’d have
to support the unaligned cases.


Mats

-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: Thursday, July 01, 2004 4:28 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] memcpy to PCI Adapter

See Mats’ reply. memcpy on x86 uses 32bit transfers as does
READ_REGISTER_BUFFER_ULONG, so I don’t see what you are
getting out of this
other than unportable code.

For host->device operations on an x86 architecture you are asking for
obscure timing related bugs by not using the HAL
WRITE_REGISTER_* routines.

=====================
Mark Roddy

-----Original Message-----
From: cd [mailto:xxxxx@hotmail.com]
Sent: Thursday, July 01, 2004 11:16 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] memcpy to PCI Adapter

Of course, but my code assumes a generic memcpy routine. On
other OSes,
memcpy like routines are provided. I just have to do it all myself for
Windows.

I just changed my OS code to use memcpy for x86 machines and
a custom memcpy
using WRITE/READ_REGISTER* optimized for aligned source/destination on
non-x86 machines.

“Roddy, Mark” wrote in message
news:xxxxx@ntdev…
> You will of course get better performance using
READ_REGISTER_BUFFER_ULONG,
> right?
>
>
>
> =====================
> Mark Roddy
>
> -----Original Message-----
> From: cd [mailto:xxxxx@hotmail.com]
> Sent: Thursday, July 01, 2004 9:27 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] memcpy to PCI Adapter
>
> At one time I had used memcpy and the virtual address returned from
> MmMapIoSpace to move data to a PCI adapter’s memory. Knowing that this
works
> for Intel x86 architectures but possibly not others, I switched to the
> READ_REGISTER_BUFFER_UCHAR, but the performance dropped considerably
> since memcpy optimizes for quad word transfers.
>
> Is there a generic READ_REGISTER_BUFFER that mimics memcpy’s
> optimization (this would be similar to memcpy_toio and memcpy_fromio
> in the Linux
world)?
> Does everyone have to recreate memcpy using the READ_REGISTER_BUFFER_*
> routines?
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@stratus.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@3dlabs.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

I suppose there is no version for LONGLONG yet !. Just a month or so ago there was a revisit of this same topic in Embedded system journal. Actually they were showing all the major compiler(s) implementationof this little beast :). If anyone is desparate then I might be able to hunt that article down. I think it is by Dan Sac…
-pro

memcpy handles copies of all sizes, not just transfers of ULONGs optimized
for a particular architecture.

All I am saying is that while they are upgrading the entire driver
framework, it would be nice to include functions similar to memcpy_fromio &
memcpy_toio. They could be called READ_REGISTER_BUFFER and
WRITE_REGISTER_BUFFER without needing to specify the transfer size. Then the
HAL could use bytes, words, dwords, quadwords, or whatever the processor is
good at using with consideration of alignment problems particular to the
specific architecture.

“Roddy, Mark” wrote in message news:xxxxx@ntdev…
> See Mats’ reply. memcpy on x86 uses 32bit transfers as does
> READ_REGISTER_BUFFER_ULONG, so I don’t see what you are getting out of
this
> other than unportable code.
>
> For host->device operations on an x86 architecture you are asking for
> obscure timing related bugs by not using the HAL WRITE_REGISTER_
routines.
>
>
>
> =====================
> Mark Roddy
>
> -----Original Message-----
> From: cd [mailto:xxxxx@hotmail.com]
> Sent: Thursday, July 01, 2004 11:16 AM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] memcpy to PCI Adapter
>
> Of course, but my code assumes a generic memcpy routine. On other OSes,
> memcpy like routines are provided. I just have to do it all myself for
> Windows.
>
> I just changed my OS code to use memcpy for x86 machines and a custom
memcpy
> using WRITE/READ_REGISTER
optimized for aligned source/destination on
> non-x86 machines.
>
> “Roddy, Mark” wrote in message
news:xxxxx@ntdev…
> > You will of course get better performance using
> READ_REGISTER_BUFFER_ULONG,
> > right?
> >
> >
> >
> > =====================
> > Mark Roddy
> >
> > -----Original Message-----
> > From: cd [mailto:xxxxx@hotmail.com]
> > Sent: Thursday, July 01, 2004 9:27 AM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] memcpy to PCI Adapter
> >
> > At one time I had used memcpy and the virtual address returned from
> > MmMapIoSpace to move data to a PCI adapter’s memory. Knowing that this
> works
> > for Intel x86 architectures but possibly not others, I switched to the
> > READ_REGISTER_BUFFER_UCHAR, but the performance dropped considerably
> > since memcpy optimizes for quad word transfers.
> >
> > Is there a generic READ_REGISTER_BUFFER that mimics memcpy’s
> > optimization (this would be similar to memcpy_toio and memcpy_fromio
> > in the Linux
> world)?
> > Does everyone have to recreate memcpy using the READ_REGISTER_BUFFER_*
> > routines?
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@stratus.com To
> > unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@stratus.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
>

It is the unalign cases that are causing the headaches - especially on the
IA64.

wrote in message news:xxxxx@ntdev…
> Ah, but memcpy is generic in the sense that it’s able to copy 1, 3, 46,
48,
> 64, 908 and 1024 bytes all the same. It just does 4-byte at a time copies
> when the length, source and destination allows it (which in x86-case is as
> long as remaining length > 4 bytes).
>
> A copy routine built along these lines using READ_REGISTER_BUFFER_ULONG
> could be used too:
>
> void memcpy_from_BUFFER(void *src, void *dest, size_t len)
> {
> READ_REGISTER_BUFFER_ULONG((PULONG)src, (PULONG)dest, (len >> 2));
> if (len & 3)
> {
> UCHAR *src1, dest1;
> src1 = (UCHAR src) + (len & ~3);
> dest1 = (UCHAR dest) + (len & ~3);
> READ_REGISTER_BUFFER_UCHAR(src1, dest1, len & 3);
> }
> }
>
> And of course, using WRITE_REGISTER_BUFFER_XXXX if you want to get the
data
> written in the opposite direction. The only problem with this would be on
> machines that do not support unaligned addresses, in which case you’d have
> to support the unaligned cases.
>
> –
> Mats
>
> > -----Original Message-----
> > From: Roddy, Mark [mailto:xxxxx@stratus.com]
> > Sent: Thursday, July 01, 2004 4:28 PM
> > To: Windows System Software Devs Interest List
> > Subject: RE: [ntdev] memcpy to PCI Adapter
> >
> >
> > See Mats’ reply. memcpy on x86 uses 32bit transfers as does
> > READ_REGISTER_BUFFER_ULONG, so I don’t see what you are
> > getting out of this
> > other than unportable code.
> >
> > For host->device operations on an x86 architecture you are asking for
> > obscure timing related bugs by not using the HAL
> > WRITE_REGISTER_
routines.
> >
> >
> >
> > =====================
> > Mark Roddy
> >
> > -----Original Message-----
> > From: cd [mailto:xxxxx@hotmail.com]
> > Sent: Thursday, July 01, 2004 11:16 AM
> > To: Windows System Software Devs Interest List
> > Subject: Re:[ntdev] memcpy to PCI Adapter
> >
> > Of course, but my code assumes a generic memcpy routine. On
> > other OSes,
> > memcpy like routines are provided. I just have to do it all myself for
> > Windows.
> >
> > I just changed my OS code to use memcpy for x86 machines and
> > a custom memcpy
> > using WRITE/READ_REGISTER
optimized for aligned source/destination on
> > non-x86 machines.
> >
> > “Roddy, Mark” wrote in message
> news:xxxxx@ntdev…
> > You will of course get better performance using
> READ_REGISTER_BUFFER_ULONG,
> > right?
> >
> >
> >
> > =====================
> > Mark Roddy
> >
> > -----Original Message-----
> > From: cd [mailto:xxxxx@hotmail.com]
> > Sent: Thursday, July 01, 2004 9:27 AM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] memcpy to PCI Adapter
> >
> > At one time I had used memcpy and the virtual address returned from
> > MmMapIoSpace to move data to a PCI adapter’s memory. Knowing that this
> works
> > for Intel x86 architectures but possibly not others, I switched to the
> > READ_REGISTER_BUFFER_UCHAR, but the performance dropped considerably
> > since memcpy optimizes for quad word transfers.
> >
> > Is there a generic READ_REGISTER_BUFFER that mimics memcpy’s
> > optimization (this would be similar to memcpy_toio and memcpy_fromio
> > in the Linux
> world)?
> > Does everyone have to recreate memcpy using the READ_REGISTER_BUFFER_

> > routines?
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@stratus.com To
> > unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@stratus.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@3dlabs.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

Of course, this wouldn’t necessarily work for a all hardware. I’ve seen
things that do different things depending on the size of the reads, for
instance… So reading a ULONG would give a different reaction to reading a
UCHAR… But that’s quirky hardware, so I guess a generic routine would be
useful for MOST things, and quirky hardware still needs to be dealt with by
quirky source-code to accomodate the quirkiness of the hardware no matter
what’s implemented in the system…


Mats

-----Original Message-----
From: cd [mailto:xxxxx@hotmail.com]
Sent: Thursday, July 01, 2004 4:50 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] memcpy to PCI Adapter

memcpy handles copies of all sizes, not just transfers of
ULONGs optimized
for a particular architecture.

All I am saying is that while they are upgrading the entire driver
framework, it would be nice to include functions similar to
memcpy_fromio &
memcpy_toio. They could be called READ_REGISTER_BUFFER and
WRITE_REGISTER_BUFFER without needing to specify the transfer
size. Then the
HAL could use bytes, words, dwords, quadwords, or whatever
the processor is
good at using with consideration of alignment problems
particular to the
specific architecture.

“Roddy, Mark” wrote in message
> news:xxxxx@ntdev…
> > See Mats’ reply. memcpy on x86 uses 32bit transfers as does
> > READ_REGISTER_BUFFER_ULONG, so I don’t see what you are
> getting out of
> this
> > other than unportable code.
> >
> > For host->device operations on an x86 architecture you are
> asking for
> > obscure timing related bugs by not using the HAL WRITE_REGISTER_
> routines.
> >
> >
> >
> > =====================
> > Mark Roddy
> >
> > -----Original Message-----
> > From: cd [mailto:xxxxx@hotmail.com]
> > Sent: Thursday, July 01, 2004 11:16 AM
> > To: Windows System Software Devs Interest List
> > Subject: Re:[ntdev] memcpy to PCI Adapter
> >
> > Of course, but my code assumes a generic memcpy routine. On
> other OSes,
> > memcpy like routines are provided. I just have to do it all
> myself for
> > Windows.
> >
> > I just changed my OS code to use memcpy for x86 machines
> and a custom
> memcpy
> > using WRITE/READ_REGISTER
optimized for aligned
> source/destination on
> > non-x86 machines.
> >
> > “Roddy, Mark” wrote in message
> news:xxxxx@ntdev…
> > > You will of course get better performance using
> > READ_REGISTER_BUFFER_ULONG,
> > > right?
> > >
> > >
> > >
> > > =====================
> > > Mark Roddy
> > >
> > > -----Original Message-----
> > > From: cd [mailto:xxxxx@hotmail.com]
> > > Sent: Thursday, July 01, 2004 9:27 AM
> > > To: Windows System Software Devs Interest List
> > > Subject: [ntdev] memcpy to PCI Adapter
> > >
> > > At one time I had used memcpy and the virtual address
> returned from
> > > MmMapIoSpace to move data to a PCI adapter’s memory.
> Knowing that this
> > works
> > > for Intel x86 architectures but possibly not others, I
> switched to the
> > > READ_REGISTER_BUFFER_UCHAR, but the performance dropped
> considerably
> > > since memcpy optimizes for quad word transfers.
> > >
> > > Is there a generic READ_REGISTER_BUFFER that mimics memcpy’s
> > > optimization (this would be similar to memcpy_toio and
> memcpy_fromio
> > > in the Linux
> > world)?
> > > Does everyone have to recreate memcpy using the
> READ_REGISTER_BUFFER_*
> > > routines?
> > >
> > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as:
> xxxxx@stratus.com To
> > > unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@stratus.com To
> > unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@3dlabs.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Here is the url, I am typing on a tty, so -

  1. www.embedded.com//showArticle.jhtml?articleID=19205567
  2. If the above does not fetch, use the main URI and search for memcpy()

Bit interesting I think :slight_smile:

-pro

As was pointed out to me by others, in NDIS under x86 and AMD64 systems, you
have NdisMoveTo/FromMappedMemory which translates to NdisMoveMappedMemory
which translates to RtlCopyMemory which translates to memcpy.

So for NDIS drivers running on x86 or AMD64 systems, the HAL is not used…

“Roddy, Mark” wrote in message news:xxxxx@ntdev…
> See Mats’ reply. memcpy on x86 uses 32bit transfers as does
> READ_REGISTER_BUFFER_ULONG, so I don’t see what you are getting out of
this
> other than unportable code.
>
> For host->device operations on an x86 architecture you are asking for
> obscure timing related bugs by not using the HAL WRITE_REGISTER_
routines.
>
>
>
> =====================
> Mark Roddy
>
> -----Original Message-----
> From: cd [mailto:xxxxx@hotmail.com]
> Sent: Thursday, July 01, 2004 11:16 AM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] memcpy to PCI Adapter
>
> Of course, but my code assumes a generic memcpy routine. On other OSes,
> memcpy like routines are provided. I just have to do it all myself for
> Windows.
>
> I just changed my OS code to use memcpy for x86 machines and a custom
memcpy
> using WRITE/READ_REGISTER
optimized for aligned source/destination on
> non-x86 machines.
>
> “Roddy, Mark” wrote in message
news:xxxxx@ntdev…
> > You will of course get better performance using
> READ_REGISTER_BUFFER_ULONG,
> > right?
> >
> >
> >
> > =====================
> > Mark Roddy
> >
> > -----Original Message-----
> > From: cd [mailto:xxxxx@hotmail.com]
> > Sent: Thursday, July 01, 2004 9:27 AM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] memcpy to PCI Adapter
> >
> > At one time I had used memcpy and the virtual address returned from
> > MmMapIoSpace to move data to a PCI adapter’s memory. Knowing that this
> works
> > for Intel x86 architectures but possibly not others, I switched to the
> > READ_REGISTER_BUFFER_UCHAR, but the performance dropped considerably
> > since memcpy optimizes for quad word transfers.
> >
> > Is there a generic READ_REGISTER_BUFFER that mimics memcpy’s
> > optimization (this would be similar to memcpy_toio and memcpy_fromio
> > in the Linux
> world)?
> > Does everyone have to recreate memcpy using the READ_REGISTER_BUFFER_*
> > routines?
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@stratus.com To
> > unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@stratus.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
>