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

Petr Hosek via libc-commits libc-commits at lists.llvm.org
Mon Jan 20 17:49:36 PST 2025


================
@@ -0,0 +1,28 @@
+//===-- Definition of GPU signal number macros ----------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_MACROS_GPU_SIGNAL_MACROS_H
+#define LLVM_LIBC_MACROS_GPU_SIGNAL_MACROS_H
+
+#define SIGINT 2
+#define SIGILL 4
+#define SIGABRT 6
+#define SIGFPE 8
+#define SIGSEGV 11
+#define SIGTERM 15
+
+#define SIG_DFL ((__sighandler_t)(0))
+#define SIG_IGN ((__sighandler_t)(1))
+#define SIG_ERR ((__sighandler_t)(-1))
+
+// Max signal number
+#define NSIG 64
+
+#define __NSIGSET_WORDS NSIG
+
+#endif // LLVM_LIBC_MACROS_GPU_SIGNAL_MACROS_H
----------------
petrhosek wrote:

Does UEFI support signals? If not, I'd rather not implement them at all rather than providing a dummy implementation.

```suggestion
//===-- Definition of UEFI signal number macros ----------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_MACROS_UEFI_SIGNAL_MACROS_H
#define LLVM_LIBC_MACROS_UEFI_SIGNAL_MACROS_H

#define SIGINT 2
#define SIGILL 4
#define SIGABRT 6
#define SIGFPE 8
#define SIGSEGV 11
#define SIGTERM 15

#define SIG_DFL ((__sighandler_t)(0))
#define SIG_IGN ((__sighandler_t)(1))
#define SIG_ERR ((__sighandler_t)(-1))

// Max signal number
#define NSIG 64

#define __NSIGSET_WORDS NSIG

#endif // LLVM_LIBC_MACROS_UEFI_SIGNAL_MACROS_H
```

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


More information about the libc-commits mailing list