// This code provides low level routines that support the Virtual Machine\r
// for option ROMs.\r
//\r
-// Copyright (c) 2015, The Linux Foundation. All rights reserved.\r
+// Copyright (c) 2016, Linaro, Ltd. All rights reserved.<BR>\r
+// Copyright (c) 2015, The Linux Foundation. All rights reserved.<BR>\r
// Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
+//\r
// This program and the accompanying materials\r
// are licensed and made available under the terms and conditions of the BSD License\r
// which accompanies this distribution. The full text of the license may be found at\r
ASM_GLOBAL ASM_PFX(EbcLLEbcInterpret)\r
ASM_GLOBAL ASM_PFX(EbcLLExecuteEbcImageEntryPoint)\r
\r
+ASM_GLOBAL ASM_PFX(mEbcInstructionBufferTemplate)\r
+\r
//****************************************************************************\r
// EbcLLCALLEX\r
//\r
//\r
// This function is called by the thunk code to handle an Native to EBC call\r
// This can handle up to 16 arguments (1-8 on in x0-x7, 9-16 are on the stack)\r
-// x9 contains the Entry point that will be the first argument when\r
+// x16 contains the Entry point that will be the first argument when\r
// EBCInterpret is called.\r
//\r
//****************************************************************************\r
mov x3, x2\r
mov x2, x1\r
mov x1, x0\r
- mov x0, x9\r
+ mov x0, x16\r
\r
// call C-code\r
bl ASM_PFX(EbcInterpret)\r
// EbcLLExecuteEbcImageEntryPoint\r
//\r
// This function is called by the thunk code to handle the image entry point\r
-// x9 contains the Entry point that will be the first argument when\r
+// x16 contains the Entry point that will be the third argument when\r
// ExecuteEbcImageEntryPoint is called.\r
//\r
//****************************************************************************\r
// build new parameter calling convention\r
mov x2, x1\r
mov x1, x0\r
- mov x0, x9\r
+ mov x0, x16\r
\r
// call C-code\r
bl ASM_PFX(ExecuteEbcImageEntryPoint)\r
ldp x29, x30, [sp], #16\r
ret\r
+\r
+//****************************************************************************\r
+// mEbcInstructionBufferTemplate\r
+//****************************************************************************\r
+ .section ".rodata", "a"\r
+ .align 3\r
+ASM_PFX(mEbcInstructionBufferTemplate):\r
+ adr x17, 0f\r
+ ldp x16, x17, [x17]\r
+ br x17\r
+\r
+ //\r
+ // Add a magic code here to help the VM recognize the thunk.\r
+ //\r
+ hlt #0xEBC\r
+\r
+0: .quad 0 // EBC_ENTRYPOINT_SIGNATURE\r
+ .quad 0 // EBC_LL_EBC_ENTRYPOINT_SIGNATURE\r