Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. #ifndef _IPXE_ERRNO_EFI_H
  2. #define _IPXE_ERRNO_EFI_H
  3. /**
  4. * @file
  5. *
  6. * EFI platform error codes
  7. *
  8. * We derive our platform error codes from the possible values for
  9. * EFI_STATUS defined in the UEFI specification.
  10. *
  11. * EFI_STATUS codes are 32/64-bit values consisting of a top bit which
  12. * is set for errors and clear for warnings, and a mildly undefined
  13. * code of low bits indicating the precise error/warning code. Errors
  14. * and warnings have completely separate namespaces.
  15. *
  16. * We assume that no EFI_STATUS code will ever be defined which uses
  17. * more than bits 0-6 of the low bits. We then choose to encode our
  18. * platform-specific error by mapping bit 31/63 of the EFI_STATUS to
  19. * bit 7 of the platform-specific error code, and preserving bits 0-6
  20. * as-is.
  21. */
  22. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  23. #include <ipxe/efi/efi.h>
  24. #include <ipxe/efi/Uefi/UefiBaseType.h>
  25. /** Bit shift for EFI error/warning bit */
  26. #define EFI_ERR_SHIFT ( 8 * ( sizeof ( EFI_STATUS ) - 1 ) )
  27. /**
  28. * Convert platform error code to platform component of iPXE error code
  29. *
  30. * @v platform Platform error code
  31. * @ret errno Platform component of iPXE error code
  32. */
  33. #define PLATFORM_TO_ERRNO( platform ) \
  34. ( ( (platform) | \
  35. ( ( ( EFI_STATUS ) (platform) ) >> EFI_ERR_SHIFT ) ) & 0xff )
  36. /**
  37. * Convert iPXE error code to platform error code
  38. *
  39. * @v errno iPXE error code
  40. * @ret platform Platform error code
  41. */
  42. #define ERRNO_TO_PLATFORM( errno ) \
  43. ( ( ( ( EFI_STATUS ) (errno) & 0x80 ) << EFI_ERR_SHIFT ) | \
  44. ( (errno) & 0x7f ) )
  45. /* Platform-specific error codes */
  46. #define PLATFORM_ENOERR EFI_SUCCESS
  47. #define PLATFORM_E2BIG EFI_BUFFER_TOO_SMALL
  48. #define PLATFORM_EACCES EFI_ACCESS_DENIED
  49. #define PLATFORM_EADDRINUSE EFI_ALREADY_STARTED
  50. #define PLATFORM_EADDRNOTAVAIL EFI_NOT_READY
  51. #define PLATFORM_EAFNOSUPPORT EFI_UNSUPPORTED
  52. #define PLATFORM_EAGAIN EFI_NOT_READY
  53. #define PLATFORM_EALREADY EFI_ALREADY_STARTED
  54. #define PLATFORM_EBADF EFI_INVALID_PARAMETER
  55. #define PLATFORM_EBADMSG EFI_PROTOCOL_ERROR
  56. #define PLATFORM_EBUSY EFI_NO_RESPONSE
  57. #define PLATFORM_ECANCELED EFI_ABORTED
  58. #define PLATFORM_ECHILD EFI_NOT_FOUND
  59. #define PLATFORM_ECONNABORTED EFI_ABORTED
  60. #define PLATFORM_ECONNREFUSED EFI_NO_RESPONSE
  61. #define PLATFORM_ECONNRESET EFI_ABORTED
  62. #define PLATFORM_EDEADLK EFI_NOT_READY
  63. #define PLATFORM_EDESTADDRREQ EFI_PROTOCOL_ERROR
  64. #define PLATFORM_EDOM EFI_INVALID_PARAMETER
  65. #define PLATFORM_EDQUOT EFI_VOLUME_FULL
  66. #define PLATFORM_EEXIST EFI_WRITE_PROTECTED
  67. #define PLATFORM_EFAULT EFI_INVALID_PARAMETER
  68. #define PLATFORM_EFBIG EFI_END_OF_MEDIA
  69. #define PLATFORM_EHOSTUNREACH EFI_NO_RESPONSE
  70. #define PLATFORM_EIDRM EFI_INVALID_PARAMETER
  71. #define PLATFORM_EILSEQ EFI_INVALID_PARAMETER
  72. #define PLATFORM_EINPROGRESS EFI_ALREADY_STARTED
  73. #define PLATFORM_EINTR EFI_NOT_READY
  74. #define PLATFORM_EINVAL EFI_INVALID_PARAMETER
  75. #define PLATFORM_EIO EFI_PROTOCOL_ERROR
  76. #define PLATFORM_EISCONN EFI_ALREADY_STARTED
  77. #define PLATFORM_EISDIR EFI_PROTOCOL_ERROR
  78. #define PLATFORM_ELOOP EFI_VOLUME_CORRUPTED
  79. #define PLATFORM_EMFILE EFI_OUT_OF_RESOURCES
  80. #define PLATFORM_EMLINK EFI_OUT_OF_RESOURCES
  81. #define PLATFORM_EMSGSIZE EFI_BAD_BUFFER_SIZE
  82. #define PLATFORM_EMULTIHOP EFI_INVALID_PARAMETER
  83. #define PLATFORM_ENAMETOOLONG EFI_INVALID_PARAMETER
  84. #define PLATFORM_ENETDOWN EFI_NO_RESPONSE
  85. #define PLATFORM_ENETRESET EFI_ABORTED
  86. #define PLATFORM_ENETUNREACH EFI_NO_RESPONSE
  87. #define PLATFORM_ENFILE EFI_OUT_OF_RESOURCES
  88. #define PLATFORM_ENOBUFS EFI_OUT_OF_RESOURCES
  89. #define PLATFORM_ENODATA EFI_NO_RESPONSE
  90. #define PLATFORM_ENODEV EFI_DEVICE_ERROR
  91. #define PLATFORM_ENOENT EFI_NOT_FOUND
  92. #define PLATFORM_ENOEXEC EFI_LOAD_ERROR
  93. #define PLATFORM_ENOLCK EFI_OUT_OF_RESOURCES
  94. #define PLATFORM_ENOLINK EFI_OUT_OF_RESOURCES
  95. #define PLATFORM_ENOMEM EFI_OUT_OF_RESOURCES
  96. #define PLATFORM_ENOMSG EFI_PROTOCOL_ERROR
  97. #define PLATFORM_ENOPROTOOPT EFI_UNSUPPORTED
  98. #define PLATFORM_ENOSPC EFI_VOLUME_FULL
  99. #define PLATFORM_ENOSR EFI_OUT_OF_RESOURCES
  100. #define PLATFORM_ENOSTR EFI_PROTOCOL_ERROR
  101. #define PLATFORM_ENOSYS EFI_UNSUPPORTED
  102. #define PLATFORM_ENOTCONN EFI_NOT_STARTED
  103. #define PLATFORM_ENOTDIR EFI_VOLUME_CORRUPTED
  104. #define PLATFORM_ENOTEMPTY EFI_VOLUME_CORRUPTED
  105. #define PLATFORM_ENOTSOCK EFI_INVALID_PARAMETER
  106. #define PLATFORM_ENOTSUP EFI_UNSUPPORTED
  107. #define PLATFORM_ENOTTY EFI_UNSUPPORTED
  108. #define PLATFORM_ENXIO EFI_NOT_FOUND
  109. #define PLATFORM_EOPNOTSUPP EFI_UNSUPPORTED
  110. #define PLATFORM_EOVERFLOW EFI_BUFFER_TOO_SMALL
  111. #define PLATFORM_EPERM EFI_ACCESS_DENIED
  112. #define PLATFORM_EPIPE EFI_ABORTED
  113. #define PLATFORM_EPROTO EFI_PROTOCOL_ERROR
  114. #define PLATFORM_EPROTONOSUPPORT EFI_UNSUPPORTED
  115. #define PLATFORM_EPROTOTYPE EFI_INVALID_PARAMETER
  116. #define PLATFORM_ERANGE EFI_BUFFER_TOO_SMALL
  117. #define PLATFORM_EROFS EFI_WRITE_PROTECTED
  118. #define PLATFORM_ESPIPE EFI_END_OF_FILE
  119. #define PLATFORM_ESRCH EFI_NOT_STARTED
  120. #define PLATFORM_ESTALE EFI_PROTOCOL_ERROR
  121. #define PLATFORM_ETIME EFI_TIMEOUT
  122. #define PLATFORM_ETIMEDOUT EFI_TIMEOUT
  123. #define PLATFORM_ETXTBSY EFI_MEDIA_CHANGED
  124. #define PLATFORM_EWOULDBLOCK EFI_NOT_READY
  125. #define PLATFORM_EXDEV EFI_VOLUME_CORRUPTED
  126. #endif /* _IPXE_ERRNO_EFI_H */