Skip to content

Commit bf566bb

Browse files
[libc][uefi] add status codes
1 parent 7428fe0 commit bf566bb

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

libc/include/llvm-libc-types/EFI_STATUS.h

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,48 @@
1313

1414
typedef size_t EFI_STATUS;
1515

16+
#define EFI_SUCCESS 0
17+
18+
#define EFI_LOAD_ERROR 1
19+
#define EFI_INVALID_PARAMETER 2
20+
#define EFI_UNSUPPORTED 3
21+
#define EFI_BAD_BUFFER_SIZE 4
22+
#define EFI_BUFFER_TOO_SMALL 5
23+
#define EFI_NOT_READY 6
24+
#define EFI_DEVICE_ERROR 7
25+
#define EFI_WRITE_PROTECTED 8
26+
#define EFI_OUT_OF_RESOURCES 9
27+
#define EFI_VOLUME_CORRUPTED 10
28+
#define EFI_VOLUME_FULL 11
29+
#define EFI_NO_MEDIA 12
30+
#define EFI_MEDIA_CHANGED 13
31+
#define EFI_NOT_FOUND 14
32+
#define EFI_ACCESS_DENIED 15
33+
#define EFI_NO_RESPONSE 16
34+
#define EFI_NO_MAPPING 17
35+
#define EFI_TIMEOUT 18
36+
#define EFI_NOT_STARTED 19
37+
#define EFI_ALREADY_STARTED 20
38+
#define EFI_ABORTED 21
39+
#define EFI_ICMP_ERROR 22
40+
#define EFI_TFTP_ERROR 23
41+
#define EFI_PROTOCOL_ERROR 24
42+
#define EFI_INCOMPATIBLE_VERSION 25
43+
#define EFI_SECURITY_VIOLATION 26
44+
#define EFI_CRC_ERROR 27
45+
#define EFI_END_OF_MEDIA 28
46+
#define EFI_END_OF_FILE 31
47+
#define EFI_INVALID_LANGUAGE 32
48+
#define EFI_COMPROMISED_DATA 33
49+
#define EFI_IP_ADDRESS_CONFLICT 34
50+
#define EFI_HTTP_ERROR 35
51+
52+
#define EFI_WARN_UNKNOWN_GLYPH 1
53+
#define EFI_WARN_DELETE_FAILURE 2
54+
#define EFI_WARN_WRITE_FAILURE 3
55+
#define EFI_WARN_BUFFER_TOO_SMALL 4
56+
#define EFI_WARN_STALE_DATA 5
57+
#define EFI_WARN_FILE_SYSTEM 6
58+
#define EFI_WARN_RESET_REQUIRED 7
59+
1660
#endif // LLVM_LIBC_TYPES_EFI_STATUS_H

libc/startup/uefi/crt1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ EFI_STATUS EfiMain(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) {
2727
main(0, nullptr, nullptr);
2828

2929
// TODO: convert the return value of main to EFI_STATUS
30-
return 0; // TODO: EFI_SUCCESS
30+
return EFI_SUCCESS;
3131
}
3232
}

0 commit comments

Comments
 (0)