[zaptel-commits] sruffell: branch sruffell/voicebus r3878 - /team/sruffell/voicebus/voicebus.c
SVN commits to the Zaptel project
zaptel-commits at lists.digium.com
Mon Feb 25 15:06:29 CST 2008
Author: sruffell
Date: Mon Feb 25 15:06:29 2008
New Revision: 3878
URL: http://svn.digium.com/view/zaptel?view=rev&rev=3878
Log:
If the system cache line size isn't one of the values supported by
the hardware, don't pad the descriptors.
Modified:
team/sruffell/voicebus/voicebus.c
Modified: team/sruffell/voicebus/voicebus.c
URL: http://svn.digium.com/view/zaptel/team/sruffell/voicebus/voicebus.c?view=diff&rev=3878&r1=3877&r2=3878
==============================================================================
--- team/sruffell/voicebus/voicebus.c (original)
+++ team/sruffell/voicebus/voicebus.c Mon Feb 25 15:06:29 2008
@@ -307,10 +307,17 @@
/*
* Add some padding to each descriptor to ensure that they are
- * aligned on host system cache-line boundaries.
+ * aligned on host system cache-line boundaries, but only for the
+ * cache-line sizes that we support.
*
*/
- dl->padding = (vb->cache_line_size*sizeof(u32)) - sizeof(*d);
+ if ((0x08 == vb->cache_line_size) || (0x10 == vb->cache_line_size) ||
+ (0x20 == vb->cache_line_size))
+ {
+ dl->padding = (vb->cache_line_size*sizeof(u32)) - sizeof(*d);
+ } else {
+ dl->padding = 0;
+ }
dl->desc = pci_alloc_consistent(vb->pdev,
(sizeof(*d) + dl->padding) * DRING_SIZE, &dl->desc_dma);
More information about the zaptel-commits
mailing list