Changeset 351 for GPL/branches
- Timestamp:
- Apr 21, 2008, 11:41:48 AM (17 years ago)
- Location:
- GPL/branches/uniaud32-2.0
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/uniaud32-2.0/alsa-kernel/core/memalloc.c
r324 r351 250 250 #ifdef CONFIG_HAS_DMA 251 251 /* allocate the coherent DMA pages */ 252 #ifndef TARGET_OS2 252 253 static void *snd_malloc_dev_pages(struct device *dev, size_t size, dma_addr_t *dma) 254 #else 255 void *snd_malloc_dev_pages(struct device *dev, size_t size, dma_addr_t *dma) 256 #endif 253 257 { 254 258 int pg; … … 271 275 272 276 /* free the coherent DMA pages */ 277 #ifndef TARGET_OS2 273 278 static void snd_free_dev_pages(struct device *dev, size_t size, void *ptr, 279 #else 280 void snd_free_dev_pages(struct device *dev, size_t size, void *ptr, 281 #endif 274 282 dma_addr_t dma) 275 283 { … … 340 348 struct snd_dma_buffer *dmab) 341 349 { 350 #ifdef DEBUG 351 dprintf(("snd_dma_alloc_pages with size = %d",size)); 352 #endif 342 353 snd_assert(size > 0, return -ENXIO); 343 354 snd_assert(dmab != NULL, return -ENXIO); -
GPL/branches/uniaud32-2.0/alsa-kernel/core/sgbuf.c
r305 r351 33 33 #define sgbuf_align_table(tbl) ALIGN((tbl), SGBUF_TBL_ALIGN) 34 34 35 #ifndef TARGET_OS2 35 36 int snd_free_sgbuf_pages(struct snd_dma_buffer *dmab) 36 37 { … … 63 64 return 0; 64 65 } 66 #else 67 /* base this fn on the one in Uniaud 1.1.4 */ 68 int snd_free_sgbuf_pages(struct snd_dma_buffer *dmab) 69 { 70 struct snd_sg_buf *sgbuf = dmab->private_data; 71 72 sgbuf_shrink(sgbuf, 0); 73 if (sgbuf->table) 74 kfree(sgbuf->table); 75 sgbuf->table = NULL; 76 if (sgbuf->page_table) 77 kfree(sgbuf->page_table); 78 kfree(sgbuf); 79 dmab->private_data = NULL; 80 81 return 0; 82 } 83 84 /* 85 * shrink to the given pages. 86 * free the unused pages 87 */ 88 static void sgbuf_shrink(struct snd_sg_buf *sgbuf, int pages) 89 { 90 snd_assert(sgbuf, return); 91 if (! sgbuf->table) 92 return; 93 while (sgbuf->pages > pages) { 94 sgbuf->pages--; 95 snd_free_dev_pages(sgbuf->dev, PAGE_SIZE, 96 sgbuf->table[sgbuf->pages].buf, 97 sgbuf->table[sgbuf->pages].addr); 98 } 99 } 100 #endif 65 101 66 102 void *snd_malloc_sgbuf_pages(struct device *device, … … 71 107 unsigned int i, pages; 72 108 struct snd_dma_buffer tmpb; 109 #ifdef TARGET_OS2 110 void *ptr; 111 dma_addr_t addr; 112 #endif 113 114 #ifdef DEBUG 115 dprintf(("snd_malloc_sgbuf_pages. size %x",size)); 116 #endif 73 117 74 118 dmab->area = NULL; 75 119 dmab->addr = 0; 76 120 dmab->private_data = sgbuf = kzalloc(sizeof(*sgbuf), GFP_KERNEL); 77 if (! sgbuf) 121 if (! sgbuf) { 122 #ifdef DEBUG 123 dprintf(("snd_malloc_sgbuf_pages failed: error allocating sgbuf")); 124 #endif 78 125 return NULL; 126 } 79 127 sgbuf->dev = device; 80 128 pages = snd_sgbuf_aligned_pages(size); 81 129 sgbuf->tblsize = sgbuf_align_table(pages); 82 130 sgbuf->table = kcalloc(sgbuf->tblsize, sizeof(*sgbuf->table), GFP_KERNEL); 83 if (! sgbuf->table) 131 if (! sgbuf->table) { 132 #ifdef DEBUG 133 dprintf(("snd_malloc_sgbuf_pages failed: error allocating sgbuf->table")); 134 #endif 84 135 goto _failed; 136 } 85 137 sgbuf->page_table = kcalloc(sgbuf->tblsize, sizeof(*sgbuf->page_table), GFP_KERNEL); 86 if (! sgbuf->page_table) 138 if (! sgbuf->page_table) { 139 #ifdef DEBUG 140 dprintf(("snd_malloc_sgbuf_pages failed: error allocating sgbuf->page_table")); 141 #endif 87 142 goto _failed; 143 } 88 144 145 #ifdef DEBUG 146 dprintf(("allocating %d pages",pages)); 147 #endif 148 #ifndef TARGET_OS2 89 149 /* allocate each page */ 90 150 for (i = 0; i < pages; i++) { … … 107 167 if (! dmab->area) 108 168 goto _failed; 169 #else 170 ptr = snd_malloc_dev_pages(sgbuf->dev, size, &addr); 171 if (! ptr) 172 goto _failed; 173 174 /* allocate each page */ 175 while (sgbuf->pages < pages) { 176 mem_map_t *page; 177 178 sgbuf->table[sgbuf->pages].buf = (char*)ptr + PAGE_SIZE*sgbuf->pages; 179 sgbuf->table[sgbuf->pages].addr = addr + PAGE_SIZE*sgbuf->pages; 180 page = (mem_map_t *)virt_to_page((int)sgbuf->table[sgbuf->pages].buf); 181 sgbuf->page_table[sgbuf->pages] = page; 182 SetPageReserved(page); 183 sgbuf->pages++; 184 } 185 186 memset(ptr,0,size); 187 188 dmab->area = ptr; 189 sgbuf->size = size; 190 #endif 109 191 return dmab->area; 110 192 -
GPL/branches/uniaud32-2.0/alsa-kernel/core/sound_oss.c
r333 r351 98 98 99 99 int snd_register_oss_device(int type, struct snd_card *card, int dev, 100 #ifndef TARGET_OS2 100 101 const struct file_operations *f_ops, void *private_data, 102 #else 103 struct file_operations *f_ops, void *private_data, 104 #endif 101 105 const char *name) 102 106 { -
GPL/branches/uniaud32-2.0/alsa-kernel/include/sound/config.h
r335 r351 140 140 #endif 141 141 #ifndef virt_to_page 142 //#define virt_to_page(x) (&mem_map[MAP_NR(x)])142 #define virt_to_page(x) (&mem_map[MAP_NR(x)]) 143 143 #endif 144 144 #define snd_request_region request_region … … 298 298 #define CONFIG_PM 299 299 #define CONFIG_HAVE_PCI_DEV_PRESENT 300 #define CONFIG_SND_DEBUG_DETECT 300 301 #define CONFIG_SYSFS_DEPRECATED 301 302 #undef interrupt -
GPL/branches/uniaud32-2.0/alsa-kernel/include/sound/core.h
r324 r351 282 282 #ifdef CONFIG_SND_OSSEMUL 283 283 int snd_register_oss_device(int type, struct snd_card *card, int dev, 284 #ifndef TARGET_OS2 284 285 const struct file_operations *f_ops, void *private_data, 286 #else 287 struct file_operations *f_ops, void *private_data, 288 #endif 285 289 const char *name); 286 290 int snd_unregister_oss_device(int type, struct snd_card *card, int dev); -
GPL/branches/uniaud32-2.0/alsa-kernel/pci/via82xx.c
r305 r351 2406 2406 w = snd_pci_quirk_lookup(pci, dxs_whitelist); 2407 2407 if (w) { 2408 #ifndef TARGET_OS22409 2408 snd_printdd(KERN_INFO "via82xx: DXS white list for %s found\n", 2410 2409 w->name); 2411 #endif2412 2410 return w->value; 2413 2411 } -
GPL/branches/uniaud32-2.0/include/linux/sched.h
r314 r351 5 5 6 6 #include <asm/param.h> /* for HZ */ 7 #include <asm/atomic.h> 7 8 8 9 #define TASK_RUNNING 0
Note:
See TracChangeset
for help on using the changeset viewer.