nps (NEWISYS): Makefile, nps.spec, common/dimm_map.h, common/jnet_...

baggins baggins at pld-linux.org
Thu Sep 22 13:18:07 CEST 2005


Author: baggins                      Date: Thu Sep 22 11:18:06 2005 GMT
Module: nps                           Tag: NEWISYS
---- Log message:
- updated to official V2.3.0.9 from Newisys

---- Files affected:
nps:
   Makefile (1.1 -> 1.1.2.1) , nps.spec (1.1 -> 1.1.2.1) 
nps/common:
   dimm_map.h (1.1 -> 1.1.2.1) , jnet_shared.c (1.1 -> 1.1.2.1) , jnet_shared.h (1.1 -> 1.1.2.1) , mc.h (1.1 -> 1.1.2.1) , nwsVersion.h (1.1 -> 1.1.2.1) , poci-start-script.sh (1.1 -> 1.1.2.1) , poci.h (1.1 -> 1.1.2.1) , swinventory.h (1.1 -> 1.1.2.1) , swinventory.xml (1.1 -> 1.1.2.1) 
nps/jnet:
   jnet_plat_src.c (1.1 -> 1.1.2.1) , jnet_plat_src.h (1.1 -> 1.1.2.1) , jnet_shared.c (1.1 -> 1.1.2.1) , makefile.2_4 (1.1 -> 1.1.2.1) , makefile.common (1.1 -> 1.1.2.1) , swinventory.xml (1.1 -> 1.1.2.1) 
nps/nws_mc:
   makefile.2_4 (1.1 -> 1.1.2.1) , makefile.common (1.1 -> 1.1.2.1) , nws_mc_src.c (1.1 -> 1.1.2.1) , swinventory.xml (1.1 -> 1.1.2.1) 
nps/poci:
   makefile (1.1 -> 1.1.2.1) , makefile_mc (1.1 -> 1.1.2.1) , nws_hb.c (1.1 -> 1.1.2.1) , nws_hb.h (1.1 -> 1.1.2.1) , nws_mc.c (1.1 -> 1.1.2.1) , nws_mc.h (1.1 -> 1.1.2.1) , nws_poci.c (1.1 -> 1.1.2.1) , nws_poci.h (1.1 -> 1.1.2.1) , poci.h (1.1 -> 1.1.2.1) , swinventory.xml (1.1 -> 1.1.2.1) 
nps/poci/script:
   poci (1.1 -> 1.1.2.1) 

---- Diffs:

================================================================
Index: nps/Makefile
diff -u nps/Makefile:1.1 nps/Makefile:1.1.2.1
--- nps/Makefile:1.1	Mon Jul 25 21:42:48 2005
+++ nps/Makefile	Thu Sep 22 13:18:01 2005
@@ -4,6 +4,8 @@
 export KERNEL_VER_2_6  := $(shell uname -r | awk '{ if ($$0 ~ /2\.6\./) print "1"; else print "0"}')
 export PLATFORM_X86_64 := $(shell uname -m | awk '{ if ($$0 ~ /x86[-_]64/) print "1"; else print "0"}')
 
+export BITS := $(shell uname -m | awk '{ if ($$0 ~ /x86[-_]64/) print "64"; else print "32"}')
+
 SED_PWD=$(shell echo `pwd` | sed -e 's/\//\\\//g')
 
 .PHONY: copy_files
@@ -28,9 +30,9 @@
 	@mkdir -p $(INSTALL_MOD_PATH)/etc/newisys
 	sed -e "s/<SWInstalledDate>.*</<SWInstalledDate>`date +%s`</" \
 	    -e "s/SWInfo\(.*\)</SWInfo\1 Source</" \
+            -e "s at bits.*@bits>$(BITS)</bits>@" \
 	  < common/swinventory.xml > common/swinventory.new
-	mv common/swinventory.new common/swinventory.xml
-	install -D -m 644 common/swinventory.xml $(INSTALL_MOD_PATH)/etc/newisys/swinventory.xml
+	install -D -m 644 common/swinventory.new $(INSTALL_MOD_PATH)/etc/newisys/swinventory.xml
 	@echo "$(INSTALL_MOD_PATH)/etc/newisys/swinventory.xml" >> file.list
 
 uninstall:

