forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 495
DMA: implement a dma::Range type #1248
Copy link
Copy link
Open
Labels
device resourcesRelated to device resources, such as MMIO, IRQs, DMA, etc.Related to device resources, such as MMIO, IRQs, DMA, etc.easyExpected to be an easy issue to resolve.Expected to be an easy issue to resolve.good first issueGood for newcomersGood for newcomers
Description
Activity
Metadata
Metadata
Assignees
Labels
device resourcesRelated to device resources, such as MMIO, IRQs, DMA, etc.Related to device resources, such as MMIO, IRQs, DMA, etc.easyExpected to be an easy issue to resolve.Expected to be an easy issue to resolve.good first issueGood for newcomersGood for newcomers
Currently the
dma::CoherentAPI provides theDmaAddresstype as a typedef (type DmaAddress = bindings::dma_addr_t) only. The base address is handed out as a bare integer, so any offset arithmetic a driver does on it is unchecked.Add a
dma::Rangetype that couples a basedma::Addresswith a length and only hands out addresses and sub-ranges provably within[base, base + len). All arithmetic must be checked against both the length and overflow of the underlyingdma_addr_t.This requires submitting a proper patch to the corresponding Linux kernel mailing lists. Please remember to test your changes (including generating the documentation if changed, running the Rust doctests if changed, etc.), use a proper title for the commit, sign your commit under the Developer's Certificate of Origin and add a Suggested-by: and Link: tags to this issue. Please see https://docs.kernel.org/process/submitting-patches.html and https://rust-for-linux.com/contributing for details.