2013-08-09 17:22:10 +02:00
|
|
|
From 1cc737f25e15c229334b2501ffaddeb39c92b1bc Mon Sep 17 00:00:00 2001
|
2012-07-31 11:51:01 +02:00
|
|
|
From: Alexander Graf <agraf@suse.de>
|
|
|
|
Date: Mon, 23 Jul 2012 10:24:14 +0200
|
|
|
|
Subject: [PATCH] linux-user: Fake /proc/cpuinfo
|
2013-07-30 14:36:48 +02:00
|
|
|
MIME-Version: 1.0
|
|
|
|
Content-Type: text/plain; charset=UTF-8
|
|
|
|
Content-Transfer-Encoding: 8bit
|
2012-07-31 11:51:01 +02:00
|
|
|
|
|
|
|
Fedora 17 for ARM reads /proc/cpuinfo and fails if it doesn't contain
|
|
|
|
ARM related contents. This patch implements a quick hack to expose real
|
|
|
|
/proc/cpuinfo data taken from a real world machine.
|
|
|
|
|
|
|
|
The real fix would be to generate at least the flags automatically based
|
|
|
|
on the selected CPU. Please do not submit this patch upstream until this
|
|
|
|
has happened.
|
|
|
|
|
|
|
|
Signed-off-by: Alexander Graf <agraf@suse.de>
|
2013-07-30 14:36:48 +02:00
|
|
|
[AF: Rebased for v1.6]
|
|
|
|
Signed-off-by: Andreas Färber <afaerber@suse.de>
|
2012-07-31 11:51:01 +02:00
|
|
|
---
|
2013-07-30 14:36:48 +02:00
|
|
|
linux-user/syscall.c | 20 ++++++++++++++++++++
|
|
|
|
1 file changed, 20 insertions(+)
|
2012-07-31 11:51:01 +02:00
|
|
|
|
|
|
|
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
|
2013-07-30 14:36:48 +02:00
|
|
|
index 8aef3e8..429ab3a 100644
|
2012-07-31 11:51:01 +02:00
|
|
|
--- a/linux-user/syscall.c
|
|
|
|
+++ b/linux-user/syscall.c
|
2013-07-30 14:36:48 +02:00
|
|
|
@@ -5011,6 +5011,25 @@ static int open_self_stat(void *cpu_env, int fd)
|
2012-07-31 11:51:01 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
+static int open_cpuinfo(void *cpu_env, int fd)
|
|
|
|
+{
|
|
|
|
+ dprintf(fd,
|
|
|
|
+"Processor : ARMv7 Processor rev 5 (v7l)\n"
|
|
|
|
+"BogoMIPS : 799.53\n"
|
|
|
|
+"Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3\n"
|
|
|
|
+"CPU implementer : 0x41\n"
|
|
|
|
+"CPU architecture: 7\n"
|
|
|
|
+"CPU variant : 0x2\n"
|
|
|
|
+"CPU part : 0xc08\n"
|
|
|
|
+"CPU revision : 5\n"
|
|
|
|
+"\n"
|
|
|
|
+"Hardware : Genesi Efika MX (Smarttop)\n"
|
|
|
|
+"Revision : 51030\n"
|
|
|
|
+"Serial : 0000000000000000\n");
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
static int open_self_auxv(void *cpu_env, int fd)
|
|
|
|
{
|
|
|
|
TaskState *ts = ((CPUArchState *)cpu_env)->opaque;
|
2013-07-30 14:36:48 +02:00
|
|
|
@@ -5075,6 +5094,7 @@ static int do_open(void *cpu_env, const char *pathname, int flags, mode_t mode)
|
|
|
|
{ "maps", open_self_maps },
|
|
|
|
{ "stat", open_self_stat },
|
|
|
|
{ "auxv", open_self_auxv },
|
|
|
|
+ { "cpuinfo", open_cpuinfo },
|
2012-07-31 11:51:01 +02:00
|
|
|
{ NULL, NULL }
|
|
|
|
};
|
|
|
|
|