[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 09/10] proc: Add support for AArch64 in uname
From: |
Sergey Bugaev |
Subject: |
[PATCH 09/10] proc: Add support for AArch64 in uname |
Date: |
Sat, 23 Mar 2024 14:53:21 +0300 |
Since no CPU subtypes are defined for CPU_TYPE_ARM64, just report the
type, same as for x86_64.
Sample uname(2) output:
sysname: GNU
release: 0.9
version: GNU-Mach 1.8/Hurd-0.9
machine: aarch64
---
proc/cpu-types.c | 3 +++
proc/host.c | 4 ++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/proc/cpu-types.c b/proc/cpu-types.c
index 3d89d5a7..41af0888 100644
--- a/proc/cpu-types.c
+++ b/proc/cpu-types.c
@@ -35,6 +35,9 @@ const char *const mach_cpu_types[] =
#endif
#ifdef CPU_TYPE_X86_64
[CPU_TYPE_X86_64] = "x86_64",
+#endif
+#ifdef CPU_TYPE_ARM64
+ [CPU_TYPE_ARM64] = "aarch64",
#endif
};
diff --git a/proc/host.c b/proc/host.c
index 0197fecf..e0aff20a 100644
--- a/proc/host.c
+++ b/proc/host.c
@@ -355,11 +355,11 @@ initialize_version_info (void)
assert_backtrace (! err);
snprintf (uname_info.machine, sizeof uname_info.machine,
"%s"
-#ifndef __x86_64__
+#if !defined (__x86_64__) && !defined (__aarch64__)
"-%s"
#endif
, mach_cpu_types[info.cpu_type]
-#ifndef __x86_64__
+#if !defined (__x86_64__) && !defined (__aarch64__)
, mach_cpu_subtypes[info.cpu_type][info.cpu_subtype]
#endif
);
--
2.44.0
- [PATCH 01/10] term: Fix function prototype, Sergey Bugaev, 2024/03/23
- [PATCH 02/10] exec: Fix creating executable stacks, Sergey Bugaev, 2024/03/23
- [PATCH 04/10] proc: Only try host_kernel_version () on i386, Sergey Bugaev, 2024/03/23
- [PATCH 05/10] libshouldbeinlibc: Stop relying on address space size, Sergey Bugaev, 2024/03/23
- [PATCH 03/10] Make long & friends 64-bit on 64-bit platforms, Sergey Bugaev, 2024/03/23
- [PATCH 06/10] exec: Stop relying on address space size, Sergey Bugaev, 2024/03/23
- [PATCH 09/10] proc: Add support for AArch64 in uname,
Sergey Bugaev <=
- [PATCH 07/10] exec: Add support for AArch64 executables, Sergey Bugaev, 2024/03/23
- [PATCH 10/10] boot: Add support for AArch64, Sergey Bugaev, 2024/03/23
- [PATCH 08/10] elfcore: Add support for saving AArch64 registers, Sergey Bugaev, 2024/03/23
- Re: [PATCH 01/10] term: Fix function prototype, Samuel Thibault, 2024/03/23