Changeset 085d973 in mainline for generic/src/proc/thread.c
- Timestamp:
- 2006-02-08T12:34:05Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5e3757d
- Parents:
- eb1b8b6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/proc/thread.c
reb1b8b6 r085d973 30 30 #include <proc/thread.h> 31 31 #include <proc/task.h> 32 #include <mm/heap.h>33 32 #include <mm/frame.h> 34 33 #include <mm/page.h> … … 96 95 { 97 96 thread_t *t = (thread_t *)obj; 97 pfn_t pfn; 98 98 99 99 spinlock_initialize(&t->lock, "thread_t_lock"); … … 103 103 link_initialize(&t->threads_link); 104 104 105 t->kstack = (__u8 *)frame_alloc(ONE_FRAME, FRAME_KA | kmflags); 105 pfn = frame_alloc(ONE_FRAME, FRAME_KA | kmflags); 106 t->kstack = (__u8 *)PA2KA(PFN2ADDR(pfn)); 106 107 if (!t->kstack) 107 108 return -1; … … 115 116 thread_t *t = (thread_t *)obj; 116 117 117 frame_free( (__address) t->kstack);118 frame_free(ADDR2PFN(KA2PA(t->kstack))); 118 119 return 1; /* One page freed */ 119 120 } … … 194 195 spinlock_unlock(&t->cpu->lock); 195 196 196 if (t->ustack)197 frame_free((__address) t->ustack);198 199 197 /* 200 198 * Detach from the containing task. … … 229 227 { 230 228 thread_t *t; 231 __address frame_us = NULL;232 229 233 230 t = (thread_t *) slab_alloc(thread_slab, 0); … … 235 232 ipl_t ipl; 236 233 237 if (THREAD_USER_STACK & flags) {238 frame_us = frame_alloc(ONE_FRAME, FRAME_KA);239 }240 241 234 /* Not needed, but good for debugging */ 242 235 memsetb((__address)t->kstack, THREAD_STACK_SIZE, 0); … … 247 240 spinlock_unlock(&tidlock); 248 241 interrupts_restore(ipl); 249 250 t->ustack = (__u8 *) frame_us;251 242 252 243 context_save(&t->saved_context);
Note:
See TracChangeset
for help on using the changeset viewer.