summaryrefslogtreecommitdiff
path: root/libl4/l4
diff options
context:
space:
mode:
authormarcus <marcus>2004-10-06 19:05:42 +0000
committermarcus <marcus>2004-10-06 19:05:42 +0000
commitc8d6d0e404136b361a8d727cdaa9e79330497d1a (patch)
tree8464e8625ce4710c059e51866f0b9dd5746642ed /libl4/l4
parent20aed9ff71432b08ec82fd81cfe5f1467135bec1 (diff)
2004-10-06 Marcus Brinkmann <marcus@gnu.org>
* l4/compat/schedule.h (_L4_CLOCK_OP): Make CLOCK argument a reference. (_L4_CLOCK_OP) [__cplusplus]: Add another instance of the macro to define operator+(L4_Clock_t&, L4_Clock_t&) and operator-(L4_Clock_t&, L4_Clock_t&). (_L4_CLOCK_OP) [!__cplusplus]: Add another instance of the macro to define L4_ClockAdd and L4_ClockSub. * l4/thread.h (_L4_user_defined_handle_of, _L4_pager_of, __L4_STOP): Add the _L4_XCHG_REGS_DELIVER bit to CONTROL. * l4/syscall.h (_L4_XCHG_REGS_DELIVER): New macro.
Diffstat (limited to 'libl4/l4')
-rw-r--r--libl4/l4/compat/schedule.h36
-rw-r--r--libl4/l4/syscall.h1
-rw-r--r--libl4/l4/thread.h6
3 files changed, 37 insertions, 6 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] */
diff --git a/libl4/l4/syscall.h b/libl4/l4/syscall.h
index e948395..86c6b09 100644
--- a/libl4/l4/syscall.h
+++ b/libl4/l4/syscall.h
@@ -44,6 +44,7 @@
#define _L4_XCHG_REGS_SET_USER_HANDLE _L4_WORD_C(0x0040)
#define _L4_XCHG_REGS_SET_PAGER _L4_WORD_C(0x0080)
#define _L4_XCHG_REGS_SET_HALT _L4_WORD_C(0x0100)
+#define _L4_XCHG_REGS_DELIVER _L4_WORD_C(0x0200)
/* Output. */
#define _L4_XCHG_REGS_HALTED _L4_WORD_C(0x01)
diff --git a/libl4/l4/thread.h b/libl4/l4/thread.h
index 819aa1f..73a0656 100644
--- a/libl4/l4/thread.h
+++ b/libl4/l4/thread.h
@@ -202,7 +202,7 @@ static inline _L4_word_t
_L4_attribute_always_inline
_L4_user_defined_handle_of (_L4_thread_id_t thread)
{
- _L4_word_t control = 0;
+ _L4_word_t control = _L4_XCHG_REGS_DELIVER;
_L4_word_t user_handle = 0;
_L4_word_t dummy = 0;
_L4_thread_id_t pager = _L4_nilthread;
@@ -231,7 +231,7 @@ static inline _L4_thread_id_t
_L4_attribute_always_inline
_L4_pager_of (_L4_thread_id_t thread)
{
- _L4_word_t control = 0;
+ _L4_word_t control = _L4_XCHG_REGS_DELIVER;
_L4_thread_id_t pager = _L4_nilthread;
_L4_word_t dummy = 0;
@@ -317,7 +317,7 @@ name ## _sp_ip_flags (_L4_thread_id_t thread, _L4_word_t *sp, \
_L4_word_t *ip, _L4_word_t *flags) \
{ \
_L4_word_t control = _L4_XCHG_REGS_SET_HALT | _L4_XCHG_REGS_HALT \
- | (extra_control); \
+ | _L4_XCHG_REGS_DELIVER | (extra_control); \
_L4_word_t dummy = 0; \
_L4_thread_id_t pager = _L4_nilthread; \
\