nps: Makefile, nps.spec, common/mc.h, common/nwsVersion.h, common/...

baggins baggins at pld-linux.org
Sun Sep 25 21:38:47 CEST 2005


Author: baggins                      Date: Sun Sep 25 19:38:47 2005 GMT
Module: nps                           Tag: HEAD
---- Log message:
- updated to v2.3.0.9

---- Files affected:
nps:
   Makefile (1.9 -> 1.10) , nps.spec (1.7 -> 1.8) 
nps/common:
   mc.h (1.2 -> 1.3) , nwsVersion.h (1.1.1.1 -> 1.2) , poci-start-script.sh (1.1.1.1 -> 1.2) , swinventory.xml (1.1.1.1 -> 1.2) 
nps/jnet:
   Makefile (1.2 -> 1.3) , swinventory.xml (1.1.1.1 -> 1.2) 
nps/nws_mc:
   Makefile (1.2 -> 1.3) , nws_mc_src.c (1.1.1.1 -> 1.2) , swinventory.xml (1.1.1.1 -> 1.2) 
nps/poci:
   Makefile (1.10 -> 1.11) , nws_hb.c (1.2 -> 1.3) , nws_mc.c (1.3 -> 1.4) , nws_poci.c (1.15 -> 1.16) , swinventory.xml (1.1.1.1 -> 1.2) 

---- Diffs:

================================================================
Index: nps/Makefile
diff -u nps/Makefile:1.9 nps/Makefile:1.10
--- nps/Makefile:1.9	Sun Sep 18 01:34:18 2005
+++ nps/Makefile	Sun Sep 25 21:38:42 2005
@@ -2,6 +2,7 @@
 
 KERNEL_VERSION := $(shell grep -m 1 UTS_RELEASE $(KERNEL_DIR)/include/linux/version.h | sed -e 's/.*UTS_RELEASE "\([0-9]*\.[0-9]*\)\..*"/\1/')
 BUILD_ARCH := $(shell uname -m | sed 'y/-/_/')
+BITS := $(shell uname -m | awk '{ if ($$0 ~ /x86[-_]64/) print "64"; else print "32"}')
 
 SED_PWD := $(shell echo `pwd` | sed -e 's/\//\\\//g')
 
@@ -25,9 +26,9 @@
 	@mkdir -p $(DESTDIR)/etc/newisys
 	sed -e "s/<SWInstalledDate>.*</<SWInstalledDate>`date +%s`</" \
 	    -e "s/SWInfo\(.*\)</SWInfo\1 Source</" \
-	  < common/swinventory.xml > common/swinventory.new
-	mv common/swinventory.new common/swinventory.xml
-	install -D -m 644 common/swinventory.xml $(DESTDIR)/etc/newisys/swinventory.xml
+	    -e "s at bits.*@bits>$(BITS)</bits>@" \
+	  < common/swinventory.xml > $(DESTDIR)/etc/newisys/swinventory.xml
+	chmod 644 $(DESTDIR)/etc/newisys/swinventory.xml
 
 uninstall:
 	make uninstall -C poci

================================================================
Index: nps/nps.spec
diff -u nps/nps.spec:1.7 nps/nps.spec:1.8
--- nps/nps.spec:1.7	Tue Aug  2 20:48:05 2005
+++ nps/nps.spec	Sun Sep 25 21:38:42 2005
@@ -7,7 +7,7 @@
 
 Summary:	Platform Linux components
 Name:		nps
-Version:	2.2.0.6.%{_vendor_rel}
+Version:	2.3.0.9.%{_vendor_rel}
 Release:	0.1
 License:	GPL
 Group:		Daemons
@@ -156,6 +156,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.8  2005/09/25 19:38:42  baggins
+- updated to v2.3.0.9
+
 Revision 1.7  2005/08/02 18:48:05  baggins
 - removed bogus polish translations (no offence qboosh ;)
 

================================================================
Index: nps/common/mc.h
diff -u nps/common/mc.h:1.2 nps/common/mc.h:1.3
--- nps/common/mc.h:1.2	Sun Sep 18 01:03:59 2005
+++ nps/common/mc.h	Sun Sep 25 21:38:42 2005
@@ -120,6 +120,8 @@
 #define MC4_ADDR_REG                0x412
 #define MC4_MISC_REG                0x413
 
