| View previous topic :: View next topic |
| Author |
Message |
ubergeek42
Joined: 13 Jul 2005 Posts: 83
|
Posted: Sat Jun 30, 2007 5:25 am Post subject: IOP Dma example? |
|
|
I am trying to copy some data from ee ram to iop ram and back again using an iop program. I saw the sifman header file in the ps2sdk, but I got a bit confused because there are 3 different sifDma's(0-2). I looked around in the ps2sdk, but I couldn't find anything that was for the iop.
Or is there a faster/better way to do 2 way transfers from the iop then dma that I am overlooking?
Thanks. |
|
| Back to top |
|
 |
Lukasz

Joined: 19 Jan 2004 Posts: 248 Location: Denmark
|
|
| Back to top |
|
 |
ubergeek42
Joined: 13 Jul 2005 Posts: 83
|
Posted: Sat Jun 30, 2007 7:46 am Post subject: |
|
|
That siftoo module looks rather incomplete(many of the functions are empty and simply return 0), but the source for ps2link looks to be very promising, after a quick glance at the source code. I should be able to figure it out from that.
Again, thank you, you have been very helpful to me. |
|
| Back to top |
|
 |
radad
Joined: 19 May 2004 Posts: 246 Location: Melbourne, Australia
|
Posted: Sat Jun 30, 2007 10:25 am Post subject: |
|
|
| What about the fileXioRead/Write? They use DMA to send the buffer between EE and IOP ram. |
|
| Back to top |
|
 |
ubergeek42
Joined: 13 Jul 2005 Posts: 83
|
Posted: Sat Jun 30, 2007 10:34 am Post subject: |
|
|
| From looking at the source for fileXio, it seems to be one way, only writing to ee ram, though I imagine swapping the src/dest pointers would reverse it. It seems so simple now that I see some actual code using it. Thanks guys. |
|
| Back to top |
|
 |
Polo35
Joined: 09 Apr 2006 Posts: 25
|
Posted: Sat Jun 30, 2007 8:04 pm Post subject: |
|
|
Hey,
When you're at iop side you have to suspend interupt before performing dma transfert and resume it after.
Like that:
| Code: |
while(SifDmaStat(dma_id) >= 0);
sifdma.src = src;
sifdma.dest = dest;
sifdma.size = size;
sifdma.attr = 0;
CpuSuspendIntr(&intr);
dma_id = SifSetDma(&sifdma, 1);
CpuResumeIntr(intr);
|
While at ee side you don't have to use interupts.
Other way to access iop ram from ee is to use sbv code ( smem.c ) which use memory mapping to access iop ram in kernel mode.
From my own experience, it's largely faster to read/write iop ram with memcpy in kernel mode then using dma transfert.
But i don't know if ps2sdk give a way make same ting from iop to ee ram.
Best regards
Polo |
|
| Back to top |
|
 |
|