!13 [sync] PR-8: [sync] PR-7: 添加sw架构
From: @openeuler-sync-bot Reviewed-by: @overweight Signed-off-by: @overweight
This commit is contained in:
commit
3f75678169
135
lshw-B.02.19.2-sw.patch
Executable file
135
lshw-B.02.19.2-sw.patch
Executable file
@ -0,0 +1,135 @@
|
||||
diff -Naur lshw-B.02.19.2.org/README.md lshw-B.02.19.2.sw/README.md
|
||||
--- lshw-B.02.19.2.org/README.md 2022-03-02 05:57:54.280000000 +0000
|
||||
+++ lshw-B.02.19.2.sw/README.md 2022-03-02 06:01:57.610000000 +0000
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
1. Requirements
|
||||
- Linux 2.4.x, 2.6.x, 3.x or 4.x (2.2.x might work, though)
|
||||
- - a PA-RISC-, Alpha-, IA-64- (Itanium-), PowerPC-, ARM- or x86- based machine
|
||||
+ - a PA-RISC-, Alpha-, Sw_64-, IA-64- (Itanium-), PowerPC-, ARM- or x86- based machine
|
||||
- cmake, GNU make or Ninja
|
||||
- an ANSI (or close enough to ANSI compliance) C++ compiler (tested with g++ 2.95.4 and 3.x)
|
||||
- for the (optional) GTK+ graphical user interface, you will need a
|
||||
diff -Naur lshw-B.02.19.2.org/src/core/cpuid.cc lshw-B.02.19.2.sw/src/core/cpuid.cc
|
||||
--- lshw-B.02.19.2.org/src/core/cpuid.cc 2022-03-02 05:57:54.280000000 +0000
|
||||
+++ lshw-B.02.19.2.sw/src/core/cpuid.cc 2022-03-02 06:17:08.250000000 +0000
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
__ID("@(#) $Id$");
|
||||
|
||||
-#if defined(__i386__) || defined(__alpha__)
|
||||
+#if defined(__i386__) || defined(__alpha__) || deined(__sw_64__)
|
||||
|
||||
static hwNode *getcache(hwNode & node,
|
||||
int n = 0)
|
||||
@@ -70,7 +70,7 @@
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
-#endif // __i386__ || __alpha__
|
||||
+#endif // __i386__ || __alpha__ || __sw_64__
|
||||
|
||||
#ifdef __i386__
|
||||
|
||||
diff -Naur lshw-B.02.19.2.org/src/core/cpuinfo.cc lshw-B.02.19.2.sw/src/core/cpuinfo.cc
|
||||
--- lshw-B.02.19.2.org/src/core/cpuinfo.cc 2022-03-02 05:57:54.280000000 +0000
|
||||
+++ lshw-B.02.19.2.sw/src/core/cpuinfo.cc 2022-03-02 06:09:36.460000000 +0000
|
||||
@@ -360,6 +360,63 @@
|
||||
}
|
||||
}
|
||||
|
||||
+static void cpuinfo_sw_64(hwNode & node,
|
||||
+string id,
|
||||
+string value)
|
||||
+{
|
||||
+ static int cpusdetected = 0;
|
||||
+ static int cpusactive = 0;
|
||||
+ unsigned long long frequency = 0;
|
||||
+ int i;
|
||||
+
|
||||
+ hwNode *cpu = getcpu(node, 0);
|
||||
+
|
||||
+ if (id == "platform string" && node.getProduct() == "")
|
||||
+ node.setProduct(value);
|
||||
+ if (id == "system serial number" && node.getSerial() == "")
|
||||
+ node.setSerial(value);
|
||||
+ if (id == "system type")
|
||||
+ node.setVersion(node.getVersion() + " " + value);
|
||||
+ if (id == "system variation")
|
||||
+ node.setVersion(node.getVersion() + " " + value);
|
||||
+ if (id == "system revision")
|
||||
+ node.setVersion(node.getVersion() + " " + value);
|
||||
+
|
||||
+ if (id == "cpus detected")
|
||||
+ cpusdetected = atoi(value.c_str());
|
||||
+ if (id == "cpus active")
|
||||
+ cpusactive = atoi(value.c_str());
|
||||
+ if (id == "cycle frequency [Hz]")
|
||||
+ frequency = atoll(value.c_str());
|
||||
+
|
||||
+ if (cpu)
|
||||
+ {
|
||||
+ cpu->claim(true);
|
||||
+
|
||||
+ if (frequency)
|
||||
+ cpu->setSize(frequency);
|
||||
+ }
|
||||
+
|
||||
+ for (i = 1; i < cpusdetected; i++)
|
||||
+ {
|
||||
+ hwNode *mycpu = getcpu(node, i);
|
||||
+
|
||||
+ if (mycpu)
|
||||
+ {
|
||||
+ mycpu->disable();
|
||||
+
|
||||
+ if (cpu)
|
||||
+ mycpu->setSize(cpu->getSize());
|
||||
+ }
|
||||
+ }
|
||||
+ for (i = 1; i < cpusactive; i++)
|
||||
+ {
|
||||
+ hwNode *mycpu = getcpu(node, i);
|
||||
+
|
||||
+ if (mycpu)
|
||||
+ mycpu->enable();
|
||||
+ }
|
||||
+}
|
||||
static void cpuinfo_alpha(hwNode & node,
|
||||
string id,
|
||||
string value)
|
||||
@@ -637,6 +694,10 @@
|
||||
{
|
||||
cpuinfo_alpha(n, id, value);
|
||||
}
|
||||
+ else if (plat == "sw_64")
|
||||
+ {
|
||||
+ cpuinfo_sw_64(n, id, value);
|
||||
+ }
|
||||
else if (plat == "ia64")
|
||||
{
|
||||
cpuinfo_ia64(n, id, value);
|
||||
diff -Naur lshw-B.02.19.2.org/src/core/dmi.cc lshw-B.02.19.2.sw/src/core/dmi.cc
|
||||
--- lshw-B.02.19.2.org/src/core/dmi.cc 2022-03-02 05:57:54.280000000 +0000
|
||||
+++ lshw-B.02.19.2.sw/src/core/dmi.cc 2022-03-02 06:11:38.140000000 +0000
|
||||
@@ -734,7 +734,8 @@
|
||||
"Core M3",
|
||||
"Core M5",
|
||||
"Core M7",
|
||||
- "Alpha", /* 0x30 */
|
||||
+ "Sw_64", /* 0x9916 */
|
||||
+ "Alpha", /* 0x30 */
|
||||
"Alpha 21064",
|
||||
"Alpha 21066",
|
||||
"Alpha 21164",
|
||||
diff -Naur lshw-B.02.19.2.org/src/core/pci.cc lshw-B.02.19.2.sw/src/core/pci.cc
|
||||
--- lshw-B.02.19.2.org/src/core/pci.cc 2022-03-02 05:57:54.290000000 +0000
|
||||
+++ lshw-B.02.19.2.sw/src/core/pci.cc 2022-03-02 06:13:58.590000000 +0000
|
||||
@@ -169,6 +169,7 @@
|
||||
#define PCI_CLASS_PROCESSOR_486 0x0b01
|
||||
#define PCI_CLASS_PROCESSOR_PENTIUM 0x0b02
|
||||
#define PCI_CLASS_PROCESSOR_ALPHA 0x0b10
|
||||
+#define PCI_CLASS_PROCESSOR_SW_64 0x9916
|
||||
#define PCI_CLASS_PROCESSOR_POWERPC 0x0b20
|
||||
#define PCI_CLASS_PROCESSOR_CO 0x0b40
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
Name: lshw
|
||||
Version: B.02.19.2
|
||||
Release: 1
|
||||
Release: 2
|
||||
Summary: Hardware lister
|
||||
License: GPLv2
|
||||
URL: http://ezix.org/project/wiki/HardwareLiSter
|
||||
@ -9,6 +9,7 @@ Patch0: lshw-B.02.18-scandir.patch
|
||||
|
||||
Patch2: lshw-B.02.18-revert-json.patch
|
||||
Patch3: lshw-B.02.19.2-cmake.patch
|
||||
Patch4: lshw-B.02.19.2-sw.patch
|
||||
|
||||
BuildRequires: gcc gcc-c++ cmake gettext
|
||||
BuildRequires: desktop-file-utils libappstream-glib ninja-build
|
||||
@ -38,6 +39,9 @@ The %{name}-help package contains doc files for %{name}.
|
||||
|
||||
%patch02 -R -p1
|
||||
%patch03 -p1
|
||||
%ifarch sw_64
|
||||
%patch04 -p1
|
||||
%endif
|
||||
|
||||
%build
|
||||
mkdir -p build && cd build
|
||||
@ -74,6 +78,9 @@ src/lshw -json -disable usb -disable pcmcia -disable isapnp \
|
||||
%{_mandir}/man1/lshw.1.gz
|
||||
|
||||
%changelog
|
||||
* Mon Oct 24 2022 wuzx<wuzx1226@qq.com> - B.02.19.2-2
|
||||
- add sw64 patch
|
||||
|
||||
* Wed Jan 27 2021 yuanxin <yuanxin24@huawei.com> - B.02.19.2-1
|
||||
- upgrade version to B.02.19.2
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user