From fb0b259e4e440577dcd6ba6722c252d90605b3e9 Mon Sep 17 00:00:00 2001 From: vanjeff Date: Thu, 10 Apr 2008 08:49:28 +0000 Subject: apply for doxgen format. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5038 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/EbcDxe/Ipf/EbcSupport.c | 176 ++++++++++--------------- MdeModulePkg/Universal/EbcDxe/Ipf/EbcSupport.h | 15 +-- 2 files changed, 76 insertions(+), 115 deletions(-) (limited to 'MdeModulePkg/Universal/EbcDxe/Ipf') diff --git a/MdeModulePkg/Universal/EbcDxe/Ipf/EbcSupport.c b/MdeModulePkg/Universal/EbcDxe/Ipf/EbcSupport.c index 3647a12fae..b2cb6f6be0 100644 --- a/MdeModulePkg/Universal/EbcDxe/Ipf/EbcSupport.c +++ b/MdeModulePkg/Universal/EbcDxe/Ipf/EbcSupport.c @@ -1,24 +1,17 @@ -/*++ - -Copyright (c) 2006, Intel Corporation -All rights reserved. This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -Module Name: - - EbcSupport.c - -Abstract: - +/** @file This module contains EBC support routines that are customized based on the target processor. ---*/ +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ #include "EbcInt.h" #include "EbcExecute.h" @@ -141,7 +134,7 @@ EbcInterpret ( // Now adjust the EBC stack pointer down to leave a gap for interpreter // execution. Then stuff a magic value there. // - + Status = GetEBCStack((EFI_HANDLE)(UINTN)-1, &VmContext.StackPool, &StackIndex); if (EFI_ERROR(Status)) { return Status; @@ -151,7 +144,7 @@ EbcInterpret ( VmContext.HighStackBottom = (UINTN) VmContext.R[0]; VmContext.R[0] -= sizeof (UINTN); - + PushU64 (&VmContext, (UINT64) VM_STACK_KEY_VALUE); VmContext.StackMagicPtr = (UINTN *) VmContext.R[0]; VmContext.LowStackTop = (UINTN) VmContext.R[0]; @@ -194,32 +187,27 @@ EbcInterpret ( return (UINT64) VmContext.R[7]; } -STATIC -UINT64 -ExecuteEbcImageEntryPoint ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -/*++ - -Routine Description: +/** IPF implementation. - Begin executing an EBC image. The address of the entry point is passed in via a processor register, so we'll need to make a call to get the value. - -Arguments: - ImageHandle - image handle for the EBC application we're executing - SystemTable - standard system table passed into an driver's entry point + @param ImageHandle image handle for the EBC application we're + executing + @param SystemTable standard system table passed into an driver's + entry point -Returns: + @return The value returned by the EBC application we're going to run. - The value returned by the EBC application we're going to run. - ---*/ +**/ +STATIC +UINT64 +ExecuteEbcImageEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) { // // Create a new VM context on the stack @@ -256,7 +244,7 @@ Returns: // Get the stack pointer. This is the bottom of the upper stack. // Addr = EbcLLGetStackPointer (); - + Status = GetEBCStack(ImageHandle, &VmContext.StackPool, &StackIndex); if (EFI_ERROR(Status)) { return Status; @@ -266,7 +254,7 @@ Returns: VmContext.HighStackBottom = (UINTN) VmContext.R[0]; VmContext.R[0] -= sizeof (UINTN); - + // // Allocate stack space for the interpreter. Then put a magic value // at the bottom so we can detect stack corruption. @@ -320,6 +308,19 @@ Returns: return (UINT64) VmContext.R[7]; } + +/** + Create thunks for an EBC image entry point, or an EBC protocol service. + + @param ImageHandle Image handle for the EBC image. If not null, then + we're creating a thunk for an image entry point. + @param EbcEntryPoint Address of the EBC code that the thunk is to call + @param Thunk Returned thunk we create here + @param Flags Flags indicating options for creating the thunk + + @return Standard EFI status. + +**/ EFI_STATUS EbcCreateThunks ( IN EFI_HANDLE ImageHandle, @@ -327,25 +328,6 @@ EbcCreateThunks ( OUT VOID **Thunk, IN UINT32 Flags ) -/*++ - -Routine Description: - - Create thunks for an EBC image entry point, or an EBC protocol service. - -Arguments: - - ImageHandle - Image handle for the EBC image. If not null, then we're - creating a thunk for an image entry point. - EbcEntryPoint - Address of the EBC code that the thunk is to call - Thunk - Returned thunk we create here - Flags - Flags indicating options for creating the thunk - -Returns: - - Standard EFI status. - ---*/ { UINT8 *Ptr; UINT8 *ThunkBase; @@ -680,6 +662,21 @@ Returns: return EFI_SUCCESS; } + +/** + Given raw bytes of Itanium based code, format them into a bundle and + write them out. + + @param MemPtr pointer to memory location to write the bundles to + @param Template 5-bit template + @param Slot0-2 instruction slot data for the bundle + + @retval EFI_INVALID_PARAMETER Pointer is not aligned + @retval No more than 5 bits in template + @retval More than 41 bits used in code + @retval EFI_SUCCESS All data is written. + +**/ STATIC EFI_STATUS WriteBundle ( @@ -689,27 +686,6 @@ WriteBundle ( IN UINT64 Slot1, IN UINT64 Slot2 ) -/*++ - -Routine Description: - - Given raw bytes of Itanium based code, format them into a bundle and - write them out. - -Arguments: - - MemPtr - pointer to memory location to write the bundles to - Template - 5-bit template - Slot0-2 - instruction slot data for the bundle - -Returns: - - EFI_INVALID_PARAMETER - Pointer is not aligned - - No more than 5 bits in template - - More than 41 bits used in code - EFI_SUCCESS - All data is written. - ---*/ { UINT8 *BPtr; UINT32 Index; @@ -760,38 +736,32 @@ Returns: return EFI_SUCCESS; } -VOID -EbcLLCALLEX ( - IN VM_CONTEXT *VmPtr, - IN UINTN FuncAddr, - IN UINTN NewStackPointer, - IN VOID *FramePtr, - IN UINT8 Size - ) -/*++ - -Routine Description: - This function is called to execute an EBC CALLEX instruction. +/** + This function is called to execute an EBC CALLEX instruction. The function check the callee's content to see whether it is common native code or a thunk to another piece of EBC code. If the callee is common native code, use EbcLLCAllEXASM to manipulate, otherwise, set the VM->IP to target EBC code directly to avoid another VM be startup which cost time and stack space. - -Arguments: - VmPtr - Pointer to a VM context. - FuncAddr - Callee's address - NewStackPointer - New stack pointer after the call - FramePtr - New frame pointer after the call - Size - The size of call instruction + @param VmPtr Pointer to a VM context. + @param FuncAddr Callee's address + @param NewStackPointer New stack pointer after the call + @param FramePtr New frame pointer after the call + @param Size The size of call instruction -Returns: + @return None. - None. - ---*/ +**/ +VOID +EbcLLCALLEX ( + IN VM_CONTEXT *VmPtr, + IN UINTN FuncAddr, + IN UINTN NewStackPointer, + IN VOID *FramePtr, + IN UINT8 Size + ) { UINTN IsThunk; UINTN TargetEbcAddr; diff --git a/MdeModulePkg/Universal/EbcDxe/Ipf/EbcSupport.h b/MdeModulePkg/Universal/EbcDxe/Ipf/EbcSupport.h index f6c929ba3e..7b554f3e65 100644 --- a/MdeModulePkg/Universal/EbcDxe/Ipf/EbcSupport.h +++ b/MdeModulePkg/Universal/EbcDxe/Ipf/EbcSupport.h @@ -1,4 +1,5 @@ -/*++ +/** @file + Definition of EBC Support function. Copyright (c) 2006, Intel Corporation All rights reserved. This program and the accompanying materials @@ -9,17 +10,7 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - - EbcSupport.h - -Abstract: - - Definition of EBC Support function - -Revision History - ---*/ +**/ #ifndef _IPF_EBC_SUPPORT_H_ #define _IPF_EBC_SUPPORT_H_ -- cgit v1.2.3