[KERNEL32]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Fri, 19 Nov 2010 23:40:01 +0000 (23:40 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Fri, 19 Nov 2010 23:40:01 +0000 (23:40 +0000)
Switch to new asm syntax
Add dependency to asm

svn path=/branches/cmake-bringup/; revision=49648

dll/win32/kernel32/CMakeLists.txt
dll/win32/kernel32/thread/amd64/fiber.S
dll/win32/kernel32/thread/amd64/thread.S
dll/win32/kernel32/thread/i386/fiber.S
dll/win32/kernel32/thread/i386/thread.S

index bba175e..11fe02d 100644 (file)
@@ -119,6 +119,6 @@ target_link_libraries(kernel32 ${PSEH_LIB})
 
 add_importlibs(kernel32 ntdll)
 add_pch(kernel32 ${CMAKE_CURRENT_SOURCE_DIR}/k32.h ${SOURCE})
-add_dependencies(kernel32 errcodes)
+add_dependencies(kernel32 errcodes asm)
 add_cab_target(kernel32 1)
 add_importlib_target(kernel32.spec)
index 984447a..09ea635 100644 (file)
@@ -7,11 +7,13 @@
  *              KJK::Hyperion <noog@libero.it>
  */
 
-#include <ndk/asm.h>
+#include <asm.inc>
 
-.globl SwitchToFiber
-.intel_syntax noprefix
+
+PUBLIC SwitchToFiber
 
 SwitchToFiber:
     /* FIXME: TODO */
     ret 4
+
+END
index 2c0c226..71ed562 100644 (file)
@@ -6,9 +6,11 @@
  * PROGRAMMER: Alex Ionescu (alex@relsoft.net)
  */
 
-.globl BaseThreadStartupThunk
-.globl BaseProcessStartThunk
-.intel_syntax noprefix
+#include <asm.inc>
+
+
+PUBLIC BaseThreadStartupThunk
+PUBLIC BaseProcessStartThunk
 
 BaseThreadStartupThunk:
     
@@ -29,4 +31,5 @@ BaseProcessStartThunk:
     push 0                    /* Return RIP */
     jmp BaseProcessStartup
 
+END
 /* EOF */
index 57358ff..bf88c46 100644 (file)
@@ -7,11 +7,12 @@
  *              KJK::Hyperion <noog@libero.it>
  */
 
-#include <ndk/asm.h>
+#include <asm.inc>
+#include <ks386.inc>
 
-.globl _SwitchToFiber@4
-.intel_syntax noprefix
+.code
 
+PUBLIC _SwitchToFiber@4
 _SwitchToFiber@4:
     /* Get the TEB */
     mov edx, fs:[TEB_SELF]
@@ -30,7 +31,7 @@ _SwitchToFiber@4:
     mov [eax+FIBER_CONTEXT_EIP], ebx
 
     /* 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 OR CONTEXT_FLOATING_POINT
     jnz NoFpuStateSave
     
     /* Save the FPU State (Status and Control)*/
@@ -80,7 +81,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 OR CONTEXT_FLOATING_POINT
     jnz NoFpuStateRestore
     
     /* Check if the Status Word Changed */
@@ -96,7 +97,7 @@ NoFpuStateSave:
 StatusWordChanged:
 
     /* Load the new one */
-    mov word ptr [ecx+FIBER_CONTEXT_FLOAT_SAVE_TAG_WORD], 0xFFFF
+    mov word ptr [ecx+FIBER_CONTEXT_FLOAT_SAVE_TAG_WORD], HEX(0FFFF)
     fldenv [ecx+FIBER_CONTEXT_FLOAT_SAVE_CONTROL_WORD]
     
 ControlWordEqual:
@@ -120,6 +121,7 @@ NoFpuStateRestore:
     mov [edx+TEB_FLS_DATA], eax
 
     /* Jump to new fiber */
-    jmp [ecx+FIBER_CONTEXT_EIP]
+    jmp dword ptr [ecx+FIBER_CONTEXT_EIP]
 
+END
 /* EOF */
index 5dea1ee..a07bcb2 100644 (file)
@@ -6,9 +6,15 @@
  * PROGRAMMER: Alex Ionescu (alex@relsoft.net)
  */
 
-.globl _BaseThreadStartupThunk@0
-.globl _BaseProcessStartThunk@0
-.intel_syntax noprefix
+#include <asm.inc>
+
+.code
+
+EXTERN _BaseThreadStartup@8:PROC
+EXTERN _BaseProcessStartup@4:PROC
+
+PUBLIC _BaseThreadStartupThunk@0
+PUBLIC _BaseProcessStartThunk@0
 
 _BaseThreadStartupThunk@0:
     
@@ -29,4 +35,5 @@ _BaseProcessStartThunk@0:
     push 0                    /* Return EIP */
     jmp _BaseProcessStartup@4
 
+END
 /* EOF */