+#define MSR_LOGICAL_CPUS_NUM        0xC001100d
+
 
 #define PRODUCT_ID          0xA9
 #define K_CPU0_HEARTBEAT    0x000000ac
@@ -137,6 +139,7 @@
 #define TEMP_OFFSET         0x000000e4
 #define TEMP_MASK           0x00003f00
 #define CPUID_FUNC1         1
+#define CPUID_FUNC8008      0x80000008
 
 #define CPUN_DEVFUNC        0x000000c0
 #define CPUN_OFFSET         0x00000060

================================================================
Index: nps/common/nwsVersion.h
diff -u nps/common/nwsVersion.h:1.1.1.1 nps/common/nwsVersion.h:1.2
--- nps/common/nwsVersion.h:1.1.1.1	Mon Jul 25 21:42:52 2005
+++ nps/common/nwsVersion.h	Sun Sep 25 21:38:42 2005
@@ -1,5 +1,5 @@
 
 #ifndef __NEWISYS_INCLUDE_NWSVERSION_H__
 #define __NEWISYS_INCLUDE_NWSVERSION_H__
-#define PLATFORM_PRODUCT_VERSION	"V2.2.0.6"
+#define PLATFORM_PRODUCT_VERSION	"V2.3.0.9"
 #endif /* __NEWISYS_INCLUDE_NWSVERSION_H__ */

================================================================
Index: nps/common/poci-start-script.sh
diff -u nps/common/poci-start-script.sh:1.1.1.1 nps/common/poci-start-script.sh:1.2
--- nps/common/poci-start-script.sh:1.1.1.1	Mon Jul 25 21:42:52 2005
+++ nps/common/poci-start-script.sh	Sun Sep 25 21:38:42 2005
@@ -44,6 +44,7 @@
   EXTRA_CMDS=""
 elif [ ${KERNEL_MAJOR_VERSION} -eq 2 ] && [ ${KERNEL_MINOR_VERSION} -eq 6 ]
 then
+  ARCH=`uname -r`
   JNET_INSMOD=`find /lib/modules/${ARCH}/ -name "jnet_*" -print`
 
   PLATFORM=`uname -m`

================================================================
Index: nps/common/swinventory.xml
diff -u nps/common/swinventory.xml:1.1.1.1 nps/common/swinventory.xml:1.2
--- nps/common/swinventory.xml:1.1.1.1	Mon Jul 25 21:42:53 2005
+++ nps/common/swinventory.xml	Sun Sep 25 21:38:42 2005
@@ -2,10 +2,10 @@
    <SoftwareInventory>
       <Software>
          <SWName>Platform Drivers</SWName>
-         <SWRev>V2.2.0.6</SWRev>
+         <SWRev>V2.3.0.9</SWRev>
          <SWInfo>Platform Driver Software Bundle</SWInfo>
          <SWInstalledDate>0</SWInstalledDate>
-         <os>Linux</os>
+         <os>linux</os>
       </Software>
    </SoftwareInventory>
 </Inventory>

================================================================
Index: nps/jnet/Makefile
diff -u nps/jnet/Makefile:1.2 nps/jnet/Makefile:1.3
--- nps/jnet/Makefile:1.2	Thu Sep 22 01:40:51 2005
+++ nps/jnet/Makefile	Sun Sep 25 21:38:42 2005
@@ -27,6 +27,10 @@
 PWD=$(shell pwd)
 TOPDIR=$(shell dirname $(PWD))
 
+ifeq (,$(BITS))
+  $(error BITS has not been defined!)
+endif
+
 # get the kernel version - we use this to find the correct install path
 KVER := $(shell grep -m 1 UTS_RELEASE $(KERNEL_DIR)/include/linux/version.h | sed -e 's/.*UTS_RELEASE "\(.*\)"/\1/')
 
@@ -87,6 +91,7 @@
 	@mkdir -p $(DESTDIR)/etc/newisys/jnet
 	sed -e "s/<SWInstalledDate>.*</<SWInstalledDate>`date +%s`</" \
 	    -e "s/SWInfo\(.*\)</SWInfo\1 Source</" \
