]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lscpu: detect sun4{u,v} in /proc/cpuinfo for sparc64
authorKarel Zak <kzak@redhat.com>
Thu, 31 Mar 2011 12:30:06 +0000 (14:30 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 31 Mar 2011 12:30:06 +0000 (14:30 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/lscpu.c
tests/expected/lscpu/lscpu-sparc64-UltraSparc-T1

index d3abb98b78fffeb61b7ce06431ca3751a334ee9c..0d948835ff05f5454996ac5d1f313916aa4a04ac 100644 (file)
@@ -353,7 +353,7 @@ init_mode(void)
        /* platforms with 64bit flag in /proc/cpuinfo, define
         * 32bit default here */
 #if defined(__i386__) || defined(__x86_64__) || \
-    defined(__s390x__) || defined(__s390__)
+    defined(__s390x__) || defined(__s390__) || defined(__sparc_v9__)
        m |= MODE_32BIT;
 #endif
        return m;
@@ -386,6 +386,7 @@ read_basicinfo(struct lscpu_desc *desc)
                else if (lookup(buf, "cpu MHz", &desc->mhz)) ;
                else if (lookup(buf, "flags", &desc->flags)) ;          /* x86 */
                else if (lookup(buf, "features", &desc->flags)) ;       /* s390 */
+               else if (lookup(buf, "type", &desc->flags)) ;           /* sparc64 */
                else if (lookup(buf, "bogomips", &desc->bogomips)) ;
                else
                        continue;
@@ -403,6 +404,8 @@ read_basicinfo(struct lscpu_desc *desc)
                        desc->mode |= MODE_32BIT | MODE_64BIT;          /* x86_64 */
                if (strstr(buf, " zarch "))
                        desc->mode |= MODE_32BIT | MODE_64BIT;          /* s390x */
+               if (strstr(buf, " sun4v ") || strstr(buf, " sun4u "))
+                       desc->mode |= MODE_32BIT | MODE_64BIT;          /* sparc64 */
        }
 
        fclose(fp);
index 58aea7a612ccc20e4e1be87a8c930a1618967192..e54f8c69877908131c59dac28199e10c833b9140 100644 (file)
@@ -1,3 +1,4 @@
+CPU op-mode(s):        32-bit, 64-bit
 CPU(s):                32
 On-line CPU(s) list:   0-23
 Off-line CPU(s) list:  24-31