From: Helge Deller <deller@kernel.org>
To: qemu-devel@nongnu.org
Cc: Helge Deller <deller@gmx.de>,
Thomas Huth <th.huth+qemu@posteo.eu>,
Laurent Vivier <laurent@vivier.eu>
Subject: [PATCH] linux-user: Implement /proc/cpuinfo for m68k CPU
Date: Tue, 16 Jun 2026 23:05:39 +0200 [thread overview]
Message-ID: <20260616210539.69342-1-deller@kernel.org> (raw)
From: Helge Deller <deller@gmx.de>
Mimic the entries for /proc/cpuinfo to what can be seen on the debian
porterbox mitchy.debian.org.
Cc: Thomas Huth <th.huth+qemu@posteo.eu>
Cc: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Helge Deller <deller@gmx.de>
---
linux-user/m68k/target_proc.h | 45 +++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/linux-user/m68k/target_proc.h b/linux-user/m68k/target_proc.h
index 3df8f28e22..5a6678d59e 100644
--- a/linux-user/m68k/target_proc.h
+++ b/linux-user/m68k/target_proc.h
@@ -1,6 +1,8 @@
/*
* M68K specific proc functions for linux-user
*
+ * Copyright (c) 2026 Helge Deller
+ *
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef M68K_TARGET_PROC_H
@@ -13,4 +15,47 @@ static int open_hardware(CPUArchState *cpu_env, int fd)
}
#define HAVE_ARCH_PROC_HARDWARE
+
+static int open_cpuinfo(CPUArchState *cpu_env, int fd)
+{
+ const char *cpu, *fpu;
+ struct timespec res;
+ double freq_mhz;
+
+ if (clock_getres(CLOCK_REALTIME, &res) == -1) {
+ res.tv_nsec = 1;
+ }
+ freq_mhz = 1000.0 / res.tv_nsec;
+
+ if (m68k_feature(cpu_env, M68K_FEATURE_M68010)) {
+ cpu = "68010";
+ } else if (m68k_feature(cpu_env, M68K_FEATURE_M68020)) {
+ cpu = "68020";
+ } else if (m68k_feature(cpu_env, M68K_FEATURE_M68030)) {
+ cpu = "68030";
+ } else if (m68k_feature(cpu_env, M68K_FEATURE_M68040)) {
+ cpu = "68040";
+ } else if (m68k_feature(cpu_env, M68K_FEATURE_M68060)) {
+ cpu = "68060";
+ } else {
+ cpu = "680x0";
+ }
+
+ if (m68k_feature(cpu_env, M68K_FEATURE_FPU)) {
+ fpu = cpu;
+ } else {
+ fpu = "none(soft float)";
+ }
+
+ dprintf(fd, "CPU:\t\t%s\n"
+ "MMU:\t\t%s\n"
+ "FPU:\t\t%s\n"
+ "Clocking:\t%.1fMHz\n",
+ cpu, cpu, fpu, freq_mhz);
+ /* dropped BogoMips and Calibration for now */
+
+ return 0;
+}
+#define HAVE_ARCH_PROC_CPUINFO
+
#endif /* M68K_TARGET_PROC_H */
--
2.54.0
reply other threads:[~2026-06-16 21:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260616210539.69342-1-deller@kernel.org \
--to=deller@kernel.org \
--cc=deller@gmx.de \
--cc=laurent@vivier.eu \
--cc=qemu-devel@nongnu.org \
--cc=th.huth+qemu@posteo.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.