40,6 → 40,12 |
(c)->tls = (sysarg_t) (ptls); |
#endif /* context_set */ |
|
typedef enum { |
PS_TO_MANAGER, |
PS_FROM_MANAGER, |
PS_PREEMPT |
} pschange_type; |
|
typedef sysarg_t pstid_t; |
|
struct psthread_data { |
61,10 → 67,17 |
extern void context_restore(context_t *c) __attribute__ ((noreturn)); |
|
pstid_t psthread_create(int (*func)(void *), void *arg); |
int psthread_schedule_next(void); |
int psthread_join(pstid_t psthrid); |
psthread_data_t * psthread_setup(tcb_t *tcb); |
psthread_data_t * psthread_setup(void); |
void psthread_teardown(psthread_data_t *pt); |
int psthread_schedule_next_adv(pschange_type ctype); |
void psthread_add_ready(pstid_t ptid); |
void psthread_add_manager(pstid_t psthrid); |
void psthread_remove_manager(void); |
|
static inline int psthread_schedule_next() { |
return psthread_schedule_next_adv(PS_PREEMPT); |
} |
|
|
#endif |