diff options
author | Karel Zak | 2011-03-31 14:30:06 +0200 |
---|---|---|
committer | Karel Zak | 2011-03-31 14:30:06 +0200 |
commit | c487c90ccdb876709822dccc97054af190d77ea3 (patch) | |
tree | 21f1387749d8c63bdafd32c48b1da69ba39d0b59 /sys-utils/lscpu.c | |
parent | tests: add dump from UltraSparc T1 to lscpu tests (diff) | |
download | kernel-qcow2-util-linux-c487c90ccdb876709822dccc97054af190d77ea3.tar.gz kernel-qcow2-util-linux-c487c90ccdb876709822dccc97054af190d77ea3.tar.xz kernel-qcow2-util-linux-c487c90ccdb876709822dccc97054af190d77ea3.zip |
lscpu: detect sun4{u,v} in /proc/cpuinfo for sparc64
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/lscpu.c')
-rw-r--r-- | sys-utils/lscpu.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c index d3abb98b7..0d948835f 100644 --- a/sys-utils/lscpu.c +++ b/sys-utils/lscpu.c @@ -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); |