RISC OS Open
Safeguarding the past, present and future of RISC OS for everyone
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

DMA callback routines (changes)

Showing changes from revision #2 to #3: Added | Removed | Changed

DMAManager
ยป DMA callback routines

DMA callback routines

When you use DMA_RegisterChannel to register with DMAManager, you are required to pass in a pointer to a word-aligned table of callback routines in R4. The table should be laid out as follows:

Offset Use
0 Pointer to DMA enable callback
4 Pointer to DMA disable callback
8 Pointer to DMA start callback
12 Pointer to DMA completed callback
16 Pointer to DMA sync callback

These routines will be called by DMAManager as the transfer(s) which are queued on the channel are processed by the system.

DMAManager may call the routines in IRQ or SVC mode, with interrupts enabled or disabled. Calling DMAManager SWIs, or enabling interrupts (if disabled on entry), should be avoided as it may result in malfunction.

On entry to the routines, R12 will be the value of R5 that was passed to DMA_RegisterChannel, and R14 will be the return address. Except where noted, on exit the routines must preserve all registers, processor mode, and IRQ state. Processor flags need not be preserved, however the V flag must be set correctly if the routine is capable of returning an error.

Over the course of a normal transfer, the callbacks will be called in the following order:

  1. Start
  2. Enable
  3. Sync (if (called as often as necessary, if requested)
  4. Disable
  5. Completed

However it may be the case that the sequence 2-4 is repeated multiple times, e.g. in response to DMA_SuspendTransfer and DMA_ResumeTransfer calls, or in response to a dynamic area claiming a physical RAM page which is part of the transfer.

Notes

This documentation only covers the RISC OS 5 version of the DMAManager SWIs. For other OS versions, consult the appropriate PRM volume (e.g. volume 5a).

See also

  • DMA_RegisterChannel
Revised on September 14, 2017 14:00:50 by Jeffrey Lee (213) (62.252.28.250)
Edit | Back in time (2 revisions) | Hide changes | History | Views: Print | Source | Linked from: DMA_RegisterChannel, DMA enable callback, DMA disable callback, DMA start callback, DMA completed callback, DMA sync callback

Search the Wiki

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.

Navigation

  • Home Page
  • All Pages
  • Recently Revised
  • Authors
  • Feeds
Site design © RISC OS Open Limited 2018 except where indicated
The RISC OS Open Instiki theme is based on Insitki's default layout

Valid XHTML 1.0  |  Valid CSS

Instiki 0.19.1(MML+)
This site runs on Rails

Hosted by Arachsys