================================================================
Index: nps/nps.spec
diff -u nps/nps.spec:1.1 nps/nps.spec:1.1.2.1
--- nps/nps.spec:1.1	Mon Jul 25 21:42:49 2005
+++ nps/nps.spec	Thu Sep 22 13:18:01 2005
@@ -4,7 +4,7 @@
 
 Summary: Platform Linux components
 Name: nps
-Version: V2.2.0.6
+Version: V2.3.0.9
 Release: 0
 URL: http://www.newisys.com
 Source0: %{name}-%{version}.%{release}.tar.gz

================================================================

================================================================

================================================================

================================================================
Index: nps/common/mc.h
diff -u nps/common/mc.h:1.1 nps/common/mc.h:1.1.2.1
--- nps/common/mc.h:1.1	Mon Jul 25 21:42:52 2005
+++ nps/common/mc.h	Thu Sep 22 13:18:01 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 nps/common/nwsVersion.h:1.1.2.1
--- nps/common/nwsVersion.h:1.1	Mon Jul 25 21:42:52 2005
+++ nps/common/nwsVersion.h	Thu Sep 22 13:18:01 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 nps/common/poci-start-script.sh:1.1.2.1
--- nps/common/poci-start-script.sh:1.1	Mon Jul 25 21:42:52 2005
+++ nps/common/poci-start-script.sh	Thu Sep 22 13:18:01 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 nps/common/swinventory.xml:1.1.2.1
--- nps/common/swinventory.xml:1.1	Mon Jul 25 21:42:53 2005
+++ nps/common/swinventory.xml	Thu Sep 22 13:18:01 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.common
diff -u nps/jnet/makefile.common:1.1 nps/jnet/makefile.common:1.1.2.1
--- nps/jnet/makefile.common:1.1	Mon Jul 25 21:42:56 2005
+++ nps/jnet/makefile.common	Thu Sep 22 13:18:01 2005
@@ -27,6 +27,10 @@
   $(error TARGET has not been defined!)
 endif
 
+ifeq (,$(BITS))
+  $(error BITS has not been defined!)
+endif
+
 # get the kernel version - we use this to find the correct install path
 KVER = $(shell uname -r)
 
@@ -81,9 +85,9 @@
 	@mkdir -p $(INSTALL_MOD_PATH)/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 > swinventory.new
-	mv swinventory.new swinventory.xml
-	install -D -m 644 swinventory.xml $(INSTALL_MOD_PATH)/etc/newisys/jnet/swinventory.xml
+	install -D -m 644 swinventory.new $(INSTALL_MOD_PATH)/etc/newisys/jnet/swinventory.xml
 	@echo "$(INSTALL_MOD_PATH)/etc/newisys/jnet/swinventory.xml" >> ../file.list
 	make postinstall
 

================================================================
Index: nps/jnet/swinventory.xml
diff -u nps/jnet/swinventory.xml:1.1 nps/jnet/swinventory.xml:1.1.2.1
--- nps/jnet/swinventory.xml:1.1	Mon Jul 25 21:42:56 2005
+++ nps/jnet/swinventory.xml	Thu Sep 22 13:18:01 2005
@@ -2,10 +2,11 @@
    <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>
+         <bits />
+         <os>linux</os>
          <bits></bits>
       </Software>
    </SoftwareInventory>

================================================================

================================================================
Index: nps/nws_mc/makefile.common
diff -u nps/nws_mc/makefile.common:1.1 nps/nws_mc/makefile.common:1.1.2.1
--- nps/nws_mc/makefile.common:1.1	Mon Jul 25 21:42:56 2005
+++ nps/nws_mc/makefile.common	Thu Sep 22 13:18:01 2005
@@ -26,6 +26,10 @@
   $(error TARGET has not been defined!)
 endif
 
+ifeq (,$(BITS))
+  $(error BITS has not been defined!)
+endif
+
 # get the kernel version - we use this to find the correct install path
 KVER := $(shell uname -r)
 
