/[openvortex]/alsa/alsa-kernel/pci/rme9652/hammerfall_mem.c
ViewVC logotype

Diff of /alsa/alsa-kernel/pci/rme9652/hammerfall_mem.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1 by vizard, Tue Apr 15 21:35:35 2003 UTC revision 1.2 by vizard, Sun Jun 15 21:01:32 2003 UTC
# Line 25  Line 25 
25      along with this program; if not, write to the Free Software      along with this program; if not, write to the Free Software
26      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
27    
28      hammerfall_mem.c,v 1.8 2003/02/25 13:35:44 perex Exp      hammerfall_mem.c,v 1.9 2003/05/31 11:33:57 perex Exp
29    
30    
31      Tue Oct 17 2000  Jaroslav Kysela <perex@suse.cz>      Tue Oct 17 2000  Jaroslav Kysela <perex@suse.cz>
# Line 98  static void *hammerfall_malloc_pages(str Line 98  static void *hammerfall_malloc_pages(str
98  {  {
99          void *res;          void *res;
100    
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 3, 0)  
101          res = (void *) pci_alloc_consistent(pci, size, dmaaddr);          res = (void *) pci_alloc_consistent(pci, size, dmaaddr);
 #else  
         int pg;  
         for (pg = 0; PAGE_SIZE * (1 << pg) < size; pg++);  
         res = (void *)__get_free_pages(GFP_KERNEL, pg);  
         if (res != NULL)  
                 *dmaaddr = virt_to_bus(res);  
 #endif  
102          if (res != NULL) {          if (res != NULL) {
103                  struct page *page = virt_to_page(res);                  struct page *page = virt_to_page(res);
104                  struct page *last_page = page + (size + PAGE_SIZE - 1) / PAGE_SIZE;                  struct page *last_page = page + (size + PAGE_SIZE - 1) / PAGE_SIZE;
# Line 127  static void hammerfall_free_pages(struct Line 119  static void hammerfall_free_pages(struct
119          last_page = virt_to_page(ptr) + (size + PAGE_SIZE - 1) / PAGE_SIZE;          last_page = virt_to_page(ptr) + (size + PAGE_SIZE - 1) / PAGE_SIZE;
120          while (page < last_page)          while (page < last_page)
121                  clear_bit(PG_reserved, &(page++)->flags);                  clear_bit(PG_reserved, &(page++)->flags);
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 3, 0)  
122          pci_free_consistent(pci, size, ptr, dmaaddr);          pci_free_consistent(pci, size, ptr, dmaaddr);
 #else  
         {  
                 int pg;  
                 for (pg = 0; PAGE_SIZE * (1 << pg) < size; pg++);  
                 if (bus_to_virt(dmaaddr) != ptr) {  
                         printk(KERN_ERR "hammerfall_free_pages: dmaaddr != ptr\n");  
                         return;  
                 }  
                 free_pages((unsigned long)ptr, pg);  
         }  
 #endif  
123  }  }
124    
125  void *snd_hammerfall_get_buffer (struct pci_dev *pcidev, dma_addr_t *dmaaddr)  void *snd_hammerfall_get_buffer (struct pci_dev *pcidev, dma_addr_t *dmaaddr)

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26