Update of /cvsroot/alsa/alsa-driver/acore
In directory sc8-pr-cvs1:/tmp/cvs-serv6528/acore

Modified Files:
        memalloc.patch 
Log Message:
- added a check and a wrapper of pci_set_consistent_dma_mask() for
  older kernels.






Index: memalloc.patch
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/acore/memalloc.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- memalloc.patch      31 May 2003 11:09:05 -0000      1.1
+++ memalloc.patch      20 Nov 2003 13:23:27 -0000      1.2
@@ -1,11 +1,11 @@
---- memalloc.c 2003-05-30 16:09:27.000000000 +0200
-+++ memalloc.c.old     2003-05-31 13:05:06.000000000 +0200
+--- memalloc.c 2003-11-20 12:44:06.000000000 +0100
++++ memalloc.c 2003-11-20 12:52:50.000000000 +0100
 @@ -1,3 +1,4 @@
 +#include "memalloc.inc"
  /*
   *  Copyright (c) by Jaroslav Kysela <[EMAIL PROTECTED]>
   *                   Takashi Iwai <[EMAIL PROTECTED]>
-@@ -80,6 +81,7 @@
+@@ -73,6 +74,7 @@
  #define snd_assert(expr, args...) /**/
  #endif
  
@@ -13,7 +13,35 @@
  #ifdef CONFIG_PCI
  #if defined(__i386__) || defined(__ppc__) || defined(__x86_64__)
  #define HACK_PCI_ALLOC_CONSISTENT
-@@ -132,6 +134,7 @@
+@@ -94,16 +96,25 @@
+                                   dma_addr_t *dma_handle)
+ {
+       void *ret;
+-      u64 dma_mask;
++      u64 dma_mask = 0xffffffff, dma_mask1;
+       unsigned long mask;
+ 
+       if (hwdev == NULL)
+               return pci_alloc_consistent(hwdev, size, dma_handle);
++#ifdef CONFIG_HAVE_PCI_CONSISTENT_DMA_MASK
+       dma_mask = hwdev->consistent_dma_mask;
+-      mask = (unsigned long)dma_mask;
++#endif
++      dma_mask1 = hwdev->dma_mask;
++      mask = (unsigned long)(dma_mask & dma_mask1);
++#ifdef CONFIG_HAVE_PCI_CONSISTENT_DMA_MASK
+       hwdev->consistent_dma_mask = 0xffffffff; /* do without masking */
++#endif
++      hwdev->dma_mask = 0xffffffff; /* do without masking */
+       ret = pci_alloc_consistent(hwdev, size, dma_handle);
++#ifdef CONFIG_HAVE_PCI_CONSISTENT_DMA_MASK
+       hwdev->consistent_dma_mask = dma_mask; /* restore */
++#endif
++      hwdev->dma_mask = dma_mask1; /* restore */
+       if (ret) {
+               /* obtained address is out of range? */
+               if (((unsigned long)*dma_handle + size - 1) & ~mask) {
+@@ -125,6 +136,7 @@
  
  #endif /* arch */
  #endif /* CONFIG_PCI */
@@ -21,7 +49,7 @@
  
  
  /*
-@@ -623,7 +626,7 @@
+@@ -617,7 +629,7 @@
  }
  
  
@@ -30,7 +58,19 @@
  /*
   * on ix86, we allocate a page with GFP_KERNEL to assure the
   * allocation.  the code is almost same with kernel/i386/pci-dma.c but
-@@ -935,3 +938,5 @@
+@@ -642,7 +654,11 @@
+       dma_addr_t addr;
+       unsigned long mask;
+ 
++#ifdef CONFIG_HAVE_PCI_CONSISTENT_DMA_MASK
+       mask = pci ? (unsigned long)pci->consistent_dma_mask : 0x00ffffffUL;
++#else
++      mask = pci ? (unsigned long)pci->dma_mask : 0x00ffffffUL;
++#endif
+       ptr = (void *)__get_free_page(GFP_KERNEL);
+       if (ptr) {
+               addr = virt_to_phys(ptr);
+@@ -997,3 +1013,5 @@
  EXPORT_SYMBOL(snd_malloc_sbus_pages_fallback);
  EXPORT_SYMBOL(snd_free_sbus_pages);
  #endif



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to