- Merge from trunk up to r45543
[reactos.git] / dll / win32 / kernel32 / thread / i386 / fiber.S
index 00b3a17..cf8bbe0 100644 (file)
@@ -9,15 +9,12 @@
 
 #include <ndk/asm.h>
 
-#define CONTEXT_FULL                    0x10007
-#define CONTEXT_FLOATING_POINT          0xF
-
 .globl _SwitchToFiber@4
 .intel_syntax noprefix
 
 _SwitchToFiber@4:
     /* Get the TEB */
-    mov edx, fs:[KGDT_R3_TEB]
+    mov edx, fs:[TEB_SELF]
     
     /* Get the Fiber */
     mov eax, [edx+TEB_FIBER_DATA]
@@ -29,7 +26,7 @@ _SwitchToFiber@4:
     mov [eax+FIBER_CONTEXT_EBP], ebp
     
     /* Check if we're to save FPU State */
-    cmp dword ptr [eax+FIBER_CONTEXT_FLAGS], CONTEXT_FULL + CONTEXT_FLOATING_POINT
+    cmp dword ptr [eax+FIBER_CONTEXT_FLAGS], CONTEXT_FULL | CONTEXT_FLOATING_POINT
     jnz NoFpuStateSave
     
     /* Save the FPU State (Status and Control)*/
@@ -79,7 +76,7 @@ NoFpuStateSave:
     mov [edx+TEB_ACTIVATION_CONTEXT_STACK_POINTER], esi
     
     /* Restore FPU State */
-    cmp dword ptr [eax+FIBER_CONTEXT_FLAGS], CONTEXT_FULL + CONTEXT_FLOATING_POINT
+    cmp dword ptr [eax+FIBER_CONTEXT_FLAGS], CONTEXT_FULL | CONTEXT_FLOATING_POINT
     jnz NoFpuStateRestore
     
     /* Check if the Status Word Changed */