Schrodinger ZHU Yifan
9ebaa9d483
[libc] implement aarch64 sigsetjmp (#136706)
- **[libc][aarch64] implement sigsetjmp**
On top of https://github.com/llvm/llvm-project/pull/136072
See also https://github.com/llvm/llvm-project/issues/137055 for remarks
on naked attributes.
```c++
//===-- 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/setjmp/sigsetjmp.h"
#include "hdr/offsetof_macros.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/setjmp/setjmp_impl.h"
#include "src/setjmp/sigsetjmp_epilogue.h"
namespace LIBC_NAMESPACE_DECL {
[[gnu::naked]]
LLVM_LIBC_FUNCTION(int, sigsetjmp, (sigjmp_buf, int)) {
asm(R"(
cbz w1, %c[setjmp]
str x30, [x0, %c[retaddr]]
str x19, [x0, %c[extra]]
mov x19, x0
bl %c[setjmp]
mov w1, w0
mov x0, x19
ldr x30, [x0, %c[retaddr]]
ldr x19, [x0, %c[extra]]
b %c[epilogue])" ::[retaddr] "i"(offsetof(__jmp_buf, sig_retaddr)),
[extra] "i"(offsetof(__jmp_buf, sig_extra)), [setjmp] "i"(setjmp),
[epilogue] "i"(sigsetjmp_epilogue)
: "x0", "x1", "x19", "x30");
}
} // namespace LIBC_NAMESPACE_DECL
```
2025-04-29 16:37:25 -04:00
..
2025-01-07 15:56:12 -08:00
2025-03-19 13:44:41 -04:00
2025-04-29 16:37:25 -04:00
2025-04-14 13:39:42 -07:00
2025-02-19 23:28:11 +08:00
2025-04-28 15:06:52 -04:00
2025-01-07 15:56:12 -08:00
2025-04-04 00:36:23 +08:00
2024-10-14 13:35:04 -04:00
2025-01-07 15:56:12 -08:00
2025-02-14 14:01:18 -08:00
2025-01-07 15:56:12 -08:00
2025-02-13 16:07:06 -08:00
2025-01-07 15:56:12 -08:00
2025-02-07 09:20:18 +08:00
2025-02-07 09:20:18 +08:00
2025-01-07 15:56:12 -08:00
2025-01-07 15:56:12 -08:00
2025-01-07 15:56:12 -08:00
2025-02-17 17:06:59 -08:00
2025-01-07 15:56:12 -08:00
2025-01-07 15:56:12 -08:00
2025-01-07 15:56:12 -08:00
2025-03-18 11:38:33 -07:00
2025-01-28 12:22:51 -08:00
2025-01-28 12:22:51 -08:00
2025-02-15 16:32:30 -08:00
2025-01-28 12:22:51 -08:00
2025-04-25 07:53:52 -04:00
2025-02-05 13:24:39 -08:00
2025-02-05 13:24:39 -08:00
2024-12-10 09:00:06 -08:00
2025-01-23 10:01:39 -08:00
2025-01-07 15:56:12 -08:00
2025-04-04 00:36:23 +08:00
2025-01-28 12:22:51 -08:00
2025-04-29 09:28:42 -04:00
2025-02-07 10:43:56 -08:00
2025-01-29 00:23:09 +08:00
2025-02-21 08:24:59 -08:00
2025-01-07 15:56:12 -08:00
2025-04-25 07:58:16 -04:00
2025-01-07 15:56:12 -08:00
2025-01-07 15:56:12 -08:00
2025-02-15 16:32:30 -08:00
2025-01-28 12:22:51 -08:00
2025-04-04 00:36:23 +08:00
2025-01-28 12:22:51 -08:00
2025-01-28 12:22:51 -08:00
2025-03-12 10:49:04 +08:00
2025-03-06 16:25:14 -08:00
2025-03-06 16:25:14 -08:00
2025-01-07 15:56:12 -08:00
2025-01-07 15:56:12 -08:00
2025-02-21 10:50:32 -08:00
2025-01-07 15:56:12 -08:00
2025-02-28 11:43:33 -05:00
2025-03-14 20:15:24 -07:00
2025-02-19 14:26:18 -08:00
2025-01-28 12:22:51 -08:00
2025-01-23 13:33:04 -08:00