[libc-commits] [libc] [libc] init uefi os target (PR #120687)

via libc-commits libc-commits at lists.llvm.org
Thu Dec 19 22:57:49 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff eb1b9fca9ca66d051179d8d2f35edb4624118b26 5bc23eb2892f9d571a7cad20b5eec5cb860f1a1c --extensions h,cpp -- libc/include/llvm-libc-macros/EFIAPI-macros.h libc/include/llvm-libc-types/EFI_ALLOCATE_TYPE.h libc/include/llvm-libc-types/EFI_BOOT_SERVICES.h libc/include/llvm-libc-types/EFI_CAPSULE.h libc/include/llvm-libc-types/EFI_CONFIGURATION_TABLE.h libc/include/llvm-libc-types/EFI_DEVICE_PATH_PROTOCOL.h libc/include/llvm-libc-types/EFI_EVENT.h libc/include/llvm-libc-types/EFI_GUID.h libc/include/llvm-libc-types/EFI_HANDLE.h libc/include/llvm-libc-types/EFI_INTERFACE_TYPE.h libc/include/llvm-libc-types/EFI_LOCATE_SEARCH_TYPE.h libc/include/llvm-libc-types/EFI_MEMORY_DESCRIPTOR.h libc/include/llvm-libc-types/EFI_MEMORY_TYPE.h libc/include/llvm-libc-types/EFI_OPEN_PROTOCOL_INFORMATION_ENTRY.h libc/include/llvm-libc-types/EFI_PHYSICAL_ADDRESS.h libc/include/llvm-libc-types/EFI_RUNTIME_SERVICES.h libc/include/llvm-libc-types/EFI_SIMPLE_TEXT_INPUT_PROTOCOL.h libc/include/llvm-libc-types/EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.h libc/include/llvm-libc-types/EFI_STATUS.h libc/include/llvm-libc-types/EFI_SYSTEM_TABLE.h libc/include/llvm-libc-types/EFI_TABLE_HEADER.h libc/include/llvm-libc-types/EFI_TIME.h libc/include/llvm-libc-types/EFI_TIMER_DELAY.h libc/include/llvm-libc-types/EFI_TPL.h libc/include/llvm-libc-types/EFI_VIRTUAL_ADDRESS.h libc/src/__support/OSUtil/uefi/exit.cpp libc/src/__support/OSUtil/uefi/io.cpp libc/src/__support/OSUtil/uefi/io.h libc/startup/uefi/crt1.cpp libc/src/__support/OSUtil/io.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libc/include/llvm-libc-types/EFI_BOOT_SERVICES.h b/libc/include/llvm-libc-types/EFI_BOOT_SERVICES.h
index 0efa7c4a00..f0562f93c9 100644
--- a/libc/include/llvm-libc-types/EFI_BOOT_SERVICES.h
+++ b/libc/include/llvm-libc-types/EFI_BOOT_SERVICES.h
@@ -229,9 +229,9 @@ typedef struct {
   EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer; // EFI 1.1+
   EFI_LOCATE_PROTOCOL LocateProtocol;          // EFI 1.1+
   EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES
-      InstallMultipleProtocolInterfaces; // EFI 1.1+
+  InstallMultipleProtocolInterfaces; // EFI 1.1+
   EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES
-      UninstallMultipleProtocolInterfaces; // EFI 1.1+*
+  UninstallMultipleProtocolInterfaces; // EFI 1.1+*
 
   //
   // 32-bit CRC Services
diff --git a/libc/src/__support/OSUtil/uefi/io.cpp b/libc/src/__support/OSUtil/uefi/io.cpp
index 9d1063b6ea..c80731ea88 100644
--- a/libc/src/__support/OSUtil/uefi/io.cpp
+++ b/libc/src/__support/OSUtil/uefi/io.cpp
@@ -19,12 +19,8 @@ ssize_t read_from_stdin(char *buf, size_t size) {
   return 0;
 }
 
-void write_to_stdout(cpp::string_view msg) {
-  (void)msg;
-}
+void write_to_stdout(cpp::string_view msg) { (void)msg; }
 
-void write_to_stderr(cpp::string_view msg) {
-  (void)msg;
-}
+void write_to_stderr(cpp::string_view msg) { (void)msg; }
 
-}
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/startup/uefi/crt1.cpp b/libc/startup/uefi/crt1.cpp
index 1198fbe97f..c4c5e5fde7 100644
--- a/libc/startup/uefi/crt1.cpp
+++ b/libc/startup/uefi/crt1.cpp
@@ -6,16 +6,16 @@
 //
 //===--------------------------------------------------------------------===//
 
+#include "include/llvm-libc-macros/stdlib-macros.h"
 #include "include/llvm-libc-types/EFI_HANDLE.h"
 #include "include/llvm-libc-types/EFI_STATUS.h"
 #include "include/llvm-libc-types/EFI_SYSTEM_TABLE.h"
-#include "include/llvm-libc-macros/stdlib-macros.h"
 #include "src/__support/macros/config.h"
 
 extern "C" int main(int argc, char **argv, char **envp);
 
 extern "C" EFI_STATUS EfiMain(EFI_HANDLE ImageHandle,
-                              EFI_SYSTEM_TABLE* SystemTable) {
+                              EFI_SYSTEM_TABLE *SystemTable) {
   (void)ImageHandle;
   (void)SystemTable;
   main(0, NULL, NULL);

``````````

</details>


https://github.com/llvm/llvm-project/pull/120687


More information about the libc-commits mailing list