+	    -e "s at bits.*@bits>$(BITS)</bits>@" \
 	  < swinventory.xml > $(DESTDIR)/etc/newisys/jnet/swinventory.xml
 	@chmod 644 $(DESTDIR)/etc/newisys/jnet/swinventory.xml
 	make postinstall

================================================================
Index: nps/jnet/swinventory.xml
diff -u nps/jnet/swinventory.xml:1.1.1.1 nps/jnet/swinventory.xml:1.2
--- nps/jnet/swinventory.xml:1.1.1.1	Mon Jul 25 21:42:56 2005
+++ nps/jnet/swinventory.xml	Sun Sep 25 21:38:42 2005
@@ -2,10 +2,10 @@
    <SoftwareInventory>
       <Software>
          <SWName>JNet</SWName>
-         <SWRev>V2.2.0.6a</SWRev>
+         <SWRev>V2.3.0.9</SWRev>
          <SWInfo>JNet Communications Platform Driver</SWInfo>
          <SWInstalledDate>0</SWInstalledDate>
-         <os>Linux</os>
+         <os>linux</os>
          <bits></bits>
       </Software>
    </SoftwareInventory>

================================================================
Index: nps/nws_mc/Makefile
diff -u nps/nws_mc/Makefile:1.2 nps/nws_mc/Makefile:1.3
--- nps/nws_mc/Makefile:1.2	Thu Sep 22 01:47:31 2005
+++ nps/nws_mc/Makefile	Sun Sep 25 21:38:42 2005
@@ -26,6 +26,10 @@
 PWD=$(shell pwd)
 TOPDIR=$(shell dirname $(PWD))
 
+ifeq (,$(BITS))
+  $(error BITS has not been defined!)
+endif
+
 # get the kernel version - we use this to find the correct install path
 KVER := $(shell grep -m 1 UTS_RELEASE $(KERNEL_DIR)/include/linux/version.h | sed -e 's/.*UTS_RELEASE "\(.*\)"/\1/')
 
@@ -86,6 +90,7 @@
 	@mkdir -p $(DESTDIR)/etc/newisys/nws_mc
 	sed -e "s/<SWInstalledDate>.*</<SWInstalledDate>`date +%s`</" \
 	    -e "s/SWInfo\(.*\)</SWInfo\1 Source</" \
+	    -e "s at bits.*@bits>$(BITS)</bits>@" \
 	  < swinventory.xml > $(DESTDIR)/etc/newisys/nws_mc/swinventory.xml
 	@chmod 644 $(DESTDIR)/etc/newisys/nws_mc/swinventory.xml
 

