summaryrefslogtreecommitdiff
path: root/debian/patches
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2015-09-08 16:52:15 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2015-09-08 16:52:15 +0200
commita6cec708bcc74656b3d688d39b23a49ade260628 (patch)
tree9d3c2b421a9e3e7b35e00499bdb05c007ae2c8bd /debian/patches
parentfe79bbddd41a9a56efc7254366cae987e897221d (diff)
add patch series
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/series4
-rw-r--r--debian/patches/try-fence0001-libshouldbeinlibc-maptime-use-memory-fences.patch27
-rw-r--r--debian/patches/try-fence0002-libshouldbeinlibc-maptime-provide-a-mapped-time-sour.patch59
-rw-r--r--debian/patches/try-fence0003-pflocal-avoid-nested-function.patch45
-rw-r--r--debian/patches/try-fence0004-libshouldbeinlibc-maptime-provide-maptime_read_time_.patch51
5 files changed, 186 insertions, 0 deletions
diff --git a/debian/patches/series b/debian/patches/series
index 0f458f68..5520dda2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -70,3 +70,7 @@ introspection0005-libdiskfs-annotate-objects-managed-by-libports.patch
introspection0006-libpager-annotate-objects-managed-by-libports.patch
introspection0007-ext2fs-annotate-objects-managed-by-libports.patch
introspection0008-utils-rpctrace-support-attaching-to-servers.patch
+try-fence0001-libshouldbeinlibc-maptime-use-memory-fences.patch
+try-fence0002-libshouldbeinlibc-maptime-provide-a-mapped-time-sour.patch
+try-fence0003-pflocal-avoid-nested-function.patch
+try-fence0004-libshouldbeinlibc-maptime-provide-maptime_read_time_.patch
diff --git a/debian/patches/try-fence0001-libshouldbeinlibc-maptime-use-memory-fences.patch b/debian/patches/try-fence0001-libshouldbeinlibc-maptime-use-memory-fences.patch
new file mode 100644
index 00000000..43efaea9
--- /dev/null
+++ b/debian/patches/try-fence0001-libshouldbeinlibc-maptime-use-memory-fences.patch
@@ -0,0 +1,27 @@
+From 2bb74c0c114d8a2b259fa3ec1880e471df39ad9c Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Tue, 8 Sep 2015 12:37:08 +0200
+Subject: [PATCH hurd 1/4] libshouldbeinlibc/maptime: use memory fences
+
+* libshouldbeinlibc/maptime.h (maptime_read): Use memory fences.
+---
+ libshouldbeinlibc/maptime.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/libshouldbeinlibc/maptime.h b/libshouldbeinlibc/maptime.h
+index 947ad64..04ce035 100644
+--- a/libshouldbeinlibc/maptime.h
++++ b/libshouldbeinlibc/maptime.h
+@@ -51,7 +51,9 @@ maptime_read (volatile struct mapped_time_value *mtime, struct timeval *tv)
+ do
+ {
+ tv->tv_sec = mtime->seconds;
++ __sync_synchronize ();
+ tv->tv_usec = mtime->microseconds;
++ __sync_synchronize ();
+ }
+ while (tv->tv_sec != mtime->check_seconds);
+ }
+--
+2.1.4
+
diff --git a/debian/patches/try-fence0002-libshouldbeinlibc-maptime-provide-a-mapped-time-sour.patch b/debian/patches/try-fence0002-libshouldbeinlibc-maptime-provide-a-mapped-time-sour.patch
new file mode 100644
index 00000000..5f8af97f
--- /dev/null
+++ b/debian/patches/try-fence0002-libshouldbeinlibc-maptime-provide-a-mapped-time-sour.patch
@@ -0,0 +1,59 @@
+From ed70f50b42f5f3e6e9f7af4fce9174df619a269a Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Tue, 8 Sep 2015 14:25:44 +0200
+Subject: [PATCH hurd 2/4] libshouldbeinlibc/maptime: provide a mapped time
+ source
+
+Automatically map an appropriate time device. I don't see any need to
+customize this process, so we might as well just use the default one
+everywhere.
+
+* libshouldbeinlibc/maptime.c (maptime_default_mtime): New variable.
+(maptime_init): New function that initializes `maptime_default_mtime'
+at load time.
+* libshouldbeinlibc/maptime.h (maptime_default_mtime): New declaration.
+---
+ libshouldbeinlibc/maptime.c | 13 +++++++++++++
+ libshouldbeinlibc/maptime.h | 2 ++
+ 2 files changed, 15 insertions(+)
+
+diff --git a/libshouldbeinlibc/maptime.c b/libshouldbeinlibc/maptime.c
+index f0b69db..1e300d6 100644
+--- a/libshouldbeinlibc/maptime.c
++++ b/libshouldbeinlibc/maptime.c
+@@ -24,6 +24,19 @@
+
+ #include "maptime.h"
+
++volatile struct mapped_time_value *maptime_default_mtime;
++
++/* Initialize maptime_default_mtime. Try to use the Hurd device
++ first, fall back to using the Mach device. */
++static void __attribute__((__constructor__))
++maptime_init (void)
++{
++ error_t err;
++ err = maptime_map (0, NULL, &maptime_default_mtime);
++ if (err)
++ maptime_map (1, NULL, &maptime_default_mtime);
++}
++
+ /* Return the mach mapped time page in MTIME. If USE_MACH_DEV is false, then
+ the hurd time device DEV_NAME, or "/dev/time" if DEV_NAME is 0, is
+ used. If USE_MACH_DEV is true, the mach device DEV_NAME, or "time" if
+diff --git a/libshouldbeinlibc/maptime.h b/libshouldbeinlibc/maptime.h
+index 04ce035..d5086b1 100644
+--- a/libshouldbeinlibc/maptime.h
++++ b/libshouldbeinlibc/maptime.h
+@@ -32,6 +32,8 @@
+ #define MAPTIME_EI __extern_inline
+ #endif
+
++extern volatile struct mapped_time_value *maptime_default_mtime;
++
+ /* Return the mach mapped time page in MTIME. If USE_MACH_DEV is false, then
+ the hurd time device DEV_NAME, or "/dev/time" if DEV_NAME is 0, is
+ used. If USE_MACH_DEV is true, the mach device DEV_NAME, or "time" if
+--
+2.1.4
+
diff --git a/debian/patches/try-fence0003-pflocal-avoid-nested-function.patch b/debian/patches/try-fence0003-pflocal-avoid-nested-function.patch
new file mode 100644
index 00000000..aa959a29
--- /dev/null
+++ b/debian/patches/try-fence0003-pflocal-avoid-nested-function.patch
@@ -0,0 +1,45 @@
+From a009c940372d3b4fc6c46fb36077945dccb7d3b1 Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Tue, 8 Sep 2015 14:41:39 +0200
+Subject: [PATCH hurd 3/4] pflocal: avoid nested function
+
+* pflocal/io.c (copy_time): Move function out of `S_io_stat', turning
+it into a static inline function.
+---
+ pflocal/io.c | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/pflocal/io.c b/pflocal/io.c
+index ee6fb84..38d6c1d 100644
+--- a/pflocal/io.c
++++ b/pflocal/io.c
+@@ -298,6 +298,13 @@ S_io_select_timeout (struct sock_user *user,
+ return io_select_common (user, reply, reply_type, &ts, select_type);
+ }
+
++static inline void
++copy_time (time_value_t *from, time_t *to_sec, long *to_nsec)
++{
++ *to_sec = from->seconds;
++ *to_nsec = from->microseconds * 1000;
++}
++
+ /* Return the current status of the object. Not all the fields of the
+ io_statuf_t are meaningful for all objects; however, the access and
+ modify times, the optimal IO size, and the fs type are meaningful
+@@ -308,12 +315,6 @@ S_io_stat (struct sock_user *user, struct stat *st)
+ struct sock *sock;
+ struct pipe *rpipe, *wpipe;
+
+- void copy_time (time_value_t *from, time_t *to_sec, long *to_nsec)
+- {
+- *to_sec = from->seconds;
+- *to_nsec = from->microseconds * 1000;
+- }
+-
+ if (!user)
+ return EOPNOTSUPP;
+
+--
+2.1.4
+
diff --git a/debian/patches/try-fence0004-libshouldbeinlibc-maptime-provide-maptime_read_time_.patch b/debian/patches/try-fence0004-libshouldbeinlibc-maptime-provide-maptime_read_time_.patch
new file mode 100644
index 00000000..45a0e49c
--- /dev/null
+++ b/debian/patches/try-fence0004-libshouldbeinlibc-maptime-provide-maptime_read_time_.patch
@@ -0,0 +1,51 @@
+From f4e247b06020b96d41088af4ed053b85bf2c350f Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Tue, 8 Sep 2015 15:16:16 +0200
+Subject: [PATCH hurd 4/4] libshouldbeinlibc/maptime: provide
+ `maptime_read_time_value'
+
+* libshouldbeinlibc/maptime.h (maptime_read_time_value): New
+declaration and definition of a variant of `maptime_read' that handles
+time_value_t.
+---
+ libshouldbeinlibc/maptime.h | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+diff --git a/libshouldbeinlibc/maptime.h b/libshouldbeinlibc/maptime.h
+index d5086b1..e2f9ce8 100644
+--- a/libshouldbeinlibc/maptime.h
++++ b/libshouldbeinlibc/maptime.h
+@@ -44,6 +44,8 @@ error_t maptime_map (int use_mach_dev, char *dev_name,
+
+ extern void maptime_read (volatile struct mapped_time_value *mtime, struct timeval *tv);
+
++extern void maptime_read_time_value (volatile struct mapped_time_value *mtime, struct time_value *t);
++
+ #if defined(__USE_EXTERN_INLINES) || defined(MAPTIME_DEFINE_EI)
+
+ /* Read the current time from MTIME into TV. This should be very fast. */
+@@ -60,6 +62,21 @@ maptime_read (volatile struct mapped_time_value *mtime, struct timeval *tv)
+ while (tv->tv_sec != mtime->check_seconds);
+ }
+
++/* Read the current time from MTIME into T. This should be very fast. */
++MAPTIME_EI void
++maptime_read_time_value (volatile struct mapped_time_value *mtime,
++ struct time_value *t)
++{
++ do
++ {
++ t->seconds = mtime->seconds;
++ __sync_synchronize ();
++ t->microseconds = mtime->microseconds;
++ __sync_synchronize ();
++ }
++ while (t->seconds != mtime->check_seconds);
++}
++
+ #endif /* Use extern inlines. */
+
+ #endif /* __MAPTIME_H__ */
+--
+2.1.4
+