Intel Extensible Firmware Interface Network Router User Manual


  Open as PDF
of 1084
 
EFI Byte Code Virtual Machine
Version 1.10 12/01/02 19-75
19.13 VM Exception Handling
This section lists the different types of exceptions that the VM may assert during execution of an
EBC image. If a debugger is attached to the EBC driver via the EFI debug support protocol, then
the debugger should be able to capture and identify the exception type. If a debugger is not
attached, then depending on the severity of the exception, the interpreter may do one of the
following:
Invoke the EFI ASSERT() macro, which will typically display an error message and halt the
system
Sit in a while(1) loop to hang the system
Ignore the exception and continue execution of the image (minor exceptions only)
It is a platform policy decision as to the action taken in response to EBC exceptions. The following
sections describe the exceptions that may be generated by the VM.
19.13.1 Divide By 0 Exception
A divide-by-0 exception can occur for the EBC instructions DIV, DIVU, MOD, and MODU.
19.13.2 Debug Break Exception
A debug break exception occurs if the VM encounters a BREAK instruction with a break code of 3.
19.13.3 Invalid Opcode Exception
An invalid opcode exception will occur if the interpreter encounters a reserved opcode during
execution.
19.13.4 Stack Fault Exception
A stack fault exception can occur if the interpreter detects that function nesting within the
interpreter or system interrupts was sufficient to potentially corrupt the EBC images stack
contents. This exception could also occur if the EBC driver attempts to adjust the stack pointer
outside the range allocated to the driver.
19.13.5 Alignment Exception
An alignment exception can occur if the particular implementation of the interpreter does not
support unaligned accesses to data or code. It may also occur if the stack pointer or instruction
pointer becomes misaligned.
19.13.6 Instruction Encoding Exception
An instruction encoding exception can occur for the following:
For some instructions, if an Operand 1 index is specified and Operand 1 is direct
If an instruction encoding has reserved bits set to values other than 0
If an instruction encoding has a field set to a reserved value.