diff options
| author | Marcel Moolenaar <marcel@FreeBSD.org> | 2003-06-26 03:55:58 +0000 |
|---|---|---|
| committer | Marcel Moolenaar <marcel@FreeBSD.org> | 2003-06-26 03:55:58 +0000 |
| commit | 6351f43f14ec7bf0787bbeae65eafb98b1399f39 (patch) | |
| tree | b0fde455c2721227a455a501f893666d59d73cf2 /lib/libpthread | |
| parent | 6833c6add5587c33620647007aa930ff25a82cf8 (diff) | |
Notes
Diffstat (limited to 'lib/libpthread')
| -rw-r--r-- | lib/libpthread/arch/ia64/include/pthread_md.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/libpthread/arch/ia64/include/pthread_md.h b/lib/libpthread/arch/ia64/include/pthread_md.h index 096543589fac..94e05a0b4f57 100644 --- a/lib/libpthread/arch/ia64/include/pthread_md.h +++ b/lib/libpthread/arch/ia64/include/pthread_md.h @@ -41,4 +41,34 @@ struct ksd { int ksd_size; }; +void _ia64_enter_uts(kse_func_t uts, struct kse_mailbox *km, void *stack, + size_t stacksz); +int _ia64_restore_context(mcontext_t *mc, intptr_t val, intptr_t *loc); +int _ia64_save_context(mcontext_t *mc); + +static __inline int +_thread_enter_uts(struct kse_thr_mailbox *tm, struct kse_mailbox *km) +{ + if (tm == NULL) + return (-1); + if (!_ia64_save_context(&tm->tm_context.uc_mcontext)) { + _ia64_enter_uts(km->km_func, km, km->km_stack.ss_sp, + km->km_stack.ss_size); + /* We should not reach here. */ + return (-1); + } + return (0); +} + +static __inline int +_thread_switch(struct kse_thr_mailbox *tm, struct kse_thr_mailbox **thrp) +{ + if (tm == NULL) + return (-1); + _ia64_restore_context(&tm->tm_context.uc_mcontext, (intptr_t)tm, + (intptr_t*)thrp); + /* We should not reach here. */ + return (-1); +} + #endif /* _PTHREAD_MD_H_ */ |
