aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazunori Asayama <asayama@sm.sony.co.jp>2009-03-13 18:18:14 -0700
committerYuji Mano <yuji.mano@am.sony.com>2009-03-17 10:58:44 -0700
commitc99278833e2521a20b968e3a0b89b501996d59e1 (patch)
tree9a5d8019c396d1988066f6e7b6592b63c42a95c8
parent4d7ae64cdcae55856724cc46f215d81be084fb2e (diff)
downloadmars-src-c99278833e2521a20b968e3a0b89b501996d59e1.tar.gz
base: MPU DMA reduce code size
Reduce code size of MPU DMA routine This patch reduces code size of DMA routine on MPU side by sharing code. Signed-off-by: Kazunori Asayama <asayama@sm.sony.co.jp> Signed-off-by: Yuji Mano <yuji.mano@am.sony.com>
-rw-r--r--base/src/mpu/kernel/dma.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/base/src/mpu/kernel/dma.c b/base/src/mpu/kernel/dma.c
index 894c6f3..b58936e 100644
--- a/base/src/mpu/kernel/dma.c
+++ b/base/src/mpu/kernel/dma.c
@@ -47,8 +47,10 @@
#define MARS_DMA_ALIGN_MASK 0xf
static int dma_large(void *ls, uint64_t ea, uint32_t size, uint32_t tag,
- int put)
+ unsigned int dma_cmd)
{
+ unsigned int cmd = MFC_CMD_WORD(0, 0, dma_cmd);
+
if (tag > MARS_DMA_TAG_MAX)
return MARS_ERROR_PARAMS;
if (((uintptr_t)ls & MARS_DMA_ALIGN_MASK) ||
@@ -61,10 +63,8 @@ static int dma_large(void *ls, uint64_t ea, uint32_t size, uint32_t tag,
block_size = (size < MARS_DMA_SIZE_MAX) ?
size : MARS_DMA_SIZE_MAX;
- if (put)
- mfc_put((volatile void *)ls, ea, block_size, tag, 0, 0);
- else
- mfc_get((volatile void *)ls, ea, block_size, tag, 0, 0);
+ spu_mfcdma64((volatile void *)ls, mfc_ea2h(ea), mfc_ea2l(ea),
+ block_size, tag, cmd);
ls += block_size;
ea += block_size;
@@ -76,12 +76,12 @@ static int dma_large(void *ls, uint64_t ea, uint32_t size, uint32_t tag,
int dma_get(void *ls, uint64_t ea, uint32_t size, uint32_t tag)
{
- return dma_large(ls, ea, size, tag, 0);
+ return dma_large(ls, ea, size, tag, MFC_GET_CMD);
}
int dma_put(const void *ls, uint64_t ea, uint32_t size, uint32_t tag)
{
- return dma_large((void *)ls, ea, size, tag, 1);
+ return dma_large((void *)ls, ea, size, tag, MFC_PUT_CMD);
}
int dma_wait(uint32_t tag)