Changeset 6a27d63 in mainline for arch/ia32/src
- Timestamp:
- 2005-05-11T21:53:09Z (21 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c884ef1
- Parents:
- 6ba143d
- Location:
- arch/ia32/src
- Files:
-
- 3 edited
-
fpu_context.c (modified) (2 diffs)
-
interrupt.c (modified) (1 diff)
-
pm.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/src/fpu_context.c
r6ba143d r6a27d63 41 41 void fpu_context_restore(fpu_context_t *fctx) 42 42 { 43 if(THREAD==CPU->arch.fpu_owner) reset_TS_flag();44 else set_TS_flag();43 if(THREAD==CPU->arch.fpu_owner) {reset_TS_flag(); } 44 else {set_TS_flag(); ((CPU->arch).fpu_owner)->fpu_context_engaged=1;} 45 45 } 46 46 … … 48 48 void fpu_lazy_context_save(fpu_context_t *fctx) 49 49 { 50 /* 51 pushl %eax 52 mov 8(%esp),%eax 53 fxsave (%eax) 54 popl %eax 55 ret 56 */ 50 asm( 51 "mov %0,%%eax;" 52 "fxsave (%%eax);" 53 "ret;" 54 :"=m"(fctx) 55 : 56 :"%eax" 57 ); 57 58 } 58 59 59 60 void fpu_lazy_context_restore(fpu_context_t *fctx) 60 61 { 61 /* 62 pushl %eax 63 mov 8(%esp),%eax 64 fxrstor (%eax) 65 popl %eax 66 ret 67 */ 62 asm( 63 "mov %0,%%eax;" 64 "fxrstor (%%eax);" 65 "ret;" 66 :"=m"(fctx) 67 : 68 :"%eax" 69 ); 68 70 } 71 72 void fpu_init(void) 73 { 74 asm( 75 "fninit;" 76 ); 77 } 78 -
arch/ia32/src/interrupt.c
r6ba143d r6a27d63 86 86 } 87 87 88 void nm_fault(__u8 n, __u32 stack[]) 89 { 90 91 if (((CPU->arch).fpu_owner)!=NULL) 92 { 93 fpu_lazy_context_save(&(((CPU->arch).fpu_owner)->saved_fpu_context)); 94 ((CPU->arch).fpu_owner)->fpu_context_engaged=0; /* Enables migration */ 95 } 96 97 if(THREAD->fpu_context_exists) fpu_lazy_context_restore(&(THREAD->saved_fpu_context)); 98 else {fpu_init();THREAD->fpu_context_exists=1;} 99 100 (CPU->arch).fpu_owner=THREAD; 101 102 reset_TS_flag(); 103 104 // panic("#NM fault\n"); 105 } 106 107 108 88 109 void page_fault(__u8 n, __u32 stack[]) 89 110 { -
arch/ia32/src/pm.c
r6ba143d r6a27d63 121 121 } 122 122 trap_register(13, gp_fault); 123 trap_register( 7, nm_fault); 123 124 } 124 125
Note:
See TracChangeset
for help on using the changeset viewer.
