Blame SOURCES/0015-merge-Github-PR-53.patch

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