diff options
Diffstat (limited to 'debian/patches/clock_boottime0001-include-provide-time-value-substraction.patch')
-rw-r--r-- | debian/patches/clock_boottime0001-include-provide-time-value-substraction.patch | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/debian/patches/clock_boottime0001-include-provide-time-value-substraction.patch b/debian/patches/clock_boottime0001-include-provide-time-value-substraction.patch deleted file mode 100644 index f65ae27..0000000 --- a/debian/patches/clock_boottime0001-include-provide-time-value-substraction.patch +++ /dev/null @@ -1,70 +0,0 @@ -From bb23879791cf015f17cb50b6443bac44b1cfbc72 Mon Sep 17 00:00:00 2001 -From: Justus Winter <4winter@informatik.uni-hamburg.de> -Date: Sat, 25 Jul 2015 20:04:27 +0200 -Subject: [PATCH gnumach 1/2] include: provide time-value substraction - -* include/mach/time_value.h (time_value_assert): New macro to assert -that the given value is well-formed. -(time_value_add_usec): Use the new macro. -(time_value_sub_usec): New macro. -(time_value_add): Use `time_value_add_usec'. -(time_value_sub_usec): New macro. ---- - include/mach/time_value.h | 31 ++++++++++++++++++++++++------- - 1 file changed, 24 insertions(+), 7 deletions(-) - -diff --git a/include/mach/time_value.h b/include/mach/time_value.h -index 2a2f091..61be581 100644 ---- a/include/mach/time_value.h -+++ b/include/mach/time_value.h -@@ -45,23 +45,40 @@ typedef struct time_value time_value_t; - */ - #define TIME_MICROS_MAX (1000000) - -+#define time_value_assert(val) \ -+ assert(0 <= (val)->microseconds && (val)->microseconds < TIME_MICROS_MAX); -+ - #define time_value_add_usec(val, micros) { \ -+ time_value_assert(val); \ - if (((val)->microseconds += (micros)) \ - >= TIME_MICROS_MAX) { \ - (val)->microseconds -= TIME_MICROS_MAX; \ - (val)->seconds++; \ - } \ -+ time_value_assert(val); \ - } - --#define time_value_add(result, addend) { \ -- (result)->microseconds += (addend)->microseconds; \ -- (result)->seconds += (addend)->seconds; \ -- if ((result)->microseconds >= TIME_MICROS_MAX) { \ -- (result)->microseconds -= TIME_MICROS_MAX; \ -- (result)->seconds++; \ -- } \ -+#define time_value_sub_usec(val, micros) { \ -+ time_value_assert(val); \ -+ if (((val)->microseconds -= (micros)) < 0) { \ -+ (val)->microseconds += TIME_MICROS_MAX; \ -+ (val)->seconds--; \ -+ } \ -+ time_value_assert(val); \ - } - -+#define time_value_add(result, addend) { \ -+ time_value_assert(addend); \ -+ (result)->seconds += (addend)->seconds; \ -+ time_value_add_usec(result, (addend)->microseconds); \ -+ } -+ -+#define time_value_sub(result, subtrahend) { \ -+ time_value_assert(subtrahend); \ -+ (result)->seconds -= (subtrahend)->seconds; \ -+ time_value_sub_usec(result, (subtrahend)->microseconds); \ -+ } -+ - /* - * Time value available through the mapped-time interface. - * Read this mapped value with --- -2.1.4 - |