Changeset f76fed4 in mainline for generic/src/proc/thread.c
- Timestamp:
- 2006-03-03T00:20:31Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 09c18f7
- Parents:
- ddcf365
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/proc/thread.c
rddcf365 rf76fed4 64 64 65 65 static slab_cache_t *thread_slab; 66 #ifdef ARCH_HAS_FPU 67 slab_cache_t *fpu_context_slab; 68 #endif 66 69 67 70 … … 104 107 link_initialize(&t->threads_link); 105 108 109 #ifdef ARCH_HAS_FPU 110 # ifdef CONFIG_FPU_LAZY 111 t->saved_fpu_context = NULL; 112 # else 113 t->saved_fpu_context = slab_alloc(fpu_context_slab,kmflags); 114 if (!t->saved_fpu_context) 115 return -1; 116 # endif 117 #endif 118 106 119 pfn = frame_alloc_rc(ONE_FRAME, FRAME_KA | kmflags,&status); 107 if (status) 120 if (status) { 121 #ifdef ARCH_HAS_FPU 122 if (t->saved_fpu_context) 123 slab_free(fpu_context_slab,t->saved_fpu_context); 124 #endif 108 125 return -1; 126 } 109 127 t->kstack = (__u8 *)PA2KA(PFN2ADDR(pfn)); 110 128 … … 118 136 119 137 frame_free(ADDR2PFN(KA2PA(t->kstack))); 138 #ifdef ARCH_HAS_FPU 139 if (t->saved_fpu_context) 140 slab_free(fpu_context_slab,t->saved_fpu_context); 141 #endif 120 142 return 1; /* One page freed */ 121 143 } … … 133 155 sizeof(thread_t),0, 134 156 thr_constructor, thr_destructor, 0); 157 #ifdef ARCH_HAS_FPU 158 fpu_context_slab = slab_cache_create("fpu_slab", 159 sizeof(fpu_context_t), 160 FPU_CONTEXT_ALIGN, 161 NULL, NULL, 0); 162 #endif 135 163 } 136 164
Note:
See TracChangeset
for help on using the changeset viewer.