================================================================
Index: nps/nws_mc/nws_mc_src.c
diff -u nps/nws_mc/nws_mc_src.c:1.1.1.1 nps/nws_mc/nws_mc_src.c:1.2
--- nps/nws_mc/nws_mc_src.c:1.1.1.1	Mon Jul 25 21:42:57 2005
+++ nps/nws_mc/nws_mc_src.c	Sun Sep 25 21:38:42 2005
@@ -376,10 +376,17 @@
 {
     unsigned char tick;
     unsigned long addr;
+    int num_cores ;
+
+    num_cores = cpuid_ecx(CPUID_FUNC8008) + 1;
+    if( num_cores > 2 || num_cores < 1 )
+    {
+        num_cores = 1;
+    }
 
     //depending on which cpu we are running on, increment the appropriate
     //prs register value
-    switch(smp_processor_id()) {
+    switch(smp_processor_id() / num_cores) {
     case 0:
         if(ProductID == NWS_PRODUCT_ID_3U4P) { addr = S_CPU0_HEARTBEAT; }
         else { addr = K_CPU0_HEARTBEAT; }
@@ -453,8 +460,15 @@
            MC4_STATUS_REG 
         };
     regErr_t regErr[] = DEFAULT_REG_ERR_VALUES;
+    int num_cores;
+
+    num_cores = cpuid_ecx(CPUID_FUNC8008) + 1;
+    if( num_cores > 2 || num_cores < 1 )
+    {
+        num_cores = 1;
+    }
 
-    cpuId = smp_processor_id();
+    cpuId = smp_processor_id() / num_cores;
     regIfValsArr[cpuId].errOccurred = FALSE;
     regIfValsArr[cpuId].cpuId = cpuId;
 

================================================================
Index: nps/nws_mc/swinventory.xml
diff -u nps/nws_mc/swinventory.xml:1.1.1.1 nps/nws_mc/swinventory.xml:1.2
--- nps/nws_mc/swinventory.xml:1.1.1.1	Mon Jul 25 21:42:57 2005
+++ nps/nws_mc/swinventory.xml	Sun Sep 25 21:38:42 2005
@@ -2,10 +2,10 @@
    <SoftwareInventory>
       <Software>
          <SWName>Machine Check</SWName>
-         <SWRev>V2.2.0.6a</SWRev>
+         <SWRev>V2.3.0.9</SWRev>
          <SWInfo>Machine Check Platform Driver</SWInfo>
          <SWInstalledDate>0</SWInstalledDate>
-         <os>Linux</os>
+         <os>linux</os>
          <bits></bits>
       </Software>
    </SoftwareInventory>

================================================================
Index: nps/poci/Makefile
diff -u nps/poci/Makefile:1.10 nps/poci/Makefile:1.11
--- nps/poci/Makefile:1.10	Sun Sep 18 01:43:50 2005
+++ nps/poci/Makefile	Sun Sep 25 21:38:42 2005
@@ -22,6 +22,14 @@
 KERNEL_VERSION := $(shell grep -m 1 UTS_RELEASE $(KERNEL_DIR)/include/linux/version.h | sed -e 's/.*UTS_RELEASE "\([0-9]*\.[0-9]*\)\..*"/\1/')
 BUILD_ARCH := $(shell uname -m | sed 'y/-/_/')
 
+FILE_EXISTS ?=  $(shell test -f /usr/include/asm/mce.h; echo $$?)
+
+ifeq ($(FILE_EXISTS),0)
+MCE_PATH = /usr/include/asm/mce.h
+else
+MCE_PATH = $(KERNEL_DIR)/include/asm/mce.h
+endif
+
 CC = gcc
 
 OPTFLAGS = -O2 -Wall
@@ -29,7 +37,7 @@
 
 ifeq ($(KERNEL_VERSION),2.6)
 ifeq ($(BUILD_ARCH),x86_64)
-CFLAGS += -DKERNEL_HAS_MCE=1 -I$(KERNEL_DIR)/include
+CFLAGS += -DKERNEL_HAS_MCE=1 -include $(MCE_PATH)
 POCI_LDFLAGS = -lpci
 endif
 endif
@@ -63,6 +71,7 @@
 	install -m744 script/poci.init $(DESTDIR)/etc/rc.d/init.d
 	sed -e "s/<SWInstalledDate>.*</<SWInstalledDate>`date +%s`</" \
 	    -e "s/SWInfo\(.*\)</SWInfo\1 Source</" \
+	    -e "s at bits.*@bits>$(BITS)</bits>@" \
 	  < swinventory.xml > swinventory.new
 	mv swinventory.new swinventory.xml
 	install -D -m 644 swinventory.xml $(DESTDIR)/etc/newisys/poci/swinventory.xml

================================================================
Index: nps/poci/nws_hb.c
diff -u nps/poci/nws_hb.c:1.2 nps/poci/nws_hb.c:1.3
--- nps/poci/nws_hb.c:1.2	Tue Sep 13 14:46:19 2005
+++ nps/poci/nws_hb.c	Sun Sep 25 21:38:42 2005
@@ -91,6 +91,23 @@
     return 0;
 }
 
+/*********************************************************************
+Function:   cpuid_ecx
+Arguments:  none
+Returns:    uint32_t value of eax after cpuid (func 1 ) is executed
+Purpose:    return the value of eax after cpuid (func 1 ) is executed.
+*********************************************************************/
+#define CPUID_FUNC8008      0x80000008
+uint32_t cpuid_ecx(void)
+{
+    uint32_t        in, a,b,c,d;
+
+    in = CPUID_FUNC8008;
+    asm("cpuid": "=a" (a), "=b" (b), "=c" (c), "=d" (d) : "a" (in));
+
+    return c;
+}
+
 /**********************************************
 Function:   hbHandler
 Arguments:  none
@@ -104,6 +121,13 @@
     unsigned long   addr = S_CPU0_HEARTBEAT;
     unsigned char   tick;
     unsigned char   prodID;
+    unsigned long   num_cores;
+
+    num_cores = cpuid_ecx() + 1;
+    if( num_cores > 2 || num_cores < 1)
+    {
+        num_cores = 1;
+    }
 
     hbPollRate = getPollRate(HB_POLL_INTERVAL);
     if(hbPollRate == 0) {
@@ -111,7 +135,7 @@
         hbPollRate = DEFAULT_HB_POLL_INTERVAL;
     }
 
-    cpus = sysconf(_SC_NPROCESSORS_ONLN);
+    cpus = sysconf(_SC_NPROCESSORS_ONLN) / num_cores;
     if( cpus < 1 || cpus > MAX_NUM_CPUS)
     {
         syslog( LOG_INFO, ("Incorrect number of processors detected\n"));

================================================================
Index: nps/poci/nws_mc.c
diff -u nps/poci/nws_mc.c:1.3 nps/poci/nws_mc.c:1.4
--- nps/poci/nws_mc.c:1.3	Sat Sep 10 00:47:29 2005
+++ nps/poci/nws_mc.c	Sun Sep 25 21:38:42 2005
@@ -40,10 +40,6 @@
 #include <syslog.h>
 #include <linux/errno.h>
 
-#if KERNEL_HAS_MCE
-#include <asm/mce.h>
-#endif
-
 #include "nwsVersion.h"
 #include "mc.h"
 #include "poci.h"
@@ -153,6 +149,23 @@
     return;
 }
 
+/*********************************************************************
+Function:   cpuid_ecx
+Arguments:  none
+Returns:    uint32_t value of eax after cpuid (func 1 ) is executed
+Purpose:    return the value of eax after cpuid (func 1 ) is executed.
+*********************************************************************/
+#define CPUID_FUNC8008      0x80000008
+uint32_t cpuid_ecx(void)
+{   
+    uint32_t        in, a,b,c,d;
+
+    in = CPUID_FUNC8008;
+    asm("cpuid": "=a" (a), "=b" (b), "=c" (c), "=d" (d) : "a" (in));
+
+    return c;
+}
+
 #if KERNEL_HAS_MCE
 /**********************************************
 Function:   mcelogHandler
@@ -171,8 +184,14 @@
     ssize_t         bytes_read;
     int             i, num_err, cpu, offset = 0;
     RegIfVals       regIfVals[MAX_NUM_CPUS];
+    int             num_cores;
+    char            errMsg[BUFSIZE];
 
-    char errMsg[BUFSIZE];
+    num_cores = cpuid_ecx() + 1;
+    if( num_cores > 2 || num_cores < 1)
+    {
+        num_cores = 1;
+    }
 
     mcelog = open(filename, O_RDONLY);
     if( mcelog < 0) {
@@ -200,7 +219,7 @@
             {
                 memset(regIfVals, 0x00, sizeof(regIfVals));
 
-                cpu = data[i].cpu;
+                cpu = data[i].cpu / num_cores;
                 if( data[i].bank <= 4 )
                 {
                     offset = data[i].bank * 3;

================================================================
Index: nps/poci/nws_poci.c
diff -u nps/poci/nws_poci.c:1.15 nps/poci/nws_poci.c:1.16
--- nps/poci/nws_poci.c:1.15	Fri Sep 16 19:08:41 2005
+++ nps/poci/nws_poci.c	Sun Sep 25 21:38:42 2005
@@ -849,6 +849,23 @@
     return 0;
 }
 
+/*********************************************************************
+Function:   cpuid_ecx
+Arguments:  none
+Returns:    uint32_t value of eax after cpuid (func 1 ) is executed
+Purpose:    return the value of eax after cpuid (func 1 ) is executed.
+*********************************************************************/
+#define CPUID_FUNC8008      0x80000008
+uint32_t cpuid_ecx(void)
+{
+    uint32_t        in, a,b,c,d;
+
+    in = CPUID_FUNC8008;
+    asm("cpuid": "=a" (a), "=b" (b), "=c" (c), "=d" (d) : "a" (in));
+
+    return c;
+}
+
 /**********************************************
 Function:   getCpuid
 Arguments:  int s - outgoing socket
@@ -871,7 +888,13 @@
     int offset;
     unsigned char cksum;
     int found = FALSE;
+    unsigned long num_cores;
 
+    num_cores = cpuid_ecx() + 1;
+    if( num_cores > 2 || num_cores < 1)
+    {
+        num_cores = 1;
+    }
 
     memset(fields, MAX_NUM_CPUS*6*BUFSIZE, 0x00);
 
@@ -895,7 +918,7 @@
 
             if(field > Unknown) {
                 if(field == Processor) {
-                    proc = atoi(token);
+                    proc = atoi(token) / num_cores;
                     if(proc >= MAX_NUM_CPUS) {
                         break;
                     }
@@ -1010,6 +1033,7 @@
       if( write(s, buf, VPD_SIZE) != VPD_SIZE) {
         //too bad.  there is no recovery
       }
+      break;
         
     }
     fclose(inFile);
@@ -1196,7 +1220,7 @@
                  "<Software> <SWName>%s</SWName> "
                  "<SWRev></SWRev><IIIPartySWRevName>NA</IIIPartySWRevName>"
                  "<SWInfo>%s</SWInfo><SWInstalledDate>-1</SWInstalledDate>"
-                 "<bits>%s</bits> </Software>",
+                 "<os>linux</os><bits>%s</bits> </Software>",
                  SWNAME_LINUX_TRIDENT, SWINFO_LINUX_TRIDENT,bits );
     strncat(buf, tmp, AVAIL(buf));
 
@@ -1205,7 +1229,7 @@
                  "<Software> <SWName>%s</SWName> "
                  "<SWRev></SWRev><IIIPartySWRevName>NA</IIIPartySWRevName>"
                  "<SWInfo>%s</SWInfo><SWInstalledDate>-1</SWInstalledDate>"
-                 "<bits>%s</bits> </Software>",
+                 "<os>linux</os><bits>%s</bits> </Software>",
                  SWNAME_LINUX_BROADCOM, SWINFO_LINUX_BROADCOM, bits );
     strncat(buf, tmp, AVAIL(buf));
 
@@ -1214,7 +1238,7 @@
                  "<Software> <SWName>%s</SWName> "
                  "<SWRev></SWRev><IIIPartySWRevName>NA</IIIPartySWRevName>"
                  "<SWInfo>%s</SWInfo><SWInstalledDate>-1</SWInstalledDate>"
-                 "<bits>%s</bits> </Software>",
+                 "<os>linux</os><bits>%s</bits> </Software>",
                  SWNAME_LINUX_LSI, SWINFO_LINUX_LSI, bits );
     strncat(buf, tmp, AVAIL(buf));
 
@@ -1223,7 +1247,7 @@
                  "<Software> <SWName>%s</SWName> "
                  "<SWRev></SWRev><IIIPartySWRevName>NA</IIIPartySWRevName>"
                  "<SWInfo>%s</SWInfo><SWInstalledDate>-1</SWInstalledDate>"
-                 "<bits>%s</bits> </Software>",
+                 "<os>linux</os><bits>%s</bits> </Software>",
                  SWNAME_LINUX_AMD_IOAPIC, SWINFO_LINUX_AMD_IOAPIC, bits );
     strncat(buf, tmp, AVAIL(buf));
 
@@ -1232,7 +1256,7 @@
                  "<Software> <SWName>%s</SWName> "
                  "<SWRev></SWRev><IIIPartySWRevName>NA</IIIPartySWRevName>"
                  "<SWInfo>%s</SWInfo><SWInstalledDate>-1</SWInstalledDate>"
-                 "<bits>%s</bits> </Software>",
+                 "<os>linux</os><bits>%s</bits> </Software>",
                  SWNAME_LINUX_AMD_EIDE, SWINFO_LINUX_AMD_EIDE, bits );
     strncat(buf, tmp, AVAIL(buf));
 
@@ -1241,7 +1265,7 @@
                  "<Software> <SWName>%s</SWName> "
                  "<SWRev></SWRev><IIIPartySWRevName>NA</IIIPartySWRevName>"
                  "<SWInfo>%s</SWInfo><SWInstalledDate>-1</SWInstalledDate>"
-                 "<bits>%s</bits> </Software>",
+                 "<os>linux</os><bits>%s</bits> </Software>",
                  SWNAME_LINUX_AMD_SM, SWINFO_LINUX_AMD_SM, bits);
     strncat(buf, tmp, AVAIL(buf));
 }
@@ -2139,15 +2163,25 @@
 *********************************************************************/
 void get_temp(char *outBuf)
 {
-    int             cpu;
+    int             cpu,cpus;
     uint32_t        temp;
     uint32_t        val, eff_family, eff_model, stepping;
     uint32_t        diode_offset, t_case_max;
     uint32_t        cpu_id;
     int             rc;
-    char buf[BUFSIZE];
+    char            buf[BUFSIZE];
+    unsigned long   num_cores;
+
+    printStart(outBuf);
+
+    num_cores = cpuid_ecx() + 1;
+    if( num_cores > 2 || num_cores < 1)
+    {
+        num_cores = 1;
+    }
+    cpus = sysconf(_SC_NPROCESSORS_ONLN) / num_cores;
 
-    for(cpu=0; cpu<MAX_NUM_CPUS; cpu++)
+    for(cpu=0; cpu<cpus; cpu++)
     {
 
         rc = read_pci( 0, DEV18+cpu, FUNC3, CPUN_THERMTRIP, &val);
@@ -2166,7 +2200,7 @@
         diode_offset = (val & DIODE_MASK) >> DIODE_OFFSET;
         t_case_max = (val & CASE_MASK) >> CASE_OFFSET;
         t_case_max = (2 * t_case_max) + TCASE_BASE_VAL;
-        if( (val & DIODE_SIGN_BIT) == 1 )
+        if( (val & DIODE_SIGN_BIT) != 0 )
         {
             diode_offset = 0 - diode_offset;
         }

================================================================
Index: nps/poci/swinventory.xml
diff -u nps/poci/swinventory.xml:1.1.1.1 nps/poci/swinventory.xml:1.2
--- nps/poci/swinventory.xml:1.1.1.1	Mon Jul 25 21:43:02 2005
+++ nps/poci/swinventory.xml	Sun Sep 25 21:38:42 2005
@@ -2,10 +2,10 @@
    <SoftwareInventory>
       <Software>
          <SWName>Poci</SWName>
-         <SWRev>V2.2.0.6a</SWRev>
+         <SWRev>V2.3.0.9</SWRev>
          <SWInfo>Poci Platform Driver</SWInfo>
          <SWInstalledDate>0</SWInstalledDate>
-         <os>Linux</os>
+         <os>linux</os>
          <bits></bits>
       </Software>
    </SoftwareInventory>
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/nps/Makefile?r1=1.9&r2=1.10&f=u
    http://cvs.pld-linux.org/nps/nps.spec?r1=1.7&r2=1.8&f=u
    http://cvs.pld-linux.org/nps/common/mc.h?r1=1.2&r2=1.3&f=u
    http://cvs.pld-linux.org/nps/common/nwsVersion.h?r1=1.1.1.1&r2=1.2&f=u
    http://cvs.pld-linux.org/nps/common/poci-start-script.sh?r1=1.1.1.1&r2=1.2&f=u
    http://cvs.pld-linux.org/nps/common/swinventory.xml?r1=1.1.1.1&r2=1.2&f=u
    http://cvs.pld-linux.org/nps/jnet/Makefile?r1=1.2&r2=1.3&f=u
    http://cvs.pld-linux.org/nps/jnet/swinventory.xml?r1=1.1.1.1&r2=1.2&f=u
    http://cvs.pld-linux.org/nps/nws_mc/Makefile?r1=1.2&r2=1.3&f=u
    http://cvs.pld-linux.org/nps/nws_mc/nws_mc_src.c?r1=1.1.1.1&r2=1.2&f=u
    http://cvs.pld-linux.org/nps/nws_mc/swinventory.xml?r1=1.1.1.1&r2=1.2&f=u
    http://cvs.pld-linux.org/nps/poci/Makefile?r1=1.10&r2=1.11&f=u
    http://cvs.pld-linux.org/nps/poci/nws_hb.c?r1=1.2&r2=1.3&f=u
    http://cvs.pld-linux.org/nps/poci/nws_mc.c?r1=1.3&r2=1.4&f=u
    http://cvs.pld-linux.org/nps/poci/nws_poci.c?r1=1.15&r2=1.16&f=u
    http://cvs.pld-linux.org/nps/poci/swinventory.xml?r1=1.1.1.1&r2=1.2&f=u




More information about the pld-cvs-commit mailing list