]> git.alsa-project.org Git - tinycompress.git/commitdiff
tinycompress: update headers for packed, aligned
authorVinod Koul <vinod.koul@intel.com>
Thu, 19 Jun 2014 09:33:17 +0000 (15:03 +0530)
committerVinod Koul <vinod.koul@intel.com>
Thu, 19 Jun 2014 09:33:17 +0000 (15:03 +0530)
commit "6b24a8dd: ALSA: compress: fix the struct alignment to 4 bytes" updated
compress struct to force packed and aligned to 4 bytes. Update here a s well

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
include/sound/compress_offload.h
include/sound/compress_params.h

index 6a8e97f0f251defa2c2ca32f0258df8128555340..980f69f3a86cc0538bbd8cdf9b48db883b2247eb 100644 (file)
 #include <sound/asound.h>
 #include <sound/compress_params.h>
 #define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 1, 2)
+
 struct snd_compressed_buffer {
  __u32 fragment_size;
  __u32 fragments;
-};
+}__attribute__((packed, aligned(4)));
 
 struct snd_compr_params {
  struct snd_compressed_buffer buffer;
  struct snd_codec codec;
  __u8 no_wake_mode;
-};
+}__attribute__((packed, aligned(4)));
 
 struct snd_compr_tstamp {
  __u32 byte_offset;
@@ -39,12 +40,12 @@ struct snd_compr_tstamp {
  __u32 pcm_frames;
  __u32 pcm_io_frames;
  __u32 sampling_rate;
-};
+}__attribute__((packed, aligned(4)));
 
 struct snd_compr_avail {
  __u64 avail;
  struct snd_compr_tstamp tstamp;
-};
+}__attribute__((packed, aligned(4)));
 
 enum snd_compr_direction {
  SND_COMPRESS_PLAYBACK = 0,
@@ -60,13 +61,13 @@ struct snd_compr_caps {
  __u32 max_fragments;
  __u32 codecs[MAX_NUM_CODECS];
  __u32 reserved[11];
-};
+}__attribute__((packed, aligned(4)));
 
 struct snd_compr_codec_caps {
  __u32 codec;
  __u32 num_descriptors;
  struct snd_codec_desc descriptor[MAX_NUM_CODEC_DESCRIPTORS];
-};
+}__attribute__((packed, aligned(4)));
 
 enum {
        SNDRV_COMPRESS_ENCODER_PADDING = 1,
@@ -76,7 +77,7 @@ enum {
 struct snd_compr_metadata {
         __u32 key;
         __u32 value[8];
-};
+}__attribute__((packed, aligned(4)));
 
 #define SNDRV_COMPRESS_IOCTL_VERSION _IOR('C', 0x00, int)
 #define SNDRV_COMPRESS_GET_CAPS _IOWR('C', 0x10, struct snd_compr_caps)
index 378417a3c7b242a0227ff224338af43566fce9cd..9802292adef1252259da8942127b335dbd3faaa2 100644 (file)
@@ -182,23 +182,23 @@ struct snd_enc_vorbis {
  __u32 max_bit_rate;
  __u32 min_bit_rate;
  __u32 downmix;
-};
+}__attribute__((packed, aligned(4)));
 
 struct snd_enc_real {
  __u32 quant_bits;
  __u32 start_region;
  __u32 num_regions;
-};
+}__attribute__((packed, aligned(4)));
 
 struct snd_enc_flac {
  __u32 num;
  __u32 gain;
-};
+}__attribute__((packed, aligned(4)));
 
 struct snd_enc_generic {
  __u32 bw;
  __s32 reserved[15];
-};
+}__attribute__((packed, aligned(4)));
 
 union snd_codec_options {
  struct snd_enc_wma wma;
@@ -206,7 +206,7 @@ union snd_codec_options {
  struct snd_enc_real real;
  struct snd_enc_flac flac;
  struct snd_enc_generic generic;
-};
+}__attribute__((packed, aligned(4)));
 
 struct snd_codec_desc {
  __u32 max_ch;
@@ -220,7 +220,7 @@ struct snd_codec_desc {
  __u32 formats;
  __u32 min_buffer;
  __u32 reserved[15];
-};
+}__attribute__((packed, aligned(4)));
 
 struct snd_codec {
  __u32 id;
@@ -236,6 +236,6 @@ struct snd_codec {
  __u32 align;
  union snd_codec_options options;
  __u32 reserved[3];
-};
+}__attribute__((packed, aligned(4)));
 
 #endif