]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/EbcDxe/AArch64/EbcSupport.c
MdeModulePkg/EbcDxe AARCH64: simplify interpreter entry point thunks
[mirror_edk2.git] / MdeModulePkg / Universal / EbcDxe / AArch64 / EbcSupport.c
index a5f21f400274200ed884b02e27c0ac5d4ef958c5..c5cc76d7bdcb8bdad9203c4c6a800f4040cc12dd 100644 (file)
@@ -89,7 +89,6 @@ PushU64 (
 \r
   This is a thunk function.\r
 \r
-  @param  EntryPoint            The entrypoint of EBC code.\r
   @param  Arg1                  The 1st argument.\r
   @param  Arg2                  The 2nd argument.\r
   @param  Arg3                  The 3rd argument.\r
@@ -98,14 +97,8 @@ PushU64 (
   @param  Arg6                  The 6th argument.\r
   @param  Arg7                  The 7th argument.\r
   @param  Arg8                  The 8th argument.\r
-  @param  Arg9                  The 9th argument.\r
-  @param  Arg10                 The 10th argument.\r
-  @param  Arg11                 The 11th argument.\r
-  @param  Arg12                 The 12th argument.\r
-  @param  Arg13                 The 13th argument.\r
-  @param  Arg14                 The 14th argument.\r
-  @param  Arg15                 The 15th argument.\r
-  @param  Arg16                 The 16th argument.\r
+  @param  EntryPoint            The entrypoint of EBC code.\r
+  @param  Args9_16[]            Array containing arguments #9 to #16.\r
 \r
   @return The value returned by the EBC application we're going to run.\r
 \r
@@ -113,23 +106,16 @@ PushU64 (
 UINT64\r
 EFIAPI\r
 EbcInterpret (\r
-  IN UINTN      EntryPoint,\r
-  IN UINTN      Arg1,\r
-  IN UINTN      Arg2,\r
-  IN UINTN      Arg3,\r
-  IN UINTN      Arg4,\r
-  IN UINTN      Arg5,\r
-  IN UINTN      Arg6,\r
-  IN UINTN      Arg7,\r
-  IN UINTN      Arg8,\r
-  IN UINTN      Arg9,\r
-  IN UINTN      Arg10,\r
-  IN UINTN      Arg11,\r
-  IN UINTN      Arg12,\r
-  IN UINTN      Arg13,\r
-  IN UINTN      Arg14,\r
-  IN UINTN      Arg15,\r
-  IN UINTN      Arg16\r
+  IN UINTN        Arg1,\r
+  IN UINTN        Arg2,\r
+  IN UINTN        Arg3,\r
+  IN UINTN        Arg4,\r
+  IN UINTN        Arg5,\r
+  IN UINTN        Arg6,\r
+  IN UINTN        Arg7,\r
+  IN UINTN        Arg8,\r
+  IN UINTN        EntryPoint,\r
+  IN CONST UINTN  Args9_16[]\r
   )\r
 {\r
   //\r
@@ -193,14 +179,14 @@ EbcInterpret (
   // For the worst case, assume there are 4 arguments passed in registers, store\r
   // them to VM's stack.\r
   //\r
-  PushU64 (&VmContext, (UINT64) Arg16);\r
-  PushU64 (&VmContext, (UINT64) Arg15);\r
-  PushU64 (&VmContext, (UINT64) Arg14);\r
-  PushU64 (&VmContext, (UINT64) Arg13);\r
-  PushU64 (&VmContext, (UINT64) Arg12);\r
-  PushU64 (&VmContext, (UINT64) Arg11);\r
-  PushU64 (&VmContext, (UINT64) Arg10);\r
-  PushU64 (&VmContext, (UINT64) Arg9);\r
+  PushU64 (&VmContext, (UINT64) Args9_16[7]);\r
+  PushU64 (&VmContext, (UINT64) Args9_16[6]);\r
+  PushU64 (&VmContext, (UINT64) Args9_16[5]);\r
+  PushU64 (&VmContext, (UINT64) Args9_16[4]);\r
+  PushU64 (&VmContext, (UINT64) Args9_16[3]);\r
+  PushU64 (&VmContext, (UINT64) Args9_16[2]);\r
+  PushU64 (&VmContext, (UINT64) Args9_16[1]);\r
+  PushU64 (&VmContext, (UINT64) Args9_16[0]);\r
   PushU64 (&VmContext, (UINT64) Arg8);\r
   PushU64 (&VmContext, (UINT64) Arg7);\r
   PushU64 (&VmContext, (UINT64) Arg6);\r
@@ -252,10 +238,10 @@ EbcInterpret (
 /**\r
   Begin executing an EBC image.\r
 \r
-  @param  EntryPoint       The entrypoint of EBC code.\r
   @param  ImageHandle      image handle for the EBC application we're executing\r
   @param  SystemTable      standard system table passed into an driver's entry\r
                            point\r
+  @param  EntryPoint       The entrypoint of EBC code.\r
 \r
   @return The value returned by the EBC application we're going to run.\r
 \r
@@ -263,9 +249,9 @@ EbcInterpret (
 UINT64\r
 EFIAPI\r
 ExecuteEbcImageEntryPoint (\r
-  IN UINTN                EntryPoint,\r
   IN EFI_HANDLE           ImageHandle,\r
-  IN EFI_SYSTEM_TABLE     *SystemTable\r
+  IN EFI_SYSTEM_TABLE     *SystemTable,\r
+  IN UINTN                EntryPoint\r
   )\r
 {\r
   //\r