From nobody Tue Feb 10 02:43:02 2026 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; dkim=pass; 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=1606244895; cv=none; d=zohomail.com; s=zohoarc; b=EmO8SmRBLlw2j/obFy1eOwyh+UzVCuvwHYt8zXgXXRzdc33+TuibNpEmY6g4yjqql0LtRifznvMmnFStfuFoyRSEtHpgyAZpniqqBohuqXS0MZJ4j1Lr6RqgX1gVJHIn2TgyyybrM2egGxOUb1Ct/Wr0ok5MJZ1BIGgNBhid4DA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606244895; 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=UWkIBqTtAF5BCGvfGIil7ROCWJIpScItP3D5RKMBLJo=; b=M92kw41Yzek6IIGDbDvEI5qISGHufvXBCKp0Lon0jHr7ueHsSTtGOErp1DBynwCvFkkVLVljRI8l2l7EtCOQyzNbQA54CBySsMVLdgDjsG2tEzzT2o3W67hJG/yvkKk2Epbddwr2eKNkQb4eytZmsniEYU7QifK6FLgvj0j13ls= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1606244895576611.690516080991; Tue, 24 Nov 2020 11:08:15 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.36810.68907 (Exim 4.92) (envelope-from ) id 1khdfR-0001YM-3d; Tue, 24 Nov 2020 19:07:57 +0000 Received: by outflank-mailman (output) from mailman id 36810.68907; Tue, 24 Nov 2020 19:07:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1khdfQ-0001Xx-Vv; Tue, 24 Nov 2020 19:07:56 +0000 Received: by outflank-mailman (input) for mailman id 36810; Tue, 24 Nov 2020 19:07:55 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1khdfP-0001UU-6h for xen-devel@lists.xenproject.org; Tue, 24 Nov 2020 19:07:55 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1khdfO-0003tH-4N; Tue, 24 Nov 2020 19:07:54 +0000 Received: from host86-183-162-145.range86-183.btcentralplus.com ([86.183.162.145] helo=u2f063a87eabd5f.home) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1khdfN-0000r4-S6; Tue, 24 Nov 2020 19:07:54 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1khdfP-0001UU-6h for xen-devel@lists.xenproject.org; Tue, 24 Nov 2020 19:07:55 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1khdfO-0003tH-4N; Tue, 24 Nov 2020 19:07:54 +0000 Received: from host86-183-162-145.range86-183.btcentralplus.com ([86.183.162.145] helo=u2f063a87eabd5f.home) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1khdfN-0000r4-S6; Tue, 24 Nov 2020 19:07:54 +0000 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" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=UWkIBqTtAF5BCGvfGIil7ROCWJIpScItP3D5RKMBLJo=; b=kNHSiQ85ejPIPK+pAkadfc9DMc iF3Eq0OYhffj0XtWTMweG1TPq/KKKX9hj2j7mJmcje3nh8EW46ARoLtOlvowRPXhhTJhrMD8GKTlt WVGu6HoEtE1WgzEUCTe/kdDPxImm6BqBOqxo6CVKxABWc3sNIN+HYc02tPDLAHVjGtEQ=; From: Paul Durrant To: xen-devel@lists.xenproject.org Cc: Paul Durrant , Jan Beulich , Andrew Cooper , George Dunlap , Ian Jackson , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH v3 07/13] xen/include: import sizeof_field() macro from Linux stddef.h Date: Tue, 24 Nov 2020 19:07:38 +0000 Message-Id: <20201124190744.11343-8-paul@xen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201124190744.11343-1-paul@xen.org> References: <20201124190744.11343-1-paul@xen.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xen.org) Content-Type: text/plain; charset="utf-8" From: Paul Durrant Co-locate it with the definition of offsetof() (since this is also in stdde= f.h in the Linux kernel source). This macro will be needed in a subsequent patc= h. Signed-off-by: Paul Durrant Acked-by: Jan Beulich --- Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jackson Cc: Julien Grall Cc: Stefano Stabellini Cc: Wei Liu --- xen/include/xen/compiler.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h index c0e0ee9f27be..676c6ea1b0a0 100644 --- a/xen/include/xen/compiler.h +++ b/xen/include/xen/compiler.h @@ -76,6 +76,14 @@ =20 #define offsetof(a,b) __builtin_offsetof(a,b) =20 +/** + * sizeof_field(TYPE, MEMBER) + * + * @TYPE: The structure containing the field of interest + * @MEMBER: The field to return the size of + */ +#define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER)) + #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L #define alignof __alignof__ #endif --=20 2.20.1