@@ -79,9 +83,9 @@
 	@mkdir -p $(INSTALL_MOD_PATH)/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 > swinventory.new
-	mv swinventory.new swinventory.xml
-	install -D -m 644 swinventory.xml $(INSTALL_MOD_PATH)/etc/newisys/nws_mc/swinventory.xml
+	install -D -m 644 swinventory.new $(INSTALL_MOD_PATH)/etc/newisys/nws_mc/swinventory.xml
 	@echo "$(INSTALL_MOD_PATH)/etc/newisys/nws_mc/swinventory.xml" >> ../file.list
 
 uninstall:

================================================================
Index: nps/nws_mc/nws_mc_src.c
diff -u nps/nws_mc/nws_mc_src.c:1.1 nps/nws_mc/nws_mc_src.c:1.1.2.1
--- nps/nws_mc/nws_mc_src.c:1.1	Mon Jul 25 21:42:57 2005
+++ nps/nws_mc/nws_mc_src.c	Thu Sep 22 13:18:01 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 nps/nws_mc/swinventory.xml:1.1.2.1
--- nps/nws_mc/swinventory.xml:1.1	Mon Jul 25 21:42:57 2005
+++ nps/nws_mc/swinventory.xml	Thu Sep 22 13:18:01 2005
@@ -2,10 +2,11 @@
    <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>
+         <bits />
+         <os>linux</os>
          <bits></bits>
       </Software>
    </SoftwareInventory>

================================================================
Index: nps/poci/makefile
diff -u nps/poci/makefile:1.1 nps/poci/makefile:1.1.2.1
--- nps/poci/makefile:1.1	Mon Jul 25 21:42:57 2005
+++ nps/poci/makefile	Thu Sep 22 13:18:01 2005
@@ -42,9 +42,9 @@
 	@mkdir -p $(INSTALL_MOD_PATH)/etc/newisys/poci
 	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 $(INSTALL_MOD_PATH)/etc/newisys/poci/swinventory.xml
+	install -D -m 644 swinventory.new $(INSTALL_MOD_PATH)/etc/newisys/poci/swinventory.xml
 	@echo "$(INSTALL_MOD_PATH)/etc/newisys/poci/swinventory.xml" >> ../file.list
 	make postinstall
 

================================================================
Index: nps/poci/makefile_mc
diff -u nps/poci/makefile_mc:1.1 nps/poci/makefile_mc:1.1.2.1
--- nps/poci/makefile_mc:1.1	Mon Jul 25 21:42:57 2005
+++ nps/poci/makefile_mc	Thu Sep 22 13:18:01 2005
@@ -18,12 +18,21 @@
 ################################################################################
 KERNEL_MAJOR_VERSION ?= $(shell uname -r | sed 's/\([0-9]*\)\.[0-9]*\..*/\1/')
 KERNEL_MINOR_VERSION ?= $(shell uname -r | sed 's/[0-9]*\.\([0-9]*\)\..*/\1/')
+RELEASE_VERSION ?= $(shell uname -r | sed 's/smp/-smp/')
 ARCH_VERSION ?= $(shell uname -m)
+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 = /usr/src/kernels/$(RELEASE_VERSION)-$(ARCH_VERSION)/include/asm-$(ARCH_VERSION)/mce.h
+endif
+
 
 ifeq ($(KERNEL_MAJOR_VERSION),2)
 ifeq ($(KERNEL_MINOR_VERSION),6)
 ifeq ($(ARCH_VERSION),x86_64)
-CFLAGS_EXTRA += -DLINUX_2_6_KERNEL=1
+CFLAGS_EXTRA += -DLINUX_2_6_KERNEL=1 -include $(MCE_PATH)
 endif
 endif
 endif

================================================================
Index: nps/poci/nws_hb.c
diff -u nps/poci/nws_hb.c:1.1 nps/poci/nws_hb.c:1.1.2.1
--- nps/poci/nws_hb.c:1.1	Mon Jul 25 21:42:57 2005
+++ nps/poci/nws_hb.c	Thu Sep 22 13:18:01 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;
     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.1 nps/poci/nws_mc.c:1.1.2.1
--- nps/poci/nws_mc.c:1.1	Mon Jul 25 21:42:58 2005
+++ nps/poci/nws_mc.c	Thu Sep 22 13:18:01 2005
@@ -40,10 +40,6 @@
 #include <syslog.h>
 #include <linux/errno.h>
 
-#if LINUX_2_6_KERNEL
-#include <asm/mce.h>
-#endif
-
 #include "nwsVersion.h"
 #include "mc.h"
 #include "poci.h"
@@ -151,6 +147,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 LINUX_2_6_KERNEL
 /**********************************************
 Function:   mcelogHandler
@@ -169,8 +182,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) {
@@ -198,7 +217,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.1 nps/poci/nws_poci.c:1.1.2.1
--- nps/poci/nws_poci.c:1.1	Mon Jul 25 21:43:01 2005
+++ nps/poci/nws_poci.c	Thu Sep 22 13:18:01 2005
@@ -629,6 +629,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
@@ -651,7 +668,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);
 
@@ -675,7 +698,7 @@
 
             if(field > Unknown) {
                 if(field == Processor) {
-                    proc = atoi(token);
+                    proc = atoi(token) / num_cores;
                     if(proc >= MAX_NUM_CPUS) {
                         break;
                     }
@@ -790,6 +813,7 @@
       if( write(s, buf, VPD_SIZE) != VPD_SIZE) {
         //too bad.  there is no recovery
       }
+      break;
         
     }
     fclose(inFile);
@@ -970,7 +994,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));
 
@@ -979,7 +1003,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));
 
@@ -988,7 +1012,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));
 
@@ -997,7 +1021,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));
 
@@ -1006,7 +1030,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));
 
@@ -1015,7 +1039,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));
 }
@@ -1903,15 +1927,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);
@@ -1930,7 +1964,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 nps/poci/swinventory.xml:1.1.2.1
--- nps/poci/swinventory.xml:1.1	Mon Jul 25 21:43:02 2005
+++ nps/poci/swinventory.xml	Thu Sep 22 13:18:01 2005
@@ -2,10 +2,11 @@
    <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>
+         <bits />
+         <os>linux</os>
          <bits></bits>
       </Software>
    </SoftwareInventory>

================================================================
Index: nps/poci/script/poci
diff -u nps/poci/script/poci:1.1 nps/poci/script/poci:1.1.2.1
--- nps/poci/script/poci:1.1	Mon Jul 25 21:43:02 2005
+++ nps/poci/script/poci	Thu Sep 22 13:18:02 2005
@@ -44,6 +44,7 @@
   EXTRA_CMDS=""
 elif [ ${KERNEL_MAJOR_VERSION} -eq 2 ] && [ ${KERNEL_MINOR_VERSION} -eq 6 ]
 then
+  ARCH=`uname -r`
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/nps/Makefile?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/nps.spec?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/common/dimm_map.h?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/common/jnet_shared.c?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/common/jnet_shared.h?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/common/mc.h?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/common/nwsVersion.h?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/common/poci-start-script.sh?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/common/poci.h?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/common/swinventory.h?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/common/swinventory.xml?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/jnet/jnet_plat_src.c?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/jnet/jnet_plat_src.h?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/jnet/jnet_shared.c?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/jnet/makefile.2_4?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/jnet/makefile.common?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/jnet/swinventory.xml?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/nws_mc/makefile.2_4?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/nws_mc/makefile.common?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/nws_mc/nws_mc_src.c?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/nws_mc/swinventory.xml?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/poci/makefile?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/poci/makefile_mc?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/poci/nws_hb.c?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/poci/nws_hb.h?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/poci/nws_mc.c?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/poci/nws_mc.h?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/poci/nws_poci.c?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/poci/nws_poci.h?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/poci/poci.h?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/poci/swinventory.xml?r1=1.1&r2=1.1.2.1&f=u
    http://cvs.pld-linux.org/nps/poci/script/poci?r1=1.1&r2=1.1.2.1&f=u




More information about the pld-cvs-commit mailing list