Alexandre Julliard : kernel: Reimplemented the MapHInst functions in
assembly.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri Jan 13 07:31:28 CST 2006
Module: wine
Branch: refs/heads/master
Commit: 068cedc7f2ebc6a2ed3f8a8e137cc9d96539d7cd
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=068cedc7f2ebc6a2ed3f8a8e137cc9d96539d7cd
Author: Alexandre Julliard <julliard at winehq.org>
Date: Fri Jan 13 14:29:30 2006 +0100
kernel: Reimplemented the MapHInst functions in assembly.
---
dlls/kernel/kernel32.spec | 8 +++---
dlls/kernel/krnl386.exe.spec | 4 +--
dlls/kernel/ne_module.c | 58 +++++++++++++++++++++++++-----------------
3 files changed, 40 insertions(+), 30 deletions(-)
diff --git a/dlls/kernel/kernel32.spec b/dlls/kernel/kernel32.spec
index 4c3a025..65976a1 100644
--- a/dlls/kernel/kernel32.spec
+++ b/dlls/kernel/kernel32.spec
@@ -790,10 +790,10 @@
@ stdcall LockFileEx(long long long long long ptr)
@ stdcall LockResource(long)
@ stdcall MakeCriticalSectionGlobal(ptr)
-@ stdcall -i386 -register MapHInstLS()
-@ stdcall -i386 -register MapHInstLS_PN()
-@ stdcall -i386 -register MapHInstSL()
-@ stdcall -i386 -register MapHInstSL_PN()
+@ stdcall -i386 -norelay MapHInstLS()
+@ stdcall -i386 -norelay MapHInstLS_PN()
+@ stdcall -i386 -norelay MapHInstSL()
+@ stdcall -i386 -norelay MapHInstSL_PN()
@ stdcall MapHModuleLS(long)
@ stdcall MapHModuleSL(long)
@ stdcall MapLS(ptr)
diff --git a/dlls/kernel/krnl386.exe.spec b/dlls/kernel/krnl386.exe.spec
index 7b7a477..0005f37 100644
--- a/dlls/kernel/krnl386.exe.spec
+++ b/dlls/kernel/krnl386.exe.spec
@@ -374,8 +374,8 @@
469 stub WOAGimmeTitle
470 stub WOADestroyConsole
471 pascal GetCurrentProcessId() GetCurrentProcessId
-472 pascal -register MapHInstLS() __regs_MapHInstLS
-473 pascal -register MapHInstSL() __regs_MapHInstSL
+472 pascal -register MapHInstLS() MapHInstLS16
+473 pascal -register MapHInstSL() MapHInstSL16
474 pascal CloseW32Handle(long) CloseHandle
475 pascal -ret16 GetTEBSelectorFS() GetTEBSelectorFS16
476 pascal ConvertToGlobalHandle(long) ConvertToGlobalHandle
diff --git a/dlls/kernel/ne_module.c b/dlls/kernel/ne_module.c
index 89600d2..930dc13 100644
--- a/dlls/kernel/ne_module.c
+++ b/dlls/kernel/ne_module.c
@@ -2138,47 +2138,57 @@ HMODULE WINAPI MapHModuleSL(HMODULE16 hm
}
/***************************************************************************
- * MapHInstLS (KERNEL32.@)
* MapHInstLS (KERNEL.472)
*/
-void WINAPI __regs_MapHInstLS( CONTEXT86 *context )
+void WINAPI MapHInstLS16( CONTEXT86 *context )
{
context->Eax = MapHModuleLS( (HMODULE)context->Eax );
}
-#ifdef DEFINE_REGS_ENTRYPOINT
-DEFINE_REGS_ENTRYPOINT( MapHInstLS, 0, 0 );
-#endif
/***************************************************************************
- * MapHInstSL (KERNEL32.@)
* MapHInstSL (KERNEL.473)
*/
-void WINAPI __regs_MapHInstSL( CONTEXT86 *context )
+void WINAPI MapHInstSL16( CONTEXT86 *context )
{
context->Eax = (DWORD)MapHModuleSL( context->Eax );
}
-#ifdef DEFINE_REGS_ENTRYPOINT
-DEFINE_REGS_ENTRYPOINT( MapHInstSL, 0, 0 );
-#endif
+
+#ifdef __i386__
+
+/***************************************************************************
+ * MapHInstLS (KERNEL32.@)
+ */
+__ASM_GLOBAL_FUNC( MapHInstLS,
+ "pushl %eax\n\t"
+ "call " __ASM_NAME("MapHModuleLS") "\n\t"
+ "ret" );
+
+/***************************************************************************
+ * MapHInstSL (KERNEL32.@)
+ */
+__ASM_GLOBAL_FUNC( MapHInstSL,
+ "pushl %eax\n\t"
+ "call " __ASM_NAME("MapHModuleSL") "\n\t"
+ "ret" );
/***************************************************************************
* MapHInstLS_PN (KERNEL32.@)
*/
-void WINAPI __regs_MapHInstLS_PN( CONTEXT86 *context )
-{
- if (context->Eax) context->Eax = MapHModuleLS( (HMODULE)context->Eax );
-}
-#ifdef DEFINE_REGS_ENTRYPOINT
-DEFINE_REGS_ENTRYPOINT( MapHInstLS_PN, 0, 0 );
-#endif
+__ASM_GLOBAL_FUNC( MapHInstLS_PN,
+ "testl %eax,%eax\n\t"
+ "jz 1f\n\t"
+ "pushl %eax\n\t"
+ "call " __ASM_NAME("MapHModuleLS") "\n"
+ "1:\tret" );
/***************************************************************************
* MapHInstSL_PN (KERNEL32.@)
*/
-void WINAPI __regs_MapHInstSL_PN( CONTEXT86 *context )
-{
- if (context->Eax) context->Eax = (DWORD)MapHModuleSL( context->Eax );
-}
-#ifdef DEFINE_REGS_ENTRYPOINT
-DEFINE_REGS_ENTRYPOINT( MapHInstSL_PN, 0, 0 );
-#endif
+__ASM_GLOBAL_FUNC( MapHInstSL_PN,
+ "andl $0xffff,%eax\n\t"
+ "jz 1f\n\t"
+ "pushl %eax\n\t"
+ "call " __ASM_NAME("MapHModuleSL") "\n"
+ "1:\tret" );
+
+#endif /* __i386__ */
More information about the wine-cvs
mailing list