From: Jan Beulich <jbeulich@suse.com>
To: "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>, Julien Grall <julien@xen.org>,
Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
Anthony Perard <anthony.perard@citrix.com>
Subject: [PATCH v3 5/8] lib: move init_constructors()
Date: Mon, 23 Nov 2020 16:22:47 +0100 [thread overview]
Message-ID: <c67ca263-8a82-d0c8-e6e1-6afdeeb9df8c@suse.com> (raw)
In-Reply-To: <1a6bac6a-7d83-f5b6-c5b9-8b3b39824d40@suse.com>
... into its own CU, for being unrelated to other things in
common/lib.c.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
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:
+ */
next prev parent reply other threads:[~2020-11-23 15:23 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-23 15:16 [PATCH v3 0/8] xen: beginnings of moving library-like code into an archive Jan Beulich
2020-11-23 15:20 ` [PATCH v3 1/8] xen: fix build when $(obj-y) consists of just blanks Jan Beulich
2020-12-09 11:34 ` Bertrand Marquis
2020-12-09 17:40 ` Anthony PERARD
2020-12-10 10:21 ` Jan Beulich
2020-12-10 14:50 ` Anthony PERARD
2020-11-23 15:21 ` [PATCH v3 2/8] lib: collect library files in an archive Jan Beulich
2020-12-09 11:37 ` Bertrand Marquis
2020-12-09 14:42 ` Jan Beulich
2020-12-09 14:46 ` Bertrand Marquis
2020-12-10 14:47 ` Anthony PERARD
2020-12-11 10:00 ` Jan Beulich
2020-12-11 15:49 ` Anthony PERARD
2020-12-18 8:02 ` Ping: Arm: " Jan Beulich
2020-12-18 9:25 ` Julien Grall
2020-11-23 15:21 ` [PATCH v3 3/8] lib: move list sorting code Jan Beulich
2020-12-09 11:39 ` Bertrand Marquis
2020-11-23 15:22 ` [PATCH v3 4/8] lib: move parse_size_and_unit() Jan Beulich
2020-12-09 11:40 ` Bertrand Marquis
2020-11-23 15:22 ` Jan Beulich [this message]
2020-12-09 14:16 ` [PATCH v3 5/8] lib: move init_constructors() Bertrand Marquis
2020-11-23 15:23 ` [PATCH v3 6/8] lib: move rbtree code Jan Beulich
2020-12-09 14:18 ` Bertrand Marquis
2020-11-23 15:23 ` [PATCH v3 7/8] lib: move bsearch code Jan Beulich
2020-11-23 15:24 ` [PATCH v3 8/8] lib: move sort code Jan Beulich
2020-12-09 14:27 ` Bertrand Marquis
2020-12-04 11:43 ` [PATCH v3 0/8] xen: beginnings of moving library-like code into an archive Wei Liu
2020-12-09 11:33 ` Bertrand Marquis
2020-12-09 14:47 ` Jan Beulich
2020-12-09 14:51 ` Julien Grall
2020-12-09 14:56 ` Jan Beulich
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=c67ca263-8a82-d0c8-e6e1-6afdeeb9df8c@suse.com \
--to=jbeulich@suse.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@citrix.com \
--cc=iwj@xenproject.org \
--cc=julien@xen.org \
--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).