mcm-linux-headers-4.19.88-1.patch (10223B)
1 Only in linux-headers-4.19.88-1: .generic.orig 2 Only in linux-headers-4.19.88-1/generic: .include.orig 3 Only in linux-headers-4.19.88-1/generic/include: .sound.orig 4 diff -ru linux-headers-4.19.88-1.orig/generic/include/sound/asound.h linux-headers-4.19.88-1/generic/include/sound/asound.h 5 --- linux-headers-4.19.88-1.orig/generic/include/sound/asound.h 2021-06-28 22:04:41.000000000 +0200 6 +++ linux-headers-4.19.88-1/generic/include/sound/asound.h 2023-06-13 00:16:33.951074824 +0200 7 @@ -32,6 +32,8 @@ 8 9 #include <stdlib.h> 10 11 +#include <asm/byteorder.h> 12 + 13 /* 14 * protocol version 15 */ 16 @@ -151,7 +153,7 @@ 17 * * 18 *****************************************************************************/ 19 20 -#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 14) 21 +#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 15) 22 23 typedef unsigned long snd_pcm_uframes_t; 24 typedef signed long snd_pcm_sframes_t; 25 @@ -298,7 +300,9 @@ 26 #define SNDRV_PCM_INFO_DRAIN_TRIGGER 0x40000000 /* internal kernel flag - trigger in drain */ 27 #define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */ 28 29 - 30 +#if (__BITS_PER_LONG == 32 && defined(__USE_TIME_BITS64)) || defined __KERNEL__ 31 +#define __SND_STRUCT_TIME64 32 +#endif 33 34 typedef int __bitwise snd_pcm_state_t; 35 #define SNDRV_PCM_STATE_OPEN ((snd_pcm_state_t) 0) /* stream is open */ 36 @@ -314,8 +318,17 @@ 37 38 enum { 39 SNDRV_PCM_MMAP_OFFSET_DATA = 0x00000000, 40 - SNDRV_PCM_MMAP_OFFSET_STATUS = 0x80000000, 41 - SNDRV_PCM_MMAP_OFFSET_CONTROL = 0x81000000, 42 + SNDRV_PCM_MMAP_OFFSET_STATUS_OLD = 0x80000000, 43 + SNDRV_PCM_MMAP_OFFSET_CONTROL_OLD = 0x81000000, 44 + SNDRV_PCM_MMAP_OFFSET_STATUS_NEW = 0x82000000, 45 + SNDRV_PCM_MMAP_OFFSET_CONTROL_NEW = 0x83000000, 46 +#ifdef __SND_STRUCT_TIME64 47 + SNDRV_PCM_MMAP_OFFSET_STATUS = SNDRV_PCM_MMAP_OFFSET_STATUS_NEW, 48 + SNDRV_PCM_MMAP_OFFSET_CONTROL = SNDRV_PCM_MMAP_OFFSET_CONTROL_NEW, 49 +#else 50 + SNDRV_PCM_MMAP_OFFSET_STATUS = SNDRV_PCM_MMAP_OFFSET_STATUS_OLD, 51 + SNDRV_PCM_MMAP_OFFSET_CONTROL = SNDRV_PCM_MMAP_OFFSET_CONTROL_OLD, 52 +#endif 53 }; 54 55 union snd_pcm_sync_id { 56 @@ -453,8 +466,13 @@ 57 SNDRV_PCM_AUDIO_TSTAMP_TYPE_LAST = SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_SYNCHRONIZED 58 }; 59 60 +#ifndef __KERNEL__ 61 +/* explicit padding avoids incompatibility between i386 and x86-64 */ 62 +typedef struct { unsigned char pad[sizeof(time_t) - sizeof(int)] } __time_pad; 63 + 64 struct snd_pcm_status { 65 snd_pcm_state_t state; /* stream state */ 66 + __time_pad pad1; /* align to timespec */ 67 struct timespec trigger_tstamp; /* time when stream was started/stopped/paused */ 68 struct timespec tstamp; /* reference timestamp */ 69 snd_pcm_uframes_t appl_ptr; /* appl ptr */ 70 @@ -470,17 +488,48 @@ 71 __u32 audio_tstamp_accuracy; /* in ns units, only valid if indicated in audio_tstamp_data */ 72 unsigned char reserved[52-2*sizeof(struct timespec)]; /* must be filled with zero */ 73 }; 74 +#endif 75 76 -struct snd_pcm_mmap_status { 77 +/* 78 + * For mmap operations, we need the 64-bit layout, both for compat mode, 79 + * and for y2038 compatibility. For 64-bit applications, the two definitions 80 + * are identical, so we keep the traditional version. 81 + */ 82 +#ifdef __SND_STRUCT_TIME64 83 +#define __snd_pcm_mmap_status64 snd_pcm_mmap_status 84 +#define __snd_pcm_mmap_control64 snd_pcm_mmap_control 85 +#define __snd_pcm_sync_ptr64 snd_pcm_sync_ptr 86 +#ifdef __KERNEL__ 87 +#define __snd_timespec64 __kernel_timespec 88 +#else 89 +#define __snd_timespec64 timespec 90 +#endif 91 +struct __snd_timespec { 92 + __s32 tv_sec; 93 + __s32 tv_nsec; 94 +}; 95 +#else 96 +#define __snd_pcm_mmap_status snd_pcm_mmap_status 97 +#define __snd_pcm_mmap_control snd_pcm_mmap_control 98 +#define __snd_pcm_sync_ptr snd_pcm_sync_ptr 99 +#define __snd_timespec timespec 100 +struct __snd_timespec64 { 101 + __s64 tv_sec; 102 + __s64 tv_nsec; 103 +}; 104 + 105 +#endif 106 + 107 +struct __snd_pcm_mmap_status { 108 snd_pcm_state_t state; /* RO: state - SNDRV_PCM_STATE_XXXX */ 109 int pad1; /* Needed for 64 bit alignment */ 110 snd_pcm_uframes_t hw_ptr; /* RO: hw ptr (0...boundary-1) */ 111 - struct timespec tstamp; /* Timestamp */ 112 + struct __snd_timespec tstamp; /* Timestamp */ 113 snd_pcm_state_t suspended_state; /* RO: suspended stream state */ 114 - struct timespec audio_tstamp; /* from sample counter or wall clock */ 115 + struct __snd_timespec audio_tstamp; /* from sample counter or wall clock */ 116 }; 117 118 -struct snd_pcm_mmap_control { 119 +struct __snd_pcm_mmap_control { 120 snd_pcm_uframes_t appl_ptr; /* RW: appl ptr (0...boundary-1) */ 121 snd_pcm_uframes_t avail_min; /* RW: min available frames for wakeup */ 122 }; 123 @@ -489,14 +538,59 @@ 124 #define SNDRV_PCM_SYNC_PTR_APPL (1<<1) /* get appl_ptr from driver (r/w op) */ 125 #define SNDRV_PCM_SYNC_PTR_AVAIL_MIN (1<<2) /* get avail_min from driver */ 126 127 -struct snd_pcm_sync_ptr { 128 +struct __snd_pcm_sync_ptr { 129 unsigned int flags; 130 union { 131 - struct snd_pcm_mmap_status status; 132 + struct __snd_pcm_mmap_status status; 133 unsigned char reserved[64]; 134 } s; 135 union { 136 - struct snd_pcm_mmap_control control; 137 + struct __snd_pcm_mmap_control control; 138 + unsigned char reserved[64]; 139 + } c; 140 +}; 141 + 142 +#if defined(__BYTE_ORDER) ? __BYTE_ORDER == __BIG_ENDIAN : defined(__BIG_ENDIAN) 143 +typedef char __pad_before_uframe[sizeof(__u64) - sizeof(snd_pcm_uframes_t)]; 144 +typedef char __pad_after_uframe[0]; 145 +#endif 146 + 147 +#if defined(__BYTE_ORDER) ? __BYTE_ORDER == __LITTLE_ENDIAN : defined(__LITTLE_ENDIAN) 148 +typedef char __pad_before_uframe[0]; 149 +typedef char __pad_after_uframe[sizeof(__u64) - sizeof(snd_pcm_uframes_t)]; 150 +#endif 151 + 152 +struct __snd_pcm_mmap_status64 { 153 + __s32 state; /* RO: state - SNDRV_PCM_STATE_XXXX */ 154 + __u32 pad1; /* Needed for 64 bit alignment */ 155 + __pad_before_uframe __pad1; 156 + snd_pcm_uframes_t hw_ptr; /* RO: hw ptr (0...boundary-1) */ 157 + __pad_after_uframe __pad2; 158 + struct __snd_timespec64 tstamp; /* Timestamp */ 159 + __s32 suspended_state; /* RO: suspended stream state */ 160 + __u32 pad3; /* Needed for 64 bit alignment */ 161 + struct __snd_timespec64 audio_tstamp; /* sample counter or wall clock */ 162 +}; 163 + 164 +struct __snd_pcm_mmap_control64 { 165 + __pad_before_uframe __pad1; 166 + snd_pcm_uframes_t appl_ptr; /* RW: appl ptr (0...boundary-1) */ 167 + __pad_before_uframe __pad2; 168 + 169 + __pad_before_uframe __pad3; 170 + snd_pcm_uframes_t avail_min; /* RW: min available frames for wakeup */ 171 + __pad_after_uframe __pad4; 172 +}; 173 + 174 +struct __snd_pcm_sync_ptr64 { 175 + __u32 flags; 176 + __u32 pad1; 177 + union { 178 + struct __snd_pcm_mmap_status64 status; 179 + unsigned char reserved[64]; 180 + } s; 181 + union { 182 + struct __snd_pcm_mmap_control64 control; 183 unsigned char reserved[64]; 184 } c; 185 }; 186 @@ -581,6 +675,8 @@ 187 #define SNDRV_PCM_IOCTL_STATUS _IOR('A', 0x20, struct snd_pcm_status) 188 #define SNDRV_PCM_IOCTL_DELAY _IOR('A', 0x21, snd_pcm_sframes_t) 189 #define SNDRV_PCM_IOCTL_HWSYNC _IO('A', 0x22) 190 +#define __SNDRV_PCM_IOCTL_SYNC_PTR _IOWR('A', 0x23, struct __snd_pcm_sync_ptr) 191 +#define __SNDRV_PCM_IOCTL_SYNC_PTR64 _IOWR('A', 0x23, struct __snd_pcm_sync_ptr64) 192 #define SNDRV_PCM_IOCTL_SYNC_PTR _IOWR('A', 0x23, struct snd_pcm_sync_ptr) 193 #define SNDRV_PCM_IOCTL_STATUS_EXT _IOWR('A', 0x24, struct snd_pcm_status) 194 #define SNDRV_PCM_IOCTL_CHANNEL_INFO _IOR('A', 0x32, struct snd_pcm_channel_info) 195 @@ -611,7 +707,7 @@ 196 * Raw MIDI section - /dev/snd/midi?? 197 */ 198 199 -#define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0) 200 +#define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 1) 201 202 enum { 203 SNDRV_RAWMIDI_STREAM_OUTPUT = 0, 204 @@ -645,13 +741,16 @@ 205 unsigned char reserved[16]; /* reserved for future use */ 206 }; 207 208 +#ifndef __KERNEL__ 209 struct snd_rawmidi_status { 210 int stream; 211 + __time_pad pad1; 212 struct timespec tstamp; /* Timestamp */ 213 size_t avail; /* available bytes */ 214 size_t xruns; /* count of overruns since last status (in bytes) */ 215 unsigned char reserved[16]; /* reserved for future use */ 216 }; 217 +#endif 218 219 #define SNDRV_RAWMIDI_IOCTL_PVERSION _IOR('W', 0x00, int) 220 #define SNDRV_RAWMIDI_IOCTL_INFO _IOR('W', 0x01, struct snd_rawmidi_info) 221 @@ -664,7 +763,7 @@ 222 * Timer section - /dev/snd/timer 223 */ 224 225 -#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 6) 226 +#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7) 227 228 enum { 229 SNDRV_TIMER_CLASS_NONE = -1, 230 @@ -758,6 +857,7 @@ 231 unsigned char reserved[60]; /* reserved */ 232 }; 233 234 +#ifndef __KERNEL__ 235 struct snd_timer_status { 236 struct timespec tstamp; /* Timestamp - last update */ 237 unsigned int resolution; /* current period resolution in ns */ 238 @@ -766,10 +866,11 @@ 239 unsigned int queue; /* used queue size */ 240 unsigned char reserved[64]; /* reserved */ 241 }; 242 +#endif 243 244 #define SNDRV_TIMER_IOCTL_PVERSION _IOR('T', 0x00, int) 245 #define SNDRV_TIMER_IOCTL_NEXT_DEVICE _IOWR('T', 0x01, struct snd_timer_id) 246 -#define SNDRV_TIMER_IOCTL_TREAD _IOW('T', 0x02, int) 247 +#define SNDRV_TIMER_IOCTL_TREAD_OLD _IOW('T', 0x02, int) 248 #define SNDRV_TIMER_IOCTL_GINFO _IOWR('T', 0x03, struct snd_timer_ginfo) 249 #define SNDRV_TIMER_IOCTL_GPARAMS _IOW('T', 0x04, struct snd_timer_gparams) 250 #define SNDRV_TIMER_IOCTL_GSTATUS _IOWR('T', 0x05, struct snd_timer_gstatus) 251 @@ -782,6 +883,15 @@ 252 #define SNDRV_TIMER_IOCTL_STOP _IO('T', 0xa1) 253 #define SNDRV_TIMER_IOCTL_CONTINUE _IO('T', 0xa2) 254 #define SNDRV_TIMER_IOCTL_PAUSE _IO('T', 0xa3) 255 +#define SNDRV_TIMER_IOCTL_TREAD64 _IOW('T', 0xa4, int) 256 + 257 +#if __BITS_PER_LONG == 64 258 +#define SNDRV_TIMER_IOCTL_TREAD SNDRV_TIMER_IOCTL_TREAD_OLD 259 +#else 260 +#define SNDRV_TIMER_IOCTL_TREAD ((sizeof(__kernel_long_t) >= sizeof(time_t)) ? \ 261 + SNDRV_TIMER_IOCTL_TREAD_OLD : \ 262 + SNDRV_TIMER_IOCTL_TREAD64) 263 +#endif 264 265 struct snd_timer_read { 266 unsigned int resolution; 267 @@ -807,11 +917,15 @@ 268 SNDRV_TIMER_EVENT_MRESUME = SNDRV_TIMER_EVENT_RESUME + 10, 269 }; 270 271 +#ifndef __KERNEL__ 272 struct snd_timer_tread { 273 int event; 274 + __time_pad pad1; 275 struct timespec tstamp; 276 unsigned int val; 277 + __time_pad pad2; 278 }; 279 +#endif 280 281 /**************************************************************************** 282 * * 283 @@ -952,8 +1066,7 @@ 284 } bytes; 285 struct snd_aes_iec958 iec958; 286 } value; /* RO */ 287 - struct timespec tstamp; 288 - unsigned char reserved[128-sizeof(struct timespec)]; 289 + unsigned char reserved[128]; 290 }; 291 292 struct snd_ctl_tlv { 293 Only in linux-headers-4.19.88-1/generic/include/sound: asound.h.orig