[libc-commits] [libc] [libc][arm] implement a basic setjmp/longjmp (PR #93220)

via libc-commits libc-commits at lists.llvm.org
Thu May 23 18:04:03 PDT 2024


================
@@ -0,0 +1,23 @@
+//===-- Implementation of setjmp ------------------------------------------===//
+//
+// 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 "src/__support/common.h"
+#include "src/setjmp/setjmp_impl.h"
+
+namespace LIBC_NAMESPACE {
+
+[[gnu::naked]]
+LLVM_LIBC_FUNCTION(int, setjmp, (__jmp_buf * buf)) {
+  asm(R"(
+      mov r12, sp
----------------
lntue wrote:

ditto

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


More information about the libc-commits mailing list