Commit 7bfa666c authored by Swann Perarnau's avatar Swann Perarnau
Browse files

[fix] fix typos across dma_seq code

Fix a few typos in the dma_linux_seq code, that for some reason didn't
raise any flags so far. Also add a small validation to the unit test.
parent 428ec530
......@@ -24,7 +24,7 @@ int aml_dma_request_linux_seq_copy_init(struct aml_dma_request_linux_seq *req,
{
assert(req != NULL);
req->type = AML_DMA_REQUEST_TYPE_MOVE;
req->type = AML_DMA_REQUEST_TYPE_COPY;
/* figure out pointers */
req->dest = aml_tiling_tilestart(dt, dptr, dtid);
req->src = aml_tiling_tilestart(st, sptr, stid);
......
......@@ -35,15 +35,20 @@ int main(int argc, char *argv[])
assert(!aml_dma_linux_seq_init(&dma, maxrequests));
/* allocate some memory */
src = aml_area_malloc(&area, TILESIZE*PAGE_SIZE*NBTILES);
src = aml_area_malloc(&area, TILESIZE*PAGE_SIZE*NBTILES);
assert(src != NULL);
dst = aml_area_malloc(&area, TILESIZE*PAGE_SIZE*NBTILES);
dst = aml_area_malloc(&area, TILESIZE*PAGE_SIZE*NBTILES);
assert(dst != NULL);
memset(src, 42, TILESIZE*PAGE_SIZE*NBTILES);
memset(dst, 24, TILESIZE*PAGE_SIZE*NBTILES);
/* move some stuff by copy */
for(int i = 0; i < NBTILES; i++)
aml_dma_copy(&dma, &tiling, dst, i, &tiling, src, i);
assert(!memcmp(src, dst, TILESIZE*PAGE_SIZE*NBTILES));
/* now move it by pages */
for(int i = 0; i < NBTILES; i++)
aml_dma_move(&dma, &area, &tiling, src, i);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment