lscpu: detect sun4{u,v} in /proc/cpuinfo for sparc64

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2011-03-31 14:30:06 +02:00
parent 2b9ced6859
commit c487c90ccd
2 changed files with 5 additions and 1 deletions

View 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);

View 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