From: David van Moolenbroek Date: Wed, 28 Dec 2016 13:08:23 +0000 (+0000) Subject: libaudiodriver: readd callback to drv_int_sum() X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/doc/howto.html?a=commitdiff_plain;h=refs%2Fchanges%2F83%2F3383%2F1;p=minix.git libaudiodriver: readd callback to drv_int_sum() The callback, which was dropped in commit git-842c4ed, allows drivers to fetch the interrupt status once and save it locally for subsequent calls to drv_int(). This fixes #190 . Change-Id: I83918656f637e716f60e9f4c19f1498f761d3b52 --- diff --git a/minix/lib/libaudiodriver/audio_fw.c b/minix/lib/libaudiodriver/audio_fw.c index a9f32febe..ff3ce5cfd 100644 --- a/minix/lib/libaudiodriver/audio_fw.c +++ b/minix/lib/libaudiodriver/audio_fw.c @@ -496,15 +496,18 @@ static void msg_hardware(unsigned int UNUSED(mask)) { int i; - /* loop over all sub devices */ - for ( i = 0; i < drv.NrOfSubDevices; i++) { - /* if interrupt from sub device and Dma transfer - was actually busy, take care of business */ - if( drv_int(i) && sub_dev[i].DmaBusy ) { - if (sub_dev[i].DmaMode == WRITE_DMA) - handle_int_write(i); - if (sub_dev[i].DmaMode == READ_DMA) - handle_int_read(i); + /* if we have an interrupt */ + if (drv_int_sum()) { + /* loop over all sub devices */ + for ( i = 0; i < drv.NrOfSubDevices; i++) { + /* if interrupt from sub device and Dma transfer + was actually busy, take care of business */ + if( drv_int(i) && sub_dev[i].DmaBusy ) { + if (sub_dev[i].DmaMode == WRITE_DMA) + handle_int_write(i); + if (sub_dev[i].DmaMode == READ_DMA) + handle_int_read(i); + } } }