mirror of
https://github.com/reactos/reactos.git
synced 2025-06-10 12:24:48 +00:00
[KERNEL32]: Implement BaseFiberStartup in ASM, just like the thread/process thunks, so we get a "naked" thunk without any compiler-generated crap.
svn path=/trunk/; revision=52806
This commit is contained in:
parent
84a32acb78
commit
8a06cf76c6
2 changed files with 14 additions and 29 deletions
|
@ -36,32 +36,6 @@ BaseRundownFls(IN PVOID FlsData)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
__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 ***********************************************************/
|
/* PUBLIC FUNCTIONS ***********************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <asm.inc>
|
#include <asm.inc>
|
||||||
|
#include <ks386.inc>
|
||||||
|
|
||||||
.code
|
.code
|
||||||
|
|
||||||
|
@ -14,8 +15,6 @@ EXTERN _BaseThreadStartup@8:PROC
|
||||||
EXTERN _BaseProcessStartup@4:PROC
|
EXTERN _BaseProcessStartup@4:PROC
|
||||||
|
|
||||||
PUBLIC _BaseThreadStartupThunk@0
|
PUBLIC _BaseThreadStartupThunk@0
|
||||||
PUBLIC _BaseProcessStartThunk@0
|
|
||||||
|
|
||||||
_BaseThreadStartupThunk@0:
|
_BaseThreadStartupThunk@0:
|
||||||
|
|
||||||
/* Start out fresh */
|
/* Start out fresh */
|
||||||
|
@ -25,9 +24,10 @@ _BaseThreadStartupThunk@0:
|
||||||
push eax /* lpStartAddress */
|
push eax /* lpStartAddress */
|
||||||
push 0 /* Return EIP */
|
push 0 /* Return EIP */
|
||||||
jmp _BaseThreadStartup@8
|
jmp _BaseThreadStartup@8
|
||||||
|
END
|
||||||
|
|
||||||
|
PUBLIC _BaseProcessStartThunk@0
|
||||||
_BaseProcessStartThunk@0:
|
_BaseProcessStartThunk@0:
|
||||||
|
|
||||||
/* Start out fresh */
|
/* Start out fresh */
|
||||||
xor ebp, ebp
|
xor ebp, ebp
|
||||||
|
|
||||||
|
@ -36,4 +36,15 @@ _BaseProcessStartThunk@0:
|
||||||
jmp _BaseProcessStartup@4
|
jmp _BaseProcessStartup@4
|
||||||
|
|
||||||
END
|
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 */
|
/* EOF */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue