[PATCH 3/3] kwsys: PA-RISC chips are from HP

Rolf Eike Beer eike at sf-mail.de
Sat Sep 8 12:40:17 EDT 2012


---
 Source/kwsys/SystemInformation.cxx | 28 +++++++++++++++++++++++-----
 1 Datei ge=C3=A4ndert, 23 Zeilen hinzugef=C3=BCgt(+), 5 Zeilen entfern=
t(-)

diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemIn=
formation.cxx
index 7b50b74..15f2325 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -307,7 +307,7 @@ public:
   enum Manufacturer
     {
     AMD, Intel, NSC, UMC, Cyrix, NexGen, IDT, Rise, Transmeta, Sun, IB=
M,
-    Motorola, UnknownManufacturer
+    Motorola, HP, UnknownManufacturer
     };
=20
 protected:
@@ -346,7 +346,7 @@ protected:
   static void Delay (unsigned int);
   static void DelayOverhead (unsigned int);
=20
-  void FindManufacturer();
+  void FindManufacturer(const kwsys_stl::string &family =3D "");
=20
   // For Mac
   bool ParseSysCtl();
@@ -1415,6 +1415,8 @@ const char * SystemInformationImplementation::Get=
VendorID()
       return "IBM";
     case Motorola:
       return "Motorola";
+    case HP:
+      return "Hewlett-Packard";
     default:
       return "Unknown Manufacturer";
     }
@@ -1755,7 +1757,7 @@ bool SystemInformationImplementation::RetrieveCPU=
Features()
=20
=20
 /** Find the manufacturer given the vendor id */
-void SystemInformationImplementation::FindManufacturer()
+void SystemInformationImplementation::FindManufacturer(const kwsys_stl=
::string& family)
 {
   if (this->ChipID.Vendor =3D=3D "GenuineIntel")       this->ChipManuf=
acturer =3D Intel;        // Intel Corp.
   else if (this->ChipID.Vendor =3D=3D "UMC UMC UMC ")  this->ChipManuf=
acturer =3D UMC;          // United Microelectronics Corp.
@@ -1771,6 +1773,8 @@ void SystemInformationImplementation::FindManufac=
turer()
   else if (this->ChipID.Vendor =3D=3D "Sun")           this->ChipManuf=
acturer =3D Sun;          // Sun Microelectronics
   else if (this->ChipID.Vendor =3D=3D "IBM")           this->ChipManuf=
acturer =3D IBM;          // IBM Microelectronics
   else if (this->ChipID.Vendor =3D=3D "Motorola")      this->ChipManuf=
acturer =3D Motorola;          // Motorola Microelectronics
+  else if (family.substr(0, 7) =3D=3D "PA-RISC")
+    this->ChipManufacturer =3D HP;           // Hewlett-Packard
   else                                             this->ChipManufactu=
rer =3D UnknownManufacturer;  // Unknown manufacturer
 }
=20
@@ -3087,11 +3091,25 @@ int SystemInformationImplementation::RetreiveIn=
formationFromCpuInfoFile()
   this->CPUSpeedInMHz =3D static_cast<float>(atof(CPUSpeed.c_str()));
=20
   // Chip family
-  this->ChipID.Family =3D atoi(this->ExtractValueFromCpuInfoFile(buffe=
r,"cpu family").c_str());
+  const kwsys_stl::string familyStr =3D
+    this->ExtractValueFromCpuInfoFile(buffer,"cpu family");
+  this->ChipID.Family =3D atoi(familyStr.c_str());
=20
   // Chip Vendor
   this->ChipID.Vendor =3D this->ExtractValueFromCpuInfoFile(buffer,"ve=
ndor_id");
-  this->FindManufacturer();
+  this->FindManufacturer(familyStr);
+
+  // second try for setting family
+  if (this->ChipID.Family =3D=3D 0 && this->ChipManufacturer =3D=3D HP=
)
+    {
+    if (familyStr =3D=3D "PA-RISC 1.1a")
+      this->ChipID.Family =3D 0x11a;
+    else if (familyStr =3D=3D "PA-RISC 2.0")
+      this->ChipID.Family =3D 0x200;
+    // If you really get CMake to work on a machine not belonging to
+    // any of those families I owe you a dinner if you get it to
+    // contribute nightly builds regularly.
+    }
=20
   // Chip Model
   this->ChipID.Model =3D atoi(this->ExtractValueFromCpuInfoFile(buffer=
,"model").c_str());
--=20
1.7.11.5


--nextPart3387433.jFLW4W1fOq--

--nextPart1832809.FyJd81ursA
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)

iEYEABECAAYFAlCr0u4ACgkQXKSJPmm5/E7cwACgiZ3+C7flMgQ5KopSAMl4Rfym
Z1QAn02kF5raKB6rwARrNLNd9Nt49Ljj
=EG9x
-----END PGP SIGNATURE-----

--nextPart1832809.FyJd81ursA--



More information about the cmake-developers mailing list