summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorBoris Gjenero <boris.gjenero@gmail.com>2013-05-24 14:57:32 -0400
committerGerrit Rockbox <gerrit@rockbox.org>2016-04-01 19:57:44 +0200
commit134e5914a1b530a9b4c5129f5b1eac1393eadcc7 (patch)
treeaa9c43bc9e5179367786d3cd41bede33f4b46007 /apps
parent26697d08912feecd3c0c924773d518d1720f0640 (diff)
downloadrockbox-134e5914a1b530a9b4c5129f5b1eac1393eadcc7.tar.gz
rockbox-134e5914a1b530a9b4c5129f5b1eac1393eadcc7.zip
Align test_disk buffer for DMA.
Some targets can only use storage DMA if the memory location is storage aligned. The required alignment can be more strict than word alignment, which was used previously. This change ensures that aligned transfers in test_disk can use DMA. Change-Id: I605b4d57f9e9c04920587017032f14449645693a
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/test_disk.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/plugins/test_disk.c b/apps/plugins/test_disk.c
index ac29f18093..339bcb8020 100644
--- a/apps/plugins/test_disk.c
+++ b/apps/plugins/test_disk.c
@@ -439,7 +439,6 @@ enum plugin_status plugin_start(const void* parameter)
439 "Disk speed", "Write & verify"); 439 "Disk speed", "Write & verify");
440 int selected=0; 440 int selected=0;
441 bool quit = false; 441 bool quit = false;
442 int align;
443 DIR *dir; 442 DIR *dir;
444 443
445 (void)parameter; 444 (void)parameter;
@@ -458,10 +457,13 @@ enum plugin_status plugin_start(const void* parameter)
458 } 457 }
459 458
460 audiobuf = rb->plugin_get_audio_buffer(&audiobuflen); 459 audiobuf = rb->plugin_get_audio_buffer(&audiobuflen);
460#ifdef STORAGE_WANTS_ALIGN
461 /* align start and length for DMA */
462 STORAGE_ALIGN_BUFFER(audiobuf, audiobuflen);
463#else
461 /* align start and length to 32 bit */ 464 /* align start and length to 32 bit */
462 align = (-(intptr_t)audiobuf) & 3; 465 ALIGN_BUFFER(audiobuf, audiobuflen, 4);
463 audiobuf += align; 466#endif
464 audiobuflen = (audiobuflen - align) & ~3;
465 467
466 rb->srand(*rb->current_tick); 468 rb->srand(*rb->current_tick);
467 469