Writing apps for Xena (which talks about the BufferEx)
xena.resource
My aim is to do something where I on the Amiga side can say something like: "Xena, take this chunk of data and process it using all your 8 threads". Looking at the bufferex/localbus example I have a few questions.
(What I write below is far from coherent and understandable. But perhaps someone can explain something with basis on my ramblings.)
1. What is xena.resource for? I'm assuming some of the code in Lyle's example can be replaced by a OpenResource("xena.resource")? Perhaps this:
Code: Select all
uint16 *Xena = (uint16 *)0xF4000000;
....
// now we modify the LocalBus timing for Xena
if((pcidevice = IPCI->FindDeviceTags(
FDT_VendorID, 0x1959,
FDT_DeviceID, 0xA008,
TAG_END))) // localbus controller
{
range = pcidevice->GetResourceRange(0);
...
IPCI->FreeDevice(pcidevice);
}
Code: Select all
IXena = IExec->OpenResource("xena.resource");
uint16 *Xena = IXena->AllocResource(XR_DATABUS, "MyAppName");
2. I don't entirely get what everything in localbus.c and BufferEx.xc do. But, it seems that Amiga writes to 0xF4000000, at some offset:
Code: Select all
line 69: uint16 *Xena = (uint16 *)0xF4000000;
...
line 245: XenaWrite(XBUF, CBUF_REQ_DATA); // will become: (0xF4000000 + (XBUF& 0xFFFE));
...
Code: Select all
line 134: /////////////////// keepout region
line 135: while(1) {
line 141: pin_LPC_AD :> addr_low;
....
line 147: pin_LPC_AD <: back2Nemo;
line 154: /////////////////// keepout region
line 155: if (0 == we)
line 156: {
line 157: pin_LPC_AD :> data; // from Nemo to Xena
...
line 163: if(XBUF == addr_low)
line 164: {
line 165: switch(data)
line 166: {
line 167: case CBUF_REQ_DATA:
line 168: bufcon <: data; // Request data
line 170: bufcon :> back2Nemo; // written back on line 147
line 171: break;
....
Can Xena read arbitrary stuff from what Amiga writes at 0xF4000000? Is this mapped to Xena's hardware? How "long" can Xena read?
Here it reads 16 bytes at a fixed position XBUF. But could Xena read any data here?
One idea I had, was that Amiga writes to pos 1, pos 2, pos 3... pos n, and then Xena does something to pos 1, and writes back the data, and continues wiht pos 2 (or rather pos 9, since it can do 8 things simultanously). And when Amiga is done writing to pos n, it can just read the new data from pos 1.
I'll start like this, and see if anyone has any pointers.