Skip to content

Commit beea8e5

Browse files
xiulipanlgirdwood
authored andcommitted
ipc: cc_version: use fixed length for CC_DESC
There is a bug in the Cadence XCC compiler that give us different linkage section sizes for flex length struct sof_ipc_ext_data in ELF file compared to GCC version. And there are appending struct in the same ELF section, this will bring wrong offset for those struct binary in ELF file. Example: When the CC_DESC is " RG-2017.8-linux", we should have struct length for 0x50 in header size, but the binary length in ELF file is 0x4c. When the CC_DESC is " RG-2017.8-win", size are both 0x4c All existing compiler description has length less than 32 bytes. So use a fixed length 32 in this structure. ABI version changes to 3.15.0 Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
1 parent 75ba94b commit beea8e5

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

src/include/ipc/info.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ struct sof_ipc_cc_version {
122122

123123
uint8_t name[16]; /* null terminated compiler name */
124124
uint8_t optim[4]; /* null terminated compiler -O flag value */
125-
uint8_t desc[]; /* null terminated compiler description */
125+
uint8_t desc[32]; /* null terminated compiler description */
126126
} __attribute__((packed));
127127

128128
/* extended data: Probe setup */

src/include/kernel/abi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
/** \brief SOF ABI version major, minor and patch numbers */
3131
#define SOF_ABI_MAJOR 3
32-
#define SOF_ABI_MINOR 14
32+
#define SOF_ABI_MINOR 15
3333
#define SOF_ABI_PATCH 0
3434

3535
/** \brief SOF ABI version number. Format within 32bit word is MMmmmppp */

src/ipc/cc_version.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,22 @@
1919
field = CC_OPTIMIZE_FLAGS, \
2020
field[ARRAY_SIZE(((struct sof_ipc_cc_version *)(0))->optim) - 1] = 0
2121

22+
/* copy CC_DESC to arrays during compilation time */
23+
#define CC_DESC_COPY(field) \
24+
field = CC_DESC, \
25+
field[ARRAY_SIZE(((struct sof_ipc_cc_version *)(0))->desc) - 1] = 0
26+
2227
const struct sof_ipc_cc_version cc_version
2328
__section(".fw_ready_metadata") = {
2429
.ext_hdr = {
2530
.hdr.cmd = SOF_IPC_FW_READY,
26-
.hdr.size = ALIGN_UP(sizeof(struct sof_ipc_cc_version)
27-
+ sizeof(CC_DESC), 4),
31+
.hdr.size = sizeof(struct sof_ipc_cc_version),
2832
.type = SOF_IPC_EXT_CC_INFO,
2933
},
3034
.micro = CC_MICRO,
3135
.minor = CC_MINOR,
3236
.major = CC_MAJOR,
3337
CC_NAME_COPY(.name),
3438
CC_OPTIM_COPY(.optim),
35-
.desc = CC_DESC,
39+
CC_DESC_COPY(.desc),
3640
};

0 commit comments

Comments
 (0)