1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Boris Gjenero 2013-05-24 14:57:32 -04:00 committed by Gerrit Rockbox
parent 26697d0891
commit 134e5914a1

View file

@ -439,7 +439,6 @@ enum plugin_status plugin_start(const void* parameter)
"Disk speed", "Write & verify");
int selected=0;
bool quit = false;
int align;
DIR *dir;
(void)parameter;
@ -458,10 +457,13 @@ enum plugin_status plugin_start(const void* parameter)
}
audiobuf = rb->plugin_get_audio_buffer(&audiobuflen);
#ifdef STORAGE_WANTS_ALIGN
/* align start and length for DMA */
STORAGE_ALIGN_BUFFER(audiobuf, audiobuflen);
#else
/* align start and length to 32 bit */
align = (-(intptr_t)audiobuf) & 3;
audiobuf += align;
audiobuflen = (audiobuflen - align) & ~3;
ALIGN_BUFFER(audiobuf, audiobuflen, 4);
#endif
rb->srand(*rb->current_tick);