9 runtime and software conventions, 1 calling outside vm, 2 calling inside vm – Intel Extensible Firmware Interface User Manual

Page 835: 3 parameter passing, 4 return values, 5 binary format, 10 architectural requirements

Advertising
background image

EFI Byte Code Virtual Machine

Version 1.10

12/01/02

19-61

19.9 Runtime and Software Conventions

19.9.1 Calling

Outside

VM

Calls can be made to routines in other modules that are native or in another VM. It is the
responsibility of the calling VM to prepare the outgoing arguments correctly to make the call
outside the VM. It is also the responsibility of the VM to prepare the incoming arguments correctly
for the call from outside the VM. Calls outside the VM must use the

CALLEX

instruction.

19.9.2 Calling Inside VM

Calls inside VM can be made either directly using the

CALL

or CALLEX instructions. Using direct

CALL instructions is an optimization.

19.9.3 Parameter

Passing

Parameters are pushed on the VM stack per the CDECL calling convention. Per this convention,
the last argument in the parameter list is pushed on the stack first, and the first argument in the
parameter list is pushed on the stack last.

All parameters are stored or accessed as natural size (using naturally sized instruction) except 64-bit
integers, which are pushed as 64-bit values. 32-bit integers are pushed as natural size (since they
should be passed as 64-bit parameter values on 64-bit machines).

19.9.4 Return

Values

Return values of 8 bytes or less in size are returned in general-purpose register R7. Return values
larger than 8 bytes are not supported.

19.9.5 Binary

Format

PE32+ format will be used for generating binaries for the VM. A VarBss section will be included
in the binary image. All global and static variables will be placed in this section. The size of the
section will be based on worst-case 64-bit pointers. Initialized data and pointers will also be placed
in the VarBss section, with the compiler generating code to initialize the values at runtime.

19.10 Architectural Requirements

This section provides a high level overview of the architectural requirements that are necessary to
support execution of EBC on a platform.

Advertising