3 # This code provides low level routines that support the Virtual Machine
6 # Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
7 # This program and the accompanying materials
8 # are licensed and made available under the terms and conditions of the BSD License
9 # which accompanies this distribution. The full text of the license may be found at
10 # http://opensource.org/licenses/bsd-license.php
12 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #---------------------------------------------------------------------------
18 # Equate files needed.
19 #---------------------------------------------------------------------------
21 ASM_GLOBAL ASM_PFX(CopyMem);
22 ASM_GLOBAL ASM_PFX(EbcInterpret);
23 ASM_GLOBAL ASM_PFX(ExecuteEbcImageEntryPoint);
25 #****************************************************************************
28 # This function is called to execute an EBC CALLEX instruction.
29 # This instruction requires that we thunk out to external native
30 # code. For x64, we switch stacks, copy the arguments to the stack
31 # and jump to the specified function.
32 # On return, we restore the stack pointer to its original location.
34 # Destroys no working registers.
35 #****************************************************************************
36 # VOID EbcLLCALLEXNative(UINTN FuncAddr, UINTN NewStackPointer, VOID *FramePtr)
37 ASM_GLOBAL ASM_PFX(EbcLLCALLEXNative);
38 ASM_PFX(EbcLLCALLEXNative):
44 # Copy FuncAddr to a preserved register.
47 # Set stack pointer to new value
55 # Considering the worst case, load 4 potiential arguments
62 # Now call the external routine
71 ASM_GLOBAL ASM_PFX(EbcLLEbcInterpret);
72 ASM_PFX(EbcLLEbcInterpret):
73 # save old parameter to stack
94 # build new paramater calling convention
101 call ASM_PFX(EbcInterpret)
109 ASM_GLOBAL ASM_PFX(EbcLLExecuteEbcImageEntryPoint);
110 ASM_PFX(EbcLLExecuteEbcImageEntryPoint):
111 # build new paramater calling convention
118 call ASM_PFX(ExecuteEbcImageEntryPoint)