From nobody Mon Feb 9 13:37:22 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; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1606144988; cv=none; d=zohomail.com; s=zohoarc; b=CUEhk6695k7DEEXK5gLjPkiqliR9Ntelye7WGYNOFgA3ZbLSoyGdrTI21eecCJXX8Y1PyFEy8IF6YVbWRGTSFngupEo0yjb5Jl6uyQo7VGc7bms2ssopo37TuOIzjf9ljf5f6TDLrvUrtKem426w54NVEpQpaSq6DjKJ7TXKUGA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606144988; h=Content-Type: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=8fmfCVpbzWpimEPZJkVHrvDAFBSfAhhMSPnv3DhM26s=; b=FkdLlw3iHhC7DtfH3vEj1gn5mANY8oYKJ/SedzlCKIsTR8B6oKmnQ2ynoye56bv5XUSkGwIKjDEIYBwHZdh+y30u9E7bRCP6Qp4hzP8Qbp2CosH8Sy+AhdC5C71Jcyqds4nAGPIziabpT0a7s/3OZAlLq+TFYIoO59eSm7aWnuc= 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; dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1606144988562236.83037171591877; Mon, 23 Nov 2020 07:23:08 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.34653.65831 (Exim 4.92) (envelope-from ) id 1khDg2-0006y3-Ql; Mon, 23 Nov 2020 15:22:50 +0000 Received: by outflank-mailman (output) from mailman id 34653.65831; Mon, 23 Nov 2020 15:22:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1khDg2-0006xw-NL; Mon, 23 Nov 2020 15:22:50 +0000 Received: by outflank-mailman (input) for mailman id 34653; Mon, 23 Nov 2020 15:22:50 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1khDg1-0006xj-Ve for xen-devel@lists.xenproject.org; Mon, 23 Nov 2020 15:22:50 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 542f9c41-7242-4cec-abaf-df9059b01856; Mon, 23 Nov 2020 15:22:49 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 6E2D3B01E; Mon, 23 Nov 2020 15:22:48 +0000 (UTC) Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1khDg1-0006xj-Ve for xen-devel@lists.xenproject.org; Mon, 23 Nov 2020 15:22:50 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 542f9c41-7242-4cec-abaf-df9059b01856; Mon, 23 Nov 2020 15:22:49 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 6E2D3B01E; Mon, 23 Nov 2020 15:22:48 +0000 (UTC) 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: 542f9c41-7242-4cec-abaf-df9059b01856 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1606144968; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8fmfCVpbzWpimEPZJkVHrvDAFBSfAhhMSPnv3DhM26s=; b=cAP4j0Jlb/yiQ5VcN3xmT3RACuC6QRyEliTufHXhlkCWrOFQixEZmfxEvq3Msqin4xANcX 83rnHESxwcz5adoXjHz5Sw01QyysMAwr73SWc+rdvz+bt36DKPg4i6Zw0XsTegqmD+l1Sl ubM2RYM0QTAwHx7mh9zBLlZju+VKhUA= Subject: [PATCH v3 5/8] lib: move init_constructors() From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , George Dunlap , Ian Jackson , Julien Grall , Wei Liu , Stefano Stabellini , Anthony Perard References: <1a6bac6a-7d83-f5b6-c5b9-8b3b39824d40@suse.com> Message-ID: Date: Mon, 23 Nov 2020 16:22:47 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <1a6bac6a-7d83-f5b6-c5b9-8b3b39824d40@suse.com> Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) Content-Type: text/plain; charset="utf-8" ... into its own CU, for being unrelated to other things in common/lib.c. Signed-off-by: Jan Beulich Reviewed-by: Bertrand Marquis --- xen/common/lib.c | 14 -------------- xen/lib/Makefile | 1 + xen/lib/ctors.c | 25 +++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 14 deletions(-) create mode 100644 xen/lib/ctors.c diff --git a/xen/common/lib.c b/xen/common/lib.c index 6cfa332142a5..f5ca179a0af4 100644 --- a/xen/common/lib.c +++ b/xen/common/lib.c @@ -1,6 +1,5 @@ #include #include -#include #include =20 /* @@ -423,19 +422,6 @@ uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c) #endif } =20 -typedef void (*ctor_func_t)(void); -extern const ctor_func_t __ctors_start[], __ctors_end[]; - -void __init init_constructors(void) -{ - const ctor_func_t *f; - for ( f =3D __ctors_start; f < __ctors_end; ++f ) - (*f)(); - - /* Putting this here seems as good (or bad) as any other place. */ - BUILD_BUG_ON(sizeof(size_t) !=3D sizeof(ssize_t)); -} - /* * Local variables: * mode: C diff --git a/xen/lib/Makefile b/xen/lib/Makefile index 99f857540c99..72c72fffecf2 100644 --- a/xen/lib/Makefile +++ b/xen/lib/Makefile @@ -1,5 +1,6 @@ obj-$(CONFIG_X86) +=3D x86/ =20 +lib-y +=3D ctors.o lib-y +=3D ctype.o lib-y +=3D list-sort.o lib-y +=3D parse-size.o diff --git a/xen/lib/ctors.c b/xen/lib/ctors.c new file mode 100644 index 000000000000..5bdc591cd50a --- /dev/null +++ b/xen/lib/ctors.c @@ -0,0 +1,25 @@ +#include +#include + +typedef void (*ctor_func_t)(void); +extern const ctor_func_t __ctors_start[], __ctors_end[]; + +void __init init_constructors(void) +{ + const ctor_func_t *f; + for ( f =3D __ctors_start; f < __ctors_end; ++f ) + (*f)(); + + /* Putting this here seems as good (or bad) as any other place. */ + BUILD_BUG_ON(sizeof(size_t) !=3D sizeof(ssize_t)); +} + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */