Calling Conventions; Data Types; Common Efi Data Types - Intel Extensible Firmware Interface Specification

Intel extensible firmware interface specification
Table of Contents

Advertisement

Extensible Firmware Interface Specification
2.3

Calling Conventions

Unless otherwise stated, all functions defined in the EFI specification are called through pointers in
common, architecturally defined, calling conventions found in C compilers. Pointers to the various
global EFI functions are found in the
tables that are located via the EFI system table. Pointers to other functions defined in this
specification are located dynamically through device handles. In all cases, all pointers to EFI
functions are cast with the word EFIAPI. This allows the compiler for each architecture to supply
the proper compiler keywords to achieve the needed calling conventions. When passing pointer
arguments to Boot Services, Runtime Services, and Protocol Interfaces, the caller has the following
responsibilities:
1. It is the caller's responsibility to pass pointer parameters that reference physical memory
locations. If a pointer is passed that does not point to a physical memory location(i.e. a
memory mapped I/O region), the results are unpredictable and the system may halt.
2. It is the caller's responsibility to pass pointer parameters with correct alignment. If an
unaligned pointer is passed to a function, the results are unpredictable and the system may halt.
3. It is the caller's responsibility to not pass in a
explicitly allowed. If a
the system may hang.
IA-32 and Itanium-based calling conventions are described in more detail below. Any function or
protocol may return any valid return code.
2.3.1

Data Types

Table 2-2 lists the common data types that are used in the interface definitions, and Table 2-3 lists
their modifiers. Unless otherwise specified all data types are naturally aligned. Structures are
aligned on boundaries equal to the largest internal datum of the structure and internal data are
implicitly padded to achieve natural alignment.
Table 2-2.

Common EFI Data Types

Mnemonic
BOOLEAN
INTN
UINTN
INT8
UINT8
INT16
UINT16
INT32
UINT32
INT64
16
EFI_RUNTIME_SERVICES
pointer is passed to a function, the results are unpredictable and
NULL
Description
Logical boolean. 1 byte value containing a 0 for
values are undefined.
Signed value of native width. (4 bytes on IA-32, 8 bytes on Itanium-based
operations)
Unsigned value of native width. (4 bytes on IA-32, 8 bytes on Itanium-based
operations)
1 byte signed value.
1 byte unsigned value.
2 byte signed value.
2 byte unsigned value.
4 byte signed value.
4 byte unsigned value.
8 byte signed value.
12/12/00
and
EFI_BOOT_SERVICES
parameter to a function unless it is
NULL
or a 1 for TRUE. Other
FALSE
continued
Version 1.02

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Extensible Firmware Interface and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents