18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * This file is provided under a dual BSD/GPLv2 license.  When using or
48c2ecf20Sopenharmony_ci * redistributing this file, you may do so under either license.
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Copyright(c) 2018 Intel Corporation. All rights reserved.
78c2ecf20Sopenharmony_ci */
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci/**
108c2ecf20Sopenharmony_ci * SOF ABI versioning is based on Semantic Versioning where we have a given
118c2ecf20Sopenharmony_ci * MAJOR.MINOR.PATCH version number. See https://semver.org/
128c2ecf20Sopenharmony_ci *
138c2ecf20Sopenharmony_ci * Rules for incrementing or changing version :-
148c2ecf20Sopenharmony_ci *
158c2ecf20Sopenharmony_ci * 1) Increment MAJOR version if you make incompatible API changes. MINOR and
168c2ecf20Sopenharmony_ci *    PATCH should be reset to 0.
178c2ecf20Sopenharmony_ci *
188c2ecf20Sopenharmony_ci * 2) Increment MINOR version if you add backwards compatible features or
198c2ecf20Sopenharmony_ci *    changes. PATCH should be reset to 0.
208c2ecf20Sopenharmony_ci *
218c2ecf20Sopenharmony_ci * 3) Increment PATCH version if you add backwards compatible bug fixes.
228c2ecf20Sopenharmony_ci */
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci#ifndef __INCLUDE_UAPI_SOUND_SOF_ABI_H__
258c2ecf20Sopenharmony_ci#define __INCLUDE_UAPI_SOUND_SOF_ABI_H__
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci/* SOF ABI version major, minor and patch numbers */
288c2ecf20Sopenharmony_ci#define SOF_ABI_MAJOR 3
298c2ecf20Sopenharmony_ci#define SOF_ABI_MINOR 17
308c2ecf20Sopenharmony_ci#define SOF_ABI_PATCH 0
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci/* SOF ABI version number. Format within 32bit word is MMmmmppp */
338c2ecf20Sopenharmony_ci#define SOF_ABI_MAJOR_SHIFT	24
348c2ecf20Sopenharmony_ci#define SOF_ABI_MAJOR_MASK	0xff
358c2ecf20Sopenharmony_ci#define SOF_ABI_MINOR_SHIFT	12
368c2ecf20Sopenharmony_ci#define SOF_ABI_MINOR_MASK	0xfff
378c2ecf20Sopenharmony_ci#define SOF_ABI_PATCH_SHIFT	0
388c2ecf20Sopenharmony_ci#define SOF_ABI_PATCH_MASK	0xfff
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci#define SOF_ABI_VER(major, minor, patch) \
418c2ecf20Sopenharmony_ci	(((major) << SOF_ABI_MAJOR_SHIFT) | \
428c2ecf20Sopenharmony_ci	((minor) << SOF_ABI_MINOR_SHIFT) | \
438c2ecf20Sopenharmony_ci	((patch) << SOF_ABI_PATCH_SHIFT))
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci#define SOF_ABI_VERSION_MAJOR(version) \
468c2ecf20Sopenharmony_ci	(((version) >> SOF_ABI_MAJOR_SHIFT) & SOF_ABI_MAJOR_MASK)
478c2ecf20Sopenharmony_ci#define SOF_ABI_VERSION_MINOR(version)	\
488c2ecf20Sopenharmony_ci	(((version) >> SOF_ABI_MINOR_SHIFT) & SOF_ABI_MINOR_MASK)
498c2ecf20Sopenharmony_ci#define SOF_ABI_VERSION_PATCH(version)	\
508c2ecf20Sopenharmony_ci	(((version) >> SOF_ABI_PATCH_SHIFT) & SOF_ABI_PATCH_MASK)
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci#define SOF_ABI_VERSION_INCOMPATIBLE(sof_ver, client_ver)		\
538c2ecf20Sopenharmony_ci	(SOF_ABI_VERSION_MAJOR((sof_ver)) !=				\
548c2ecf20Sopenharmony_ci		SOF_ABI_VERSION_MAJOR((client_ver))			\
558c2ecf20Sopenharmony_ci	)
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ci#define SOF_ABI_VERSION SOF_ABI_VER(SOF_ABI_MAJOR, SOF_ABI_MINOR, SOF_ABI_PATCH)
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ci/* SOF ABI magic number "SOF\0". */
608c2ecf20Sopenharmony_ci#define SOF_ABI_MAGIC		0x00464F53
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci#endif
63