File tree Expand file tree Collapse file tree 5 files changed +14
-25
lines changed
src/__support/OSUtil/uefi Expand file tree Collapse file tree 5 files changed +14
-25
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1818
1919namespace LIBC_NAMESPACE_DECL {
2020
21- #define EFI_ERROR_MAX_BIT (cpp::numeric_limits<EFI_STATUS>::max())
22- #define EFI_ENCODE_ERROR (value ) \
23- (EFI_ERROR_MAX_BIT | (EFI_ERROR_MAX_BIT >> 2 ) | (value))
24- #define EFI_ENCODE_WARNING (value ) ((EFI_ERROR_MAX_BIT >> 2 ) | (value))
21+ static constexpr int EFI_ERROR_MAX_BIT = cpp::numeric_limits<EFI_STATUS>::max();
22+
23+ static constexpr int EFI_ENCODE_ERROR (int value) {
24+ return EFI_ERROR_MAX_BIT | (EFI_ERROR_MAX_BIT >> 2 ) | (value);
25+ }
26+
27+ static constexpr int EFI_ENCODE_WARNING (int value) {
28+ return (EFI_ERROR_MAX_BIT >> 2 ) | (value);
29+ }
2530
2631struct UefiStatusErrnoEntry {
2732 EFI_STATUS status;
@@ -79,7 +84,7 @@ LIBC_INLINE int uefi_status_to_errno(EFI_STATUS status) {
7984 }
8085
8186 // Unknown type
82- __builtin_unreachable () ;
87+ return EINVAL ;
8388}
8489
8590LIBC_INLINE EFI_STATUS errno_to_uefi_status (int errno_value) {
@@ -91,7 +96,7 @@ LIBC_INLINE EFI_STATUS errno_to_uefi_status(int errno_value) {
9196 }
9297
9398 // Unknown type
94- __builtin_unreachable () ;
99+ return EFI_INVALID_PARAMETER ;
95100}
96101
97102} // namespace LIBC_NAMESPACE_DECL
Original file line number Diff line number Diff line change 77// ===-----------------------------------------------------------------===//
88
99#include " src/__support/OSUtil/exit.h"
10- #include " config/uefi/app .h"
10+ #include " config/uefi.h"
1111#include " include/llvm-libc-types/EFI_SYSTEM_TABLE.h"
1212#include " src/__support/macros/config.h"
1313
Original file line number Diff line number Diff line change 99#include " io.h"
1010
1111#include " Uefi.h"
12- #include " config/uefi/ app.h"
12+ #include " config/app.h"
1313#include " src/__support/CPP/string_view.h"
1414#include " src/__support/macros/config.h"
1515
Original file line number Diff line number Diff line change 66//
77// ===----------------------------------------------------------------------===//
88
9- #include " config/uefi/ app.h"
9+ #include " config/app.h"
1010#include " include/llvm-libc-types/EFI_STATUS.h"
1111#include " src/__support/OSUtil/uefi/error.h"
1212#include " src/__support/macros/config.h"
You can’t perform that action at this time.
0 commit comments