xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien@xen.org>
To: Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <iwj@xenproject.org>, Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH v2 1/8] lib: split _ctype[] into its own object, under lib/
Date: Wed, 18 Nov 2020 17:00:15 +0000	[thread overview]
Message-ID: <0bdd27a2-f770-260b-298b-bceba9b28adc@xen.org> (raw)
In-Reply-To: <8bf44bbd-8c39-7ab1-3ccb-52bf3744592b@suse.com>

Hi Jan,

On 23/10/2020 11:16, Jan Beulich wrote:
> This is, besides for tidying, in preparation of then starting to use an
> archive rather than an object file for generic library code which
> arch-es (or even specific configurations within a single arch) may or
> may not need.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Julien Grall <jgrall@amazon.com>

Cheers,

> ---
>   xen/Makefile     |  3 ++-
>   xen/Rules.mk     |  2 +-
>   xen/common/lib.c | 29 -----------------------------
>   xen/lib/Makefile |  1 +
>   xen/lib/ctype.c  | 38 ++++++++++++++++++++++++++++++++++++++
>   5 files changed, 42 insertions(+), 31 deletions(-)
>   create mode 100644 xen/lib/ctype.c
> 
> diff --git a/xen/Makefile b/xen/Makefile
> index bf0c804d4352..73bdc326c549 100644
> --- a/xen/Makefile
> +++ b/xen/Makefile
> @@ -331,6 +331,7 @@ _clean: delete-unfresh-files
>   	$(MAKE) $(clean) include
>   	$(MAKE) $(clean) common
>   	$(MAKE) $(clean) drivers
> +	$(MAKE) $(clean) lib
>   	$(MAKE) $(clean) xsm
>   	$(MAKE) $(clean) crypto
>   	$(MAKE) $(clean) arch/arm
> @@ -414,7 +415,7 @@ include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
>   	  echo ""; \
>   	  echo "#endif") <$< >$@
>   
> -SUBDIRS = xsm arch/$(TARGET_ARCH) common drivers test
> +SUBDIRS = xsm arch/$(TARGET_ARCH) common drivers lib test
>   define all_sources
>       ( find include/asm-$(TARGET_ARCH) -name '*.h' -print; \
>         find include -name 'asm-*' -prune -o -name '*.h' -print; \
> diff --git a/xen/Rules.mk b/xen/Rules.mk
> index 891c94e6ad00..333e19bec343 100644
> --- a/xen/Rules.mk
> +++ b/xen/Rules.mk
> @@ -36,7 +36,7 @@ TARGET := $(BASEDIR)/xen
>   # Note that link order matters!
>   ALL_OBJS-y               += $(BASEDIR)/common/built_in.o
>   ALL_OBJS-y               += $(BASEDIR)/drivers/built_in.o
> -ALL_OBJS-$(CONFIG_X86)   += $(BASEDIR)/lib/built_in.o
> +ALL_OBJS-y               += $(BASEDIR)/lib/built_in.o
>   ALL_OBJS-y               += $(BASEDIR)/xsm/built_in.o
>   ALL_OBJS-y               += $(BASEDIR)/arch/$(TARGET_ARCH)/built_in.o
>   ALL_OBJS-$(CONFIG_CRYPTO)   += $(BASEDIR)/crypto/built_in.o
> diff --git a/xen/common/lib.c b/xen/common/lib.c
> index b2b799da44c5..a224efa8f6e8 100644
> --- a/xen/common/lib.c
> +++ b/xen/common/lib.c
> @@ -1,37 +1,8 @@
> -
> -#include <xen/ctype.h>
>   #include <xen/lib.h>
>   #include <xen/types.h>
>   #include <xen/init.h>
>   #include <asm/byteorder.h>
>   
> -/* for ctype.h */
> -const unsigned char _ctype[] = {
> -    _C,_C,_C,_C,_C,_C,_C,_C,                        /* 0-7 */
> -    _C,_C|_S,_C|_S,_C|_S,_C|_S,_C|_S,_C,_C,         /* 8-15 */
> -    _C,_C,_C,_C,_C,_C,_C,_C,                        /* 16-23 */
> -    _C,_C,_C,_C,_C,_C,_C,_C,                        /* 24-31 */
> -    _S|_SP,_P,_P,_P,_P,_P,_P,_P,                    /* 32-39 */
> -    _P,_P,_P,_P,_P,_P,_P,_P,                        /* 40-47 */
> -    _D,_D,_D,_D,_D,_D,_D,_D,                        /* 48-55 */
> -    _D,_D,_P,_P,_P,_P,_P,_P,                        /* 56-63 */
> -    _P,_U|_X,_U|_X,_U|_X,_U|_X,_U|_X,_U|_X,_U,      /* 64-71 */
> -    _U,_U,_U,_U,_U,_U,_U,_U,                        /* 72-79 */
> -    _U,_U,_U,_U,_U,_U,_U,_U,                        /* 80-87 */
> -    _U,_U,_U,_P,_P,_P,_P,_P,                        /* 88-95 */
> -    _P,_L|_X,_L|_X,_L|_X,_L|_X,_L|_X,_L|_X,_L,      /* 96-103 */
> -    _L,_L,_L,_L,_L,_L,_L,_L,                        /* 104-111 */
> -    _L,_L,_L,_L,_L,_L,_L,_L,                        /* 112-119 */
> -    _L,_L,_L,_P,_P,_P,_P,_C,                        /* 120-127 */
> -    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,                /* 128-143 */
> -    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,                /* 144-159 */
> -    _S|_SP,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,   /* 160-175 */
> -    _P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,       /* 176-191 */
> -    _U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,       /* 192-207 */
> -    _U,_U,_U,_U,_U,_U,_U,_P,_U,_U,_U,_U,_U,_U,_U,_L,       /* 208-223 */
> -    _L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,       /* 224-239 */
> -    _L,_L,_L,_L,_L,_L,_L,_P,_L,_L,_L,_L,_L,_L,_L,_L};      /* 240-255 */
> -
>   /*
>    * A couple of 64 bit operations ported from FreeBSD.
>    * The code within the '#if BITS_PER_LONG == 32' block below, and no other
> diff --git a/xen/lib/Makefile b/xen/lib/Makefile
> index 7019ca00e8fd..53b1da025e0d 100644
> --- a/xen/lib/Makefile
> +++ b/xen/lib/Makefile
> @@ -1 +1,2 @@
> +obj-y += ctype.o
>   obj-$(CONFIG_X86) += x86/
> diff --git a/xen/lib/ctype.c b/xen/lib/ctype.c
> new file mode 100644
> index 000000000000..7b233a335fdf
> --- /dev/null
> +++ b/xen/lib/ctype.c
> @@ -0,0 +1,38 @@
> +#include <xen/ctype.h>
> +
> +/* for ctype.h */
> +const unsigned char _ctype[] = {
> +    _C,_C,_C,_C,_C,_C,_C,_C,                        /* 0-7 */
> +    _C,_C|_S,_C|_S,_C|_S,_C|_S,_C|_S,_C,_C,         /* 8-15 */
> +    _C,_C,_C,_C,_C,_C,_C,_C,                        /* 16-23 */
> +    _C,_C,_C,_C,_C,_C,_C,_C,                        /* 24-31 */
> +    _S|_SP,_P,_P,_P,_P,_P,_P,_P,                    /* 32-39 */
> +    _P,_P,_P,_P,_P,_P,_P,_P,                        /* 40-47 */
> +    _D,_D,_D,_D,_D,_D,_D,_D,                        /* 48-55 */
> +    _D,_D,_P,_P,_P,_P,_P,_P,                        /* 56-63 */
> +    _P,_U|_X,_U|_X,_U|_X,_U|_X,_U|_X,_U|_X,_U,      /* 64-71 */
> +    _U,_U,_U,_U,_U,_U,_U,_U,                        /* 72-79 */
> +    _U,_U,_U,_U,_U,_U,_U,_U,                        /* 80-87 */
> +    _U,_U,_U,_P,_P,_P,_P,_P,                        /* 88-95 */
> +    _P,_L|_X,_L|_X,_L|_X,_L|_X,_L|_X,_L|_X,_L,      /* 96-103 */
> +    _L,_L,_L,_L,_L,_L,_L,_L,                        /* 104-111 */
> +    _L,_L,_L,_L,_L,_L,_L,_L,                        /* 112-119 */
> +    _L,_L,_L,_P,_P,_P,_P,_C,                        /* 120-127 */
> +    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,                /* 128-143 */
> +    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,                /* 144-159 */
> +    _S|_SP,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,   /* 160-175 */
> +    _P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,       /* 176-191 */
> +    _U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,       /* 192-207 */
> +    _U,_U,_U,_U,_U,_U,_U,_P,_U,_U,_U,_U,_U,_U,_U,_L,       /* 208-223 */
> +    _L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,       /* 224-239 */
> +    _L,_L,_L,_L,_L,_L,_L,_P,_L,_L,_L,_L,_L,_L,_L,_L};      /* 240-255 */
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-file-style: "BSD"
> + * c-basic-offset: 4
> + * tab-width: 4
> + * indent-tabs-mode: nil
> + * End:
> + */
> 

-- 
Julien Grall


  reply	other threads:[~2020-11-18 17:00 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-23 10:15 [PATCH v2 0/8] xen: beginnings of moving library-like code into an archive Jan Beulich
2020-10-23 10:16 ` [PATCH v2 1/8] lib: split _ctype[] into its own object, under lib/ Jan Beulich
2020-11-18 17:00   ` Julien Grall [this message]
2020-10-23 10:17 ` [PATCH v2 2/8] lib: collect library files in an archive Jan Beulich
2020-11-18 17:06   ` Julien Grall
2020-11-19 10:15     ` Jan Beulich
2020-11-18 17:31   ` Julien Grall
2020-11-19 10:44     ` Jan Beulich
2020-10-23 10:17 ` [PATCH v2 3/8] lib: move list sorting code Jan Beulich
2020-11-18 17:38   ` Julien Grall
2020-11-19 10:10     ` Jan Beulich
2020-10-23 10:17 ` [PATCH v2 4/8] lib: move parse_size_and_unit() Jan Beulich
2020-11-18 17:39   ` Julien Grall
2020-11-18 17:57     ` Julien Grall
2020-11-24  0:58   ` Andrew Cooper
2020-11-24  9:30     ` Jan Beulich
2020-10-23 10:18 ` [PATCH v2 5/8] lib: move init_constructors() Jan Beulich
2020-11-18 17:42   ` Julien Grall
2020-10-23 10:18 ` [PATCH v2 6/8] lib: move rbtree code Jan Beulich
2020-11-18 17:46   ` Julien Grall
2020-11-19 10:23     ` Jan Beulich
2020-10-23 10:19 ` [PATCH v2 7/8] lib: move bsearch code Jan Beulich
2020-11-18 18:09   ` Julien Grall
2020-11-19 10:27     ` Jan Beulich
2020-11-23 22:49       ` Julien Grall
2020-11-24  0:40         ` Andrew Cooper
2020-11-24  9:39           ` Jan Beulich
2020-11-24 16:57           ` Julien Grall
2020-12-07 10:23             ` Jan Beulich
2020-12-09  9:41               ` Julien Grall
2020-12-09 14:27                 ` Bertrand Marquis
2020-12-09 14:54                   ` Jan Beulich
2020-12-09 15:06                     ` Bertrand Marquis
2020-10-23 10:19 ` [PATCH v2 8/8] lib: move sort code Jan Beulich
2020-11-18 18:10   ` Julien Grall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0bdd27a2-f770-260b-298b-bceba9b28adc@xen.org \
    --to=julien@xen.org \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=jbeulich@suse.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).