Chapter . . .: StartDMA
Section . . .: EXAMPLE
The example wrongly calls IExec->AllocSysObject() where it should call IExec->AllocSysObjectTags().
This allocation is with (struct DMAList *) cast to a non-existent structure. This cast should have been (struct DMAEntry *).
This allocation is then freed by a IExec->FreeVec(), where it should be freed by a call to IExec->FreeSysObject().
Here's the corrected example:
/*
** This example assumes you want to make a DMA write transfer to
** addr, size bytes
*/
ULONG endFlags = 0;
/*
** Tell the system to prepare for DMA
*/
ULONG arraySize = IExec->StartDMA(addr, size, 0);
if (arraySize != 0)
{
/*
** The memory area is prepared, allocate and retrieve the DMA list
*/
struct DMAEntry *DMAList = (struct DMAList *)IExec->AllocSysObjectTags(ASOT_DMAENTRY, ASODMAE_NumEntries, arraySize,
TAG_DONE);
if (DMAList)
{
IExec->GetDMAList(addr, size, 0, DMAList);
/*
** Feed the DMA controller and do stuff
*/
...
/*
** Get rid of the DMAList's memory
*/
IExec->FreeSysObject(ASOT_DMAENTRY, DMAList);
}
else
{
printf("Can't allocate DMA list\n");
endFlags |= DMAF_NoModify;
}
/*
** Note: We still call EndDMA even though the actual transfer
** didn't happen.
*/
IExec->EndDMA(addr, size, endFlags);
}
else
{
printf("Can't initiate DMA transfer\n");
}
===================================================================================================
Chapter . . .: Insert
Section . . .: FUNCTION
Current text:
Insert a node into a doubly linked list AFTER a given node
position. Insertion at the head of a list is possible by passing a
zero value for listNode, though the AddHead function is slightly
faster for that special case.
Proposed text:
Insert a node into a doubly linked list AFTER a given node
position. Insertion at the head of a list is possible by passing a
NULL value for listNode, though the AddHead function is slightly
faster for that special case.
===================================================================================================
AutoDocs: exec errors & dicrepancies
AutoDocs: exec errors & dicrepancies
X5000, appears to be sick. Dismantled jan 1, 2024.
Dead MicroA1
A1200 in ElBox, c/w Blizzard '040 @ 50MHz + SCSI module, ZIV-board c/w (o.a.) cv64/3d + flickerdoubler + FastATA-ZIV + Lots of SCSI gear, sitting idle.
RaspBerry Pi 2B, 3B, 4B/4Gb, 4B/8Gb
OrangePi 5+ 8Gb
ACER Windows 10
Dead MicroA1
A1200 in ElBox, c/w Blizzard '040 @ 50MHz + SCSI module, ZIV-board c/w (o.a.) cv64/3d + flickerdoubler + FastATA-ZIV + Lots of SCSI gear, sitting idle.
RaspBerry Pi 2B, 3B, 4B/4Gb, 4B/8Gb
OrangePi 5+ 8Gb
ACER Windows 10