加载中…
个人资料
新浪研发中心
新浪研发中心
  • 博客等级:
  • 博客积分:0
  • 博客访问:11,592
  • 关注人气:289
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

在LINUX下怎样决断你的CPU是否为64位?

(2011-02-15 18:14:57)
标签:

cpu

64位

it

分类: 操作系统
打入下面的命令
grep flags /proc/cpuinfo
 
输出
flags fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm nx lm
 
如果找到lm, 则说明你的CPU是64位的. lm是long mode的意思.
 
 
Long Mode 64位CPU
Real Mode 16位CPU
Protected Mode 32位CPU
 
 
在内核源码中我们可以找到每个 flag 的相关注释,通过这些注释可以很方便我们理解这些 flags 缩写:
cat  linux-2.6.31.8/arch/x86/include/asm/cpufeature.h
...
#define X86_FEATURE_FPU         (0*32+ 0) 
#define X86_FEATURE_VME         (0*32+ 1) 
#define X86_FEATURE_DE          (0*32+ 2) 
#define X86_FEATURE_PSE         (0*32+ 3) 
#define X86_FEATURE_TSC         (0*32+ 4) 
#define X86_FEATURE_MSR         (0*32+ 5) 
#define X86_FEATURE_PAE         (0*32+ 6) 
#define X86_FEATURE_MCE         (0*32+ 7) 
#define X86_FEATURE_CX8         (0*32+ 8) 
#define X86_FEATURE_APIC        (0*32+ 9) 
#define X86_FEATURE_SEP         (0*32+11) 
#define X86_FEATURE_MTRR        (0*32+12) 
#define X86_FEATURE_PGE         (0*32+13) 
#define X86_FEATURE_MCA         (0*32+14) 
#define X86_FEATURE_CMOV        (0*32+15) 
                                          
#define X86_FEATURE_PAT         (0*32+16) 
#define X86_FEATURE_PSE36       (0*32+17) 
#define X86_FEATURE_PN          (0*32+18) 
#define X86_FEATURE_CLFLSH      (0*32+19) 
#define X86_FEATURE_DS          (0*32+21) 
#define X86_FEATURE_ACPI        (0*32+22) 
#define X86_FEATURE_MMX         (0*32+23) 
#define X86_FEATURE_FXSR        (0*32+24) 
#define X86_FEATURE_XMM         (0*32+25) 
#define X86_FEATURE_XMM2        (0*32+26) 
#define X86_FEATURE_SELFSNOOP   (0*32+27) 
#define X86_FEATURE_HT          (0*32+28) 
#define X86_FEATURE_ACC         (0*32+29) 
#define X86_FEATURE_IA64        (0*32+30) 
#define X86_FEATURE_PBE         (0*32+31) 
#define X86_FEATURE_SYSCALL     (1*32+11) 
#define X86_FEATURE_MP          (1*32+19) 
#define X86_FEATURE_NX          (1*32+20) 
#define X86_FEATURE_MMXEXT      (1*32+22) 
#define X86_FEATURE_FXSR_OPT    (1*32+25) 
#define X86_FEATURE_GBPAGES     (1*32+26) 
#define X86_FEATURE_RDTSCP      (1*32+27) 
#define X86_FEATURE_LM          (1*32+29) 
#define X86_FEATURE_3DNOWEXT    (1*32+30) 
#define X86_FEATURE_3DNOW       (1*32+31) 
...
...
...
...

0

阅读 收藏 喜欢 打印举报/Report
后一篇:虚同步简介
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有