[libc-commits] [libc] [libc] init uefi os target (PR #120687)
Tristan Ross via libc-commits
libc-commits at lists.llvm.org
Sat Feb 8 07:47:52 PST 2025
================
@@ -0,0 +1,65 @@
+//===-- Implementation of crt for UEFI ----------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--------------------------------------------------------------------===//
+
+#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 "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+using InitCallback = void(void);
+using FiniCallback = void(void);
+extern "C" InitCallback *__CTOR_LIST__[];
+extern "C" FiniCallback *__DTOR_LIST__[];
+
+static void call_init_array_callbacks() {
+ unsigned long nptrs = (unsigned long)__CTOR_LIST__[0];
+ unsigned long i;
+
+ if (nptrs == (unsigned long)-1) {
----------------
RossComputerGuy wrote:
This is done
https://github.com/llvm/llvm-project/pull/120687
More information about the libc-commits
mailing list