[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 5/8] lib: move init_constructors()


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 9 Dec 2020 14:16:10 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4izZKCVsdEjKthzaBsRUktlaPI4UQdr3VkDWbU0Rydo=; b=ByRD55oh6kVikCg/PIRPl6vHc+X7R2KkTB/lCWqZjmhkVob2YezzKZ01XhF1weTQJ7GjfNaniIUFQQprVtkK/oS6ykxXOCKMRVByJXxPcw0NVWNx97goF7NFRHLg3CwUzifdwpxNHnUZsrA3EJl8JsOXCKvwCeKx41JrCqXpeev/S8FZAhDj3tbM0vJIeZpSxlxkV8GzaUvAqUnSoELKCbagR/5Chgjv9CyG8P9MEvTbXQVDeFcc7lYU+tK6UQCy3L+SnnbFXpA2z8X7F/g1OHBOg5JVz2GBC2No1cUF8sKz/ru8CsPRK0Lm3TFapswxaYZbKG7+R/pC+ezjXCbYIg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M4X8bGnk352HdGnDorp2q1THtw/2QZhA+EjqkhoSOPVuS9qKfMMb2xgFxbo3Cv7cDGBbpLxdCDvCY6C9dt4sjVLq0ACogt3B2sldtIBMcbiNoVDlB5yBa3wXwUb6GZC5OC6IcHZ/0f7EVeLw9iuXIU7jOCcgQM2VDl+/39q4eFm2LbMhK7sHO8xSMsmPr+NxM5ofbR+E+JLBeajbPd9BvpsNk//WuOjTnjBeWYLK9lx4+9GglLwaP/r8R+rFx0rodkr605voG9INNYvHlmbrNwRG/lnYWlhZxTpDbLlwKOt0olCEfXjQuicfITCgbENt7eS9zD4iHVggD/OlQlbAdQ==
  • Authentication-results-original: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Wei Liu <wl@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Wed, 09 Dec 2020 14:17:02 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHWwayh7DilyZtY2UyuPRFMdOVH76nu6FSA
  • Thread-topic: [PATCH v3 5/8] lib: move init_constructors()

Hi Jan,


> On 23 Nov 2020, at 15:22, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> ... into its own CU, for being unrelated to other things in
> common/lib.c.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

Cheers
Bertrand

> ---
> 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 <xen/lib.h>
> #include <xen/types.h>
> -#include <xen/init.h>
> #include <asm/byteorder.h>
> 
> /*
> @@ -423,19 +422,6 @@ uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c)
> #endif
> }
> 
> -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 = __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) != 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) += x86/
> 
> +lib-y += ctors.o
> lib-y += ctype.o
> lib-y += list-sort.o
> lib-y += 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 <xen/init.h>
> +#include <xen/lib.h>
> +
> +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 = __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) != sizeof(ssize_t));
> +}
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-file-style: "BSD"
> + * c-basic-offset: 4
> + * tab-width: 4
> + * indent-tabs-mode: nil
> + * End:
> + */
> 
> 




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.