1717#ifndef __ARCH_DMAC_H
1818#define __ARCH_DMAC_H
1919
20- #include <sys /cdefs.h>
20+ #include <kos /cdefs.h>
2121__BEGIN_DECLS
2222
2323#include <stdint.h>
24+ #include <stdbool.h>
2425
2526/** \defgroup dmac DMA Controller API
2627 \brief API to use the SH4's DMA Controller
@@ -139,7 +140,7 @@ typedef struct dma_config {
139140 dma_addrmode_t src_mode , dst_mode ; /**< Source/destination address mode. */
140141 dma_transmitmode_t transmit_mode ; /**< DMA Transfer transmit mode. */
141142 dma_callback_t callback ; /**< Optional callback function for
142- end-of-transfer notification. */
143+ end-of-transfer notification. */
143144} dma_config_t ;
144145
145146/** \brief DMA address.
@@ -227,6 +228,17 @@ int dma_transfer(const dma_config_t *cfg, dma_addr_t dst, dma_addr_t src,
227228*/
228229void dma_wait_complete (dma_channel_t channel );
229230
231+ /** \brief Check if a DMA transfer is running
232+ \ingroup dmac
233+
234+ This function will return true if a DMA transfer is running for the given
235+ DMA channel.
236+
237+ \param channel The DMA channel to check.
238+ \return True if a DMA transfer is running, false otherwise.
239+ */
240+ bool dma_is_running (dma_channel_t channel );
241+
230242/** \brief Get the remaining size of a DMA transfer
231243 \ingroup dmac
232244
@@ -239,6 +251,15 @@ void dma_wait_complete(dma_channel_t channel);
239251*/
240252size_t dma_transfer_get_remaining (dma_channel_t channel );
241253
254+ /** \brief Abort a DMA transfer
255+ \ingroup dmac
256+
257+ This function will abort a DMA transfer for the given DMA channel.
258+
259+ \param channel The DMA channel to abort.
260+ */
261+ void dma_transfer_abort (dma_channel_t channel );
262+
242263/** @} */
243264
244265__END_DECLS
0 commit comments