Skip to content

Commit

Permalink
Merge pull request #471 from akloniex/redefine-abi-version
Browse files Browse the repository at this point in the history
abi: Redefine SOF_ABI_VERSION to allow for backward compatibility
  • Loading branch information
lgirdwood authored Oct 10, 2018
2 parents bad7b99 + 62ad4b8 commit 7996f1a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/include/uapi/abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,21 @@
#define __INCLUDE_UAPI_ABI_H__

/** \brief SOF ABI version number. */
#define SOF_ABI_VERSION 1
#define SOF_ABI_VER(major, minor, micro) \
(((major)<<8)|((minor)<<4)|(micro))
#define SOF_ABI_VERSION_MAJOR(version) (((version)>>8) & 0xff)
#define SOF_ABI_VERSION_MINOR(version) (((version)>>4) & 0xf)
#define SOF_ABI_VERSION_MICRO(version) ((version) & 0xf)
#define SOF_ABI_VERSION_INCOMPATIBLE(sof_ver, client_ver) \
(SOF_ABI_VERSION_MAJOR(sof_ver) != SOF_ABI_VERSION_MAJOR(client_ver) ||\
(SOF_ABI_VERSION_MAJOR(sof_ver) == SOF_ABI_VERSION_MAJOR(client_ver) &&\
SOF_ABI_VERSION_MINOR(sof_ver) != SOF_ABI_VERSION_MINOR(client_ver)))

#define SOF_ABI_MAJOR 1
#define SOF_ABI_MINOR 0
#define SOF_ABI_MICRO 0

#define SOF_ABI_VERSION SOF_ABI_VER(SOF_ABI_MAJOR, SOF_ABI_MINOR, SOF_ABI_MICRO)

/** \brief SOF ABI magic number "SOF\0". */
#define SOF_ABI_MAGIC 0x00464F53
Expand Down

0 comments on commit 7996f1a

Please sign in to comment.