 Autodocs Libraries:
exec.library AVL_AddNode AVL_FindFirstNode AVL_FindLastNode AVL_FindNextNodeByAddress AVL_FindNextNodeByKey AVL_FindNode AVL_FindPrevNodeByAddress AVL_FindPrevNodeByKey AVL_RemNodeByAddress AVL_RemNodeByKey AbortIO AddDevice AddHead AddIntServer AddLibrary AddMemHandler AddMemList AddPort AddResource AddSemaphore AddTail AddTask Alert AllocAbs AllocEntry AllocMem AllocPooled AllocSignal AllocTrap AllocVec Allocate AttemptSemaphore AttemptSemaphoreShared AvailMem CacheClearE CacheClearU CacheControl CachePostDMA CachePreDMA Cause CheckIO CloseDevice CloseLibrary ColdReboot CopyMem CopyMemQuick CreateIORequest CreateMsgPort CreatePool Deallocate Debug DeleteIORequest DeleteMsgPort DeletePool Disable DoIO Enable Enqueue FindName FindPort FindResident FindSemaphore FindTask Forbid FreeEntry FreeMem FreePooled FreeSignal FreeTrap FreeVec GetCC GetMsg InitCode InitResident InitSemaphore InitStruct Insert MakeFunctions MakeLibrary ObtainQuickVector ObtainSemaphore ObtainSemaphoreList ObtainSemaphoreShared OldOpenLibrary OpenDevice OpenLibrary OpenResource Permit Procure PutMsg RawDoFmt ReleaseSemaphore ReleaseSemaphoreList RemDevice RemHead RemIntServer RemLibrary RemMemHandler RemPort RemResource RemSemaphore RemTail RemTask Remove ReplyMsg SendIO SetExcept SetFunction SetIntVector SetSR SetSignal SetTaskPri Signal StackSwap SumKickData SumLibrary SuperState Supervisor TypeOfMem UserState Vacate Wait WaitIO WaitPort Include GuruMeditation
|
Docs » Autodocs » exec.library » CachePreDMA
CachePreDMA - Take actions prior to hardware DMA (V37)
paddress = CachePreDMA(vaddress,&length,flags) d0 a0 a1 d0 APTR CachePreDMA(APTR,LONG *,ULONG);
Take all appropriate steps before Direct Memory Access (DMA). This function is primarily intended for writers of DMA device drivers. The action will depend on the CPU type installed, caching modes, and the state of any Memory Management Unit (MMU) activity. This function supports advanced cache architectures that have "copyback" modes. With copyback, write data may be cached, but not actually flushed out to memory. If the CPU has unflushed data at the time of DMA, data may be lost. As implemented 68000 - Do nothing 68010 - Do nothing 68020 - Do nothing 68030 - Do nothing 68040 - Write any matching dirty cache lines back to memory. As a side effect of the 68040's design, matching data cache lines are also invalidated -- future CPUs may be different. ????? - External cache boards, Virtual Memory Systems, or future hardware may patch this vector to best emulate the intended behavior. With a Bus-Snooping CPU, this function my end up doing nothing.
address - Base address to start the action. length - Pointer to a longword with a length. flags - Values: DMA_Continue - Indicates this call is to complete a prior request that was broken up. DMA_ReadFromRAM - Indicates that this DMA is a read from RAM to the DMA device (ie - a write to the hard drive) This flag is not required but if used must match in both the PreDMA and PostDMA calls. This flag *should* be used to help the system provide the best performance. This flag is safe in all versions of CachePreDMA()
paddress- Physical address that corresponds to the input virtual address. &length - This length value will be updated to reflect the contiguous length of physical memory present at paddress. This may be smaller than the requested length. To get the mapping for the next chunk of memory, call the function again with a new address, length, and the DMA_Continue flag.
Due to processor granularity, areas outside of the address range may be affected by the cache flushing actions. Care has been taken to ensure that no harm is done outside the range, and that activities on overlapping cache lines won't harm data.
"exec/execbase.i", CachePostDMA(), CacheClearU(), CacheClearE()
|