iPXE
Macros | Functions
efi.h File Reference

EFI platform error codes. More...

#include <ipxe/efi/efi.h>
#include <ipxe/efi/Uefi/UefiBaseType.h>

Go to the source code of this file.

Macros

#define EFI_ERR_SHIFT   ( 8 * ( sizeof ( EFI_STATUS ) - 1 ) )
 Bit shift for EFI error/warning bit. More...
 
#define PLATFORM_TO_ERRNO(platform)
 Convert platform error code to platform component of iPXE error code. More...
 
#define ERRNO_TO_PLATFORM(errno)
 Convert iPXE error code to platform error code. More...
 
#define PLATFORM_ENOERR   EFI_SUCCESS
 
#define PLATFORM_E2BIG   EFI_BUFFER_TOO_SMALL
 
#define PLATFORM_EACCES   EFI_ACCESS_DENIED
 
#define PLATFORM_EADDRINUSE   EFI_ALREADY_STARTED
 
#define PLATFORM_EADDRNOTAVAIL   EFI_NOT_READY
 
#define PLATFORM_EAFNOSUPPORT   EFI_UNSUPPORTED
 
#define PLATFORM_EAGAIN   EFI_NOT_READY
 
#define PLATFORM_EALREADY   EFI_ALREADY_STARTED
 
#define PLATFORM_EBADF   EFI_INVALID_PARAMETER
 
#define PLATFORM_EBADMSG   EFI_PROTOCOL_ERROR
 
#define PLATFORM_EBUSY   EFI_NO_RESPONSE
 
#define PLATFORM_ECANCELED   EFI_ABORTED
 
#define PLATFORM_ECHILD   EFI_NOT_FOUND
 
#define PLATFORM_ECONNABORTED   EFI_ABORTED
 
#define PLATFORM_ECONNREFUSED   EFI_NO_RESPONSE
 
#define PLATFORM_ECONNRESET   EFI_ABORTED
 
#define PLATFORM_EDEADLK   EFI_NOT_READY
 
#define PLATFORM_EDESTADDRREQ   EFI_PROTOCOL_ERROR
 
#define PLATFORM_EDOM   EFI_INVALID_PARAMETER
 
#define PLATFORM_EDQUOT   EFI_VOLUME_FULL
 
#define PLATFORM_EEXIST   EFI_WRITE_PROTECTED
 
#define PLATFORM_EFAULT   EFI_INVALID_PARAMETER
 
#define PLATFORM_EFBIG   EFI_END_OF_MEDIA
 
#define PLATFORM_EHOSTUNREACH   EFI_NO_RESPONSE
 
#define PLATFORM_EIDRM   EFI_INVALID_PARAMETER
 
#define PLATFORM_EILSEQ   EFI_INVALID_PARAMETER
 
#define PLATFORM_EINPROGRESS   EFI_ALREADY_STARTED
 
#define PLATFORM_EINTR   EFI_NOT_READY
 
#define PLATFORM_EINVAL   EFI_INVALID_PARAMETER
 
#define PLATFORM_EIO   EFI_PROTOCOL_ERROR
 
#define PLATFORM_EISCONN   EFI_ALREADY_STARTED
 
#define PLATFORM_EISDIR   EFI_PROTOCOL_ERROR
 
#define PLATFORM_ELOOP   EFI_VOLUME_CORRUPTED
 
#define PLATFORM_EMFILE   EFI_OUT_OF_RESOURCES
 
#define PLATFORM_EMLINK   EFI_OUT_OF_RESOURCES
 
#define PLATFORM_EMSGSIZE   EFI_BAD_BUFFER_SIZE
 
#define PLATFORM_EMULTIHOP   EFI_INVALID_PARAMETER
 
#define PLATFORM_ENAMETOOLONG   EFI_INVALID_PARAMETER
 
#define PLATFORM_ENETDOWN   EFI_NO_RESPONSE
 
#define PLATFORM_ENETRESET   EFI_ABORTED
 
#define PLATFORM_ENETUNREACH   EFI_NO_RESPONSE
 
#define PLATFORM_ENFILE   EFI_OUT_OF_RESOURCES
 
#define PLATFORM_ENOBUFS   EFI_OUT_OF_RESOURCES
 
#define PLATFORM_ENODATA   EFI_NO_RESPONSE
 
#define PLATFORM_ENODEV   EFI_DEVICE_ERROR
 
#define PLATFORM_ENOENT   EFI_NOT_FOUND
 
#define PLATFORM_ENOEXEC   EFI_LOAD_ERROR
 
#define PLATFORM_ENOLCK   EFI_OUT_OF_RESOURCES
 
#define PLATFORM_ENOLINK   EFI_OUT_OF_RESOURCES
 
#define PLATFORM_ENOMEM   EFI_OUT_OF_RESOURCES
 
#define PLATFORM_ENOMSG   EFI_PROTOCOL_ERROR
 
#define PLATFORM_ENOPROTOOPT   EFI_UNSUPPORTED
 
#define PLATFORM_ENOSPC   EFI_VOLUME_FULL
 
#define PLATFORM_ENOSR   EFI_OUT_OF_RESOURCES
 
#define PLATFORM_ENOSTR   EFI_PROTOCOL_ERROR
 
#define PLATFORM_ENOSYS   EFI_UNSUPPORTED
 
#define PLATFORM_ENOTCONN   EFI_NOT_STARTED
 
#define PLATFORM_ENOTDIR   EFI_VOLUME_CORRUPTED
 
#define PLATFORM_ENOTEMPTY   EFI_VOLUME_CORRUPTED
 
#define PLATFORM_ENOTSOCK   EFI_INVALID_PARAMETER
 
#define PLATFORM_ENOTSUP   EFI_UNSUPPORTED
 
#define PLATFORM_ENOTTY   EFI_UNSUPPORTED
 
#define PLATFORM_ENXIO   EFI_NOT_FOUND
 
#define PLATFORM_EOPNOTSUPP   EFI_UNSUPPORTED
 
#define PLATFORM_EOVERFLOW   EFI_BUFFER_TOO_SMALL
 
#define PLATFORM_EPERM   EFI_ACCESS_DENIED
 
#define PLATFORM_EPIPE   EFI_ABORTED
 
#define PLATFORM_EPROTO   EFI_PROTOCOL_ERROR
 
#define PLATFORM_EPROTONOSUPPORT   EFI_UNSUPPORTED
 
#define PLATFORM_EPROTOTYPE   EFI_INVALID_PARAMETER
 
#define PLATFORM_ERANGE   EFI_BUFFER_TOO_SMALL
 
#define PLATFORM_EROFS   EFI_WRITE_PROTECTED
 
#define PLATFORM_ESPIPE   EFI_END_OF_FILE
 
#define PLATFORM_ESRCH   EFI_NOT_STARTED
 
#define PLATFORM_ESTALE   EFI_PROTOCOL_ERROR
 
#define PLATFORM_ETIME   EFI_TIMEOUT
 
#define PLATFORM_ETIMEDOUT   EFI_TIMEOUT
 
#define PLATFORM_ETXTBSY   EFI_MEDIA_CHANGED
 
#define PLATFORM_EWOULDBLOCK   EFI_NOT_READY
 
#define PLATFORM_EXDEV   EFI_VOLUME_CORRUPTED
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 

Detailed Description

EFI platform error codes.

We derive our platform error codes from the possible values for EFI_STATUS defined in the UEFI specification.

EFI_STATUS codes are 32/64-bit values consisting of a top bit which is set for errors and clear for warnings, and a mildly undefined code of low bits indicating the precise error/warning code. Errors and warnings have completely separate namespaces.

We assume that no EFI_STATUS code will ever be defined which uses more than bits 0-6 of the low bits. We then choose to encode our platform-specific error by mapping bit 31/63 of the EFI_STATUS to bit 7 of the platform-specific error code, and preserving bits 0-6 as-is.

Definition in file efi.h.

Macro Definition Documentation

◆ EFI_ERR_SHIFT

#define EFI_ERR_SHIFT   ( 8 * ( sizeof ( EFI_STATUS ) - 1 ) )

Bit shift for EFI error/warning bit.

Definition at line 30 of file efi.h.

◆ PLATFORM_TO_ERRNO

#define PLATFORM_TO_ERRNO (   platform)
Value:
( ( (platform) | \
( ( ( EFI_STATUS ) (platform) ) >> EFI_ERR_SHIFT ) ) & 0xff )
#define EFI_ERR_SHIFT
Bit shift for EFI error/warning bit.
Definition: efi.h:30
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:35

Convert platform error code to platform component of iPXE error code.

Parameters
platformPlatform error code
Return values
errnoPlatform component of iPXE error code

Definition at line 38 of file efi.h.

◆ ERRNO_TO_PLATFORM

#define ERRNO_TO_PLATFORM (   errno)
Value:
( ( ( ( EFI_STATUS ) (errno) & 0x80 ) << EFI_ERR_SHIFT ) | \
( (errno) & 0x7f ) )
int errno
Global "last error" number.
Definition: errno.c:20
#define EFI_ERR_SHIFT
Bit shift for EFI error/warning bit.
Definition: efi.h:30
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:35

Convert iPXE error code to platform error code.

Parameters
errnoiPXE error code
Return values
platformPlatform error code

Definition at line 48 of file efi.h.

◆ PLATFORM_ENOERR

#define PLATFORM_ENOERR   EFI_SUCCESS

Definition at line 53 of file efi.h.

◆ PLATFORM_E2BIG

#define PLATFORM_E2BIG   EFI_BUFFER_TOO_SMALL

Definition at line 54 of file efi.h.

◆ PLATFORM_EACCES

#define PLATFORM_EACCES   EFI_ACCESS_DENIED

Definition at line 55 of file efi.h.

◆ PLATFORM_EADDRINUSE

#define PLATFORM_EADDRINUSE   EFI_ALREADY_STARTED

Definition at line 56 of file efi.h.

◆ PLATFORM_EADDRNOTAVAIL

#define PLATFORM_EADDRNOTAVAIL   EFI_NOT_READY

Definition at line 57 of file efi.h.

◆ PLATFORM_EAFNOSUPPORT

#define PLATFORM_EAFNOSUPPORT   EFI_UNSUPPORTED

Definition at line 58 of file efi.h.

◆ PLATFORM_EAGAIN

#define PLATFORM_EAGAIN   EFI_NOT_READY

Definition at line 59 of file efi.h.

◆ PLATFORM_EALREADY

#define PLATFORM_EALREADY   EFI_ALREADY_STARTED

Definition at line 60 of file efi.h.

◆ PLATFORM_EBADF

#define PLATFORM_EBADF   EFI_INVALID_PARAMETER

Definition at line 61 of file efi.h.

◆ PLATFORM_EBADMSG

#define PLATFORM_EBADMSG   EFI_PROTOCOL_ERROR

Definition at line 62 of file efi.h.

◆ PLATFORM_EBUSY

#define PLATFORM_EBUSY   EFI_NO_RESPONSE

Definition at line 63 of file efi.h.

◆ PLATFORM_ECANCELED

#define PLATFORM_ECANCELED   EFI_ABORTED

Definition at line 64 of file efi.h.

◆ PLATFORM_ECHILD

#define PLATFORM_ECHILD   EFI_NOT_FOUND

Definition at line 65 of file efi.h.

◆ PLATFORM_ECONNABORTED

#define PLATFORM_ECONNABORTED   EFI_ABORTED

Definition at line 66 of file efi.h.

◆ PLATFORM_ECONNREFUSED

#define PLATFORM_ECONNREFUSED   EFI_NO_RESPONSE

Definition at line 67 of file efi.h.

◆ PLATFORM_ECONNRESET

#define PLATFORM_ECONNRESET   EFI_ABORTED

Definition at line 68 of file efi.h.

◆ PLATFORM_EDEADLK

#define PLATFORM_EDEADLK   EFI_NOT_READY

Definition at line 69 of file efi.h.

◆ PLATFORM_EDESTADDRREQ

#define PLATFORM_EDESTADDRREQ   EFI_PROTOCOL_ERROR

Definition at line 70 of file efi.h.

◆ PLATFORM_EDOM

#define PLATFORM_EDOM   EFI_INVALID_PARAMETER

Definition at line 71 of file efi.h.

◆ PLATFORM_EDQUOT

#define PLATFORM_EDQUOT   EFI_VOLUME_FULL

Definition at line 72 of file efi.h.

◆ PLATFORM_EEXIST

#define PLATFORM_EEXIST   EFI_WRITE_PROTECTED

Definition at line 73 of file efi.h.

◆ PLATFORM_EFAULT

#define PLATFORM_EFAULT   EFI_INVALID_PARAMETER

Definition at line 74 of file efi.h.

◆ PLATFORM_EFBIG

#define PLATFORM_EFBIG   EFI_END_OF_MEDIA

Definition at line 75 of file efi.h.

◆ PLATFORM_EHOSTUNREACH

#define PLATFORM_EHOSTUNREACH   EFI_NO_RESPONSE

Definition at line 76 of file efi.h.

◆ PLATFORM_EIDRM

#define PLATFORM_EIDRM   EFI_INVALID_PARAMETER

Definition at line 77 of file efi.h.

◆ PLATFORM_EILSEQ

#define PLATFORM_EILSEQ   EFI_INVALID_PARAMETER

Definition at line 78 of file efi.h.

◆ PLATFORM_EINPROGRESS

#define PLATFORM_EINPROGRESS   EFI_ALREADY_STARTED

Definition at line 79 of file efi.h.

◆ PLATFORM_EINTR

#define PLATFORM_EINTR   EFI_NOT_READY

Definition at line 80 of file efi.h.

◆ PLATFORM_EINVAL

#define PLATFORM_EINVAL   EFI_INVALID_PARAMETER

Definition at line 81 of file efi.h.

◆ PLATFORM_EIO

#define PLATFORM_EIO   EFI_PROTOCOL_ERROR

Definition at line 82 of file efi.h.

◆ PLATFORM_EISCONN

#define PLATFORM_EISCONN   EFI_ALREADY_STARTED

Definition at line 83 of file efi.h.

◆ PLATFORM_EISDIR

#define PLATFORM_EISDIR   EFI_PROTOCOL_ERROR

Definition at line 84 of file efi.h.

◆ PLATFORM_ELOOP

#define PLATFORM_ELOOP   EFI_VOLUME_CORRUPTED

Definition at line 85 of file efi.h.

◆ PLATFORM_EMFILE

#define PLATFORM_EMFILE   EFI_OUT_OF_RESOURCES

Definition at line 86 of file efi.h.

◆ PLATFORM_EMLINK

#define PLATFORM_EMLINK   EFI_OUT_OF_RESOURCES

Definition at line 87 of file efi.h.

◆ PLATFORM_EMSGSIZE

#define PLATFORM_EMSGSIZE   EFI_BAD_BUFFER_SIZE

Definition at line 88 of file efi.h.

◆ PLATFORM_EMULTIHOP

#define PLATFORM_EMULTIHOP   EFI_INVALID_PARAMETER

Definition at line 89 of file efi.h.

◆ PLATFORM_ENAMETOOLONG

#define PLATFORM_ENAMETOOLONG   EFI_INVALID_PARAMETER

Definition at line 90 of file efi.h.

◆ PLATFORM_ENETDOWN

#define PLATFORM_ENETDOWN   EFI_NO_RESPONSE

Definition at line 91 of file efi.h.

◆ PLATFORM_ENETRESET

#define PLATFORM_ENETRESET   EFI_ABORTED

Definition at line 92 of file efi.h.

◆ PLATFORM_ENETUNREACH

#define PLATFORM_ENETUNREACH   EFI_NO_RESPONSE

Definition at line 93 of file efi.h.

◆ PLATFORM_ENFILE

#define PLATFORM_ENFILE   EFI_OUT_OF_RESOURCES

Definition at line 94 of file efi.h.

◆ PLATFORM_ENOBUFS

#define PLATFORM_ENOBUFS   EFI_OUT_OF_RESOURCES

Definition at line 95 of file efi.h.

◆ PLATFORM_ENODATA

#define PLATFORM_ENODATA   EFI_NO_RESPONSE

Definition at line 96 of file efi.h.

◆ PLATFORM_ENODEV

#define PLATFORM_ENODEV   EFI_DEVICE_ERROR

Definition at line 97 of file efi.h.

◆ PLATFORM_ENOENT

#define PLATFORM_ENOENT   EFI_NOT_FOUND

Definition at line 98 of file efi.h.

◆ PLATFORM_ENOEXEC

#define PLATFORM_ENOEXEC   EFI_LOAD_ERROR

Definition at line 99 of file efi.h.

◆ PLATFORM_ENOLCK

#define PLATFORM_ENOLCK   EFI_OUT_OF_RESOURCES

Definition at line 100 of file efi.h.

◆ PLATFORM_ENOLINK

#define PLATFORM_ENOLINK   EFI_OUT_OF_RESOURCES

Definition at line 101 of file efi.h.

◆ PLATFORM_ENOMEM

#define PLATFORM_ENOMEM   EFI_OUT_OF_RESOURCES

Definition at line 102 of file efi.h.

◆ PLATFORM_ENOMSG

#define PLATFORM_ENOMSG   EFI_PROTOCOL_ERROR

Definition at line 103 of file efi.h.

◆ PLATFORM_ENOPROTOOPT

#define PLATFORM_ENOPROTOOPT   EFI_UNSUPPORTED

Definition at line 104 of file efi.h.

◆ PLATFORM_ENOSPC

#define PLATFORM_ENOSPC   EFI_VOLUME_FULL

