Changeset b49f4ae in mainline for src/proc/scheduler.c
- Timestamp:
- 2005-09-06T09:56:26Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 50a4e25
- Parents:
- a5d1331
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/proc/scheduler.c
ra5d1331 rb49f4ae 61 61 void before_thread_runs(void) 62 62 { 63 before_thread_runs_arch(); 64 fpu_context_restore(&(THREAD->saved_fpu_context)); 65 } 66 63 before_thread_runs_arch(); 64 #ifdef FPU_LAZY 65 if(THREAD==CPU->fpu_owner) 66 fpu_enable(); 67 else 68 fpu_disable(); 69 #else 70 fpu_enable(); 71 if (THREAD->fpu_context_exists) 72 fpu_context_restore(&(THREAD->saved_fpu_context)); 73 else { 74 fpu_init(); 75 THREAD->fpu_context_exists=1; 76 } 77 #endif 78 } 79 80 #ifdef FPU_LAZY 81 void scheduler_fpu_lazy_request(void) 82 { 83 fpu_enable(); 84 if (CPU->fpu_owner != NULL) { 85 fpu_context_save(&CPU->fpu_owner->saved_fpu_context); 86 /* don't prevent migration */ 87 CPU->fpu_owner->fpu_context_engaged=0; 88 } 89 if (THREAD->fpu_context_exists) 90 fpu_context_restore(&THREAD->saved_fpu_context); 91 else { 92 fpu_init(); 93 THREAD->fpu_context_exists=1; 94 } 95 CPU->fpu_owner=THREAD; 96 THREAD->fpu_context_engaged = 1; 97 } 98 #endif 67 99 68 100 /** Initialize scheduler … … 241 273 if (THREAD) { 242 274 spinlock_lock(&THREAD->lock); 275 #ifndef FPU_LAZY 243 276 fpu_context_save(&(THREAD->saved_fpu_context)); 277 #endif 244 278 if (!context_save(&THREAD->saved_context)) { 245 279 /*
Note:
See TracChangeset
for help on using the changeset viewer.