mirror of
https://github.com/ipxe/ipxe
synced 2025-12-12 14:32:49 +03:00
[riscv] Provide a DMA API implementation for RISC-V bare-metal systems
Provide an implementation of dma_map() that performs cache clean or invalidation as required, and an implementation of dma_alloc() that returns virtual addresses within the coherent mapping of the 32-bit physical address space. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
15
src/include/bits/dma.h
Normal file
15
src/include/bits/dma.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#ifndef _BITS_DMA_H
|
||||
#define _BITS_DMA_H
|
||||
|
||||
/** @file
|
||||
*
|
||||
* Dummy architecture-specific DMA API implementations
|
||||
*
|
||||
* This file is included only if the architecture does not provide its
|
||||
* own version of this file.
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
|
||||
#endif /* _BITS_DMA_H */
|
||||
@@ -345,6 +345,9 @@ DMAAPI_INLINE ( op, dma ) ( struct dma_mapping *map, void *addr ) {
|
||||
return ( virt_to_phys ( addr ) + map->offset );
|
||||
}
|
||||
|
||||
/* Include all architecture-dependent DMA API headers */
|
||||
#include <bits/dma.h>
|
||||
|
||||
/**
|
||||
* Map buffer for DMA
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user