From patchwork Thu Sep 21 19:59:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 9964779 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 1810F6020C for ; Thu, 21 Sep 2017 20:03:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A47F205A4 for ; Thu, 21 Sep 2017 20:03:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3168296A9; Thu, 21 Sep 2017 20:03:01 +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 63016205A4 for ; Thu, 21 Sep 2017 20:03:01 +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 1dv7eM-0007Rd-4r; Thu, 21 Sep 2017 20:00:42 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dv7eL-0007Qp-7d for xen-devel@lists.xen.org; Thu, 21 Sep 2017 20:00:41 +0000 Received: from [85.158.143.35] by server-11.bemta-6.messagelabs.com id D0/9E-03616-86A14C95; Thu, 21 Sep 2017 20:00:40 +0000 X-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_Babchuk@epam.com X-Msg-Ref: server-6.tower-21.messagelabs.com!1506024039!60972801!1 X-Originating-IP: [40.107.5.44] 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 48056 invoked from network); 21 Sep 2017 20:00:39 -0000 Received: from mail-eopbgr50044.outbound.protection.outlook.com (HELO EUR03-VE1-obe.outbound.protection.outlook.com) (40.107.5.44) by server-6.tower-21.messagelabs.com with AES256-SHA256 encrypted SMTP; 21 Sep 2017 20:00:39 -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=8swdMjKmOl7+p+2J9OYl8fjGfOxl4Uj/XUsGVhSXlzI=; b=FT3PjR84EWKR7W3FmlBqLCj+WzWw43Llq3vxXeUTqj+VVYW6HrALbElrxG88S1fC0He/bhQoa4YXD2SpxhoI6+2TQs8b6COyxRqi+tnN5motWoD9NVSMIGWtNr2JBsI8oMZVHMviN92h95EI0VfWKygCIIGMC8qvqHMjKFjPaog= Received: from EPUAKYIW2556.kyiv.epam.com (85.223.209.56) by DB6PR0301MB2135.eurprd03.prod.outlook.com (2603:10a6:4:46::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11; Thu, 21 Sep 2017 20:00:35 +0000 Received: by EPUAKYIW2556.kyiv.epam.com (sSMTP sendmail emulation); Thu, 21 Sep 2017 23:00:30 +0300 From: Volodymyr Babchuk To: xen-devel@lists.xen.org Date: Thu, 21 Sep 2017 22:59:57 +0300 Message-Id: <1506024004-8615-4-git-send-email-volodymyr_babchuk@epam.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506024004-8615-1-git-send-email-volodymyr_babchuk@epam.com> References: <1506024004-8615-1-git-send-email-volodymyr_babchuk@epam.com> MIME-Version: 1.0 X-Originating-IP: [85.223.209.56] X-ClientProxiedBy: HE1PR0102CA0034.eurprd01.prod.exchangelabs.com (2603:10a6:7:14::47) To DB6PR0301MB2135.eurprd03.prod.outlook.com (2603:10a6:4:46::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5a0a7af7-5801-46c3-96f7-08d5012b6d10 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DB6PR0301MB2135; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0301MB2135; 3:4KV1m7g6rw6M6+tcetq3D88iyj/Xgzos5b2+ikiEn7GIPKp5Iqoa6iFi5dlRYxF10Acn3kbcnr9gU4XtdYiRZJwRUVWt6/CWzPTqUnRbF0kwj2FH/WOnwP5fhtjgyKB254eAJHI3GCpCh0jFwjIg3FniEkr5YCxVDT5OzwFZbaTCoymOpr4cc435yhxbTTAgpc1L5iOk9T11oTxKQzx8fZ3o5nqiqd2m8Jtx5CpIiUCL3X8sJzirqwUTB3JFB7lo; 25:oJIaWR4kZ1uKsRcaF6EJvcS3oE+jEEY9IP6tqMPpiGaNSVG3n78SwoOtfjnw/jcKUC4BKEsFolJr+x5mD840glcPcrUnuRLPf4hV8VjYefput4mEjQmynwNLN1YGmFj31Hx0AN5JjJKPTEEEv8YfbTTi1v++CgHXP43w0Y7AlNm+WhLGzdnwViaxIEnY6vokUuDmxTV4UH816zT4Dn2sqD+KJfRKppJ6AcHBmARB63L0Jggn5xAQPawUxJ/f1dQq1Y0OS6bcxR00DtlMs3llulxtWWU3oxRn6697kh0FPGv7S336lGCP0P6uJZtfUpOaD0cdWdR5cT6alMmXT8kucg==; 31:2/h7YG691em/1PDCCk/yzzZpvkTdTEeqlJkKg4am9ttPoph2h3XoddfR0E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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)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123555025)(20161123562025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB6PR0301MB2135; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB6PR0301MB2135; X-Forefront-PRVS: 04371797A5 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(346002)(376002)(199003)(189002)(54906003)(3846002)(966005)(76176999)(80792005)(81156014)(97736004)(81166006)(7350300001)(101416001)(6916009)(2950100002)(6306002)(50986999)(47776003)(53936002)(8666007)(1720100001)(2906002)(7416002)(45080400002)(50466002)(7736002)(42186006)(48376002)(50226002)(36756003)(4326008)(8656003)(66066001)(189998001)(6116002)(6666003)(8676002)(2351001)(316002)(16586007)(305945005)(106356001)(478600001)(72206003)(86362001)(5003940100001)(122856001)(2361001)(105586002)(53376002)(33646002)(5660300001)(68736007); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0301MB2135; H:EPUAKYIW2556.kyiv.epam.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; DB6PR0301MB2135; 23:Gl6cFbb9fFAauxV+KEqPAhiObxqwv1bMI02N+vJ?= =?us-ascii?Q?z3Ui0eY4UrYrkqpQ8uc62hlcnBMghZB63sANqyMj62oself/b4uy/nzODvJO?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5YihGbCbd7/qFv/MqQV6MLhV/OvIBKWx+1c=; 7:QMoBNqBsvNiVbbgZCYsSW/KE+RWJWIdXQj//kSYt4kOK74Bq39P8MPqGZMHTA/vto6P0F+ET3Ao8IwvCqVsj4Uh4p/E2lJBMRusCZ3JoiXGuFJvxhTwtwP9KDs4DxxgxAiCg93ofs1pT/rp9IKj3ZIVyqYZ2L6ulul93I9FufHpPpLgoXrtzG32jOAz2zxo+oPaoUL98zYabL7HX0Tf37ohntdmBLYIe/cz7a9Ol2RQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2017 20:00:35.2505 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0301MB2135 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 v6 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(0x00112233, 0x4455, 0x6677, 0x8899, 0xaabbccddeeff) 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 --- * Fixed commit message (added 0x in XEN_DEFINE_UUID usage example) * As was agreed with Julien Grail ([1]), added two flavours of XEN_DEFINE_UUID(). One of them casts initialization list to right type (if compiler supports this), another - does not. [1] http://markmail.org/message/cpced37242alfvz7 --- xen/include/public/xen.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h index 2ac6b1e..263bb3b 100644 --- a/xen/include/public/xen.h +++ b/xen/include/public/xen.h @@ -930,6 +930,33 @@ __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; + +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) + +#define XEN_DEFINE_UUID(a, b, c, d, e1, e2, e3, e4, e5, e6) \ + (xen_uuid_t){{((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}} + +#else + +#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 /* (__GNUC__) && !defined(__STRICT_ANSI__) */ + #endif /* !__ASSEMBLY__ */ /* Default definitions for macros used by domctl/sysctl. */