diff options
author | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-04-10 08:49:28 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-04-10 08:49:28 +0000 |
commit | fb0b259e4e440577dcd6ba6722c252d90605b3e9 (patch) | |
tree | 579879eca4d90b56a40580670123bc5a73099628 /MdeModulePkg/Universal/EbcDxe | |
parent | ed7752ec44001d317f79c8631dccd9650c396617 (diff) | |
download | edk2-fb0b259e4e440577dcd6ba6722c252d90605b3e9.zip edk2-fb0b259e4e440577dcd6ba6722c252d90605b3e9.tar.gz edk2-fb0b259e4e440577dcd6ba6722c252d90605b3e9.tar.bz2 |
apply for doxgen format.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5038 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/EbcDxe')
-rw-r--r-- | MdeModulePkg/Universal/EbcDxe/EbcExecute.c | 1508 | ||||
-rw-r--r-- | MdeModulePkg/Universal/EbcDxe/EbcExecute.h | 31 | ||||
-rw-r--r-- | MdeModulePkg/Universal/EbcDxe/EbcInt.c | 417 | ||||
-rw-r--r-- | MdeModulePkg/Universal/EbcDxe/EbcInt.h | 29 | ||||
-rw-r--r-- | MdeModulePkg/Universal/EbcDxe/Ia32/EbcSupport.c | 162 | ||||
-rw-r--r-- | MdeModulePkg/Universal/EbcDxe/Ipf/EbcSupport.c | 176 | ||||
-rw-r--r-- | MdeModulePkg/Universal/EbcDxe/Ipf/EbcSupport.h | 15 | ||||
-rw-r--r-- | MdeModulePkg/Universal/EbcDxe/x64/EbcSupport.c | 164 |
8 files changed, 1024 insertions, 1478 deletions
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcExecute.c b/MdeModulePkg/Universal/EbcDxe/EbcExecute.c index 174e774..d44892e 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcExecute.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcExecute.c @@ -1,23 +1,16 @@ -/*++
-
-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:
-
- EbcExecute.c
+/** @file
+ Contains code that implements the virtual machine.
-Abstract:
+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
- Contains code that implements the virtual machine.
+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"
@@ -573,31 +566,25 @@ static CONST UINT8 mJMPLen[] = { 2, 2, 6, 10 }; //
EFI_GUID mEbcSimpleDebuggerProtocolGuid = EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL_GUID;
-EFI_STATUS
-EbcExecuteInstructions (
- IN EFI_EBC_VM_TEST_PROTOCOL *This,
- IN VM_CONTEXT *VmPtr,
- IN OUT UINTN *InstructionCount
- )
-/*++
-Routine Description:
-
+/**
Given a pointer to a new VM context, execute one or more instructions. This
function is only used for test purposes via the EBC VM test protocol.
-Arguments:
-
- This - pointer to protocol interface
- VmPtr - pointer to a VM context
- InstructionCount - how many instructions to execute. 0 if don't count.
+ @param This pointer to protocol interface
+ @param VmPtr pointer to a VM context
+ @param InstructionCount how many instructions to execute. 0 if don't count.
-Returns:
+ @return EFI_UNSUPPORTED
+ @return EFI_SUCCESS
- EFI_UNSUPPORTED
- EFI_SUCCESS
-
---*/
+**/
+EFI_STATUS
+EbcExecuteInstructions (
+ IN EFI_EBC_VM_TEST_PROTOCOL *This,
+ IN VM_CONTEXT *VmPtr,
+ IN OUT UINTN *InstructionCount
+ )
{
UINTN ExecFunc;
EFI_STATUS Status;
@@ -641,25 +628,19 @@ Returns: return Status;
}
-EFI_STATUS
-EbcExecute (
- IN VM_CONTEXT *VmPtr
- )
-/*++
-Routine Description:
-
+/**
Execute an EBC image from an entry point or from a published protocol.
-Arguments:
+ @param VmPtr pointer to prepared VM context.
- VmPtr - pointer to prepared VM context.
+ @return Standard EBC status.
-Returns:
-
- Standard EBC status.
-
---*/
+**/
+EFI_STATUS
+EbcExecute (
+ IN VM_CONTEXT *VmPtr
+ )
{
UINTN ExecFunc;
UINT8 StackCorrupted;
@@ -770,39 +751,28 @@ Done: return Status;
}
-STATIC
-EFI_STATUS
-ExecuteMOVxx (
- IN VM_CONTEXT *VmPtr
- )
-/*++
-Routine Description:
-
+/**
Execute the MOVxx instructions.
-Arguments:
-
- VmPtr - pointer to a VM context.
+ @param VmPtr pointer to a VM context.
-Returns:
+ @return EFI_UNSUPPORTED
+ @return EFI_SUCCESS
+ @return Instruction format:
+ @return MOV[b|w|d|q|n]{w|d} {@}R1 {Index16|32}, {@}R2 {Index16|32}
+ @return MOVqq {@}R1 {Index64}, {@}R2 {Index64}
+ @return Copies contents of [R2] -> [R1], zero extending where required.
+ @return First character indicates the size of the move.
+ @return Second character indicates the size of the index(s).
+ @return Invalid to have R1 direct with index.
- EFI_UNSUPPORTED
- EFI_SUCCESS
-
-Instruction format:
-
- MOV[b|w|d|q|n]{w|d} {@}R1 {Index16|32}, {@}R2 {Index16|32}
- MOVqq {@}R1 {Index64}, {@}R2 {Index64}
-
- Copies contents of [R2] -> [R1], zero extending where required.
-
- First character indicates the size of the move.
- Second character indicates the size of the index(s).
-
- Invalid to have R1 direct with index.
-
---*/
+**/
+STATIC
+EFI_STATUS
+ExecuteMOVxx (
+ IN VM_CONTEXT *VmPtr
+ )
{
UINT8 Opcode;
UINT8 OpcMasked;
@@ -1059,27 +1029,21 @@ Instruction format: return EFI_SUCCESS;
}
-STATIC
-EFI_STATUS
-ExecuteBREAK (
- IN VM_CONTEXT *VmPtr
- )
-/*++
-Routine Description:
-
+/**
Execute the EBC BREAK instruction
-Arguments:
+ @param VmPtr pointer to current VM context
- VmPtr - pointer to current VM context
+ @return EFI_UNSUPPORTED
+ @return EFI_SUCCESS
-Returns:
-
- EFI_UNSUPPORTED
- EFI_SUCCESS
-
---*/
+**/
+STATIC
+EFI_STATUS
+ExecuteBREAK (
+ IN VM_CONTEXT *VmPtr
+ )
{
UINT8 Operands;
VOID *EbcEntryPoint;
@@ -1175,39 +1139,30 @@ Returns: return EFI_SUCCESS;
}
+
+/**
+ Execute the JMP instruction
+
+ @param VmPtr pointer to VM context
+
+ @return Standard EFI_STATUS
+ @return Instruction syntax:
+ @return JMP64{cs|cc} Immed64
+ @return JMP32{cs|cc} {@}R1 {Immed32|Index32}
+ @return Encoding:
+ @retval b0.7 immediate data present
+ @retval b0.6 1 = 64 bit immediate data 0 = 32 bit immediate data
+ @retval b1.7 1 = conditional b1.6 1 = CS (condition set) 0 = CC
+ (condition clear) b1.4 1 = relative address 0 =
+ absolute address b1.3 1 = operand1 indirect b1.2-0
+ operand 1
+
+**/
STATIC
EFI_STATUS
ExecuteJMP (
IN VM_CONTEXT *VmPtr
)
-/*++
-
-Routine Description:
- Execute the JMP instruction
-
-Arguments:
- VmPtr - pointer to VM context
-
-Returns:
- Standard EFI_STATUS
-
-Instruction syntax:
- JMP64{cs|cc} Immed64
- JMP32{cs|cc} {@}R1 {Immed32|Index32}
-
-Encoding:
- b0.7 - immediate data present
- b0.6 - 1 = 64 bit immediate data
- 0 = 32 bit immediate data
- b1.7 - 1 = conditional
- b1.6 1 = CS (condition set)
- 0 = CC (condition clear)
- b1.4 1 = relative address
- 0 = absolute address
- b1.3 1 = operand1 indirect
- b1.2-0 operand 1
-
---*/
{
UINT8 Opcode;
UINT8 CompareSet;
@@ -1354,26 +1309,22 @@ Encoding: return EFI_SUCCESS;
}
-STATIC
-EFI_STATUS
-ExecuteJMP8 (
- IN VM_CONTEXT *VmPtr
- )
-/*++
-Routine Description:
+/**
Execute the EBC JMP8 instruction
-Arguments:
- VmPtr - pointer to a VM context
-
-Returns:
- Standard EFI_STATUS
+ @param VmPtr pointer to a VM context
-Instruction syntax:
- JMP8{cs|cc} Offset/2
+ @return Standard EFI_STATUS
+ @return Instruction syntax:
+ @return JMP8{cs|cc} Offset/2
---*/
+**/
+STATIC
+EFI_STATUS
+ExecuteJMP8 (
+ IN VM_CONTEXT *VmPtr
+ )
{
UINT8 Opcode;
UINT8 ConditionFlag;
@@ -1408,38 +1359,27 @@ Instruction syntax: return EFI_SUCCESS;
}
+
+/**
+ Execute the EBC MOVI
+
+ @param VmPtr pointer to a VM context
+
+ @return Standard EFI_STATUS
+ @return Instruction syntax:
+ @return MOVI[b|w|d|q][w|d|q] {@}R1 {Index16}, ImmData16|32|64
+ @return First variable character specifies the move size
+ @return Second variable character specifies size of the immediate data
+ @return Sign-extend the immediate data to the size of the operation, and zero-extend
+ @return if storing to a register.
+ @return Operand1 direct with index/immed is invalid.
+
+**/
STATIC
EFI_STATUS
ExecuteMOVI (
IN VM_CONTEXT *VmPtr
)
-/*++
-
-Routine Description:
-
- Execute the EBC MOVI
-
-Arguments:
-
- VmPtr - pointer to a VM context
-
-Returns:
-
- Standard EFI_STATUS
-
-Instruction syntax:
-
- MOVI[b|w|d|q][w|d|q] {@}R1 {Index16}, ImmData16|32|64
-
- First variable character specifies the move size
- Second variable character specifies size of the immediate data
-
- Sign-extend the immediate data to the size of the operation, and zero-extend
- if storing to a register.
-
- Operand1 direct with index/immed is invalid.
-
---*/
{
UINT8 Opcode;
UINT8 Operands;
@@ -1539,31 +1479,23 @@ Instruction syntax: return EFI_SUCCESS;
}
-STATIC
-EFI_STATUS
-ExecuteMOVIn (
- IN VM_CONTEXT *VmPtr
- )
-/*++
-Routine Description:
-
+/**
Execute the EBC MOV immediate natural. This instruction moves an immediate
index value into a register or memory location.
-Arguments:
-
- VmPtr - pointer to a VM context
+ @param VmPtr pointer to a VM context
-Returns:
+ @return Standard EFI_STATUS
+ @return Instruction syntax:
+ @return MOVIn[w|d|q] {@}R1 {Index16}, Index16|32|64
- Standard EFI_STATUS
-
-Instruction syntax:
-
- MOVIn[w|d|q] {@}R1 {Index16}, Index16|32|64
-
---*/
+**/
+STATIC
+EFI_STATUS
+ExecuteMOVIn (
+ IN VM_CONTEXT *VmPtr
+ )
{
UINT8 Opcode;
UINT8 Operands;
@@ -1647,31 +1579,23 @@ Instruction syntax: return EFI_SUCCESS;
}
-STATIC
-EFI_STATUS
-ExecuteMOVREL (
- IN VM_CONTEXT *VmPtr
- )
-/*++
-Routine Description:
-
+/**
Execute the EBC MOVREL instruction.
Dest <- Ip + ImmData
-Arguments:
-
- VmPtr - pointer to a VM context
-
-Returns:
-
- Standard EFI_STATUS
-
-Instruction syntax:
+ @param VmPtr pointer to a VM context
- MOVREL[w|d|q] {@}R1 {Index16}, ImmData16|32|64
+ @return Standard EFI_STATUS
+ @return Instruction syntax:
+ @return MOVREL[w|d|q] {@}R1 {Index16}, ImmData16|32|64
---*/
+**/
+STATIC
+EFI_STATUS
+ExecuteMOVREL (
+ IN VM_CONTEXT *VmPtr
+ )
{
UINT8 Opcode;
UINT8 Operands;
@@ -1754,36 +1678,27 @@ Instruction syntax: return EFI_SUCCESS;
}
-STATIC
-EFI_STATUS
-ExecuteMOVsnw (
- IN VM_CONTEXT *VmPtr
- )
-/*++
-Routine Description:
-
- Execute the EBC MOVsnw instruction. This instruction loads a signed
+/**
+ Execute the EBC MOVsnw instruction. This instruction loads a signed
natural value from memory or register to another memory or register. On
32-bit machines, the value gets sign-extended to 64 bits if the destination
is a register.
-Arguments:
-
- VmPtr - pointer to a VM context
-
-Returns:
+ @param VmPtr pointer to a VM context
- Standard EFI_STATUS
+ @return Standard EFI_STATUS
+ @return Instruction syntax:
+ @return MOVsnw {@}R1 {Index16}, {@}R2 {Index16|Immed16}
+ @return 0:7 1=>operand1 index present
+ @return 0:6 1=>operand2 index present
-Instruction syntax:
-
- MOVsnw {@}R1 {Index16}, {@}R2 {Index16|Immed16}
-
- 0:7 1=>operand1 index present
- 0:6 1=>operand2 index present
-
---*/
+**/
+STATIC
+EFI_STATUS
+ExecuteMOVsnw (
+ IN VM_CONTEXT *VmPtr
+ )
{
UINT8 Opcode;
UINT8 Operands;
@@ -1853,36 +1768,27 @@ Instruction syntax: return EFI_SUCCESS;
}
-STATIC
-EFI_STATUS
-ExecuteMOVsnd (
- IN VM_CONTEXT *VmPtr
- )
-/*++
-Routine Description:
-
- Execute the EBC MOVsnw instruction. This instruction loads a signed
+/**
+ Execute the EBC MOVsnw instruction. This instruction loads a signed
natural value from memory or register to another memory or register. On
32-bit machines, the value gets sign-extended to 64 bits if the destination
is a register.
-Arguments:
-
- VmPtr - pointer to a VM context
-
-Returns:
-
- Standard EFI_STATUS
-
-Instruction syntax:
+ @param VmPtr pointer to a VM context
- MOVsnd {@}R1 {Indx32}, {@}R2 {Index32|Immed32}
+ @return Standard EFI_STATUS
+ @return Instruction syntax:
+ @return MOVsnd {@}R1 {Indx32}, {@}R2 {Index32|Immed32}
+ @return 0:7 1=>operand1 index present
+ @return 0:6 1=>operand2 index present
- 0:7 1=>operand1 index present
- 0:6 1=>operand2 index present
-
---*/
+**/
+STATIC
+EFI_STATUS
+ExecuteMOVsnd (
+ IN VM_CONTEXT *VmPtr
+ )
{
UINT8 Opcode;
UINT8 Operands;
@@ -1952,26 +1858,22 @@ Instruction syntax: return EFI_SUCCESS;
}
-STATIC
-EFI_STATUS
-ExecutePUSHn (
- IN VM_CONTEXT *VmPtr
- )
-/*++
-Routine Description:
+/**
Execute the EBC PUSHn instruction
-Arguments:
- VmPtr - pointer to a VM context
-
-Returns:
- Standard EFI_STATUS
+ @param VmPtr pointer to a VM context
-Instruction syntax:
- PUSHn {@}R1 {Index16|Immed16}
+ @return Standard EFI_STATUS
+ @return Instruction syntax:
+ @return PUSHn {@}R1 {Index16|Immed16}
---*/
+**/
+STATIC
+EFI_STATUS
+ExecutePUSHn (
+ IN VM_CONTEXT *VmPtr
+ )
{
UINT8 Opcode;
UINT8 Operands;
@@ -2015,26 +1917,22 @@ Instruction syntax: return EFI_SUCCESS;
}
-STATIC
-EFI_STATUS
-ExecutePUSH (
- IN VM_CONTEXT *VmPtr
- )
-/*++
-Routine Description:
+/**
Execute the EBC PUSH instruction
-Arguments:
- VmPtr - pointer to a VM context
-
-Returns:
- Standard EFI_STATUS
+ @param VmPtr pointer to a VM context
-Instruction syntax:
- PUSH[32|64] {@}R1 {Index16|Immed16}
+ @return Standard EFI_STATUS
+ @return Instruction syntax:
+ @return PUSH[32|64] {@}R1 {Index16|Immed16}
---*/
+**/
+STATIC
+EFI_STATUS
+ExecutePUSH (
+ IN VM_CONTEXT *VmPtr
+ )
{
UINT8 Opcode;
UINT8 Operands;
@@ -2095,26 +1993,22 @@ Instruction syntax: return EFI_SUCCESS;
}
-STATIC
-EFI_STATUS
-ExecutePOPn (
- IN VM_CONTEXT *VmPtr
- )
-/*++
-Routine Description:
+/**
Execute the EBC POPn instruction
-Arguments:
- VmPtr - pointer to a VM context
+ @param VmPtr pointer to a VM context
-Returns:
- Standard EFI_STATUS
+ @return Standard EFI_STATUS
+ @return Instruction syntax:
+ @return POPn {@}R1 {Index16|Immed16}
-Instruction syntax:
- POPn {@}R1 {Index16|Immed16}
-
---*/
+**/
+STATIC
+EFI_STATUS
+ExecutePOPn (
+ IN VM_CONTEXT *VmPtr
+ )
{
UINT8 Opcode;
UINT8 Operands;
@@ -2158,26 +2052,22 @@ Instruction syntax: return EFI_SUCCESS;
}
-STATIC
-EFI_STATUS
-ExecutePOP (
- IN VM_CONTEXT *VmPtr
- )
-/*++
-Routine Description:
+/**
Execute the EBC POP instruction
-Arguments:
- VmPtr - pointer to a VM context
+ @param VmPtr pointer to a VM context
-Returns:
- Standard EFI_STATUS
+ @return Standard EFI_STATUS
+ @return Instruction syntax:
+ @return POP {@}R1 {Index16|Immed16}
-Instruction syntax:
- POP {@}R1 {Index16|Immed16}
-
---*/
+**/
+STATIC
+EFI_STATUS
+ExecutePOP (
+ IN VM_CONTEXT *VmPtr
+ )
{
UINT8 Opcode;
UINT8 Operands;
@@ -2241,32 +2131,26 @@ Instruction syntax: return EFI_SUCCESS;
}
-STATIC
-EFI_STATUS
-ExecuteCALL (
- IN VM_CONTEXT *VmPtr
- )
-/*++
-Routine Description:
+/**
Implements the EBC CALL instruction.
-
- Instruction format:
-
- CALL64 Immed64
- CALL32 {@}R1 {Immed32|Index32}
- CALLEX64 Immed64
- CALLEX16 {@}R1 {Immed32}
-
+ Instruction format:
+ CALL64 Immed64
+ CALL32 {@}R1 {Immed32|Index32}
+ CALLEX64 Immed64
+ CALLEX16 {@}R1 {Immed32}
If Rx == R0, then it's a PC relative call to PC = PC + imm32.
-
-Arguments:
- VmPtr - pointer to a VM context.
-Returns:
- Standard EFI_STATUS
+ @param VmPtr pointer to a VM context.
+
+ @return Standard EFI_STATUS
---*/
+**/
+STATIC
+EFI_STATUS
+ExecuteCALL (
+ IN VM_CONTEXT *VmPtr
+ )
{
UINT8 Opcode;
UINT8 Operands;
@@ -2384,26 +2268,22 @@ Returns: return EFI_SUCCESS;
}
-STATIC
-EFI_STATUS
-ExecuteRET (
- IN VM_CONTEXT *VmPtr
- )
-/*++
-Routine Description:
+/**
Execute the EBC RET instruction
-Arguments:
- VmPtr - pointer to a VM context
+ @param VmPtr pointer to a VM context
-Returns:
- Standard EFI_STATUS
+ @return Standard EFI_STATUS
+ @return Instruction syntax:
+ @return RET
-Instruction syntax:
- RET
-
---*/
+**/
+STATIC
+EFI_STATUS
+ExecuteRET (
+ IN VM_CONTEXT *VmPtr
+ )
{
//
// If we're at the top of the stack, then simply set the done
@@ -2435,26 +2315,22 @@ Instruction syntax: return EFI_SUCCESS;
}
-STATIC
-EFI_STATUS
-ExecuteCMP (
- IN VM_CONTEXT *VmPtr
- )
-/*++
-Routine Description:
+/**
Execute the EBC CMP instruction
-Arguments:
- VmPtr - pointer to a VM context
-
-Returns:
- Standard EFI_STATUS
+ @param VmPtr pointer to a VM context
-Instruction syntax:
- CMP[32|64][eq|lte|gte|ulte|ugte] R1, {@}R2 {Index16|Immed16}
+ @return Standard EFI_STATUS
+ @return Instruction syntax:
+ @return CMP[32|64][eq|lte|gte|ulte|ugte] R1, {@}R2 {Index16|Immed16}
---*/
+**/
+STATIC
+EFI_STATUS
+ExecuteCMP (
+ IN VM_CONTEXT *VmPtr
+ )
{
UINT8 Opcode;
UINT8 Operands;
@@ -2599,26 +2475,22 @@ Instruction syntax: return EFI_SUCCESS;
}
-STATIC
-EFI_STATUS
-ExecuteCMPI (
- IN VM_CONTEXT *VmPtr
- )
-/*++
-Routine Description:
+/**
Execute the EBC CMPI instruction
-Arguments:
- VmPtr - pointer to a VM context
-
-Returns:
- Standard EFI_STATUS
+ @param VmPtr pointer to a VM context
-Instruction syntax:
- CMPI[32|64]{w|d}[eq|lte|gte|ulte|ugte] {@}Rx {Index16}, Immed16|Immed32
+ @return Standard EFI_STATUS
+ @return Instruction syntax:
+ @return CMPI[32|64]{w|d}[eq|lte|gte|ulte|ugte] {@}Rx {Index16}, Immed16|Immed32
---*/
+**/
+STATIC
+EFI_STATUS
+ExecuteCMPI (
+ IN VM_CONTEXT *VmPtr
+ )
{
UINT8 Opcode;
UINT8 Operands;
@@ -2781,6 +2653,19 @@ Instruction syntax: return EFI_SUCCESS;
}
+
+/**
+ Execute the EBC NOT instruction
+
+ @param VmPtr pointer to a VM context
+ @param Op1 Operand 1 from the instruction
+ @param Op2 Operand 2 from the instruction
+
+ @return ~Op2
+ @return Instruction syntax:
+ @return NOT[32|64] {@}R1, {@}R2 {Index16|Immed16}
+
+**/
STATIC
UINT64
ExecuteNOT (
@@ -2788,27 +2673,23 @@ ExecuteNOT ( IN UINT64 Op1,
IN UINT64 Op2
)
-/*++
+{
+ return ~Op2;
+}
-Routine Description:
- Execute the EBC NOT instruction
-Arguments:
- VmPtr - pointer to a VM context
- Op1 - Operand 1 from the instruction
- Op2 - Operand 2 from the instruction
+/**
+ Execute the EBC NEG instruction
-Returns:
- ~Op2
+ @param VmPtr pointer to a VM context
+ @param Op1 Operand 1 from the instruction
+ @param Op2 Operand 2 from the instruction
-Instruction syntax:
- NOT[32|64] {@}R1, {@}R2 {Index16|Immed16}
-
---*/
-{
- return ~Op2;
-}
+ @return Op2 * -1
+ @return Instruction syntax:
+ @return NEG[32|64] {@}R1, {@}R2 {Index16|Immed16}
+**/
STATIC
UINT64
ExecuteNEG (
@@ -2816,27 +2697,23 @@ ExecuteNEG ( IN UINT64 Op1,
IN UINT64 Op2
)
-/*++
-
-Routine Description:
- Execute the EBC NEG instruction
+{
+ return ~Op2 + 1;
+}
-Arguments:
- VmPtr - pointer to a VM context
- Op1 - Operand 1 from the instruction
- Op2 - Operand 2 from the instruction
-Returns:
- Op2 * -1
+/**
+ Execute the EBC ADD instruction
-Instruction syntax:
- NEG[32|64] {@}R1, {@}R2 {Index16|Immed16}
+ @param VmPtr pointer to a VM context
+ @param Op1 Operand 1 from the instruction
+ @param Op2 Operand 2 from the instruction
---*/
-{
- return ~Op2 + 1;
-}
+ @return Op1 + Op2
+ @return Instruction syntax:
+ @return ADD[32|64] {@}R1, {@}R2 {Index16}
+**/
STATIC
UINT64
ExecuteADD (
@@ -2844,28 +2721,23 @@ ExecuteADD ( IN UINT64 Op1,
IN UINT64 Op2
)
-/*++
-
-Routine Description:
-
- Execute the EBC ADD instruction
+{
+ return Op1 + Op2;
+}
-Arguments:
- VmPtr - pointer to a VM context
- Op1 - Operand 1 from the instruction
- Op2 - Operand 2 from the instruction
-Returns:
- Op1 + Op2
+/**
+ Execute the EBC SUB instruction
-Instruction syntax:
- ADD[32|64] {@}R1, {@}R2 {Index16}
+ @param VmPtr pointer to a VM context
+ @param Op1 Operand 1 from the instruction
+ @param Op2 Operand 2 from the instruction
---*/
-{
- return Op1 + Op2;
-}
+ @retval Op1 Op2 Standard EFI_STATUS
+ @return Instruction syntax:
+ @return SUB[32|64] {@}R1, {@}R2 {Index16|Immed16}
+**/
STATIC
UINT64
ExecuteSUB (
@@ -2873,24 +2745,6 @@ ExecuteSUB ( IN UINT64 Op1,
IN UINT64 Op2
)
-/*++
-
-Routine Description:
- Execute the EBC SUB instruction
-
-Arguments:
- VmPtr - pointer to a VM context
- Op1 - Operand 1 from the instruction
- Op2 - Operand 2 from the instruction
-
-Returns:
- Op1 - Op2
- Standard EFI_STATUS
-
-Instruction syntax:
- SUB[32|64] {@}R1, {@}R2 {Index16|Immed16}
-
---*/
{
if (*VmPtr->Ip & DATAMANIP_M_64) {
return (UINT64) ((INT64) ((INT64) Op1 - (INT64) Op2));
@@ -2899,6 +2753,19 @@ Instruction syntax: }
}
+
+/**
+ Execute the EBC MUL instruction
+
+ @param VmPtr pointer to a VM context
+ @param Op1 Operand 1 from the instruction
+ @param Op2 Operand 2 from the instruction
+
+ @return Op1 * Op2
+ @return Instruction syntax:
+ @return MUL[32|64] {@}R1, {@}R2 {Index16|Immed16}
+
+**/
STATIC
UINT64
ExecuteMUL (
@@ -2906,24 +2773,6 @@ ExecuteMUL ( IN UINT64 Op1,
IN UINT64 Op2
)
-/*++
-
-Routine Description:
-
- Execute the EBC MUL instruction
-
-Arguments:
- VmPtr - pointer to a VM context
- Op1 - Operand 1 from the instruction
- Op2 - Operand 2 from the instruction
-
-Returns:
- Op1 * Op2
-
-Instruction syntax:
- MUL[32|64] {@}R1, {@}R2 {Index16|Immed16}
-
---*/
{
if (*VmPtr->Ip & DATAMANIP_M_64) {
return MultS64x64 ((INT64)Op1, (INT64)Op2);
@@ -2932,6 +2781,19 @@ Instruction syntax: }
}
+
+/**
+ Execute the EBC MULU instruction
+
+ @param VmPtr pointer to a VM context
+ @param Op1 Operand 1 from the instruction
+ @param Op2 Operand 2 from the instruction
+
+ @return (unsigned)Op1 * (unsigned)Op2
+ @return Instruction syntax:
+ @return MULU[32|64] {@}R1, {@}R2 {Index16|Immed16}
+
+**/
STATIC
UINT64
ExecuteMULU (
@@ -2939,23 +2801,6 @@ ExecuteMULU ( IN UINT64 Op1,
IN UINT64 Op2
)
-/*++
-
-Routine Description:
- Execute the EBC MULU instruction
-
-Arguments:
- VmPtr - pointer to a VM context
- Op1 - Operand 1 from the instruction
- Op2 - Operand 2 from the instruction
-
-Returns:
- (unsigned)Op1 * (unsigned)Op2
-
-Instruction syntax:
- MULU[32|64] {@}R1, {@}R2 {Index16|Immed16}
-
---*/
{
if (*VmPtr->Ip & DATAMANIP_M_64) {
return MultU64x64 (Op1, Op2);
@@ -2964,6 +2809,19 @@ Instruction syntax: }
}
+
+/**
+ Execute the EBC DIV instruction
+
+ @param VmPtr pointer to a VM context
+ @param Op1 Operand 1 from the instruction
+ @param Op2 Operand 2 from the instruction
+
+ @return Op1/Op2
+ @return Instruction syntax:
+ @return DIV[32|64] {@}R1, {@}R2 {Index16|Immed16}
+
+**/
STATIC
UINT64
ExecuteDIV (
@@ -2971,24 +2829,6 @@ ExecuteDIV ( IN UINT64 Op1,
IN UINT64 Op2
)
-/*++
-
-Routine Description:
-
- Execute the EBC DIV instruction
-
-Arguments:
- VmPtr - pointer to a VM context
- Op1 - Operand 1 from the instruction
- Op2 - Operand 2 from the instruction
-
-Returns:
- Op1/Op2
-
-Instruction syntax:
- DIV[32|64] {@}R1, {@}R2 {Index16|Immed16}
-
---*/
{
INT64 Remainder;
@@ -3012,6 +2852,19 @@ Instruction syntax: }
}
+
+/**
+ Execute the EBC DIVU instruction
+
+ @param VmPtr pointer to a VM context
+ @param Op1 Operand 1 from the instruction
+ @param Op2 Operand 2 from the instruction
+
+ @return (unsigned)Op1 / (unsigned)Op2
+ @return Instruction syntax:
+ @return DIVU[32|64] {@}R1, {@}R2 {Index16|Immed16}
+
+**/
STATIC
UINT64
ExecuteDIVU (
@@ -3019,23 +2872,6 @@ ExecuteDIVU ( IN UINT64 Op1,
IN UINT64 Op2
)
-/*++
-
-Routine Description:
- Execute the EBC DIVU instruction
-
-Arguments:
- VmPtr - pointer to a VM context
- Op1 - Operand 1 from the instruction
- Op2 - Operand 2 from the instruction
-
-Returns:
- (unsigned)Op1 / (unsigned)Op2
-
-Instruction syntax:
- DIVU[32|64] {@}R1, {@}R2 {Index16|Immed16}
-
---*/
{
UINT64 Remainder;
@@ -3061,6 +2897,19 @@ Instruction syntax: }
}
+
+/**
+ Execute the EBC MOD instruction
+
+ @param VmPtr pointer to a VM context
+ @param Op1 Operand 1 from the instruction
+ @param Op2 Operand 2 from the instruction
+
+ @return Op1 MODULUS Op2
+ @return Instruction syntax:
+ @return MOD[32|64] {@}R1, {@}R2 {Index16|Immed16}
+
+**/
STATIC
UINT64
ExecuteMOD (
@@ -3068,23 +2917,6 @@ ExecuteMOD ( IN UINT64 Op1,
IN UINT64 Op2
)
-/*++
-
-Routine Description:
- Execute the EBC MOD instruction
-
-Arguments:
- VmPtr - pointer to a VM context
- Op1 - Operand 1 from the instruction
- Op2 - Operand 2 from the instruction
-
-Returns:
- Op1 MODULUS Op2
-
-Instruction syntax:
- MOD[32|64] {@}R1, {@}R2 {Index16|Immed16}
-
---*/
{
INT64 Remainder;
@@ -3104,6 +2936,19 @@ Instruction syntax: }
}
+
+/**
+ Execute the EBC MODU instruction
+
+ @param VmPtr pointer to a VM context
+ @param Op1 Operand 1 from the instruction
+ @param Op2 Operand 2 from the instruction
+
+ @return Op1 UNSIGNED_MODULUS Op2
+ @return Instruction syntax:
+ @return MODU[32|64] {@}R1, {@}R2 {Index16|Immed16}
+
+**/
STATIC
UINT64
ExecuteMODU (
@@ -3111,23 +2956,6 @@ ExecuteMODU ( IN UINT64 Op1,
IN UINT64 Op2
)
-/*++
-
-Routine Description:
- Execute the EBC MODU instruction
-
-Arguments:
- VmPtr - pointer to a VM context
- Op1 - Operand 1 from the instruction
- Op2 - Operand 2 from the instruction
-
-Returns:
- Op1 UNSIGNED_MODULUS Op2
-
-Instruction syntax:
- MODU[32|64] {@}R1, {@}R2 {Index16|Immed16}
-
---*/
{
UINT64 Remainder;
@@ -3147,6 +2975,19 @@ Instruction syntax: }
}
+
+/**
+ Execute the EBC AND instruction
+
+ @param VmPtr pointer to a VM context
+ @param Op1 Operand 1 from the instruction
+ @param Op2 Operand 2 from the instruction
+
+ @return Op1 AND Op2
+ @return Instruction syntax:
+ @return AND[32|64] {@}R1, {@}R2 {Index16|Immed16}
+
+**/
STATIC
UINT64
ExecuteAND (
@@ -3154,27 +2995,23 @@ ExecuteAND ( IN UINT64 Op1,
IN UINT64 Op2
)
-/*++
-
-Routine Description:
- Execute the EBC AND instruction
+{
+ return Op1 & Op2;
+}
-Arguments:
- VmPtr - pointer to a VM context
- Op1 - Operand 1 from the instruction
- Op2 - Operand 2 from the instruction
-Returns:
- Op1 AND Op2
+/**
+ Execute the EBC OR instruction
-Instruction syntax:
- AND[32|64] {@}R1, {@}R2 {Index16|Immed16}
+ @param VmPtr pointer to a VM context
+ @param Op1 Operand 1 from the instruction
+ @param Op2 Operand 2 from the instruction
---*/
-{
- return Op1 & Op2;
-}
+ @return Op1 OR Op2
+ @return Instruction syntax:
+ @return OR[32|64] {@}R1, {@}R2 {Index16|Immed16}
+**/
STATIC
UINT64
ExecuteOR (
@@ -3182,27 +3019,23 @@ ExecuteOR ( IN UINT64 Op1,
IN UINT64 Op2
)
-/*++
-
-Routine Description:
- Execute the EBC OR instruction
+{
+ return Op1 | Op2;
+}
-Arguments:
- VmPtr - pointer to a VM context
- Op1 - Operand 1 from the instruction
- Op2 - Operand 2 from the instruction
-Returns:
- Op1 OR Op2
+/**
+ Execute the EBC XOR instruction
-Instruction syntax:
- OR[32|64] {@}R1, {@}R2 {Index16|Immed16}
+ @param VmPtr pointer to a VM context
+ @param Op1 Operand 1 from the instruction
+ @param Op2 Operand 2 from the instruction
---*/
-{
- return Op1 | Op2;
-}
+ @return Op1 XOR Op2
+ @return Instruction syntax:
+ @return XOR[32|64] {@}R1, {@}R2 {Index16|Immed16}
+**/
STATIC
UINT64
ExecuteXOR (
@@ -3210,27 +3043,23 @@ ExecuteXOR ( IN UINT64 Op1,
IN UINT64 Op2
)
-/*++
-
-Routine Description:
- Execute the EBC XOR instruction
+{
+ return Op1 ^ Op2;
+}
-Arguments:
- VmPtr - pointer to a VM context
- Op1 - Operand 1 from the instruction
- Op2 - Operand 2 from the instruction
-Returns:
- Op1 XOR Op2
+/**
+ Execute the EBC SHL shift left instruction
-Instruction syntax:
- XOR[32|64] {@}R1, {@}R2 {Index16|Immed16}
+ @param VmPtr pointer to a VM context
+ @param Op1 Operand 1 from the instruction
+ @param Op2 Operand 2 from the instruction
---*/
-{
- return Op1 ^ Op2;
-}
+ @return Op1 << Op2
+ @return Instruction syntax:
+ @return SHL[32|64] {@}R1, {@}R2 {Index16|Immed16}
+**/
STATIC
UINT64
ExecuteSHL (
@@ -3238,24 +3067,6 @@ ExecuteSHL ( IN UINT64 Op1,
IN UINT64 Op2
)
-/*++
-
-Routine Description:
-
- Execute the EBC SHL shift left instruction
-
-Arguments:
- VmPtr - pointer to a VM context
- Op1 - Operand 1 from the instruction
- Op2 - Operand 2 from the instruction
-
-Returns:
- Op1 << Op2
-
-Instruction syntax:
- SHL[32|64] {@}R1, {@}R2 {Index16|Immed16}
-
---*/
{
if (*VmPtr->Ip & DATAMANIP_M_64) {
return LShiftU64 (Op1, (UINTN)Op2);
@@ -3264,6 +3075,19 @@ Instruction syntax: }
}
+
+/**
+ Execute the EBC SHR instruction
+
+ @param VmPtr pointer to a VM context
+ @param Op1 Operand 1 from the instruction
+ @param Op2 Operand 2 from the instruction
+
+ @return Op1 >> Op2 (unsigned operands)
+ @return Instruction syntax:
+ @return SHR[32|64] {@}R1, {@}R2 {Index16|Immed16}
+
+**/
STATIC
UINT64
ExecuteSHR (
@@ -3271,23 +3095,6 @@ ExecuteSHR ( IN UINT64 Op1,
IN UINT64 Op2
)
-/*++
-
-Routine Description:
- Execute the EBC SHR instruction
-
-Arguments:
- VmPtr - pointer to a VM context
- Op1 - Operand 1 from the instruction
- Op2 - Operand 2 from the instruction
-
-Returns:
- Op1 >> Op2 (unsigned operands)
-
-Instruction syntax:
- SHR[32|64] {@}R1, {@}R2 {Index16|Immed16}
-
---*/
{
if (*VmPtr->Ip & DATAMANIP_M_64) {
return RShiftU64 (Op1, (UINTN)Op2);
@@ -3296,6 +3103,19 @@ Instruction syntax: }
}
+
+/**
+ Execute the EBC ASHR instruction
+
+ @param VmPtr pointer to a VM context
+ @param Op1 Operand 1 from the instruction
+ @param Op2 Operand 2 from the instruction
+
+ @return Op1 >> Op2 (signed)
+ @return Instruction syntax:
+ @return ASHR[32|64] {@}R1, {@}R2 {Index16|Immed16}
+
+**/
STATIC
UINT64
ExecuteASHR (
@@ -3303,23 +3123,6 @@ ExecuteASHR ( IN UINT64 Op1,
IN UINT64 Op2
)
-/*++
-
-Routine Description:
- Execute the EBC ASHR instruction
-
-Arguments:
- VmPtr - pointer to a VM context
- Op1 - Operand 1 from the instruction
- Op2 - Operand 2 from the instruction
-
-Returns:
- Op1 >> Op2 (signed)
-
-Instruction syntax:
- ASHR[32|64] {@}R1, {@}R2 {Index16|Immed16}
-
---*/
{
if (*VmPtr->Ip & DATAMANIP_M_64) {
return ARShiftU64 (Op1, (UINTN)Op2);
@@ -3328,6 +3131,19 @@ Instruction syntax: }
}
+
+/**
+ Execute the EBC EXTNDB instruction to sign-extend a byte value.
+
+ @param VmPtr pointer to a VM context
+ @param Op1 Operand 1 from the instruction
+ @param Op2 Operand 2 from the instruction
+
+ @return (INT64)(INT8)Op2
+ @return Instruction syntax:
+ @return EXTNDB[32|64] {@}R1, {@}R2 {Index16|Immed16}
+
+**/
STATIC
UINT64
ExecuteEXTNDB (
@@ -3335,24 +3151,6 @@ ExecuteEXTNDB ( IN UINT64 Op1,
IN UINT64 Op2
)
-/*++
-
-Routine Description:
- Execute the EBC EXTNDB instruction to sign-extend a byte value.
-
-Arguments:
- VmPtr - pointer to a VM context
- Op1 - Operand 1 from the instruction
- Op2 - Operand 2 from the instruction
-
-Returns:
- (INT64)(INT8)Op2
-
-Instruction syntax:
- EXTNDB[32|64] {@}R1, {@}R2 {Index16|Immed16}
-
-
---*/
{
INT8 Data8;
INT64 Data64;
@@ -3366,6 +3164,19 @@ Instruction syntax: return (UINT64) Data64;
}
+
+/**
+ Execute the EBC EXTNDW instruction to sign-extend a 16-bit value.
+
+ @param VmPtr pointer to a VM context
+ @param Op1 Operand 1 from the instruction
+ @param Op2 Operand 2 from the instruction
+
+ @return (INT64)(INT16)Op2
+ @return Instruction syntax:
+ @return EXTNDW[32|64] {@}R1, {@}R2 {Index16|Immed16}
+
+**/
STATIC
UINT64
ExecuteEXTNDW (
@@ -3373,24 +3184,6 @@ ExecuteEXTNDW ( IN UINT64 Op1,
IN UINT64 Op2
)
-/*++
-
-Routine Description:
- Execute the EBC EXTNDW instruction to sign-extend a 16-bit value.
-
-Arguments:
- VmPtr - pointer to a VM context
- Op1 - Operand 1 from the instruction
- Op2 - Operand 2 from the instruction
-
-Returns:
- (INT64)(INT16)Op2
-
-Instruction syntax:
- EXTNDW[32|64] {@}R1, {@}R2 {Index16|Immed16}
-
-
---*/
{
INT16 Data16;
INT64 Data64;
@@ -3411,6 +3204,19 @@ Instruction syntax: //
// Operation: Dest <- SignExtended((DWORD)Source))
//
+
+/**
+ Execute the EBC EXTNDD instruction to sign-extend a 32-bit value.
+
+ @param VmPtr pointer to a VM context
+ @param Op1 Operand 1 from the instruction
+ @param Op2 Operand 2 from the instruction
+
+ @return (INT64)(INT32)Op2
+ @return Instruction syntax:
+ @return EXTNDD[32|64] {@}R1, {@}R2 {Index16|Immed16}
+
+**/
STATIC
UINT64
ExecuteEXTNDD (
@@ -3418,24 +3224,6 @@ ExecuteEXTNDD ( IN UINT64 Op1,
IN UINT64 Op2
)
-/*++
-
-Routine Description:
- Execute the EBC EXTNDD instruction to sign-extend a 32-bit value.
-
-Arguments:
- VmPtr - pointer to a VM context
- Op1 - Operand 1 from the instruction
- Op2 - Operand 2 from the instruction
-
-Returns:
- (INT64)(INT32)Op2
-
-Instruction syntax:
- EXTNDD[32|64] {@}R1, {@}R2 {Index16|Immed16}
-
-
---*/
{
INT32 Data32;
INT64 Data64;
@@ -3475,32 +3263,28 @@ ExecuteUnsignedDataManip ( return ExecuteDataManip (VmPtr, FALSE);
}
-STATIC
-EFI_STATUS
-ExecuteDataManip (
- IN VM_CONTEXT *VmPtr,
- IN BOOLEAN IsSignedOp
- )
-/*++
-Routine Description:
- Execute all the EBC data manipulation instructions.
- Since the EBC data manipulation instructions all have the same basic form,
+/**
+ Execute all the EBC data manipulation instructions.
+ Since the EBC data manipulation instructions all have the same basic form,
they can share the code that does the fetch of operands and the write-back
of the result. This function performs the fetch of the operands (even if
both are not needed to be fetched, like NOT instruction), dispatches to the
appropriate subfunction, then writes back the returned result.
-Arguments:
- VmPtr - pointer to VM context
+ @param VmPtr pointer to VM context
-Returns:
- Standard EBC status
+ @return Standard EBC status
+ @return Format:
+ @return INSTRUCITON[32|64] {@}R1, {@}R2 {Immed16|Index16}
-Format:
- INSTRUCITON[32|64] {@}R1, {@}R2 {Immed16|Index16}
-
---*/
+**/
+STATIC
+EFI_STATUS
+ExecuteDataManip (
+ IN VM_CONTEXT *VmPtr,
+ IN BOOLEAN IsSignedOp
+ )
{
UINT8 Opcode;
INT16 Index16;
@@ -3632,26 +3416,22 @@ Format: return EFI_SUCCESS;
}
-STATIC
-EFI_STATUS
-ExecuteLOADSP (
- IN VM_CONTEXT *VmPtr
- )
-/*++
-Routine Description:
+/**
Execute the EBC LOADSP instruction
-Arguments:
- VmPtr - pointer to a VM context
-
-Returns:
- Standard EFI_STATUS
+ @param VmPtr pointer to a VM context
-Instruction syntax:
- LOADSP SP1, R2
+ @return Standard EFI_STATUS
+ @return Instruction syntax:
+ @return LOADSP SP1, R2
---*/
+**/
+STATIC
+EFI_STATUS
+ExecuteLOADSP (
+ IN VM_CONTEXT *VmPtr
+ )
{
UINT8 Operands;
@@ -3689,26 +3469,22 @@ Instruction syntax: return EFI_SUCCESS;
}
-STATIC
-EFI_STATUS
-ExecuteSTORESP (
- IN VM_CONTEXT *VmPtr
- )
-/*++
-Routine Description:
+/**
Execute the EBC STORESP instruction
-Arguments:
- VmPtr - pointer to a VM context
-
-Returns:
- Standard EFI_STATUS
+ @param VmPtr pointer to a VM context
-Instruction syntax:
- STORESP Rx, FLAGS|IP
+ @return Standard EFI_STATUS
+ @return Instruction syntax:
+ @return STORESP Rx, FLAGS|IP
---*/
+**/
+STATIC
+EFI_STATUS
+ExecuteSTORESP (
+ IN VM_CONTEXT *VmPtr
+ )
{
UINT8 Operands;
@@ -3753,37 +3529,32 @@ Instruction syntax: return EFI_SUCCESS;
}
+
+/**
+ Decode a 16-bit index to determine the offset. Given an index value:
+ b15 - sign bit
+ b14:12 - number of bits in this index assigned to natural units (=a)
+ ba:11 - constant units = C
+ b0:a - natural units = N
+ Given this info, the offset can be computed by:
+ offset = sign_bit * (C + N * sizeof(UINTN))
+ Max offset is achieved with index = 0x7FFF giving an offset of
+ 0x27B (32-bit machine) or 0x477 (64-bit machine).
+ Min offset is achieved with index =
+
+ @param VmPtr pointer to VM context
+ @param CodeOffset offset from IP of the location of the 16-bit index to
+ decode
+
+ @return The decoded offset.
+
+**/
STATIC
INT16
VmReadIndex16 (
IN VM_CONTEXT *VmPtr,
IN UINT32 CodeOffset
)
-/*++
-
-Routine Description:
- Decode a 16-bit index to determine the offset. Given an index value:
-
- b15 - sign bit
- b14:12 - number of bits in this index assigned to natural units (=a)
- ba:11 - constant units = C
- b0:a - natural units = N
-
- Given this info, the offset can be computed by:
- offset = sign_bit * (C + N * sizeof(UINTN))
-
- Max offset is achieved with index = 0x7FFF giving an offset of
- 0x27B (32-bit machine) or 0x477 (64-bit machine).
- Min offset is achieved with index =
-
-Arguments:
- VmPtr - pointer to VM context
- CodeOffset - offset from IP of the location of the 16-bit index to decode
-
-Returns:
- The decoded offset.
-
---*/
{
UINT16 Index;
INT16 Offset;
@@ -3839,25 +3610,23 @@ Returns: return Offset;
}
+
+/**
+ Decode a 32-bit index to determine the offset.
+
+ @param VmPtr pointer to VM context
+ @param CodeOffset offset from IP of the location of the 32-bit index to
+ decode
+
+ @return Converted index per EBC VM specification
+
+**/
STATIC
INT32
VmReadIndex32 (
IN VM_CONTEXT *VmPtr,
IN UINT32 CodeOffset
)
-/*++
-
-Routine Description:
- Decode a 32-bit index to determine the offset.
-
-Arguments:
- VmPtr - pointer to VM context
- CodeOffset - offset from IP of the location of the 32-bit index to decode
-
-Returns:
- Converted index per EBC VM specification
-
---*/
{
UINT32 Index;
INT32 Offset;
@@ -3905,25 +3674,23 @@ Returns: return Offset;
}
+
+/**
+ Decode a 64-bit index to determine the offset.
+
+ @param VmPtr pointer to VM context
+ @param CodeOffset offset from IP of the location of the 64-bit index to
+ decode
+
+ @return Converted index per EBC VM specification
+
+**/
STATIC
INT64
VmReadIndex64 (
IN VM_CONTEXT *VmPtr,
IN UINT32 CodeOffset
)
-/*++
-
-Routine Description:
- Decode a 64-bit index to determine the offset.
-
-Arguments:
- VmPtr - pointer to VM context
- CodeOffset - offset from IP of the location of the 64-bit index to decode
-
-Returns:
- Converted index per EBC VM specification
-
---*/
{
UINT64 Index;
INT64 Offset;
@@ -3971,37 +3738,32 @@ Returns: return Offset;
}
-STATIC
-EFI_STATUS
-VmWriteMem8 (
- IN VM_CONTEXT *VmPtr,
- IN UINTN Addr,
- IN UINT8 Data
- )
-/*++
-Routine Description:
+/**
The following VmWriteMem? routines are called by the EBC data
movement instructions that write to memory. Since these writes
may be to the stack, which looks like (high address on top) this,
-
[EBC entry point arguments]
[VM stack]
[EBC stack]
-
we need to detect all attempts to write to the EBC entry point argument
- stack area and adjust the address (which will initially point into the
+ stack area and adjust the address (which will initially point into the
VM stack) to point into the EBC entry point arguments.
-Arguments:
- VmPtr - pointer to a VM context
- Addr - adddress to write to
- Data - value to write to Addr
-
-Returns:
- Standard EFI_STATUS
+ @param VmPtr pointer to a VM context
+ @param Addr adddress to write to
+ @param Data value to write to Addr
+
+ @return Standard EFI_STATUS
---*/
+**/
+STATIC
+EFI_STATUS
+VmWriteMem8 (
+ IN VM_CONTEXT *VmPtr,
+ IN UINTN Addr,
+ IN UINT8 Data
+ )
{
//
// Convert the address if it's in the stack gap
@@ -4166,29 +3928,25 @@ VmWriteMemN ( return Status;
}
-STATIC
-INT8
-VmReadImmed8 (
- IN VM_CONTEXT *VmPtr,
- IN UINT32 Offset
- )
-/*++
-Routine Description:
-
+/**
The following VmReadImmed routines are called by the EBC execute
functions to read EBC immediate values from the code stream.
- Since we can't assume alignment, each tries to read in the biggest
+ Since we can't assume alignment, each tries to read in the biggest
chunks size available, but will revert to smaller reads if necessary.
-Arguments:
- VmPtr - pointer to a VM context
- Offset - offset from IP of the code bytes to read.
+ @param VmPtr pointer to a VM context
+ @param Offset offset from IP of the code bytes to read.
-Returns:
- Signed data of the requested size from the specified address.
+ @return Signed data of the requested size from the specified address.
---*/
+**/
+STATIC
+INT8
+VmReadImmed8 (
+ IN VM_CONTEXT *VmPtr,
+ IN UINT32 Offset
+ )
{
//
// Simply return the data in flat memory space
@@ -4276,26 +4034,23 @@ VmReadImmed64 ( return Data64;
}
+
+/**
+ The following VmReadCode() routines provide the ability to read raw
+ unsigned data from the code stream.
+
+ @param VmPtr pointer to VM context
+ @param Offset offset from current IP to the raw data to read.
+
+ @return The raw unsigned 16-bit value from the code stream.
+
+**/
STATIC
UINT16
VmReadCode16 (
IN VM_CONTEXT *VmPtr,
IN UINT32 Offset
)
-/*++
-
-Routine Description:
- The following VmReadCode() routines provide the ability to read raw
- unsigned data from the code stream.
-
-Arguments:
- VmPtr - pointer to VM context
- Offset - offset from current IP to the raw data to read.
-
-Returns:
- The raw unsigned 16-bit value from the code stream.
-
---*/
{
//
// Read direct if aligned
@@ -4466,64 +4221,53 @@ VmReadMem64 ( return Data;
}
-STATIC
-UINTN
-ConvertStackAddr (
- IN VM_CONTEXT *VmPtr,
- IN UINTN Addr
- )
-/*++
-
-Routine Description:
+/**
Given an address that EBC is going to read from or write to, return
an appropriate address that accounts for a gap in the stack.
-
The stack for this application looks like this (high addr on top)
[EBC entry point arguments]
[VM stack]
[EBC stack]
-
The EBC assumes that its arguments are at the top of its stack, which
is where the VM stack is really. Therefore if the EBC does memory
accesses into the VM stack area, then we need to convert the address
to point to the EBC entry point arguments area. Do this here.
-Arguments:
-
- VmPtr - pointer to VM context
- Addr - address of interest
+ @param VmPtr pointer to VM context
+ @param Addr address of interest
-Returns:
+ @return The unchanged address if it's not in the VM stack region. Otherwise,
+ @return adjust for the stack gap and return the modified address.
- The unchanged address if it's not in the VM stack region. Otherwise,
- adjust for the stack gap and return the modified address.
-
---*/
-{
+**/
+STATIC
+UINTN
+ConvertStackAddr (
+ IN VM_CONTEXT *VmPtr,
+ IN UINTN Addr
+ )
+{
ASSERT(((Addr < VmPtr->LowStackTop) || (Addr > VmPtr->HighStackBottom)));
return Addr;
}
+
+/**
+ Read a natural value from memory. May or may not be aligned.
+
+ @param VmPtr current VM context
+ @param Addr the address to read from
+
+ @return The natural value at address Addr.
+
+**/
STATIC
UINTN
VmReadMemN (
IN VM_CONTEXT *VmPtr,
IN UINTN Addr
)
-/*++
-
-Routine Description:
- Read a natural value from memory. May or may not be aligned.
-
-Arguments:
- VmPtr - current VM context
- Addr - the address to read from
-
-Returns:
- The natural value at address Addr.
-
---*/
{
UINTN Data;
volatile UINT32 Size;
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcExecute.h b/MdeModulePkg/Universal/EbcDxe/EbcExecute.h index b1926ee..91aada0 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcExecute.h +++ b/MdeModulePkg/Universal/EbcDxe/EbcExecute.h @@ -1,25 +1,18 @@ -/*++
-
-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:
-
- EbcExecute.h
-
-Abstract:
-
+/** @file
Header file for Virtual Machine support. Contains EBC defines that can
- be of use to a disassembler for the most part. Also provides function
+ be of use to a disassembler for the most part. Also provides function
prototypes for VM functions.
---*/
+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.
+
+**/
#ifndef _EBC_EXECUTE_H_
#define _EBC_EXECUTE_H_
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcInt.c b/MdeModulePkg/Universal/EbcDxe/EbcInt.c index 2b647d9..37a2b7f 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcInt.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcInt.c @@ -1,4 +1,7 @@ -/*++
+/** @file
+ Top level module for the EBC virtual machine implementation.
+ Provides auxilliary support routines for the VM. That is, routines
+ that are not particularly related to VM execution of EBC instructions.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
@@ -9,17 +12,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:
-
- EbcInt.c
-
-Abstract:
-
- Top level module for the EBC virtual machine implementation.
- Provides auxilliary support routines for the VM. That is, routines
- that are not particularly related to VM execution of EBC instructions.
-
---*/
+**/
#include "EbcInt.h"
#include "EbcExecute.h"
@@ -188,28 +181,23 @@ static UINTN mStackNum = 0; static EFI_EVENT mEbcPeriodicEvent;
VM_CONTEXT *mVmPtr = NULL;
-EFI_STATUS
-EFIAPI
-InitializeEbcDriver (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-
-Routine Description:
+/**
Initializes the VM EFI interface. Allocates memory for the VM interface
and registers the VM protocol.
-Arguments:
-
- ImageHandle - EFI image handle.
- SystemTable - Pointer to the EFI system table.
+ @param ImageHandle EFI image handle.
+ @param SystemTable Pointer to the EFI system table.
-Returns:
- Standard EFI status code.
+ @return Standard EFI status code.
---*/
+**/
+EFI_STATUS
+EFIAPI
+InitializeEbcDriver (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
{
EFI_EBC_PROTOCOL *EbcProtocol;
EFI_EBC_PROTOCOL *OldEbcProtocol;
@@ -384,6 +372,24 @@ ErrorExit: return Status;
}
+
+/**
+ This is the top-level routine plugged into the EBC protocol. Since thunks
+ are very processor-specific, from here we dispatch directly to the very
+ processor-specific routine EbcCreateThunks().
+
+ @param This protocol instance pointer
+ @param ImageHandle handle to the image. The EBC interpreter may use
+ this to keep track of any resource allocations
+ performed in loading and executing the image.
+ @param EbcEntryPoint the entry point for the image (as defined in the
+ file header)
+ @param Thunk pointer to thunk pointer where the address of the
+ created thunk is returned.
+
+ @return EFI_STATUS
+
+**/
STATIC
EFI_STATUS
EFIAPI
@@ -393,29 +399,6 @@ EbcCreateThunk ( IN VOID *EbcEntryPoint,
OUT VOID **Thunk
)
-/*++
-
-Routine Description:
-
- This is the top-level routine plugged into the EBC protocol. Since thunks
- are very processor-specific, from here we dispatch directly to the very
- processor-specific routine EbcCreateThunks().
-
-Arguments:
-
- This - protocol instance pointer
- ImageHandle - handle to the image. The EBC interpreter may use this to keep
- track of any resource allocations performed in loading and
- executing the image.
- EbcEntryPoint - the entry point for the image (as defined in the file header)
- Thunk - pointer to thunk pointer where the address of the created
- thunk is returned.
-
-Returns:
-
- EFI_STATUS
-
---*/
{
EFI_STATUS Status;
@@ -428,6 +411,18 @@ Returns: return Status;
}
+
+/**
+ This EBC debugger protocol service is called by the debug agent
+
+ @param This pointer to the caller's debug support protocol
+ interface
+ @param MaxProcessorIndex pointer to a caller allocated UINTN in which the
+ maximum processor index is returned.
+
+ @return Standard EFI_STATUS
+
+**/
STATIC
EFI_STATUS
EFIAPI
@@ -435,28 +430,23 @@ EbcDebugGetMaximumProcessorIndex ( IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
OUT UINTN *MaxProcessorIndex
)
-/*++
-
-Routine Description:
-
- This EBC debugger protocol service is called by the debug agent
-
-Arguments:
-
- This - pointer to the caller's debug support protocol interface
- MaxProcessorIndex - pointer to a caller allocated UINTN in which the maximum
- processor index is returned.
-
-Returns:
-
- Standard EFI_STATUS
-
---*/
{
*MaxProcessorIndex = 0;
return EFI_SUCCESS;
}
+
+/**
+ This protocol service is called by the debug agent to register a function
+ for us to call on a periodic basis.
+
+ @param This pointer to the caller's debug support protocol
+ interface
+ @param PeriodicCallback pointer to the function to call periodically
+
+ @return Always EFI_SUCCESS
+
+**/
STATIC
EFI_STATUS
EFIAPI
@@ -465,24 +455,6 @@ EbcDebugRegisterPeriodicCallback ( IN UINTN ProcessorIndex,
IN EFI_PERIODIC_CALLBACK PeriodicCallback
)
-/*++
-
-Routine Description:
-
- This protocol service is called by the debug agent to register a function
- for us to call on a periodic basis.
-
-
-Arguments:
-
- This - pointer to the caller's debug support protocol interface
- PeriodicCallback - pointer to the function to call periodically
-
-Returns:
-
- Always EFI_SUCCESS
-
---*/
{
if ((mDebugPeriodicCallback == NULL) && (PeriodicCallback == NULL)) {
return EFI_INVALID_PARAMETER;
@@ -495,6 +467,18 @@ Returns: return EFI_SUCCESS;
}
+
+/**
+ This protocol service is called by the debug agent to register a function
+ for us to call when we detect an exception.
+
+ @param This pointer to the caller's debug support protocol
+ interface
+ @param ExceptionCallback pointer to the function to the exception
+
+ @return Always EFI_SUCCESS
+
+**/
STATIC
EFI_STATUS
EFIAPI
@@ -504,24 +488,6 @@ EbcDebugRegisterExceptionCallback ( IN EFI_EXCEPTION_CALLBACK ExceptionCallback,
IN EFI_EXCEPTION_TYPE ExceptionType
)
-/*++
-
-Routine Description:
-
- This protocol service is called by the debug agent to register a function
- for us to call when we detect an exception.
-
-
-Arguments:
-
- This - pointer to the caller's debug support protocol interface
- ExceptionCallback - pointer to the function to the exception
-
-Returns:
-
- Always EFI_SUCCESS
-
---*/
{
if ((ExceptionType < 0) || (ExceptionType > MAX_EBC_EXCEPTION)) {
return EFI_INVALID_PARAMETER;
@@ -536,6 +502,15 @@ Returns: return EFI_SUCCESS;
}
+
+/**
+ This EBC debugger protocol service is called by the debug agent. Required
+ for DebugSupport compliance but is only stubbed out for EBC.
+
+
+ @return EFI_SUCCESS
+
+**/
STATIC
EFI_STATUS
EFIAPI
@@ -545,45 +520,26 @@ EbcDebugInvalidateInstructionCache ( IN VOID *Start,
IN UINT64 Length
)
-/*++
-
-Routine Description:
+{
+ return EFI_SUCCESS;
+}
- This EBC debugger protocol service is called by the debug agent. Required
- for DebugSupport compliance but is only stubbed out for EBC.
-Arguments:
+/**
+ The VM interpreter calls this function when an exception is detected.
-Returns:
+ @param VmPtr pointer to a VM context for passing info to the
+ EFI debugger.
- EFI_SUCCESS
-
---*/
-{
- return EFI_SUCCESS;
-}
+ @return EFI_SUCCESS if it returns at all
+**/
EFI_STATUS
EbcDebugSignalException (
IN EFI_EXCEPTION_TYPE ExceptionType,
IN EXCEPTION_FLAGS ExceptionFlags,
IN VM_CONTEXT *VmPtr
)
-/*++
-
-Routine Description:
-
- The VM interpreter calls this function when an exception is detected.
-
-Arguments:
-
- VmPtr - pointer to a VM context for passing info to the EFI debugger.
-
-Returns:
-
- EFI_SUCCESS if it returns at all
-
---*/
{
EFI_SYSTEM_CONTEXT_EBC EbcContext;
EFI_SYSTEM_CONTEXT SystemContext;
@@ -645,26 +601,20 @@ Returns: return EFI_SUCCESS;
}
-STATIC
-EFI_STATUS
-InitializeEbcCallback (
- IN EFI_DEBUG_SUPPORT_PROTOCOL *This
- )
-/*++
-
-Routine Description:
+/**
To install default Callback function for the VM interpreter.
-Arguments:
+ @param This pointer to the instance of DebugSupport protocol
- This - pointer to the instance of DebugSupport protocol
+ @return None
-Returns:
-
- None
-
---*/
+**/
+STATIC
+EFI_STATUS
+InitializeEbcCallback (
+ IN EFI_DEBUG_SUPPORT_PROTOCOL *This
+ )
{
INTN Index;
EFI_STATUS Status;
@@ -707,30 +657,24 @@ Returns: return EFI_SUCCESS;
}
-STATIC
-VOID
-CommonEbcExceptionHandler (
- IN EFI_EXCEPTION_TYPE InterruptType,
- IN EFI_SYSTEM_CONTEXT SystemContext
- )
-/*++
-
-Routine Description:
+/**
The default Exception Callback for the VM interpreter.
In this function, we report status code, and print debug information
about EBC_CONTEXT, then dead loop.
-Arguments:
-
- InterruptType - Interrupt type.
- SystemContext - EBC system context.
-
-Returns:
+ @param InterruptType Interrupt type.
+ @param SystemContext EBC system context.
- None
+ @return None
---*/
+**/
+STATIC
+VOID
+CommonEbcExceptionHandler (
+ IN EFI_EXCEPTION_TYPE InterruptType,
+ IN EFI_SYSTEM_CONTEXT SystemContext
+ )
{
//
// We deadloop here to make it easy to debug this issue.
@@ -740,6 +684,17 @@ Returns: return ;
}
+
+/**
+ The periodic callback function for EBC VM interpreter, which is used
+ to support the EFI debug support protocol.
+
+ @param Event The Periodic Callback Event.
+ @param Context It should be the address of VM_CONTEXT pointer.
+
+ @return None.
+
+**/
STATIC
VOID
EFIAPI
@@ -747,23 +702,6 @@ EbcPeriodicNotifyFunction ( IN EFI_EVENT Event,
IN VOID *Context
)
-/*++
-
-Routine Description:
-
- The periodic callback function for EBC VM interpreter, which is used
- to support the EFI debug support protocol.
-
-Arguments:
-
- Event - The Periodic Callback Event.
- Context - It should be the address of VM_CONTEXT pointer.
-
-Returns:
-
- None.
-
---*/
{
VM_CONTEXT *VmPtr;
@@ -776,27 +714,22 @@ Returns: return ;
}
-STATIC
-EFI_STATUS
-EbcDebugPeriodic (
- IN VM_CONTEXT *VmPtr
- )
-/*++
-
-Routine Description:
+/**
The VM interpreter calls this function on a periodic basis to support
the EFI debug support protocol.
-Arguments:
-
- VmPtr - pointer to a VM context for passing info to the debugger.
+ @param VmPtr pointer to a VM context for passing info to the
+ debugger.
-Returns:
+ @return Standard EFI status.
- Standard EFI status.
-
---*/
+**/
+STATIC
+EFI_STATUS
+EbcDebugPeriodic (
+ IN VM_CONTEXT *VmPtr
+ )
{
EFI_SYSTEM_CONTEXT_EBC EbcContext;
EFI_SYSTEM_CONTEXT SystemContext;
@@ -842,33 +775,27 @@ Returns: return EFI_SUCCESS;
}
-STATIC
-EFI_STATUS
-EFIAPI
-EbcUnloadImage (
- IN EFI_EBC_PROTOCOL *This,
- IN EFI_HANDLE ImageHandle
- )
-/*++
-
-Routine Description:
+/**
This routine is called by the core when an image is being unloaded from
memory. Basically we now have the opportunity to do any necessary cleanup.
Typically this will include freeing any memory allocated for thunk-creation.
-Arguments:
-
- This - protocol instance pointer
- ImageHandle - handle to the image being unloaded.
-
-Returns:
+ @param This protocol instance pointer
+ @param ImageHandle handle to the image being unloaded.
- EFI_INVALID_PARAMETER - the ImageHandle passed in was not found in
- the internal list of EBC image handles.
- EFI_STATUS - completed successfully
+ @retval EFI_INVALID_PARAMETER the ImageHandle passed in was not found in the
+ internal list of EBC image handles.
+ @retval EFI_STATUS completed successfully
---*/
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+EbcUnloadImage (
+ IN EFI_EBC_PROTOCOL *This,
+ IN EFI_HANDLE ImageHandle
+ )
{
EBC_THUNK_LIST *ThunkList;
EBC_THUNK_LIST *NextThunkList;
@@ -922,32 +849,26 @@ Returns: return EFI_SUCCESS;
}
-EFI_STATUS
-EbcAddImageThunk (
- IN EFI_HANDLE ImageHandle,
- IN VOID *ThunkBuffer,
- IN UINT32 ThunkSize
- )
-/*++
-
-Routine Description:
+/**
Add a thunk to our list of thunks for a given image handle.
Also flush the instruction cache since we've written thunk code
to memory that will be executed eventually.
-Arguments:
-
- ImageHandle - the image handle to which the thunk is tied
- ThunkBuffer - the buffer we've created/allocated
- ThunkSize - the size of the thunk memory allocated
-
-Returns:
+ @param ImageHandle the image handle to which the thunk is tied
+ @param ThunkBuffer the buffer we've created/allocated
+ @param ThunkSize the size of the thunk memory allocated
- EFI_OUT_OF_RESOURCES - memory allocation failed
- EFI_SUCCESS - successful completion
+ @retval EFI_OUT_OF_RESOURCES memory allocation failed
+ @retval EFI_SUCCESS successful completion
---*/
+**/
+EFI_STATUS
+EbcAddImageThunk (
+ IN EFI_HANDLE ImageHandle,
+ IN VOID *ThunkBuffer,
+ IN UINT32 ThunkSize
+ )
{
EBC_THUNK_LIST *ThunkList;
EBC_IMAGE_LIST *ImageList;
@@ -1113,27 +1034,21 @@ FreeEBCStack( }
return EFI_SUCCESS;
}
-STATIC
-EFI_STATUS
-InitEbcVmTestProtocol (
- IN EFI_HANDLE *IHandle
- )
-/*++
-
-Routine Description:
+/**
Produce an EBC VM test protocol that can be used for regression tests.
-Arguments:
-
- IHandle - handle on which to install the protocol.
+ @param IHandle handle on which to install the protocol.
-Returns:
+ @retval EFI_OUT_OF_RESOURCES memory allocation failed
+ @retval EFI_SUCCESS successful completion
- EFI_OUT_OF_RESOURCES - memory allocation failed
- EFI_SUCCESS - successful completion
-
---*/
+**/
+STATIC
+EFI_STATUS
+InitEbcVmTestProtocol (
+ IN EFI_HANDLE *IHandle
+ )
{
EFI_HANDLE Handle;
EFI_STATUS Status;
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcInt.h b/MdeModulePkg/Universal/EbcDxe/EbcInt.h index a62b121..c9f2b82 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcInt.h +++ b/MdeModulePkg/Universal/EbcDxe/EbcInt.h @@ -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.
+/** @file
+ Main routines for the EBC interpreter. Includes the initialization and
+ main interpreter routines.
-Module Name:
+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
- EbcInt.h
-
-Abstract:
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Main routines for the EBC interpreter. Includes the initialization and
- main interpreter routines.
-
---*/
+**/
#ifndef _EBC_INT_H_
#define _EBC_INT_H_
diff --git a/MdeModulePkg/Universal/EbcDxe/Ia32/EbcSupport.c b/MdeModulePkg/Universal/EbcDxe/Ia32/EbcSupport.c index a534e00..1d008ac 100644 --- a/MdeModulePkg/Universal/EbcDxe/Ia32/EbcSupport.c +++ b/MdeModulePkg/Universal/EbcDxe/Ia32/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"
@@ -33,38 +26,33 @@ Abstract: #define EBC_THUNK_SIZE 32
#define STACK_REMAIN_SIZE (1024 * 4)
-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
+ @parm VmPtr Pointer to a VM context.
+ @parm FuncAddr Callee's address
+ @parm NewStackPointer New stack pointer after the call
+ @parm FramePtr New frame pointer after the call
+ @parm 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;
@@ -134,7 +122,7 @@ Action: // The callee is not a thunk to EBC, call native code.
//
EbcLLCALLEXNative (FuncAddr, NewStackPointer, FramePtr);
-
+
//
// Get return value and advance the IP.
//
@@ -143,6 +131,19 @@ Action: }
}
+
+/**
+ 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.
+
+ None. Since we're called from a fixed up thunk (which we want to keep
+ small), our only so-called argument is the EBC entry point passed in
+ to us in a processor register.
+
+ @return The value returned by the EBC application we're going to run.
+
+**/
STATIC
UINT64
EbcInterpret (
@@ -163,25 +164,6 @@ EbcInterpret ( IN OUT UINTN Arg15,
IN OUT UINTN Arg16
)
-/*++
-
-Routine Description:
-
- 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:
-
- None. Since we're called from a fixed up thunk (which we want to keep
- small), our only so-called argument is the EBC entry point passed in
- to us in a processor register.
-
-Returns:
-
- The value returned by the EBC application we're going to run.
-
---*/
{
//
// Create a new VM context on the stack
@@ -298,30 +280,24 @@ Returns: return (UINT64) VmContext.R[7];
}
-STATIC
-UINT64
-ExecuteEbcImageEntryPoint (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-
-Routine Description:
+/**
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
@@ -373,7 +349,7 @@ Returns: VmContext.R[0] = (UINT64)(UINTN) ((UINT8*)VmContext.StackPool + STACK_POOL_SIZE);
VmContext.HighStackBottom = (UINTN)VmContext.R[0];
VmContext.R[0] -= sizeof (UINTN);
-
+
//
// Put a magic value in the stack gap, then adjust down again
//
@@ -390,7 +366,7 @@ Returns: VmContext.R[0] -= sizeof (UINTN);
*(UINTN *) (UINTN) (VmContext.R[0]) = (UINTN) ImageHandle;
- VmContext.R[0] -= 16;
+ VmContext.R[0] -= 16;
VmContext.StackRetAddr = (UINT64) VmContext.R[0];
//
// VM pushes 16-bytes for return address. Simulate that here.
@@ -407,6 +383,17 @@ Returns: return (UINT64) VmContext.R[7];
}
+
+/**
+ Create an IA32 thunk for the given EBC entry point.
+
+ @param ImageHandle Handle of image for which this thunk is being created
+ @param EbcEntryPoint Address of the EBC code that the thunk is to call
+ @param Thunk Returned thunk we create here
+
+ @return Standard EFI status.
+
+**/
EFI_STATUS
EbcCreateThunks (
IN EFI_HANDLE ImageHandle,
@@ -414,23 +401,6 @@ EbcCreateThunks ( OUT VOID **Thunk,
IN UINT32 Flags
)
-/*++
-
-Routine Description:
-
- Create an IA32 thunk for the given EBC entry point.
-
-Arguments:
-
- ImageHandle - Handle of image for which this thunk is being created
- EbcEntryPoint - Address of the EBC code that the thunk is to call
- Thunk - Returned thunk we create here
-
-Returns:
-
- Standard EFI status.
-
---*/
{
UINT8 *Ptr;
UINT8 *ThunkBase;
diff --git a/MdeModulePkg/Universal/EbcDxe/Ipf/EbcSupport.c b/MdeModulePkg/Universal/EbcDxe/Ipf/EbcSupport.c index 3647a12..b2cb6f6 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 f6c929b..7b554f3 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_
diff --git a/MdeModulePkg/Universal/EbcDxe/x64/EbcSupport.c b/MdeModulePkg/Universal/EbcDxe/x64/EbcSupport.c index bec82d6..90db166 100644 --- a/MdeModulePkg/Universal/EbcDxe/x64/EbcSupport.c +++ b/MdeModulePkg/Universal/EbcDxe/x64/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 x64 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"
@@ -45,7 +38,7 @@ PushU64 ( Routine Description:
Push a 64 bit unsigned value to the VM stack.
-
+
Arguments:
VmPtr - The pointer to current VM context.
@@ -54,7 +47,7 @@ Arguments: Returns:
VOID
-
+
--*/
{
//
@@ -66,6 +59,19 @@ Returns: return;
}
+
+/**
+ 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.
+
+ This is a thunk function. Microsoft x64 compiler only provide fast_call
+ calling convention, so the first four arguments are passed by rcx, rdx,
+ r8, and r9, while other arguments are passed in stack.
+
+ @return The value returned by the EBC application we're going to run.
+
+**/
STATIC
UINT64
EbcInterpret (
@@ -86,25 +92,6 @@ EbcInterpret ( UINTN Arg15,
UINTN Arg16
)
-/*++
-
-Routine Description:
-
- 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:
-
- This is a thunk function. Microsoft x64 compiler only provide fast_call
- calling convention, so the first four arguments are passed by rcx, rdx,
- r8, and r9, while other arguments are passed in stack.
-
-Returns:
-
- The value returned by the EBC application we're going to run.
-
---*/
{
//
// Create a new VM context on the stack
@@ -140,7 +127,7 @@ Returns: //
// Adjust the VM's stack pointer down.
//
-
+
Status = GetEBCStack((EFI_HANDLE)(UINTN)-1, &VmContext.StackPool, &StackIndex);
if (EFI_ERROR(Status)) {
return Status;
@@ -225,30 +212,25 @@ Returns: return (UINT64) VmContext.R[7];
}
-STATIC
-UINT64
-ExecuteEbcImageEntryPoint (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-
-Routine Description:
+/**
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
@@ -344,6 +326,17 @@ Returns: return (UINT64) VmContext.R[7];
}
+
+/**
+ Create an IA32 thunk for the given EBC entry point.
+
+ @param ImageHandle Handle of image for which this thunk is being created
+ @param EbcEntryPoint Address of the EBC code that the thunk is to call
+ @param Thunk Returned thunk we create here
+
+ @return Standard EFI status.
+
+**/
EFI_STATUS
EbcCreateThunks (
IN EFI_HANDLE ImageHandle,
@@ -351,23 +344,6 @@ EbcCreateThunks ( OUT VOID **Thunk,
IN UINT32 Flags
)
-/*++
-
-Routine Description:
-
- Create an IA32 thunk for the given EBC entry point.
-
-Arguments:
-
- ImageHandle - Handle of image for which this thunk is being created
- EbcEntryPoint - Address of the EBC code that the thunk is to call
- Thunk - Returned thunk we create here
-
-Returns:
-
- Standard EFI status.
-
---*/
{
UINT8 *Ptr;
UINT8 *ThunkBase;
@@ -496,38 +472,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;
|