From: Arne Welzel Date: Wed, 14 Nov 2012 21:43:42 +0000 (+0100) Subject: libaudiodriver: allocate mem lower 16 MB and 64K aligned X-Git-Tag: v3.3.0~834 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=5b211ac848071690303a8455b9b376e3ba2e6d3e;p=minix.git libaudiodriver: allocate mem lower 16 MB and 64K aligned Righ now, the DMA controller will access some random memory below 16 MB, as the physical address returned by alloc_contig() is simply truncated when given to the DMA controller. Yes, it's bad... --- diff --git a/lib/libaudiodriver/audio_fw.c b/lib/libaudiodriver/audio_fw.c index 5b9ea47e3..58ce03a4f 100644 --- a/lib/libaudiodriver/audio_fw.c +++ b/lib/libaudiodriver/audio_fw.c @@ -929,7 +929,7 @@ static int init_buffers(sub_dev_t *sub_dev_ptr) /* allocate dma buffer space */ size= sub_dev_ptr->DmaSize + 64 * 1024; - base= alloc_contig(size, AC_ALIGN4K, &ph); + base= alloc_contig(size, AC_ALIGN64K|AC_LOWER16M, &ph); if (!base) { printf("%s: failed to allocate dma buffer for a channel\n", drv.DriverName);