public: xen.h: add definitions for UUID handling
authorVolodymyr Babchuk <volodymyr_babchuk@epam.com>
Wed, 11 Oct 2017 11:57:59 +0000 (14:57 +0300)
committerStefano Stabellini <sstabellini@kernel.org>
Wed, 11 Oct 2017 19:40:14 +0000 (12:40 -0700)
commitb8290a150e7fa272d6967841b1b6c75a4bcdee92
tree17f90a4974d3130437b28d2a971ef8188d731d41
parent307cf4c4fd6d17d6cd27e04fb821d412e6471938
public: xen.h: add definitions for UUID handling

Added type xen_uuid_t. This type represents UUID as an array of 16
bytes in big endian format.

Added macro XEN_DEFINE_UUID that constructs UUID in the usual way:

 XEN_DEFINE_UUID(0x00112233, 0x4455, 0x6677, 0x8899,
0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff)

will construct UUID 00112233-4455-6677-8899-aabbccddeeff presented as
 {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
  0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}

NB: We define a new structure here rather than re-using EFI_GUID.
EFI_GUID uses a Microsoft-style encoding which, among other things,
mixes little-endian and big-endian. The structure defined in this
patch, unlike EFI_GUID, is compatible with the Linux kernel and libuuid.

Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
xen/include/public/xen.h