Showing changes from revision #0 to #1:
Added | Removed | Changed
DMAManager and some other modules make use of “scatter lists” to describe a discontiguous memory buffer which is being used by an operation.
The basic form of a scatter list is a word-aligned list of (address, length) pairs (each attribute being a word). However there are some values which have special meanings:
Note that scatter lists have no terminator. APIs which use scatter lists also require you to specify the length of the transfer (typically in bytes). This means you must also be careful not to read off the end of a scatter list, or get stuck in a loop dereferencing back-pointers, while looking for the next buffer.
It’s also valid for the last byte of a transfer to not correspond to the last byte of a scatter list entry; i.e. the transfer can stop in the middle of an entry.
For scatter lists used by DMAManager, scatter list entries which describe memory buffers must have a length which is a multiple of the transfer unit size.
Unless it’s a circular transfer, DMAManager will update your scatter list as it processes the transfer. I.e. for each byte which is confirmed as being transferred, it will increase the address and decrease the length of the corresponding scatter list entry.