|
 |
5a9c2e |
From 89759485f86a48526b4f508a10f7478c76a3f71e Mon Sep 17 00:00:00 2001
|
|
 |
5a9c2e |
From: Lyonel Vincent <lyonel@ezix.org>
|
|
 |
5a9c2e |
Date: Fri, 15 May 2020 16:00:08 +0200
|
|
 |
5a9c2e |
Subject: [PATCH] merge Github PR #53
|
|
 |
5a9c2e |
|
|
 |
5a9c2e |
---
|
|
 |
5a9c2e |
src/core/cpuinfo.cc | 21 ++++++++++-----------
|
|
 |
5a9c2e |
1 file changed, 10 insertions(+), 11 deletions(-)
|
|
 |
5a9c2e |
|
|
 |
5a9c2e |
diff --git a/src/core/cpuinfo.cc b/src/core/cpuinfo.cc
|
|
 |
5a9c2e |
index ff76147ff367..faeeabf0fd8d 100644
|
|
 |
5a9c2e |
--- a/src/core/cpuinfo.cc
|
|
 |
5a9c2e |
+++ b/src/core/cpuinfo.cc
|
|
 |
5a9c2e |
@@ -446,6 +446,7 @@ string value)
|
|
 |
5a9c2e |
|
|
 |
5a9c2e |
if (cpu)
|
|
 |
5a9c2e |
{
|
|
 |
5a9c2e |
+ hw::value family, model, stepping;
|
|
 |
5a9c2e |
|
|
 |
5a9c2e |
// x86 CPUs are assumed to be 32 bits per default
|
|
 |
5a9c2e |
if(cpu->getWidth()==0) cpu->setWidth(32);
|
|
 |
5a9c2e |
@@ -472,6 +473,13 @@ string value)
|
|
 |
5a9c2e |
cpu->addHint(id, atoll(value.c_str()));
|
|
 |
5a9c2e |
if (id == "stepping")
|
|
 |
5a9c2e |
cpu->addHint(id, atoll(value.c_str()));
|
|
 |
5a9c2e |
+
|
|
 |
5a9c2e |
+ family = cpu->getHint("cpu family");
|
|
 |
5a9c2e |
+ model = cpu->getHint("model");
|
|
 |
5a9c2e |
+ stepping = cpu->getHint("stepping");
|
|
 |
5a9c2e |
+ if(family.defined() && model.defined() && stepping.defined())
|
|
 |
5a9c2e |
+ cpu->setVersion(tostring(family.asInteger())+"."+tostring(model.asInteger())+"."+tostring(stepping.asInteger()));
|
|
 |
5a9c2e |
+
|
|
 |
5a9c2e |
//if ((id == "cpu MHz") && (cpu->getSize() == 0))
|
|
 |
5a9c2e |
//{
|
|
 |
5a9c2e |
//cpu->setSize((long long) (1000000L * atof(value.c_str())));
|
|
 |
5a9c2e |
@@ -676,17 +684,8 @@ bool scan_cpuinfo(hwNode & n)
|
|
 |
5a9c2e |
}
|
|
 |
5a9c2e |
|
|
 |
5a9c2e |
hwNode *cpu = getcpu(n, 0);
|
|
 |
5a9c2e |
- if(cpu)
|
|
 |
5a9c2e |
- {
|
|
 |
5a9c2e |
- hw::value family, model, stepping;
|
|
 |
5a9c2e |
- family = cpu->getHint("cpu family");
|
|
 |
5a9c2e |
- model = cpu->getHint("model");
|
|
 |
5a9c2e |
- stepping = cpu->getHint("stepping");
|
|
 |
5a9c2e |
- if(family.defined() && model.defined() && stepping.defined())
|
|
 |
5a9c2e |
- cpu->setVersion(tostring(family.asInteger())+"."+tostring(model.asInteger())+"."+tostring(stepping.asInteger()));
|
|
 |
5a9c2e |
- if(n.getWidth()==0)
|
|
 |
5a9c2e |
- n.setWidth(cpu->getWidth());
|
|
 |
5a9c2e |
- }
|
|
 |
5a9c2e |
+ if(cpu && (n.getWidth()==0))
|
|
 |
5a9c2e |
+ n.setWidth(cpu->getWidth());
|
|
 |
5a9c2e |
|
|
 |
5a9c2e |
return true;
|
|
 |
5a9c2e |
}
|
|
 |
5a9c2e |
--
|
|
 |
5a9c2e |
2.17.1
|
|
 |
5a9c2e |
|