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:
parent
26697d0891
commit
134e5914a1
1 changed files with 6 additions and 4 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue