Changeset 464 for GPL/trunk/alsa-kernel/include/sound/pcm.h
- Timestamp:
- Oct 8, 2009, 10:35:00 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk/alsa-kernel/include/sound/pcm.h
r426 r464 99 99 #define SNDRV_PCM_IOCTL1_CHANNEL_INFO 2 100 100 #define SNDRV_PCM_IOCTL1_GSTATE 3 101 #define SNDRV_PCM_IOCTL1_FIFO_SIZE 4 101 102 102 103 #define SNDRV_PCM_TRIGGER_STOP 0 … … 271 272 snd_pcm_uframes_t hw_ptr_interrupt; /* Position at interrupt time */ 272 273 unsigned long hw_ptr_jiffies; /* Time when hw_ptr is updated */ 274 snd_pcm_sframes_t delay; /* extra delay; typically FIFO size */ 273 275 274 276 /* -- HW params -- */ … … 490 492 void snd_pcm_vma_notify_data(void *client, void *data); 491 493 int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area); 492 493 #if BITS_PER_LONG >= 64494 495 static inline void div64_32(u_int64_t *n, u_int32_t div, u_int32_t *rem)496 {497 *rem = *n % div;498 *n /= div;499 }500 501 #elif defined(i386)502 503 static inline void div64_32(u_int64_t *n, u_int32_t div, u_int32_t *rem)504 {505 u_int32_t low, high;506 low = *n & 0xffffffff;507 high = *n >> 32;508 if (high) {509 u_int32_t high1 = high % div;510 high /= div;511 asm("divl %2":"=a" (low), "=d" (*rem):"rm" (div), "a" (low), "d" (high1));512 *n = (u_int64_t)high << 32 | low;513 } else {514 *n = low / div;515 *rem = low % div;516 }517 }518 #else519 520 static inline void divl(u_int32_t high, u_int32_t low,521 u_int32_t div,522 u_int32_t *q, u_int32_t *r)523 {524 u_int64_t n = (u_int64_t)high << 32 | low;525 u_int64_t d = (u_int64_t)div << 31;526 u_int32_t q1 = 0;527 int c = 32;528 while (n > 0xffffffffU) {529 q1 <<= 1;530 if (n >= d) {531 n -= d;532 q1 |= 1;533 }534 d >>= 1;535 c--;536 }537 q1 <<= c;538 if (n) {539 low = n;540 *q = q1 | (low / div);541 *r = low % div;542 } else {543 *r = 0;544 *q = q1;545 }546 return;547 }548 549 static inline void div64_32(u_int64_t *n, u_int32_t div, u_int32_t *rem)550 {551 u_int32_t low, high;552 low = *n & 0xffffffff;553 high = *n >> 32;554 if (high) {555 u_int32_t high1 = high % div;556 u_int32_t low1 = low;557 high /= div;558 divl(high1, low1, div, &low, rem);559 *n = (u_int64_t)high << 32 | low;560 } else {561 *n = low / div;562 *rem = low % div;563 }564 }565 #endif566 494 567 495 /* … … 992 920 int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream); 993 921 922 #ifdef CONFIG_SND_DMA_SGBUF 994 923 /* 995 924 * SG-buffer handling … … 1016 945 unsigned int snd_pcm_sgbuf_get_chunk_size(struct snd_pcm_substream *substream, 1017 946 unsigned int ofs, unsigned int size); 947 948 #else /* !SND_DMA_SGBUF */ 949 /* 950 * fake using a continuous buffer 951 */ 952 static inline dma_addr_t 953 snd_pcm_sgbuf_get_addr(struct snd_pcm_substream *substream, unsigned int ofs) 954 { 955 return substream->runtime->dma_addr + ofs; 956 } 957 958 static inline void * 959 snd_pcm_sgbuf_get_ptr(struct snd_pcm_substream *substream, unsigned int ofs) 960 { 961 return substream->runtime->dma_area + ofs; 962 } 963 964 #define snd_pcm_sgbuf_ops_page NULL 965 966 #define snd_pcm_sgbuf_get_chunk_size(subs, ofs, size) (size) 967 968 #endif /* SND_DMA_SGBUF */ 1018 969 1019 970 /* handle mmap counter - PCM mmap callback should handle this counter properly */
Note:
See TracChangeset
for help on using the changeset viewer.