[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 3935309..fd515c2 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -206,7 +206,7 @@ public:
enum Manufacturer
{
AMD, Intel, NSC, UMC, Cyrix, NexGen, IDT, Rise, Transmeta, Sun, IB=
M,
- Motorola, UnknownManufacturer
+ Motorola, HP, UnknownManufacturer
};
=20
protected:
@@ -245,7 +245,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();
@@ -692,6 +692,8 @@ const char * SystemInformationImplementation::GetVe=
ndorID()
return "IBM";
case Motorola:
return "Motorola";
+ case HP:
+ return "Hewlett-Packard";
default:
return "Unknown Manufacturer";
}
@@ -1026,7 +1028,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.
@@ -1042,6 +1044,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
@@ -2357,11 +2361,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
--nextPart1521271.jnsFObbNLZ--
--nextPart2691398.x2bM6S9t4W
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)
iEYEABECAAYFAlBLdh8ACgkQXKSJPmm5/E5v+QCePyr4s+0YtHEjfRTXg1DaBcL7
cEQAn1zd1mGzV2OI2fy73rH2Pk0zYhx6
=Ydkr
-----END PGP SIGNATURE-----
--nextPart2691398.x2bM6S9t4W--
More information about the cmake-developers
mailing list