diff options
Diffstat (limited to 'sound/core/pcm_compat.c')
-rw-r--r-- | sound/core/pcm_compat.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c index 91cdf9435fec..af49721ba0e3 100644 --- a/sound/core/pcm_compat.c +++ b/sound/core/pcm_compat.c | |||
@@ -190,7 +190,9 @@ struct snd_pcm_status32 { | |||
190 | u32 avail_max; | 190 | u32 avail_max; |
191 | u32 overrange; | 191 | u32 overrange; |
192 | s32 suspended_state; | 192 | s32 suspended_state; |
193 | unsigned char reserved[60]; | 193 | u32 reserved_alignment; |
194 | struct compat_timespec audio_tstamp; | ||
195 | unsigned char reserved[56-sizeof(struct compat_timespec)]; | ||
194 | } __attribute__((packed)); | 196 | } __attribute__((packed)); |
195 | 197 | ||
196 | 198 | ||
@@ -205,17 +207,16 @@ static int snd_pcm_status_user_compat(struct snd_pcm_substream *substream, | |||
205 | return err; | 207 | return err; |
206 | 208 | ||
207 | if (put_user(status.state, &src->state) || | 209 | if (put_user(status.state, &src->state) || |
208 | put_user(status.trigger_tstamp.tv_sec, &src->trigger_tstamp.tv_sec) || | 210 | compat_put_timespec(&status.trigger_tstamp, &src->trigger_tstamp) || |
209 | put_user(status.trigger_tstamp.tv_nsec, &src->trigger_tstamp.tv_nsec) || | 211 | compat_put_timespec(&status.tstamp, &src->tstamp) || |
210 | put_user(status.tstamp.tv_sec, &src->tstamp.tv_sec) || | ||
211 | put_user(status.tstamp.tv_nsec, &src->tstamp.tv_nsec) || | ||
212 | put_user(status.appl_ptr, &src->appl_ptr) || | 212 | put_user(status.appl_ptr, &src->appl_ptr) || |
213 | put_user(status.hw_ptr, &src->hw_ptr) || | 213 | put_user(status.hw_ptr, &src->hw_ptr) || |
214 | put_user(status.delay, &src->delay) || | 214 | put_user(status.delay, &src->delay) || |
215 | put_user(status.avail, &src->avail) || | 215 | put_user(status.avail, &src->avail) || |
216 | put_user(status.avail_max, &src->avail_max) || | 216 | put_user(status.avail_max, &src->avail_max) || |
217 | put_user(status.overrange, &src->overrange) || | 217 | put_user(status.overrange, &src->overrange) || |
218 | put_user(status.suspended_state, &src->suspended_state)) | 218 | put_user(status.suspended_state, &src->suspended_state) || |
219 | compat_put_timespec(&status.audio_tstamp, &src->audio_tstamp)) | ||
219 | return -EFAULT; | 220 | return -EFAULT; |
220 | 221 | ||
221 | return err; | 222 | return err; |
@@ -364,6 +365,7 @@ struct snd_pcm_mmap_status32 { | |||
364 | u32 hw_ptr; | 365 | u32 hw_ptr; |
365 | struct compat_timespec tstamp; | 366 | struct compat_timespec tstamp; |
366 | s32 suspended_state; | 367 | s32 suspended_state; |
368 | struct compat_timespec audio_tstamp; | ||
367 | } __attribute__((packed)); | 369 | } __attribute__((packed)); |
368 | 370 | ||
369 | struct snd_pcm_mmap_control32 { | 371 | struct snd_pcm_mmap_control32 { |
@@ -426,12 +428,14 @@ static int snd_pcm_ioctl_sync_ptr_compat(struct snd_pcm_substream *substream, | |||
426 | sstatus.hw_ptr = status->hw_ptr % boundary; | 428 | sstatus.hw_ptr = status->hw_ptr % boundary; |
427 | sstatus.tstamp = status->tstamp; | 429 | sstatus.tstamp = status->tstamp; |
428 | sstatus.suspended_state = status->suspended_state; | 430 | sstatus.suspended_state = status->suspended_state; |
431 | sstatus.audio_tstamp = status->audio_tstamp; | ||
429 | snd_pcm_stream_unlock_irq(substream); | 432 | snd_pcm_stream_unlock_irq(substream); |
430 | if (put_user(sstatus.state, &src->s.status.state) || | 433 | if (put_user(sstatus.state, &src->s.status.state) || |
431 | put_user(sstatus.hw_ptr, &src->s.status.hw_ptr) || | 434 | put_user(sstatus.hw_ptr, &src->s.status.hw_ptr) || |
432 | put_user(sstatus.tstamp.tv_sec, &src->s.status.tstamp.tv_sec) || | 435 | compat_put_timespec(&sstatus.tstamp, &src->s.status.tstamp) || |
433 | put_user(sstatus.tstamp.tv_nsec, &src->s.status.tstamp.tv_nsec) || | ||
434 | put_user(sstatus.suspended_state, &src->s.status.suspended_state) || | 436 | put_user(sstatus.suspended_state, &src->s.status.suspended_state) || |
437 | compat_put_timespec(&sstatus.audio_tstamp, | ||
438 | &src->s.status.audio_tstamp) || | ||
435 | put_user(scontrol.appl_ptr, &src->c.control.appl_ptr) || | 439 | put_user(scontrol.appl_ptr, &src->c.control.appl_ptr) || |
436 | put_user(scontrol.avail_min, &src->c.control.avail_min)) | 440 | put_user(scontrol.avail_min, &src->c.control.avail_min)) |
437 | return -EFAULT; | 441 | return -EFAULT; |