comparison src/core/ngx_cpuinfo.c @ 468:56baf312c1b5 NGINX_0_7_46

nginx 0.7.46 *) Bugfix: the previous release tarball was incorrect.
author Igor Sysoev <http://sysoev.ru>
date Mon, 30 Mar 2009 00:00:00 +0400
parents a39aab45a53f
children d0f7a625f27c
comparison
equal deleted inserted replaced
467:d46142e61c30 468:56baf312c1b5
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