[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[mig] 01/01: generate-inlines.patch: Upstream patch to inline demuxers.
From: |
Samuel Thibault |
Subject: |
[mig] 01/01: generate-inlines.patch: Upstream patch to inline demuxers. |
Date: |
Tue, 04 Feb 2014 17:22:36 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch master
in repository mig.
commit 0134c83c24ca0cb4fd5ef7632ac2ae6e3a2cc48c
Author: Samuel Thibault <address@hidden>
Date: Mon Feb 3 23:23:57 2014 +0000
generate-inlines.patch: Upstream patch to inline demuxers.
---
debian/changelog | 6 ++
debian/patches/generate-inlines.patch | 127 ++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 134 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 1ff2a2a..9468b6c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+mig (1.4-2) unstable; urgency=medium
+
+ * patches/generate-inlines.patch: Upstream patch to inline demuxers.
+
+ -- Samuel Thibault <address@hidden> Mon, 03 Feb 2014 23:14:00 +0000
+
mig (1.4-1) unstable; urgency=low
[ Samuel Thibault ]
diff --git a/debian/patches/generate-inlines.patch
b/debian/patches/generate-inlines.patch
new file mode 100644
index 0000000..522f3cd
--- /dev/null
+++ b/debian/patches/generate-inlines.patch
@@ -0,0 +1,127 @@
+commit b39ae10e7d9c9db61822fe48585dbc2fdbbcc5d2
+Author: Justus Winter <address@hidden>
+Date: Sun Dec 1 16:28:44 2013 +0100
+
+ Move the generation of x_server_routine function into a function
+
+ * server.c (WriteSubsystemServerRoutine): New function.
+ (WriteEpilog): Adjust accordingly.
+ * write.h (WriteSubsystemServerRoutine): New declaration.
+
+diff --git a/server.c b/server.c
+index 793b9fc..6a35607 100644
+--- a/server.c
++++ b/server.c
+@@ -133,6 +133,26 @@ WriteArrayEntries(FILE *file, const statement_t *stats)
+ fprintf(file, "\t\t\t0,\n");
+ }
+
++void
++WriteSubsystemServerRoutine(FILE *file, const char *typeModifier)
++{
++ fprintf(file, "%s mig_routine_t %s_routine\n", typeModifier,
++ ServerDemux);
++ fprintf(file, "\t(const mach_msg_header_t *InHeadP)\n");
++
++ fprintf(file, "{\n");
++ fprintf(file, "\tint msgh_id;\n");
++ fprintf(file, "\n");
++ fprintf(file, "\tmsgh_id = InHeadP->msgh_id - %d;\n", SubsystemBase);
++ fprintf(file, "\n");
++ fprintf(file, "\tif ((msgh_id > %d) || (msgh_id < 0))\n",
++ rtNumber - 1);
++ fprintf(file, "\t\treturn 0;\n");
++ fprintf(file, "\n");
++ fprintf(file, "\treturn %s_routines[msgh_id];\n", ServerDemux);
++ fprintf(file, "}\n");
++}
++
+ static void
+ WriteEpilog(FILE *file, const statement_t *stats)
+ {
+@@ -199,20 +219,7 @@ WriteEpilog(FILE *file, const statement_t *stats)
+ /*
+ * Then, the <subsystem>_server_routine routine
+ */
+- fprintf(file, "mig_external mig_routine_t %s_routine\n", ServerDemux);
+- fprintf(file, "\t(const mach_msg_header_t *InHeadP)\n");
+-
+- fprintf(file, "{\n");
+- fprintf(file, "\tint msgh_id;\n");
+- fprintf(file, "\n");
+- fprintf(file, "\tmsgh_id = InHeadP->msgh_id - %d;\n", SubsystemBase);
+- fprintf(file, "\n");
+- fprintf(file, "\tif ((msgh_id > %d) || (msgh_id < 0))\n",
+- rtNumber - 1);
+- fprintf(file, "\t\treturn 0;\n");
+- fprintf(file, "\n");
+- fprintf(file, "\treturn %s_routines[msgh_id];\n", ServerDemux);
+- fprintf(file, "}\n");
++ WriteSubsystemServerRoutine(file, "mig_external");
+ fprintf(file, "\n");
+
+ /* symtab */
+diff --git a/write.h b/write.h
+index b5180df..4d24e63 100644
+--- a/write.h
++++ b/write.h
+@@ -38,5 +38,6 @@ extern void WriteUser(FILE *file, const statement_t *stats);
+ extern void WriteUserIndividual(const statement_t *stats);
+ extern void WriteServer(FILE *file, const statement_t *stats);
+ extern void WriteRoutineList(FILE *file, const statement_t *stats);
++extern void WriteSubsystemServerRoutine(FILE *file, const char *typeModifier);
+
+ #endif /* _WRITE_H */
+
+commit 5e3ef5153fe6aa2190ffa185009fa45e3549469d
+Author: Justus Winter <address@hidden>
+Date: Sun Dec 1 17:02:28 2013 +0100
+
+ Generate a x_server_routine in the sheader so it can be inlined
+
+ * header.c (WriteServerHeader): Emit a x_server_routine that can be
+ inlined.
+ * server.c (WriteEpilog): Export the x_routines array so it can be
+ used from the inlined x_server_routine.
+
+diff --git a/header.c b/header.c
+index 1bc570f..23e5686 100644
+--- a/header.c
++++ b/header.c
+@@ -154,6 +154,8 @@ WriteServerHeader(FILE *file, const statement_t *stats)
+ const char *protect = strconcat(SubsystemName, "_server_");
+
+ WriteProlog(file, protect);
++ fprintf(file, "#include <mach/mig_errors.h>\n"); /* For mig_routine_t. */
++
+ for (stat = stats; stat != stNULL; stat = stat->stNext)
+ switch (stat->stKind)
+ {
+@@ -170,6 +172,14 @@ WriteServerHeader(FILE *file, const statement_t *stats)
+ fatal("WriteServerHeader(): bad statement_kind_t (%d)",
+ (int) stat->stKind);
+ }
++ fprintf(file, "\n");
++
++ /*
++ * Include the x_server_routine function so it can be inlined.
++ */
++ fprintf(file, "extern mig_routine_t %s_routines[];\n", ServerDemux);
++ WriteSubsystemServerRoutine(file, "extern inline");
++
+ WriteEpilog(file, protect);
+ }
+
+diff --git a/server.c b/server.c
+index 6a35607..129cec3 100644
+--- a/server.c
++++ b/server.c
+@@ -161,7 +161,7 @@ WriteEpilog(FILE *file, const statement_t *stats)
+ /*
+ * First, the symbol table
+ */
+- fprintf(file, "static mig_routine_t %s_routines[] = {\n", ServerDemux);
++ fprintf(file, "mig_routine_t %s_routines[] = {\n", ServerDemux);
+
+ WriteArrayEntries(file, stats);
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..610714f
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+generate-inlines.patch
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/mig.git