From d9417bbddaea4b096c939d45a38011908c981fdd Mon Sep 17 00:00:00 2001 From: Fredrik Noring Date: Wed, 14 Jul 2021 08:25:39 +0200 Subject: [PATCH] Document SIF DMA transfer structure --- include/iopmod/module/sifman.h | 6 +++--- include/iopmod/sifman.h | 20 ++++++++++++++------ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/include/iopmod/module/sifman.h b/include/iopmod/module/sifman.h index eb53423..3c804aa 100644 --- a/include/iopmod/module/sifman.h +++ b/include/iopmod/module/sifman.h @@ -23,7 +23,7 @@ id_(6) void sifman_set_dchain(void) * Return: DMA transfer id, or zero if no DMA id could be allocated and a * retry may be necessary */ -id_(7) int sifman_set_dma(const struct sifman_dma_transfer *dma_tr, int count) +id_(7) int sifman_set_dma(const struct sif_dma_transfer *dma_tr, int count) alias_(sceSifSetDma); /** @@ -36,7 +36,7 @@ id_(7) int sifman_set_dma(const struct sifman_dma_transfer *dma_tr, int count) id_(8) enum sifman_dma_status sifman_dma_stat(int dma_id) alias_(sceSifDmaStat); -id_(9) void sifman_set_one_dma(struct sifman_dma_transfer dma_tr) +id_(9) void sifman_set_one_dma(struct sif_dma_transfer dma_tr) alias_(sceSifSetOneDma); id_(12) void sifman_dma0_transfer(void *addr, int size, int mode) @@ -89,6 +89,6 @@ id_(30) void sifman_set_dma_intr_handler(void (*handler)(void *), void *arg) id_(31) void sifman_reset_dma_intr_handler(void) alias_(sceSifResetDmaIntrHandler); -id_(32) unsigned int sifman_set_dma_intr(struct sifman_dma_transfer *dma_tr, +id_(32) unsigned int sifman_set_dma_intr(struct sif_dma_transfer *dma_tr, int len, void (*func)(void), void *data) alias_(sceSifSetDmaIntr); diff --git a/include/iopmod/sifman.h b/include/iopmod/sifman.h index db74905..d066c1e 100644 --- a/include/iopmod/sifman.h +++ b/include/iopmod/sifman.h @@ -3,12 +3,20 @@ #ifndef IOPMOD_SIFMAN_H #define IOPMOD_SIFMAN_H -struct sifman_dma_transfer -{ - void *src; - void *dst; - int size; - int attr; +#include + +/** + * struct sif_dma_transfer - SIF DMA transfer structure + * @src: sub data to copy from, must be aligned with a 4-byte DMA boundary + * @dst: main data to copy to, must be aligned with a 16-byte DMA boundary + * @nbytes: size in bytes to copy, will be rounded up to multiple of 16 bytes + * @attr: zero or DMA completion attributes + */ +struct sif_dma_transfer { + void *src; + main_addr_t dst; + size_t nbytes; + u32 attr; }; /**