diff options
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/pcm_native.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 87288762403..9681518aa39 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
@@ -3434,14 +3434,28 @@ out: | |||
3434 | #endif /* CONFIG_SND_SUPPORT_OLD_API */ | 3434 | #endif /* CONFIG_SND_SUPPORT_OLD_API */ |
3435 | 3435 | ||
3436 | #ifndef CONFIG_MMU | 3436 | #ifndef CONFIG_MMU |
3437 | unsigned long dummy_get_unmapped_area(struct file *file, unsigned long addr, | 3437 | static unsigned long snd_pcm_get_unmapped_area(struct file *file, |
3438 | unsigned long len, unsigned long pgoff, | 3438 | unsigned long addr, |
3439 | unsigned long flags) | 3439 | unsigned long len, |
3440 | { | 3440 | unsigned long pgoff, |
3441 | return 0; | 3441 | unsigned long flags) |
3442 | { | ||
3443 | struct snd_pcm_file *pcm_file = file->private_data; | ||
3444 | struct snd_pcm_substream *substream = pcm_file->substream; | ||
3445 | struct snd_pcm_runtime *runtime = substream->runtime; | ||
3446 | unsigned long offset = pgoff << PAGE_SHIFT; | ||
3447 | |||
3448 | switch (offset) { | ||
3449 | case SNDRV_PCM_MMAP_OFFSET_STATUS: | ||
3450 | return (unsigned long)runtime->status; | ||
3451 | case SNDRV_PCM_MMAP_OFFSET_CONTROL: | ||
3452 | return (unsigned long)runtime->control; | ||
3453 | default: | ||
3454 | return (unsigned long)runtime->dma_area + offset; | ||
3455 | } | ||
3442 | } | 3456 | } |
3443 | #else | 3457 | #else |
3444 | # define dummy_get_unmapped_area NULL | 3458 | # define snd_pcm_get_unmapped_area NULL |
3445 | #endif | 3459 | #endif |
3446 | 3460 | ||
3447 | /* | 3461 | /* |
@@ -3460,7 +3474,7 @@ const struct file_operations snd_pcm_f_ops[2] = { | |||
3460 | .compat_ioctl = snd_pcm_ioctl_compat, | 3474 | .compat_ioctl = snd_pcm_ioctl_compat, |
3461 | .mmap = snd_pcm_mmap, | 3475 | .mmap = snd_pcm_mmap, |
3462 | .fasync = snd_pcm_fasync, | 3476 | .fasync = snd_pcm_fasync, |
3463 | .get_unmapped_area = dummy_get_unmapped_area, | 3477 | .get_unmapped_area = snd_pcm_get_unmapped_area, |
3464 | }, | 3478 | }, |
3465 | { | 3479 | { |
3466 | .owner = THIS_MODULE, | 3480 | .owner = THIS_MODULE, |
@@ -3473,6 +3487,6 @@ const struct file_operations snd_pcm_f_ops[2] = { | |||
3473 | .compat_ioctl = snd_pcm_ioctl_compat, | 3487 | .compat_ioctl = snd_pcm_ioctl_compat, |
3474 | .mmap = snd_pcm_mmap, | 3488 | .mmap = snd_pcm_mmap, |
3475 | .fasync = snd_pcm_fasync, | 3489 | .fasync = snd_pcm_fasync, |
3476 | .get_unmapped_area = dummy_get_unmapped_area, | 3490 | .get_unmapped_area = snd_pcm_get_unmapped_area, |
3477 | } | 3491 | } |
3478 | }; | 3492 | }; |