blob: 1eb320711292be35378caf4b42d35f09f3bef951 [file] [log] [blame]
Julian Hall29f87ec2021-10-13 11:43:30 +01001/*
2 * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef COMMON_EFI_STATUS_H
8#define COMMON_EFI_STATUS_H
9
10#include <limits.h>
11#include <stdint.h>
12
13/**
14 * Common EFI status type
15 */
Julian Halld1dfda52021-11-25 18:46:45 +010016typedef uint64_t efi_status_t;
Julian Hall29f87ec2021-10-13 11:43:30 +010017
18/* For error class status codes */
Julian Halld1dfda52021-11-25 18:46:45 +010019#define EFI_ERROR(s) ((1ULL << ((CHAR_BIT * sizeof(efi_status_t)) - 1)) | s)
Julian Hall29f87ec2021-10-13 11:43:30 +010020
21/**
22 * Common EFI status codes
23 */
24#define EFI_SUCCESS 0x0
25#define EFI_LOAD_ERROR EFI_ERROR(0x01)
26#define EFI_INVALID_PARAMETER EFI_ERROR(0x02)
27#define EFI_UNSUPPORTED EFI_ERROR(0x03)
28#define EFI_BAD_BUFFER_SIZE EFI_ERROR(0x04)
29#define EFI_BUFFER_TOO_SMALL EFI_ERROR(0x05)
30#define EFI_NOT_READY EFI_ERROR(0x06)
31#define EFI_DEVICE_ERROR EFI_ERROR(0x07)
32#define EFI_WRITE_PROTECTED EFI_ERROR(0x08)
33#define EFI_OUT_OF_RESOURCES EFI_ERROR(0x09)
34#define EFI_VOLUME_CORRUPTED EFI_ERROR(0x0a)
35#define EFI_VOLUME_FULL EFI_ERROR(0x0b)
36#define EFI_NO_MEDIA EFI_ERROR(0x0c)
37#define EFI_MEDIA_CHANGED EFI_ERROR(0x0d)
38#define EFI_NOT_FOUND EFI_ERROR(0x0e)
39#define EFI_ACCESS_DENIED EFI_ERROR(0x0f)
40#define EFI_NO_RESPONSE EFI_ERROR(0x10)
41#define EFI_NO_MAPPING EFI_ERROR(0x11)
42#define EFI_TIMEOUT EFI_ERROR(0x12)
43#define EFI_NOT_STARTED EFI_ERROR(0x13)
44#define EFI_ALREADY_STARTED EFI_ERROR(0x14)
45#define EFI_ABORTED EFI_ERROR(0x15)
46#define EFI_ICMP_ERROR EFI_ERROR(0x16)
47#define EFI_TFTP_ERROR EFI_ERROR(0x17)
48#define EFI_PROTOCOL_ERROR EFI_ERROR(0x18)
49#define EFI_INCOMPATIBLE_VERSION EFI_ERROR(0x19)
50#define EFI_SECURITY_VIOLATION EFI_ERROR(0x1a)
51#define EFI_CRC_ERROR EFI_ERROR(0x1b)
52#define EFI_END_OF_MEDIA EFI_ERROR(0x1c)
53#define EFI_END_OF_FILE EFI_ERROR(0x1f)
54#define EFI_INVALID_LANGUAGE EFI_ERROR(0x20)
55#define EFI_COMPROMISED_DATA EFI_ERROR(0x21)
56#define EFI_HTTP_ERROR EFI_ERROR(0x23)
57
58
59#endif /* COMMON_EFI_STATUS_H */