[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 08/20] aarch64: Add dl-procinfo
From: |
Sergey Bugaev |
Subject: |
[PATCH v2 08/20] aarch64: Add dl-procinfo |
Date: |
Sat, 23 Mar 2024 20:32:49 +0300 |
This is based on the Linux version, but doesn't define
GLRO(dl_aarch64_cap_flags) and implement _dl_hwcap_string (which seems
unused anyway) based on Linux HWCAP bit values.
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
---
sysdeps/aarch64/dl-procinfo.c | 59 +++++++++++++++++++++++++++++++++++
sysdeps/aarch64/dl-procinfo.h | 38 ++++++++++++++++++++++
2 files changed, 97 insertions(+)
create mode 100644 sysdeps/aarch64/dl-procinfo.c
create mode 100644 sysdeps/aarch64/dl-procinfo.h
diff --git a/sysdeps/aarch64/dl-procinfo.c b/sysdeps/aarch64/dl-procinfo.c
new file mode 100644
index 00000000..5a51edbc
--- /dev/null
+++ b/sysdeps/aarch64/dl-procinfo.c
@@ -0,0 +1,59 @@
+/* Data for AArch64 version of processor capability information.
+ Copyright (C) 2017-2024 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+/* If anything should be added here check whether the size of each string
+ is still ok with the given array size.
+
+ All the #ifdefs in the definitions are quite irritating but
+ necessary if we want to avoid duplicating the information. There
+ are three different modes:
+
+ - PROCINFO_DECL is defined. This means we are only interested in
+ declarations.
+
+ - PROCINFO_DECL is not defined:
+
+ + if SHARED is defined the file is included in an array
+ initializer. The .element = { ... } syntax is needed.
+
+ + if SHARED is not defined a normal array initialization is
+ needed.
+ */
+
+#ifndef PROCINFO_CLASS
+# define PROCINFO_CLASS
+#endif
+
+#if !IS_IN (ldconfig)
+# if !defined PROCINFO_DECL && defined SHARED
+ ._dl_aarch64_cpu_features
+# else
+PROCINFO_CLASS struct cpu_features _dl_aarch64_cpu_features
+# endif
+# ifndef PROCINFO_DECL
+= { }
+# endif
+# if !defined SHARED || defined PROCINFO_DECL
+;
+# else
+,
+# endif
+#endif
+
+#undef PROCINFO_DECL
+#undef PROCINFO_CLASS
diff --git a/sysdeps/aarch64/dl-procinfo.h b/sysdeps/aarch64/dl-procinfo.h
new file mode 100644
index 00000000..176de5cd
--- /dev/null
+++ b/sysdeps/aarch64/dl-procinfo.h
@@ -0,0 +1,38 @@
+/* Processor capability information handling macros - aarch64 version.
+ Copyright (C) 2017-2024 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _DL_PROCINFO_H
+#define _DL_PROCINFO_H 1
+
+#include <sys/auxv.h>
+#include <unistd.h>
+#include <ldsodefs.h>
+#include <sysdep.h>
+
+/* We cannot provide a general printing function. */
+#define _dl_procinfo(type, word) -1
+
+/* No additional library search paths. */
+#define HWCAP_IMPORTANT HWCAP_ATOMICS
+
+/* There're no platforms to filter out. */
+#define _DL_HWCAP_PLATFORM 0
+
+#define _dl_string_platform(str) (-1)
+
+#endif /* dl-procinfo.h */
--
2.44.0
- [PATCH v2 00/20] aarch64-gnu port & GNU/Hurd on AArch64 progress, Sergey Bugaev, 2024/03/23
- [PATCH v2 01/20] hurd: Move internal functions to internal header, Sergey Bugaev, 2024/03/23
- [PATCH v2 05/20] hurd: Use the RETURN_ADDRESS macro, Sergey Bugaev, 2024/03/23
- [PATCH v2 04/20] hurd: Disable Prefer_MAP_32BIT_EXEC on non-x86_64 for now, Sergey Bugaev, 2024/03/23
- [PATCH v2 06/20] htl: Respect GL(dl_stack_flags) when allocating stacks, Sergey Bugaev, 2024/03/23
- [PATCH v2 08/20] aarch64: Add dl-procinfo,
Sergey Bugaev <=
- [PATCH v2 11/20] mach: Add a basic AArch64 port, Sergey Bugaev, 2024/03/23
- [PATCH v2 13/20] hurd: Add a basic AArch64 port, Sergey Bugaev, 2024/03/23
- [PATCH v2 18/20] htl: Implement some support for TLS_DTV_AT_TP, Sergey Bugaev, 2024/03/23
- [PATCH v2 02/20] hurd: Stop relying on VM_MAX_ADDRESS, Sergey Bugaev, 2024/03/23
- [PATCH v2 03/20] Allow glibc to be compiled without EXEC_PAGESIZE, Sergey Bugaev, 2024/03/23
- [PATCH v2 07/20] aarch64: Move pointer_guard.h out of sysdeps/unix/sysv/linux, Sergey Bugaev, 2024/03/23
- [PATCH v2 10/20] aarch64: Allow building without kernel support for BTI, Sergey Bugaev, 2024/03/23
- [PATCH v2 12/20] mach: Declare the new thread_set_self_state () trap, Sergey Bugaev, 2024/03/23
- [PATCH v2 15/20] hurd: Implement longjmp for AArch64, Sergey Bugaev, 2024/03/23
- [PATCH v2 17/20] hurd: Add an AArch64 signal implementation, Sergey Bugaev, 2024/03/23