Author: ion
Date: Sat Jul 23 12:05:38 2011
New Revision: 52806
URL:
http://svn.reactos.org/svn/reactos?rev=52806&view=rev
Log:
[KERNEL32]: Implement BaseFiberStartup in ASM, just like the thread/process thunks, so we
get a "naked" thunk without any compiler-generated crap.
Modified:
trunk/reactos/dll/win32/kernel32/client/fiber.c
trunk/reactos/dll/win32/kernel32/client/i386/thread.S
Modified: trunk/reactos/dll/win32/kernel32/client/fiber.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/fiber.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/fiber.c [iso-8859-1] Sat Jul 23 12:05:38 2011
@@ -36,32 +36,6 @@
}
-__declspec(noreturn)
-VOID
-WINAPI
-BaseFiberStartup(VOID)
-{
-#ifdef _M_IX86
- PFIBER Fiber = GetCurrentFiber();
-
- /* Call the Thread Startup Routine */
- DPRINT("Starting Fiber\n");
- BaseThreadStartup((LPTHREAD_START_ROUTINE)Fiber->Context.Eax,
- (LPVOID)Fiber->Context.Ebx);
-#elif defined(_M_AMD64)
- PFIBER Fiber = GetFiberData();
-
- /* Call the Thread Startup Routine */
- DPRINT1("Starting Fiber\n");
- BaseThreadStartup((LPTHREAD_START_ROUTINE)Fiber->Context.Rax,
- (LPVOID)Fiber->Context.Rbx);
-#else
-#warning Unknown architecture
- UNIMPLEMENTED;
- DbgBreakPoint();
-#endif
-}
-
/* PUBLIC FUNCTIONS ***********************************************************/
/*
Modified: trunk/reactos/dll/win32/kernel32/client/i386/thread.S
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/i386/thread.S [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/i386/thread.S [iso-8859-1] Sat Jul 23 12:05:38
2011
@@ -7,6 +7,7 @@
*/
#include <asm.inc>
+#include <ks386.inc>
.code
@@ -14,8 +15,6 @@
EXTERN _BaseProcessStartup@4:PROC
PUBLIC _BaseThreadStartupThunk@0
-PUBLIC _BaseProcessStartThunk@0
-
_BaseThreadStartupThunk@0:
/* Start out fresh */
@@ -25,9 +24,10 @@
push eax /* lpStartAddress */
push 0 /* Return EIP */
jmp _BaseThreadStartup@8
+END
+PUBLIC _BaseProcessStartThunk@0
_BaseProcessStartThunk@0:
-
/* Start out fresh */
xor ebp, ebp
@@ -36,4 +36,15 @@
jmp _BaseProcessStartup@4
END
+
+PUBLIC _BaseFiberStartup@0
+_BaseFiberStartup@0:
+ /* Get the fiber data */
+ mov eax, fs:[TEB_FIBER_DATA]
+
+ push dword ptr [eax+FIBER_CONTEXT_EBX] /* Parameter */
+ push dword ptr [eax+FIBER_CONTEXT_EAX] /* Start Address */
+ call _BaseThreadStartup@8
+END
+
/* EOF */