From patchwork Fri Sep 2 13:47:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Razvan Cojocaru X-Patchwork-Id: 9311029 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 3097C60756 for ; Fri, 2 Sep 2016 13:49:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 22965297AC for ; Fri, 2 Sep 2016 13:49:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17073297A3; Fri, 2 Sep 2016 13:49:35 +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.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED 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 EED1A297A3 for ; Fri, 2 Sep 2016 13:49:33 +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 1bfooZ-0005Z2-BK; Fri, 02 Sep 2016 13:47:27 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bfooY-0005Ym-0v for xen-devel@lists.xen.org; Fri, 02 Sep 2016 13:47:26 +0000 Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id B6/58-12874-DE289C75; Fri, 02 Sep 2016 13:47:25 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprMIsWRWlGSWpSXmKPExsUSfTxjoe6bppP hBl+uylos+biYxYHR4+ju30wBjFGsmXlJ+RUJrBlH3j5hKjjHWXFpyzTWBsYP7F2MnBxCAm4S n69PYO1i5AKy1zBKHDrcxQ7hXGOUmNp5gwWmasqM+4wQiX1AVYt7mUESbAKGEqs3trCB2CIC0 hLXPl8GK2IWeM8o8a9vLStIQljAW+L58RtADRwcLAKqEvemVYCEeQU8JU68nAdWIiEgJ3Hy2G QoO0fiyN4WFpByCQEpif+tSiAjJQS6WCQuvjnACFEjI/Fo4k22CYwCCxgZVjGqF6cWlaUW6Zr rJRVlpmeU5CZm5ugaGpjq5aYWFyemp+YkJhXrJefnbmIEBhYDEOxgPDbZ+RCjJAeTkijvg4CT 4UJ8SfkplRmJxRnxRaU5qcWHGGU4OJQkeN2AgSokWJSanlqRlpkDDHGYtAQHj5II75tGoDRvc UFibnFmOkTqFKOilDjvW5CEAEgiozQPrg0WV5cYZaWEeRmBDhHiKUgtys0sQZV/xSjOwagkzP sZZApPZl4J3PRXQIuZgBaXXDsOsrgkESEl1cDo6rxeL79s6nGR+r8H6p9I3hRePUMu1zvUIeX R2+TlbHdFXaSF1qr26vZ3dGQIPa74Uiqa4mR7aGrHz6jq0yH995fZHPI8Lq9RXtj7sSU6evqp w9rSUj/q9C/fmuziHJGn33RBgD/Q6+gEt+RENW2mz2whJyx2y9c2lFqGz1NestSyv2K2shJLc UaioRZzUXEiADn/C3SmAgAA X-Env-Sender: rcojocaru@bitdefender.com X-Msg-Ref: server-3.tower-206.messagelabs.com!1472824043!53926012!1 X-Originating-IP: [91.199.104.161] X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50 X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 34527 invoked from network); 2 Sep 2016 13:47:24 -0000 Received: from mx01.bbu.dsd.mx.bitdefender.com (HELO mx01.bbu.dsd.mx.bitdefender.com) (91.199.104.161) by server-3.tower-206.messagelabs.com with DHE-RSA-AES128-GCM-SHA256 encrypted SMTP; 2 Sep 2016 13:47:24 -0000 Received: (qmail 3713 invoked from network); 2 Sep 2016 16:47:23 +0300 Received: from unknown (HELO mx-sr.buh.bitdefender.com) (10.17.80.103) by mx01.bbu.dsd.mx.bitdefender.com with AES256-GCM-SHA384 encrypted SMTP; 2 Sep 2016 16:47:23 +0300 Received: from smtp03.buh.bitdefender.org (smtp.bitdefender.biz [10.17.80.77]) by mx-sr.buh.bitdefender.com (Postfix) with ESMTP id 1CAE37FBF5 for ; Fri, 2 Sep 2016 16:47:23 +0300 (EEST) Received: (qmail 1092 invoked from network); 2 Sep 2016 16:47:23 +0300 Received: from xen.dsd.ro (HELO xen.dsd.bitdefender.biz) (rcojocaru@bitdefender.com@10.10.14.109) by smtp03.buh.bitdefender.org with AES128-SHA256 encrypted SMTP; 2 Sep 2016 16:47:23 +0300 From: Razvan Cojocaru To: xen-devel@lists.xen.org Date: Fri, 2 Sep 2016 16:47:14 +0300 Message-Id: <1472824034-29713-1-git-send-email-rcojocaru@bitdefender.com> X-Mailer: git-send-email 1.9.1 X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.6 on smtp03.buh.bitdefender.org, sigver: 7.67065 X-BitDefender-Spam: No (0) X-BitDefender-SpamStamp: Build: [Engines: 2.15.6.911, Dats: 431149, Stamp: 3], Multi: [Enabled, t: (0.000007, 0.001492)], BW: [Enabled, t: (0.000006,0.000001)], RBL DNSBL: [Disabled], APM: [Enabled, Score: 500, t: (0.002368), Flags: 85D2ED72; NN_NO_CONTENT_TYPE; NN_NO_LINK_NMD; NN_LEGIT_BITDEFENDER; NN_LEGIT_S_SQARE_BRACKETS; NN_LEGIT_MAILING_LIST_TO], SGN: [Enabled, t: (0.006665)], URL: [Enabled, t: (0.000004)], RTDA: [Enabled, t: (0.012845), Hit: No, Details: v2.3.11; Id: 2m1ghn0.1arlhf9ud.4t5], total: 0(775) X-BitDefender-CF-Stamp: none Cc: sstabellini@kernel.org, wei.liu2@citrix.com, Razvan Cojocaru , George.Dunlap@eu.citrix.com, andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com, tim@xen.org, jbeulich@suse.com Subject: [Xen-devel] [PATCH] xen: Have __DEFINE_COMPAT_HANDLE() generate const versions 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: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Both DEFINE_XEN_GUEST_HANDLE() and __DEFINE_XEN_GUEST_HANDLE() each produce both const and non-const handles, only DEFINE_COMPAT_HANDLE() does (__DEFINE_COMPAT_HANDLE() does not). This patch has __DEFINE_COMPAT_HANDLE() also produce a const handle. Suggested-by: Jan Beulich Signed-off-by: Razvan Cojocaru --- xen/include/xen/compat.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xen/include/xen/compat.h b/xen/include/xen/compat.h index 3f4cef6..ce913ac 100644 --- a/xen/include/xen/compat.h +++ b/xen/include/xen/compat.h @@ -15,11 +15,14 @@ typedef struct { \ compat_ptr_t c; \ type *_[0] __packed; \ - } __compat_handle_ ## name + } __compat_handle_ ## name; \ + typedef struct { \ + compat_ptr_t c; \ + const type *_[0] __packed; \ + } __compat_handle_const_ ## name #define DEFINE_COMPAT_HANDLE(name) \ - __DEFINE_COMPAT_HANDLE(name, name); \ - __DEFINE_COMPAT_HANDLE(const_ ## name, const name) + __DEFINE_COMPAT_HANDLE(name, name) #define COMPAT_HANDLE(name) __compat_handle_ ## name /* NB: it is assumed that if an arch uses the compat layer it does not