diff options
Diffstat (limited to 'libl4/l4/compat/schedule.h')
-rw-r--r-- | libl4/l4/compat/schedule.h | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/libl4/l4/compat/schedule.h b/libl4/l4/compat/schedule.h index a2664e7..ab959d5 100644 --- a/libl4/l4/compat/schedule.h +++ b/libl4/l4/compat/schedule.h @@ -41,7 +41,7 @@ typedef struct #define _L4_CLOCK_OP(op, type) \ static inline L4_Clock_t \ _L4_attribute_always_inline \ -operator ## op ## (const L4_Clock_t clock, const type usec) \ +operator ## op ## (const L4_Clock_t& clock, const type usec) \ { \ L4_Clock_t new_clock; \ new_clock.raw = clock.raw op usec; \ @@ -56,6 +56,21 @@ _L4_CLOCK_OP(-, L4_Word64_t) #define _L4_CLOCK_OP(op) \ +static inline L4_Clock_t \ +_L4_attribute_always_inline \ +operator ## op ## (const L4_Clock_t& clock1, const L4_Clock_t& clock2) \ +{ \ + L4_Clock_t new_clock; \ + new_clock.raw = clock1.raw op clock2.raw; \ + return new_clock; \ +} + +_L4_CLOCK_OP(+) +_L4_CLOCK_OP(-) +#undef _L4_CLOCK_OP + + +#define _L4_CLOCK_OP(op) \ static inline L4_Bool_t \ _L4_attribute_always_inline \ operator ## op ## (const L4_Clock_t& clock1, const L4_Clock_t& clock2) \ @@ -76,13 +91,28 @@ _L4_CLOCK_OP(!=) #define _L4_CLOCK_OP(name, op) \ static inline L4_Clock_t \ _L4_attribute_always_inline \ -L4_Clock ## name ## Usec (const L4_Clock_t clock, const L4_Word64_t usec) \ +L4_Clock ## name (const L4_Clock_t clock, const L4_Word64_t usec) \ { \ L4_Clock_t new_clock; \ new_clock.raw = clock.raw op usec; \ return new_clock; \ } +_L4_CLOCK_OP(AddUsec, +) +_L4_CLOCK_OP(SubUsec, -) +#undef _L4_CLOCK_OP + + +#define _L4_CLOCK_OP(name, op) \ +static inline L4_Clock_t \ +_L4_attribute_always_inline \ +L4_Clock ## name (const L4_Clock_t clock1, const L4_Clock_t clock2) \ +{ \ + L4_Clock_t new_clock; \ + new_clock.raw = clock1.raw op clock2.raw; \ + return new_clock; \ +} + _L4_CLOCK_OP(Add, +) _L4_CLOCK_OP(Sub, -) #undef _L4_CLOCK_OP @@ -395,7 +425,7 @@ L4_IsTimeNotEqual (const L4_Time_t l, const L4_Time_t r) return _L4_is_time_not_equal (l.raw, r.raw); } -#endif /* _cplusplus */ +#endif /* __cplusplus */ /* 3.4 ThreadSwitch [Systemcall] */ |