From e6771b3452561ae1d42e2e5ef2d9518e708389c8 Mon Sep 17 00:00:00 2001
From: Rolf Eike Beer <eike@sf-mail.de>
Date: Thu, 20 Dec 2012 23:37:44 +0100
Subject: [PATCH] SystemInformation: determine CPU type on HP-UX

Change-Id: I3ce3fbaa56d8777a21f5d9bad903eeb15a344a5e
---
 SystemInformation.cxx | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/SystemInformation.cxx b/SystemInformation.cxx
index efcd8cc..0bc9bdb 100644
--- a/SystemInformation.cxx
+++ b/SystemInformation.cxx
@@ -1815,6 +1815,7 @@ void SystemInformationImplementation::FindManufacturer(const kwsys_stl::string&
   else if (this->ChipID.Vendor == "Geode By NSC")  this->ChipManufacturer = NSC;          // National Semiconductor
   else if (this->ChipID.Vendor == "Sun")           this->ChipManufacturer = Sun;          // Sun Microelectronics
   else if (this->ChipID.Vendor == "IBM")           this->ChipManufacturer = IBM;          // IBM Microelectronics
+  else if (this->ChipID.Vendor == "Hewlett-Packard") this->ChipManufacturer = HP;         // Hewlett-Packard
   else if (this->ChipID.Vendor == "Motorola")      this->ChipManufacturer = Motorola;          // Motorola Microelectronics
   else if (family.substr(0, 7) == "PA-RISC")       this->ChipManufacturer = HP;           // Hewlett-Packard
   else                                             this->ChipManufacturer = UnknownManufacturer;  // Unknown manufacturer
@@ -4288,6 +4289,34 @@ bool SystemInformationImplementation::QueryHPUXProcessor()
   this->NumberOfPhysicalCPU = c;
   this->NumberOfLogicalCPU = this->NumberOfPhysicalCPU;
 
+  long t = sysconf(_SC_CPU_VERSION);
+
+  if (t == -1)
+    {
+    return false;
+    }
+
+  switch (t)
+    {
+    case CPU_PA_RISC1_0:
+      this->ChipID.Vendor = "Hewlett-Packard";
+      this->ChipID.Family = 0x100;
+    case CPU_PA_RISC1_1:
+      this->ChipID.Vendor = "Hewlett-Packard";
+      this->ChipID.Family = 0x110;
+    case CPU_PA_RISC2_0:
+      this->ChipID.Vendor = "Hewlett-Packard";
+      this->ChipID.Family = 0x200;
+    case CPU_IA64_ARCHREV_0:
+      this->ChipID.Vendor = "GenuineIntel";
+      this->Features.HasIA64 = true;
+      break;
+    default:
+      return false;
+    }
+
+  this->FindManufacturer();
+
   return true;
 # else
   return false;
-- 
GitLab