Normally, the type of enums is "unsigned int" or "int". GCC has the "-fshort-enums" option, which instructs the compiler to use the smallest data type that can hold all the values in the enum (i.e: char, short, int or their unsigned variants). According to the GCC documentation, "-fshort-enums" may be default on some targets. This seems to be the case for SOF when built for a certain 32-bit ARM platform. On Linux, this is not the case (tested with "aarch64-linux-gnu-gcc") which means enums such as "enum sof_comp_type" will end up having different sizes on Linux and SOF. Since "enum sof_comp_type" is used in IPC-related structures such as "struct sof_ipc_comp", this means the fields of the structures will end up being placed at different offsets. This, in turn, leads to SOF not being able to properly interpret data passed from Linux. With this in mind, replace "enum sof_comp_type" from "struct sof_ipc_comp" with "uint32_t". Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://patch.msgid.link/20240826182442.6191-1-laurentiumihalcea111@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
66 lines
2.1 KiB
C
66 lines
2.1 KiB
C
/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
|
|
/*
|
|
* This file is provided under a dual BSD/GPLv2 license. When using or
|
|
* redistributing this file, you may do so under either license.
|
|
*
|
|
* Copyright(c) 2018 Intel Corporation
|
|
*/
|
|
|
|
/**
|
|
* SOF ABI versioning is based on Semantic Versioning where we have a given
|
|
* MAJOR.MINOR.PATCH version number. See https://semver.org/
|
|
*
|
|
* Rules for incrementing or changing version :-
|
|
*
|
|
* 1) Increment MAJOR version if you make incompatible API changes. MINOR and
|
|
* PATCH should be reset to 0.
|
|
*
|
|
* 2) Increment MINOR version if you add backwards compatible features or
|
|
* changes. PATCH should be reset to 0.
|
|
*
|
|
* 3) Increment PATCH version if you add backwards compatible bug fixes.
|
|
*/
|
|
|
|
#ifndef __INCLUDE_UAPI_SOUND_SOF_ABI_H__
|
|
#define __INCLUDE_UAPI_SOUND_SOF_ABI_H__
|
|
|
|
#include <linux/types.h>
|
|
|
|
/* SOF ABI version major, minor and patch numbers */
|
|
#define SOF_ABI_MAJOR 3
|
|
#define SOF_ABI_MINOR 23
|
|
#define SOF_ABI_PATCH 1
|
|
|
|
/* SOF ABI version number. Format within 32bit word is MMmmmppp */
|
|
#define SOF_ABI_MAJOR_SHIFT 24
|
|
#define SOF_ABI_MAJOR_MASK 0xff
|
|
#define SOF_ABI_MINOR_SHIFT 12
|
|
#define SOF_ABI_MINOR_MASK 0xfff
|
|
#define SOF_ABI_PATCH_SHIFT 0
|
|
#define SOF_ABI_PATCH_MASK 0xfff
|
|
|
|
#define SOF_ABI_VER(major, minor, patch) \
|
|
(((major) << SOF_ABI_MAJOR_SHIFT) | \
|
|
((minor) << SOF_ABI_MINOR_SHIFT) | \
|
|
((patch) << SOF_ABI_PATCH_SHIFT))
|
|
|
|
#define SOF_ABI_VERSION_MAJOR(version) \
|
|
(((version) >> SOF_ABI_MAJOR_SHIFT) & SOF_ABI_MAJOR_MASK)
|
|
#define SOF_ABI_VERSION_MINOR(version) \
|
|
(((version) >> SOF_ABI_MINOR_SHIFT) & SOF_ABI_MINOR_MASK)
|
|
#define SOF_ABI_VERSION_PATCH(version) \
|
|
(((version) >> SOF_ABI_PATCH_SHIFT) & SOF_ABI_PATCH_MASK)
|
|
|
|
#define SOF_ABI_VERSION_INCOMPATIBLE(sof_ver, client_ver) \
|
|
(SOF_ABI_VERSION_MAJOR((sof_ver)) != \
|
|
SOF_ABI_VERSION_MAJOR((client_ver)) \
|
|
)
|
|
|
|
#define SOF_ABI_VERSION SOF_ABI_VER(SOF_ABI_MAJOR, SOF_ABI_MINOR, SOF_ABI_PATCH)
|
|
|
|
/* SOF ABI magic number "SOF\0". */
|
|
#define SOF_ABI_MAGIC 0x00464F53
|
|
/* SOF IPC4 ABI magic number "SOF4". */
|
|
#define SOF_IPC4_ABI_MAGIC 0x34464F53
|
|
|
|
#endif
|