From patchwork Thu Aug 31 20:09:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 9932789 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C5C1F60362 for ; Thu, 31 Aug 2017 20:12:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BAC291FEB1 for ; Thu, 31 Aug 2017 20:12:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AEDA11FF27; Thu, 31 Aug 2017 20:12:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 139F61FEB1 for ; Thu, 31 Aug 2017 20:12:28 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnVn3-00009Q-MZ; Thu, 31 Aug 2017 20:10:13 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnVn1-000090-RT for xen-devel@lists.xen.org; Thu, 31 Aug 2017 20:10:11 +0000 Received: from [193.109.254.147] by server-6.bemta-6.messagelabs.com id 4C/39-03423-32D68A95; Thu, 31 Aug 2017 20:10:11 +0000 X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volodymyr_Babchuk@epam.com X-Msg-Ref: server-3.tower-27.messagelabs.com!1504210209!114145100!1 X-Originating-IP: [104.47.0.71] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 20722 invoked from network); 31 Aug 2017 20:10:10 -0000 Received: from mail-he1eur01on0071.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) (104.47.0.71) by server-3.tower-27.messagelabs.com with AES256-SHA256 encrypted SMTP; 31 Aug 2017 20:10:10 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=EPAM.onmicrosoft.com; s=selector1-epam-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=RRG1k3u69LG8gFjnoEHKTv6ynspWSWJyoWMm04vkq8Y=; b=aIrT1uSOX3KAEDT9kZK4CBk6omsS1+YohBJLn/oE9C45eSDsUWdLvEqqx73qOC+0y5+HBdVYVwEdHB0r8PQd+YQbTT5mWbvQbTUzkl9PUq7Eauh+a8mXH2ubeWHs4NA91mNSZa5jvvNZEhCpfWPPKXAXtrcLYJ/l8esyfDH7m6E= Received: from EPUAKYIW2556.kyiv.epam.com (85.223.209.51) by HE1PR0301MB2140.eurprd03.prod.outlook.com (2603:10a6:3:21::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Thu, 31 Aug 2017 20:10:04 +0000 Received: by EPUAKYIW2556.kyiv.epam.com (sSMTP sendmail emulation); Thu, 31 Aug 2017 23:09:58 +0300 From: Volodymyr Babchuk To: xen-devel@lists.xen.org Date: Thu, 31 Aug 2017 23:09:25 +0300 Message-Id: <1504210172-27234-4-git-send-email-volodymyr_babchuk@epam.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504210172-27234-1-git-send-email-volodymyr_babchuk@epam.com> References: <1504210172-27234-1-git-send-email-volodymyr_babchuk@epam.com> MIME-Version: 1.0 X-Originating-IP: [85.223.209.51] X-ClientProxiedBy: HE1PR09CA0084.eurprd09.prod.outlook.com (2603:10a6:7:3d::28) To HE1PR0301MB2140.eurprd03.prod.outlook.com (2603:10a6:3:21::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2ef7f5fc-972a-46d9-1a56-08d4f0ac4573 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:HE1PR0301MB2140; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0301MB2140; 3:to/ytliU8ySBtLZDrvPcKHUVCpzyOT+tSlzCpueZSBy/VtZ8hZN45gNxSKSon0rc1EEf5SCIAxlwYEfyC+F1MuJUJB6yzRI5Y0zGFXSfwZ3cjwjj8FJwGXsr2v4UHOFvm/8xtRt3HIihjvOfgJVB57ECjQLgy32wuuy6aGIN56HDdhZ16bToAXu90qPkX/My11uvvjufxelexaapfxaX3f98wL8eC8bKibPE09QVQxnRzLUgC7AFnFqpuMkUtH1S; 25:fZFaylPg1L7zEOa0iKdpueplvG1Hso7SfulEh1pDYNZo6/HvruEaInTfa1l8OC5Qn1EF2eifqgKmzA2kaWZ4rlBuCHH9wE1rh/pWeR82RxW2m0TyxWGVmvRWOpDknFhdblG2FwCGO05L9g/6oC6Q+N1AqOxKUlfUWz0a/8P8uN6Hqbnp+WZFrzIjZs8381q4UAxiAWXeAcYUtQUjuMNCijlG2/BShPb1OrNXL3deNporcNKMIVwZpafkwfN/+HGRl11/oDEG49xVpZmHzc8mpU1PmZjVJLcqCjcY3IobRDlj3t+kHqZXjlzrKP1JwXEnLI2iD1GfHi53H6vZfUS94w==; 31:MSq47/PpJYeNMD9BRPS7f2JbeHyTz9ZUAqsBbEt+bLHqSLt6wFTrZ9g17h4jHsEtueQDOkHTOV0QXIMuOSOqQefJnU1BxjZ5kiY+G8uMnDuUb1SXd27aUgoAc9K307Y1TvyRu9hRUz+30DtL8wX/H/JkjwSpomxUKoMV4nQfb5XRxie1r6wSnvCOxY91xW4Xbuge3/RPkz/bL6DNdldLAkY2UqkxOd/edp1sSjEw6hc= X-MS-TrafficTypeDiagnostic: HE1PR0301MB2140: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0301MB2140; 20:kahihldCgV8t7JEIj4eE5HfDJkfFfxekSgc6RTaDrByQBr5O5BPhZlAn7ySssB952NNJ17QR8/asi98ajbDJHSTAilkSgYLebJUEMRsNgShiA1chmvk1w+1zv3atrPo2bEUNYL5h3jYEETv5OAgEulDXRv7pcbupNrAjunwyIKaVgFGi22ISI12XgUevpG5rRGhRJpas7hBNyxghknxO94APM5uIi73TEQU2AqZft4MVv+HHFbjS1bEPijEBNzmUicB4OZPJyoOaQXaYTIiaPBq2cLQL27UbIMMayrfBMKg3onH4gVQdggJVdTx0eKJmHu9QebULWY88dsYfduQLDoJgUwWsAYlpijZsO6sk+ISHR22ysk5gZ73GyUVFFPjFLS72eapfN5QeS6xzAubGMiFDVZGT99cjVZMiy4Bib4vGKzjOhoD8Y4ofCxYepDAltYqNdo2pBRlwnC085sJ5hOT9DLiMrIB2uRf4t+EP+j6Fe+XwmJMDLdNWj0bAJ/c/; 4:rhRZksKh50Z9xEGBG/qzcqRqbKNnB0F5376+L2RODUAJPo2VXisOZfYHYTPWrFx5OJlKVvXFYFiJTfnwonNwYLfNdGPpneUGkDfA/DcVN9W8xV88Lqni4wDMie6gtyk5Q2FK9yaPupnstaFSkuK42bHcEdtU86FZ+ZFaU/gue0pUrhRjMn7cJWY65/3NPT/3GLeboT/002TpY2CupFkR/iDqmDMbSavVd7tk9PCYwA43yEtkWWmo6LcEOoS8NatmBmB2WB/41hUwQNku74bXR4HSwjbFrSqwyx+QqVpsQq8= X-Exchange-Antispam-Report-Test: UriScan:(4114951738403); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(3002001)(93006095)(93001095)(10201501046)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(20161123560025)(20161123555025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR0301MB2140; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR0301MB2140; X-Forefront-PRVS: 04163EF38A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(189002)(199003)(6666003)(45080400002)(5660300001)(106356001)(101416001)(305945005)(2906002)(110136004)(2351001)(36756003)(189998001)(33646002)(81156014)(7350300001)(53936002)(48376002)(72206003)(478600001)(42186005)(50226002)(8676002)(2361001)(50466002)(105586002)(6116002)(54906002)(86362001)(3846002)(7416002)(81166006)(8666007)(122856001)(66066001)(5003940100001)(47776003)(68736007)(50986999)(7736002)(76176999)(2950100002)(97736004)(6916009)(8656003)(4326008)(80792005); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0301MB2140; H:EPUAKYIW2556.kyiv.epam.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: epam.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0301MB2140; 23:CrHhLtVPxopN9p9Q2wzpyIzpLbgn0kd5pratC64?= =?us-ascii?Q?6UqsFisbc9woK657EslBdkLe211dVbKHPqjDm+21NEsZqsFdXLbJpRUVFilF?= =?us-ascii?Q?q9R4aOe1gVuY6/YGT6A9cBg4Z5z0DOmXQtwf+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UQx2GJKC4z0O5s6GaoX55k40sQ2L/Vr0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2017 20:10:04.7857 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0301MB2140 Cc: "Edgar E . Iglesias" , Stefano Stabellini , Wei Liu , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich , Volodymyr Babchuk Subject: [Xen-devel] [PATCH v5 03/10] public: xen.h: add definitions for UUID handling X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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(00112233, 4455, 6677, 8899, aabbccddeeff) 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: This is compatible with Linux kernel and with libuuid, but it is not compatible with Microsoft, as they use mixed-endian encoding (some components are little-endian, some are big-endian). Signed-off-by: Volodymyr Babchuk --- * Array was wrapped into a structure --- xen/include/public/xen.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h index 2ac6b1e..3dc81e3 100644 --- a/xen/include/public/xen.h +++ b/xen/include/public/xen.h @@ -930,6 +930,19 @@ __DEFINE_XEN_GUEST_HANDLE(uint16, uint16_t); __DEFINE_XEN_GUEST_HANDLE(uint32, uint32_t); __DEFINE_XEN_GUEST_HANDLE(uint64, uint64_t); +typedef struct +{ + uint8_t a[16]; +} xen_uuid_t; + +#define XEN_DEFINE_UUID(a, b, c, d, e1, e2, e3, e4, e5, e6) \ + {{((a) >> 24) & 0xFF, ((a) >> 16) & 0xFF, \ + ((a) >> 8) & 0xFF, ((a) >> 0) & 0xFF, \ + ((b) >> 8) & 0xFF, ((b) >> 0) & 0xFF, \ + ((c) >> 8) & 0xFF, ((c) >> 0) & 0xFF, \ + ((d) >> 8) & 0xFF, ((d) >> 0) & 0xFF, \ + e1, e2, e3, e4, e5, e6}} + #endif /* !__ASSEMBLY__ */ /* Default definitions for macros used by domctl/sysctl. */