Mercurial > hg > nginx
comparison src/core/ngx_cpuinfo.c @ 2613:b863be280d3b
update cpuid for Core 2 and Atom
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sat, 28 Mar 2009 12:43:41 +0000 |
parents | 8e88522cb6da |
children | d620f497c50f |
comparison
equal
deleted
inserted
replaced
2612:038dc63b657a | 2613:b863be280d3b |
---|---|
70 | 70 |
71 void | 71 void |
72 ngx_cpuinfo(void) | 72 ngx_cpuinfo(void) |
73 { | 73 { |
74 u_char *vendor; | 74 u_char *vendor; |
75 uint32_t vbuf[5], cpu[4]; | 75 uint32_t vbuf[5], cpu[4], model; |
76 | 76 |
77 vbuf[0] = 0; | 77 vbuf[0] = 0; |
78 vbuf[1] = 0; | 78 vbuf[1] = 0; |
79 vbuf[2] = 0; | 79 vbuf[2] = 0; |
80 vbuf[3] = 0; | 80 vbuf[3] = 0; |
101 | 101 |
102 /* Pentium Pro, II, III */ | 102 /* Pentium Pro, II, III */ |
103 case 6: | 103 case 6: |
104 ngx_cacheline_size = 32; | 104 ngx_cacheline_size = 32; |
105 | 105 |
106 if ((cpu[0] & 0xf0) >= 0xd0) { | 106 model = ((cpu[0] & 0xf0000) >> 8) | (cpu[0] & 0xf0); |
107 /* Intel Core */ | 107 |
108 if (model >= 0xd0) { | |
109 /* Intel Core, Core 2, Atom */ | |
108 ngx_cacheline_size = 64; | 110 ngx_cacheline_size = 64; |
109 } | 111 } |
110 | 112 |
111 break; | 113 break; |
112 | 114 |