; Destroys no working registers.\r
;****************************************************************************\r
; VOID EbcLLCALLEXNative(UINTN FuncAddr, UINTN NewStackPointer, VOID *FramePtr)\r
-EbcLLCALLEXNative PROC\r
+\r
+CopyMem PROTO Destination:PTR DWORD, Source:PTR DWORD, Count:DWORD\r
+\r
+\r
+EbcLLCALLEXNative PROC NEAR PUBLIC\r
push rbp\r
push rbx\r
mov rbp, rsp\r
mov rbx, rcx\r
\r
; Set stack pointer to new value\r
- mov rsp, rdx \r
+ sub r8, rdx\r
+ sub rsp, r8\r
+ mov rcx, rsp\r
+ sub rsp, 20h\r
+ call CopyMem \r
+ add rsp, 20h\r
\r
; Considering the worst case, load 4 potiential arguments\r
; into registers.\r
; Returns:\r
; The contents of the register in which the entry point is passed.\r
;\r
-EbcLLGetEbcEntryPoint PROC\r
+EbcLLGetEbcEntryPoint PROC NEAR PUBLIC\r
ret\r
EbcLLGetEbcEntryPoint ENDP\r
\r
;--*/\r
\r
; UINTN EbcLLGetStackPointer() \r
-EbcLLGetStackPointer PROC\r
+EbcLLGetStackPointer PROC NEAR PUBLIC\r
mov rax, rsp ; get current stack pointer\r
; Stack adjusted by this much when we were called,\r
; For this function, it's 4.\r
; Returns:\r
; The unmodified value returned by the native code.\r
;\r
-EbcLLGetReturnValue PROC\r
+EbcLLGetReturnValue PROC NEAR PUBLIC\r
ret\r
EbcLLGetReturnValue ENDP\r
\r