[KERNEL32]

Switch to new asm syntax
Add dependency to asm

svn path=/branches/cmake-bringup/; revision=49648
This commit is contained in:
Timo Kreuzer 2010-11-19 23:40:01 +00:00
parent cf6d90b6f2
commit ecdfe19579
5 changed files with 31 additions and 17 deletions

View 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)

View 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

View 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 */

View 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 */

View 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 */