Changeset 1f12fab in mainline for kernel/arch/sparc32/src/proc/thread.c
- Timestamp:
- 2013-10-07T20:00:34Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a73ebf0
- Parents:
- 80d9d83
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc32/src/proc/thread.c
r80d9d83 r1f12fab 33 33 */ 34 34 35 #include <arch/regwin.h> 35 36 #include <proc/thread.h> 37 38 void thr_constructor_arch(thread_t *t) 39 { 40 t->arch.uspace_window_buffer = NULL; 41 } 42 43 void thr_destructor_arch(thread_t *t) 44 { 45 if (t->arch.uspace_window_buffer) { 46 uintptr_t uw_buf = (uintptr_t) t->arch.uspace_window_buffer; 47 /* 48 * Mind the possible alignment of the userspace window buffer 49 * belonging to a killed thread. 50 */ 51 free((uint8_t *) ALIGN_DOWN(uw_buf, UWB_ALIGNMENT)); 52 } 53 } 36 54 37 55 void thread_create_arch(thread_t *t) 38 56 { 57 if ((t->uspace) && (!t->arch.uspace_window_buffer)) 58 { 59 /* 60 * The thread needs userspace window buffer and the object 61 * returned from the slab allocator doesn't have any. 62 */ 63 t->arch.uspace_window_buffer = malloc(UWB_ASIZE, 0); 64 } else { 65 uintptr_t uw_buf = (uintptr_t) t->arch.uspace_window_buffer; 66 67 /* 68 * Mind the possible alignment of the userspace window buffer 69 * belonging to a killed thread. 70 */ 71 t->arch.uspace_window_buffer = (uint8_t *) ALIGN_DOWN(uw_buf, 72 UWB_ASIZE); 73 } 39 74 } 40 75
Note:
See TracChangeset
for help on using the changeset viewer.