diff options
Diffstat (limited to 'libl4')
-rw-r--r-- | libl4/ChangeLog | 17 | ||||
-rw-r--r-- | libl4/README | 25 | ||||
-rw-r--r-- | libl4/l4/compat/schedule.h | 36 | ||||
-rw-r--r-- | libl4/l4/syscall.h | 1 | ||||
-rw-r--r-- | libl4/l4/thread.h | 6 |
5 files changed, 69 insertions, 16 deletions
diff --git a/libl4/ChangeLog b/libl4/ChangeLog index 91bab4b..63b4159 100644 --- a/libl4/ChangeLog +++ b/libl4/ChangeLog @@ -1,6 +1,19 @@ 2004-10-06 Marcus Brinkmann <marcus@gnu.org> - - * l4/compat/space.h (L4_FlushFpage) [!__cplusplus]: Rename to ... + + * 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. + + * l4/compat/space.h: Change all tests for _cplusplus to tests + for __cplusplus. + (L4_FlushFpage) [!__cplusplus]: Rename to ... (L4_FlushFpages) [!__cplusplus]: ... this. * l4/gnu/space.h (L4_FPAGE_READ_WRITE_ONLY): Define macro. diff --git a/libl4/README b/libl4/README index 766f562..f81b22d 100644 --- a/libl4/README +++ b/libl4/README @@ -132,12 +132,21 @@ powerpc needs to be tested and updated to latest API version TODO ---- -* Optimize l4_time_period for built-in constants. -* Implement l4_time_point. -* Implement l4_time_add, l4_time_sub, l4_time_add_usec, l4_time_sub_usec. -* Add l4_time_t period shift operators for fast exponential backoff +* Bugs +** Fix _L4_msg_get_string_item. +* Optimizations: +** l4_time_period for built-in constants. +** l4_exchange_register does not need to copy out return values if the + "deliver" bit is not set, this can usually be tested at compilation + time. Check if this is required or if gcc already optimizes that away. +* Implement: +** l4_time_point. +** Implement l4_time_add, l4_time_sub, l4_time_add_usec, l4_time_sub_usec. +* Extend: +** Add l4_time_t period shift operators for fast exponential backoff (ie, just increase the exponent). Use in __pthread_spin_lock, for example. -* Sanitize the error handling. The GNU interface should return proper errno - values for all failures. ExchangeRegister can fail, so all functions using - it must also return an error value (l4_start_sp_ip etc). -* Fix _L4_msg_get_string_item. +** Sanitize the error handling. The GNU interface should return + proper errno values for all failures. ExchangeRegister can fail, + so all functions using it should also return an error value + (l4_start_sp_ip etc) (currently result is undefined). + 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; \ \ |