Changes in uspace/lib/c/generic/fibril.c [e7267a2:32d19f7] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/fibril.c
re7267a2 r32d19f7 37 37 #include <fibril.h> 38 38 #include <thread.h> 39 #include <stack.h>40 39 #include <tls.h> 41 40 #include <malloc.h> 42 #include <abi/mm/as.h>43 #include <as.h>44 41 #include <unistd.h> 45 42 #include <stdio.h> … … 49 46 #include <assert.h> 50 47 #include <async.h> 48 49 #ifndef FIBRIL_INITIAL_STACK_PAGES_NO 50 #define FIBRIL_INITIAL_STACK_PAGES_NO 1 51 #endif 51 52 52 53 /** … … 194 195 * stack member filled. 195 196 */ 196 as_area_destroy(stack);197 free(stack); 197 198 } 198 199 fibril_teardown(srcf->clean_after_me); … … 268 269 return 0; 269 270 270 size_t stack_size = stack_size_get(); 271 fibril->stack = as_area_create((void *) -1, stack_size, 272 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE | AS_AREA_GUARD | 273 AS_AREA_LATE_RESERVE); 274 if (fibril->stack == (void *) -1) { 271 fibril->stack = 272 (char *) malloc(FIBRIL_INITIAL_STACK_PAGES_NO * getpagesize()); 273 if (!fibril->stack) { 275 274 fibril_teardown(fibril); 276 275 return 0; … … 282 281 context_save(&fibril->ctx); 283 282 context_set(&fibril->ctx, FADDR(fibril_main), fibril->stack, 284 stack_size, fibril->tcb);283 FIBRIL_INITIAL_STACK_PAGES_NO * getpagesize(), fibril->tcb); 285 284 286 285 return (fid_t) fibril; … … 299 298 fibril_t *fibril = (fibril_t *) fid; 300 299 301 as_area_destroy(fibril->stack);300 free(fibril->stack); 302 301 fibril_teardown(fibril); 303 302 }
Note:
See TracChangeset
for help on using the changeset viewer.