- Timestamp:
- 2006-03-24T11:05:41Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4f2c821
- Parents:
- a71d9af9
- Location:
- libc
- Files:
-
- 5 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
libc/arch/ia64/Makefile.inc
ra71d9af9 r86d05fae 36 36 AFLAGS += 37 37 38 ARCH_SOURCES += arch/$(ARCH)/src/syscall.S 38 ARCH_SOURCES += arch/$(ARCH)/src/syscall.S \ 39 arch/$(ARCH)/src/psthread.S -
libc/generic/psthread.c
ra71d9af9 r86d05fae 33 33 #include <thread.h> 34 34 #include <stdio.h> 35 #include <kernel/arch/faddr.h> 35 36 36 37 static LIST_INITIALIZE(ready_list); 38 39 static void ps_exit(void) __attribute__ ((noinline)); 37 40 38 41 /** Function to preempt to other thread without adding 39 42 * currently running thread to runqueue 40 43 */ 41 staticvoid ps_exit(void)44 void ps_exit(void) 42 45 { 43 46 psthread_data_t *pt; … … 88 91 int ps_join(pstid_t psthrid) 89 92 { 90 psthread_data_t *pt, *mypt;91 int retval;93 volatile psthread_data_t *pt, *mypt; 94 volatile int retval; 92 95 93 96 /* Handle psthrid = Kernel address -> it is wait for call */ … … 97 100 if (!pt->finished) { 98 101 mypt = __tls_get(); 99 if (context_save(& mypt->ctx)) {100 pt->waiter = mypt;102 if (context_save(&((psthread_data_t *) mypt)->ctx)) { 103 pt->waiter = (psthread_data_t *) mypt; 101 104 ps_exit(); 102 105 } … … 105 108 106 109 free(pt->stack); 107 __free_tls( pt);110 __free_tls((psthread_data_t *) pt); 108 111 109 112 return retval; … … 131 134 132 135 context_save(&pt->ctx); 133 context_set(&pt->ctx, psthread_main, pt->stack, getpagesize(), pt);136 context_set(&pt->ctx, FADDR(psthread_main), pt->stack, getpagesize(), pt); 134 137 135 138 list_append(&pt->list, &ready_list); -
libc/include/psthread.h
ra71d9af9 r86d05fae 34 34 35 35 #ifndef context_set 36 #define context_set(c, _pc, stack, size, ptls) \37 (c)->pc = (sysarg_t) (_pc); \38 (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \36 #define context_set(c, _pc, stack, size, ptls) \ 37 (c)->pc = (sysarg_t) (_pc); \ 38 (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \ 39 39 (c)->tls = (sysarg_t) (ptls); 40 40 #endif /* context_set */ … … 43 43 44 44 struct psthread_data { 45 struct psthread_data *self; /* IA32,AMD64 needs to get self address */45 struct psthread_data *self; /* ia32, amd64 needs to get self address */ 46 46 47 47 link_t list; -
libc/include/stdarg.h
ra71d9af9 r86d05fae 45 45 46 46 #endif 47 -
libc/include/stdlib.h
ra71d9af9 r86d05fae 30 30 #define __LIBC__STDLIB_H__ 31 31 32 #include <unistd.h> 32 33 #include <malloc.h> 33 34
Note:
See TracChangeset
for help on using the changeset viewer.