From nobody Wed Apr 24 17:28:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1619525160; cv=none; d=zohomail.com; s=zohoarc; b=MtiMrkd4FP3U9y65+74SZ+vwpZixGWh36mFSBqS+wi53DlI+jBZNx601zppfgJgXvjhIvm+a9c9dQhPDtSuKD6gWtWDUIelUig/32fUhhMcYXLqhr94IvqEFWnCNuCL5waoyaMVduVn5vBIrr11B1DE8to9mpEiuWE2sI0rE2j8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619525160; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=16YY2xIltl4KJsKMeJxPxRD5eA/Umci1yb0Ous8iIs4=; b=SS6BTBaaw1RRFa7ebB5D6OSHy5MwBYuAV43xs7gSFSn76EELrqwBjQDkk/xQnB2KrE9OnxNitDqgJCrhpgIp7SpTVvwi9YJsPDuByzm4ylbLWNeHNMrGl8lITUF7UItUXpM2n9x4Vh58doqliT7Ti400GgXG/z13AZ+XEnG8KIo= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1619525160322931.4750831300057; Tue, 27 Apr 2021 05:06:00 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.118360.224418 (Exim 4.92) (envelope-from ) id 1lbMT5-00063b-KI; Tue, 27 Apr 2021 12:05:31 +0000 Received: by outflank-mailman (output) from mailman id 118360.224418; Tue, 27 Apr 2021 12:05:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lbMT5-00063R-CL; Tue, 27 Apr 2021 12:05:31 +0000 Received: by outflank-mailman (input) for mailman id 118360; Tue, 27 Apr 2021 12:05:30 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lbMT4-00062t-4R for xen-devel@lists.xenproject.org; Tue, 27 Apr 2021 12:05:30 +0000 Received: from mx.upb.ro (unknown [141.85.13.220]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 6c09d5c7-2c62-4a8e-8c59-2555e05fe806; Tue, 27 Apr 2021 12:05:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mx.upb.ro (Postfix) with ESMTP id 32687B5600B3; Tue, 27 Apr 2021 15:05:27 +0300 (EEST) Received: from mx.upb.ro ([127.0.0.1]) by localhost (mx.upb.ro [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id sT9FuaziNEZ1; Tue, 27 Apr 2021 15:05:25 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by mx.upb.ro (Postfix) with ESMTP id 3707BB5600B6; Tue, 27 Apr 2021 15:05:25 +0300 (EEST) Received: from mx.upb.ro ([127.0.0.1]) by localhost (mx.upb.ro [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 2S4aCd2cXliT; Tue, 27 Apr 2021 15:05:25 +0300 (EEST) Received: from localhost.localdomain (unknown [188.25.174.245]) by mx.upb.ro (Postfix) with ESMTPSA id BAB95B560069; Tue, 27 Apr 2021 15:05:24 +0300 (EEST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 6c09d5c7-2c62-4a8e-8c59-2555e05fe806 X-Virus-Scanned: amavisd-new at upb.ro From: Costin Lupu To: xen-devel@lists.xenproject.org Cc: Tim Deegan , Ian Jackson , Wei Liu Subject: [PATCH 1/5] tools/debugger: Fix PAGE_SIZE redefinition error Date: Tue, 27 Apr 2021 15:05:16 +0300 Message-Id: <0cd234096c9bfa8d29eac9906553af79d378733e.1619524463.git.costin.lupu@cs.pub.ro> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" If PAGE_SIZE is already defined in the system (e.g. in /usr/include/limits.h header) then gcc will trigger a redefinition error because of -Werror. This commit also protects PAGE_SHIFT definitions for keeping consistency. Signed-off-by: Costin Lupu Acked-by: Christian Lindig > --- tools/debugger/kdd/kdd-xen.c | 4 ++++ tools/debugger/kdd/kdd.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/tools/debugger/kdd/kdd-xen.c b/tools/debugger/kdd/kdd-xen.c index f3f9529f9f..04d2361ba7 100644 --- a/tools/debugger/kdd/kdd-xen.c +++ b/tools/debugger/kdd/kdd-xen.c @@ -48,8 +48,12 @@ =20 #define MAPSIZE 4093 /* Prime */ =20 +#ifndef PAGE_SHIFT #define PAGE_SHIFT 12 +#endif +#ifndef PAGE_SIZE #define PAGE_SIZE (1U << PAGE_SHIFT) +#endif =20 struct kdd_guest { struct xentoollog_logger xc_log; /* Must be first for xc log callbacks= */ diff --git a/tools/debugger/kdd/kdd.c b/tools/debugger/kdd/kdd.c index 17513c2650..acd5832714 100644 --- a/tools/debugger/kdd/kdd.c +++ b/tools/debugger/kdd/kdd.c @@ -288,8 +288,12 @@ static void kdd_log_pkt(kdd_state *s, const char *name= , kdd_pkt *p) * Memory access: virtual addresses and syntactic sugar. */ =20 +#ifndef PAGE_SHIFT #define PAGE_SHIFT (12) +#endif +#ifndef PAGE_SIZE #define PAGE_SIZE (1ULL << PAGE_SHIFT)=20 +#endif =20 static uint32_t kdd_read_physical(kdd_state *s, uint64_t addr,=20 uint32_t len, void *buf) --=20 2.20.1 From nobody Wed Apr 24 17:28:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1619525162; cv=none; d=zohomail.com; s=zohoarc; b=TBTkqy0/kAvHYMGa1KvbbqczFEUtv22fqyjg966nJ3HpHDHWqaoykLY9qlnbhFR9/lecILAww4VhZV4TIDBFYgMWpkVbLa6jL8vN0n74xj2lVfTRVVhfZxqVXAHFI6YT2xN1vTLyTfHuot5wEpsKwd471vnLDuPTimcScI+d5U0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619525162; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZqHfNtrPiUVUSnKSMhc5EPrUPq/3XAtCZkHxtE7ffHg=; b=hvRtOc4nSdINPaFOYtrXt5vE0M0OGXjduNGPAn/Wdx7ySNqguTT9BIXNOYFq58IE7JzX0DZPty5HMDqS1tMoRR5j6wcnfvyqJLbE6Z/9ocMmx9YjqzLePQn/DNWObcTnFsZ1f0H40AIyHhPNFlhnt8QoOQWm+JaB3Im/13JgjOo= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1619525162994561.0152743640691; Tue, 27 Apr 2021 05:06:02 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.118364.224470 (Exim 4.92) (envelope-from ) id 1lbMTK-0006Ic-LZ; Tue, 27 Apr 2021 12:05:46 +0000 Received: by outflank-mailman (output) from mailman id 118364.224470; Tue, 27 Apr 2021 12:05:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lbMTK-0006IT-Hr; Tue, 27 Apr 2021 12:05:46 +0000 Received: by outflank-mailman (input) for mailman id 118364; Tue, 27 Apr 2021 12:05:45 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lbMTI-00062t-UP for xen-devel@lists.xenproject.org; Tue, 27 Apr 2021 12:05:44 +0000 Received: from mx.upb.ro (unknown [141.85.13.200]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 7eb09498-64b8-432c-b5ef-d660233f1178; Tue, 27 Apr 2021 12:05:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mx.upb.ro (Postfix) with ESMTP id 99E19B560069; Tue, 27 Apr 2021 15:05:32 +0300 (EEST) Received: from mx.upb.ro ([127.0.0.1]) by localhost (mx.upb.ro [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 0OFQ6eJ013ed; Tue, 27 Apr 2021 15:05:25 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by mx.upb.ro (Postfix) with ESMTP id A40DCB5600B8; Tue, 27 Apr 2021 15:05:25 +0300 (EEST) Received: from mx.upb.ro ([127.0.0.1]) by localhost (mx.upb.ro [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id WxSkCHgP_ggo; Tue, 27 Apr 2021 15:05:25 +0300 (EEST) Received: from localhost.localdomain (unknown [188.25.174.245]) by mx.upb.ro (Postfix) with ESMTPSA id 36F35B560057; Tue, 27 Apr 2021 15:05:25 +0300 (EEST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 7eb09498-64b8-432c-b5ef-d660233f1178 X-Virus-Scanned: amavisd-new at upb.ro From: Costin Lupu To: xen-devel@lists.xenproject.org Cc: Ian Jackson , Wei Liu Subject: [PATCH 2/5] tools/libfsimage: Fix PATH_MAX redefinition error Date: Tue, 27 Apr 2021 15:05:17 +0300 Message-Id: X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" If PATH_MAX is already defined in the system (e.g. in /usr/include/limits.h header) then gcc will trigger a redefinition error because of -Werror. Signed-off-by: Costin Lupu Acked-by: Christian Lindig > Reviewed-by: Julien Grall --- tools/libfsimage/ext2fs/fsys_ext2fs.c | 2 ++ tools/libfsimage/reiserfs/fsys_reiserfs.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tools/libfsimage/ext2fs/fsys_ext2fs.c b/tools/libfsimage/ext2f= s/fsys_ext2fs.c index a4ed10419c..5ed8fce90e 100644 --- a/tools/libfsimage/ext2fs/fsys_ext2fs.c +++ b/tools/libfsimage/ext2fs/fsys_ext2fs.c @@ -278,7 +278,9 @@ struct ext4_extent_header { =20 #define EXT2_SUPER_MAGIC 0xEF53 /* include/linux/ext2_fs.h */ #define EXT2_ROOT_INO 2 /* include/linux/ext2_fs.h */ +#ifndef PATH_MAX #define PATH_MAX 1024 /* include/linux/limits.h */ +#endif #define MAX_LINK_COUNT 5 /* number of symbolic links to follow= */ =20 /* made up, these are pointers into FSYS_BUF */ diff --git a/tools/libfsimage/reiserfs/fsys_reiserfs.c b/tools/libfsimage/r= eiserfs/fsys_reiserfs.c index 916eb15292..10ca657476 100644 --- a/tools/libfsimage/reiserfs/fsys_reiserfs.c +++ b/tools/libfsimage/reiserfs/fsys_reiserfs.c @@ -284,7 +284,9 @@ struct reiserfs_de_head #define S_ISDIR(mode) (((mode) & 0170000) =3D=3D 0040000) #define S_ISLNK(mode) (((mode) & 0170000) =3D=3D 0120000) =20 +#ifndef PATH_MAX #define PATH_MAX 1024 /* include/linux/limits.h */ +#endif #define MAX_LINK_COUNT 5 /* number of symbolic links to follow */ =20 /* The size of the node cache */ --=20 2.20.1 From nobody Wed Apr 24 17:28:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1619525161; cv=none; d=zohomail.com; s=zohoarc; b=j1i/3UIvgp+7dvt5Qw8gb63WGyPptRGMB+5hFreVzG7mWNUiKvmn6ykxN/QFe6FIzxio+pISozFnmzxeOtxbsrxEHOlakDaVAIWauQ/EhJ3QyxsX32DHzBHkVm9TN1mBVZqe8y07pRBottZoTcLW/Sc2cJQRWkPp1kAZiPbHlGE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619525161; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=u1RItNo68AK9UTeRQ4jZLqQhYl4qXxdup6XVZZ/e+gc=; b=NmLZI4Uscmlx6sy5datPZRFKMiOLy0eENlAVorkxq8WQ4tv70WLWZbKLbszVFLUmQR5OdHSJTLLdU1ATP0DnvuMgm1NqzYZDBIiGS1WUDBGQjuMPoJlAhvrsVc7pOADHcex4fC1l+vxe9kKDUqRTye1sw5lkPiQNfkJuMH0/8uk= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1619525161169314.0522083233119; Tue, 27 Apr 2021 05:06:01 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.118362.224440 (Exim 4.92) (envelope-from ) id 1lbMTA-00067T-4Z; Tue, 27 Apr 2021 12:05:36 +0000 Received: by outflank-mailman (output) from mailman id 118362.224440; Tue, 27 Apr 2021 12:05:36 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lbMT9-00067B-Un; Tue, 27 Apr 2021 12:05:35 +0000 Received: by outflank-mailman (input) for mailman id 118362; Tue, 27 Apr 2021 12:05:35 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lbMT8-00062t-UJ for xen-devel@lists.xenproject.org; Tue, 27 Apr 2021 12:05:34 +0000 Received: from mx.upb.ro (unknown [141.85.13.210]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 7b7d1fb2-0de2-4f02-986c-29249f071718; Tue, 27 Apr 2021 12:05:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mx.upb.ro (Postfix) with ESMTP id ED01AB560069; Tue, 27 Apr 2021 15:05:27 +0300 (EEST) Received: from mx.upb.ro ([127.0.0.1]) by localhost (mx.upb.ro [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id HxNMnXbwKZLk; Tue, 27 Apr 2021 15:05:26 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by mx.upb.ro (Postfix) with ESMTP id 1D4ECB5600B9; Tue, 27 Apr 2021 15:05:26 +0300 (EEST) Received: from mx.upb.ro ([127.0.0.1]) by localhost (mx.upb.ro [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id rk5V-VS7Et-W; Tue, 27 Apr 2021 15:05:26 +0300 (EEST) Received: from localhost.localdomain (unknown [188.25.174.245]) by mx.upb.ro (Postfix) with ESMTPSA id A39C2B560069; Tue, 27 Apr 2021 15:05:25 +0300 (EEST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 7b7d1fb2-0de2-4f02-986c-29249f071718 X-Virus-Scanned: amavisd-new at upb.ro From: Costin Lupu To: xen-devel@lists.xenproject.org Cc: Ian Jackson , Wei Liu Subject: [PATCH 3/5] tools/libs/foreignmemory: Fix PAGE_SIZE redefinition error Date: Tue, 27 Apr 2021 15:05:18 +0300 Message-Id: X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" If PAGE_SIZE is already defined in the system (e.g. in /usr/include/limits.h header) then gcc will trigger a redefinition error because of -Werror. This commit also protects PAGE_SHIFT and PAGE_MASK definitions for keeping consistency. Signed-off-by: Costin Lupu Acked-by: Christian Lindig > --- tools/libs/foreignmemory/private.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/libs/foreignmemory/private.h b/tools/libs/foreignmemory/= private.h index 1ee3626dd2..f3c1ba2867 100644 --- a/tools/libs/foreignmemory/private.h +++ b/tools/libs/foreignmemory/private.h @@ -10,11 +10,13 @@ #include #include =20 -#ifndef PAGE_SHIFT /* Mini-os, Yukk */ +#ifndef PAGE_SHIFT #define PAGE_SHIFT 12 #endif -#ifndef __MINIOS__ /* Yukk */ +#ifndef PAGE_SIZE #define PAGE_SIZE (1UL << PAGE_SHIFT) +#endif +#ifndef PAGE_MASK #define PAGE_MASK (~(PAGE_SIZE-1)) #endif =20 --=20 2.20.1 From nobody Wed Apr 24 17:28:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1619525161; cv=none; d=zohomail.com; s=zohoarc; b=TRpQsNU/Yf0GBu1VaOto0YpNa5hmuoKwzmfJ3Rnmgnc++YLNKUMRQwKapLH11vvkz/Upl5OMSyhnkQwgGgjWgQ910+JA2Pu0y/04jpUNDccwPnZOB0Zt7xSVFDuK4prxmwnyITSdQGzKitSdB1+nKppb8mI1Lt9sjPJRaNSnRtU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619525161; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=q5DCyyVT6sWASZ34q0wonQTLFw56gk8TDjY6J57ZniI=; b=kYzS7KE73pVZsT9SwdlVXrJtj5yOl8uwuU/IHir+DcLkS79qxl2APssj1+QibzGgdMFdieyEQETYqWjPCP1aNZLgrbhjGkHLwiN1v8OtPudDdeNFDELN7rLXzl6W2hnnNUOWGBctOvHqk3+AknH6yONjIJFNE0tJNB+hIEil7os= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 161952516091919.815091021058493; Tue, 27 Apr 2021 05:06:00 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.118361.224434 (Exim 4.92) (envelope-from ) id 1lbMT9-00066Y-Ow; Tue, 27 Apr 2021 12:05:35 +0000 Received: by outflank-mailman (output) from mailman id 118361.224434; Tue, 27 Apr 2021 12:05:35 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lbMT9-00066Q-Lm; Tue, 27 Apr 2021 12:05:35 +0000 Received: by outflank-mailman (input) for mailman id 118361; Tue, 27 Apr 2021 12:05:34 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lbMT8-00062s-RD for xen-devel@lists.xenproject.org; Tue, 27 Apr 2021 12:05:34 +0000 Received: from mx.upb.ro (unknown [141.85.13.220]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 995564d1-63ae-4e44-bc03-4d4a0bde0b66; Tue, 27 Apr 2021 12:05:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mx.upb.ro (Postfix) with ESMTP id 478AFB5600B9; Tue, 27 Apr 2021 15:05:28 +0300 (EEST) Received: from mx.upb.ro ([127.0.0.1]) by localhost (mx.upb.ro [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id XMZxpq2MkaK4; Tue, 27 Apr 2021 15:05:26 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by mx.upb.ro (Postfix) with ESMTP id 71715B5600BA; Tue, 27 Apr 2021 15:05:26 +0300 (EEST) Received: from mx.upb.ro ([127.0.0.1]) by localhost (mx.upb.ro [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 6IiaJN9JLXvb; Tue, 27 Apr 2021 15:05:26 +0300 (EEST) Received: from localhost.localdomain (unknown [188.25.174.245]) by mx.upb.ro (Postfix) with ESMTPSA id 1CB92B560057; Tue, 27 Apr 2021 15:05:26 +0300 (EEST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 995564d1-63ae-4e44-bc03-4d4a0bde0b66 X-Virus-Scanned: amavisd-new at upb.ro From: Costin Lupu To: xen-devel@lists.xenproject.org Cc: Ian Jackson , Wei Liu Subject: [PATCH 4/5] tools/libs/gnttab: Fix PAGE_SIZE redefinition error Date: Tue, 27 Apr 2021 15:05:19 +0300 Message-Id: X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" If PAGE_SIZE is already defined in the system (e.g. in /usr/include/limits.h header) then gcc will trigger a redefinition error because of -Werror. This commit also protects PAGE_SHIFT and PAGE_MASK definitions for keeping consistency. Signed-off-by: Costin Lupu Acked-by: Christian Lindig > --- tools/libs/gnttab/linux.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/libs/gnttab/linux.c b/tools/libs/gnttab/linux.c index 74331a4c7b..e12f2697a5 100644 --- a/tools/libs/gnttab/linux.c +++ b/tools/libs/gnttab/linux.c @@ -36,9 +36,15 @@ =20 #include "private.h" =20 +#ifndef PAGE_SHIFT #define PAGE_SHIFT 12 +#endif +#ifndef PAGE_SIZE #define PAGE_SIZE (1UL << PAGE_SHIFT) +#endif +#ifndef PAGE_MASK #define PAGE_MASK (~(PAGE_SIZE-1)) +#endif =20 #define DEVXEN "/dev/xen/" =20 --=20 2.20.1 From nobody Wed Apr 24 17:28:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1619525158; cv=none; d=zohomail.com; s=zohoarc; b=Mns9mcPLwtQQz34laMlaEtqn9Hp9TZactPI0l3NSZ/1o/PC7fQLyuOdNzcgmqM1myxTalq97Vk9Wt9+rgybXwQ9r0JmXHqbNKP2fFMN1fPIk0XVoawgHxDWa8w3EAKweuaaJsaFgtpM8vaCdrhnsoiojev0NHB2o/dl4jO3WQ5s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619525158; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zqtTRC9nRpcTk8LwJ3EhrsnAW5sY5pBxa4cco0tb9pM=; b=HE+zapXUNBTaVkWpuW68QcUZ9Afx6fdR4NE9jvz/bGv3vEe9Cugs6TnzPufvRj9Ke15Msvem9BbPqMqQe6FCO4LukT/dbsvxVRIN1yjCiJpDXYU95T3WN9bz+F8CK1h11x7/HL3IY//Gg9THiTOS3cyncYCG0bfyZHEfoauEtxs= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1619525158157508.06385964931746; Tue, 27 Apr 2021 05:05:58 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.118363.224458 (Exim 4.92) (envelope-from ) id 1lbMTF-0006Co-EC; Tue, 27 Apr 2021 12:05:41 +0000 Received: by outflank-mailman (output) from mailman id 118363.224458; Tue, 27 Apr 2021 12:05:41 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lbMTF-0006Ch-9H; Tue, 27 Apr 2021 12:05:41 +0000 Received: by outflank-mailman (input) for mailman id 118363; Tue, 27 Apr 2021 12:05:40 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lbMTD-00062t-UE for xen-devel@lists.xenproject.org; Tue, 27 Apr 2021 12:05:39 +0000 Received: from mx.upb.ro (unknown [141.85.13.210]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 034b139a-45ed-4413-939d-90671de231b2; Tue, 27 Apr 2021 12:05:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mx.upb.ro (Postfix) with ESMTP id 019FFB5600BB; Tue, 27 Apr 2021 15:05:30 +0300 (EEST) Received: from mx.upb.ro ([127.0.0.1]) by localhost (mx.upb.ro [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id sFRqpkv4cXg7; Tue, 27 Apr 2021 15:05:27 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by mx.upb.ro (Postfix) with ESMTP id 41889B5600B6; Tue, 27 Apr 2021 15:05:27 +0300 (EEST) Received: from mx.upb.ro ([127.0.0.1]) by localhost (mx.upb.ro [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 2eqPK_g_p6EI; Tue, 27 Apr 2021 15:05:27 +0300 (EEST) Received: from localhost.localdomain (unknown [188.25.174.245]) by mx.upb.ro (Postfix) with ESMTPSA id 71557B560069; Tue, 27 Apr 2021 15:05:26 +0300 (EEST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 034b139a-45ed-4413-939d-90671de231b2 X-Virus-Scanned: amavisd-new at upb.ro From: Costin Lupu To: xen-devel@lists.xenproject.org Cc: Christian Lindig , David Scott , Ian Jackson , Wei Liu Subject: [PATCH 5/5] tools/ocaml: Fix redefinition errors Date: Tue, 27 Apr 2021 15:05:20 +0300 Message-Id: <91dc6057e7c58c2acf8d3f6f6201d9f70a84fb3d.1619524463.git.costin.lupu@cs.pub.ro> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" If PAGE_SIZE is already defined in the system (e.g. in /usr/include/limits.h header) then gcc will trigger a redefinition error because of -Werror. This commit also protects PAGE_SHIFT and PAGE_MASK definitions for keeping consistency. Same issue applies for redefinitions of Val_none and Some_val macros which can be already define in the OCaml system headers (e.g. /usr/lib/ocaml/caml/mlvalues.h). Signed-off-by: Costin Lupu Acked-by: Christian Lindig > --- tools/ocaml/libs/xc/xenctrl_stubs.c | 8 ++++++++ tools/ocaml/libs/xentoollog/xentoollog_stubs.c | 4 ++++ tools/ocaml/libs/xl/xenlight_stubs.c | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenc= trl_stubs.c index d05d7bb30e..1c82e76b19 100644 --- a/tools/ocaml/libs/xc/xenctrl_stubs.c +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c @@ -36,14 +36,22 @@ =20 #include "mmap_stubs.h" =20 +#ifndef PAGE_SHIFT #define PAGE_SHIFT 12 +#endif +#ifndef PAGE_SIZE #define PAGE_SIZE (1UL << PAGE_SHIFT) +#endif +#ifndef PAGE_MASK #define PAGE_MASK (~(PAGE_SIZE-1)) +#endif =20 #define _H(__h) ((xc_interface *)(__h)) #define _D(__d) ((uint32_t)Int_val(__d)) =20 +#ifndef Val_none #define Val_none (Val_int(0)) +#endif =20 #define string_of_option_array(array, index) \ ((Field(array, index) =3D=3D Val_none) ? NULL : String_val(Field(Field(ar= ray, index), 0))) diff --git a/tools/ocaml/libs/xentoollog/xentoollog_stubs.c b/tools/ocaml/l= ibs/xentoollog/xentoollog_stubs.c index bf64b211c2..e4306a0c2f 100644 --- a/tools/ocaml/libs/xentoollog/xentoollog_stubs.c +++ b/tools/ocaml/libs/xentoollog/xentoollog_stubs.c @@ -53,8 +53,12 @@ static char * dup_String_val(value s) #include "_xtl_levels.inc" =20 /* Option type support as per http://www.linux-nantes.org/~fmonnier/ocaml/= ocaml-wrapping-c.php */ +#ifndef Val_none #define Val_none Val_int(0) +#endif +#ifndef Some_val #define Some_val(v) Field(v,0) +#endif =20 static value Val_some(value v) { diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xen= light_stubs.c index 352a00134d..45b8af61c7 100644 --- a/tools/ocaml/libs/xl/xenlight_stubs.c +++ b/tools/ocaml/libs/xl/xenlight_stubs.c @@ -227,8 +227,12 @@ static value Val_string_list(libxl_string_list *c_val) } =20 /* Option type support as per http://www.linux-nantes.org/~fmonnier/ocaml/= ocaml-wrapping-c.php */ +#ifndef Val_none #define Val_none Val_int(0) +#endif +#ifndef Some_val #define Some_val(v) Field(v,0) +#endif =20 static value Val_some(value v) { --=20 2.20.1