Definition at line 105 of file efi.h.

◆ PLATFORM_ENOSR

#define PLATFORM_ENOSR   EFI_OUT_OF_RESOURCES

Definition at line 106 of file efi.h.

◆ PLATFORM_ENOSTR

#define PLATFORM_ENOSTR   EFI_PROTOCOL_ERROR

Definition at line 107 of file efi.h.

◆ PLATFORM_ENOSYS

#define PLATFORM_ENOSYS   EFI_UNSUPPORTED

Definition at line 108 of file efi.h.

◆ PLATFORM_ENOTCONN

#define PLATFORM_ENOTCONN   EFI_NOT_STARTED

Definition at line 109 of file efi.h.

◆ PLATFORM_ENOTDIR

#define PLATFORM_ENOTDIR   EFI_VOLUME_CORRUPTED

Definition at line 110 of file efi.h.

◆ PLATFORM_ENOTEMPTY

#define PLATFORM_ENOTEMPTY   EFI_VOLUME_CORRUPTED

Definition at line 111 of file efi.h.

◆ PLATFORM_ENOTSOCK

#define PLATFORM_ENOTSOCK   EFI_INVALID_PARAMETER

Definition at line 112 of file efi.h.

◆ PLATFORM_ENOTSUP

#define PLATFORM_ENOTSUP   EFI_UNSUPPORTED

Definition at line 113 of file efi.h.

◆ PLATFORM_ENOTTY

#define PLATFORM_ENOTTY   EFI_UNSUPPORTED

Definition at line 114 of file efi.h.

◆ PLATFORM_ENXIO

#define PLATFORM_ENXIO   EFI_NOT_FOUND

Definition at line 115 of file efi.h.

◆ PLATFORM_EOPNOTSUPP

#define PLATFORM_EOPNOTSUPP   EFI_UNSUPPORTED

Definition at line 116 of file efi.h.

◆ PLATFORM_EOVERFLOW

#define PLATFORM_EOVERFLOW   EFI_BUFFER_TOO_SMALL

Definition at line 117 of file efi.h.

◆ PLATFORM_EPERM

#define PLATFORM_EPERM   EFI_ACCESS_DENIED

Definition at line 118 of file efi.h.

◆ PLATFORM_EPIPE

#define PLATFORM_EPIPE   EFI_ABORTED

Definition at line 119 of file efi.h.

◆ PLATFORM_EPROTO

#define PLATFORM_EPROTO   EFI_PROTOCOL_ERROR

Definition at line 120 of file efi.h.

◆ PLATFORM_EPROTONOSUPPORT

#define PLATFORM_EPROTONOSUPPORT   EFI_UNSUPPORTED

Definition at line 121 of file efi.h.

◆ PLATFORM_EPROTOTYPE

#define PLATFORM_EPROTOTYPE   EFI_INVALID_PARAMETER

Definition at line 122 of file efi.h.

◆ PLATFORM_ERANGE

#define PLATFORM_ERANGE   EFI_BUFFER_TOO_SMALL

Definition at line 123 of file efi.h.

◆ PLATFORM_EROFS

#define PLATFORM_EROFS   EFI_WRITE_PROTECTED

Definition at line 124 of file efi.h.

◆ PLATFORM_ESPIPE

#define PLATFORM_ESPIPE   EFI_END_OF_FILE

Definition at line 125 of file efi.h.

◆ PLATFORM_ESRCH

#define PLATFORM_ESRCH   EFI_NOT_STARTED

Definition at line 126 of file efi.h.

◆ PLATFORM_ESTALE

#define PLATFORM_ESTALE   EFI_PROTOCOL_ERROR

Definition at line 127 of file efi.h.

◆ PLATFORM_ETIME

#define PLATFORM_ETIME   EFI_TIMEOUT

Definition at line 128 of file efi.h.

◆ PLATFORM_ETIMEDOUT

#define PLATFORM_ETIMEDOUT   EFI_TIMEOUT

Definition at line 129 of file efi.h.

◆ PLATFORM_ETXTBSY

#define PLATFORM_ETXTBSY   EFI_MEDIA_CHANGED

Definition at line 130 of file efi.h.

◆ PLATFORM_EWOULDBLOCK

#define PLATFORM_EWOULDBLOCK   EFI_NOT_READY

Definition at line 131 of file efi.h.

◆ PLATFORM_EXDEV

#define PLATFORM_EXDEV   EFI_VOLUME_CORRUPTED

Definition at line 132 of file efi.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )