Changeset add04f7 in mainline for kernel/arch/ia32/src/fpu_context.c
- Timestamp:
- 2009-03-03T15:20:49Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f24d300
- Parents:
- deca67b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/fpu_context.c
rdeca67b radd04f7 45 45 { 46 46 asm volatile ( 47 "fnsave % 0"48 : "=m"(*fctx)49 47 "fnsave %[fctx]" 48 : [fctx] "=m" (*fctx) 49 ); 50 50 } 51 51 … … 53 53 { 54 54 asm volatile ( 55 "frstor % 0"56 : "=m"(*fctx)57 55 "frstor %[fctx]" 56 : [fctx] "=m" (*fctx) 57 ); 58 58 } 59 59 … … 61 61 { 62 62 asm volatile ( 63 "fxsave % 0"64 : "=m"(*fctx)65 63 "fxsave %[fctx]" 64 : [fctx] "=m" (*fctx) 65 ); 66 66 } 67 67 … … 69 69 { 70 70 asm volatile ( 71 "fxrstor % 0"72 : "=m"(*fctx)73 71 "fxrstor %[fctx]" 72 : [fctx] "=m" (*fctx) 73 ); 74 74 } 75 75 76 /* 77 Setup using fxsr instruction 78 */ 76 /* Setup using fxsr instruction */ 79 77 void fpu_fxsr(void) 80 78 { … … 82 80 fpu_restore=fpu_context_fx_restore; 83 81 } 84 /* 85 Setup using not fxsr instruction 86 */ 82 83 /* Setup using not fxsr instruction */ 87 84 void fpu_fsr(void) 88 85 { … … 103 100 void fpu_init() 104 101 { 105 uint32_t help0 = 0, help1 = 0; 102 uint32_t help0 = 0; 103 uint32_t help1 = 0; 104 106 105 asm volatile ( 107 "fninit ;\n"108 "stmxcsr % 0\n"109 "mov % 0,%1;\n"110 "or % 2,%1;\n"111 "mov % 1,%0;\n"112 "ldmxcsr % 0;\n"113 : "+m" (help0),"+r" (help1)114 : "i" (0x1f80)106 "fninit\n" 107 "stmxcsr %[help0]\n" 108 "mov %[help0], %[help1]\n" 109 "or %[magic], %[help1]\n" 110 "mov %[help1], %[help0]\n" 111 "ldmxcsr %[help0]\n" 112 : [help0] "+m" (help0), [help1] "+r" (help1) 113 : [magic] "i" (0x1f80) 115 114 ); 116 115 }
Note:
See TracChangeset
for help on using the changeset viewer.