comparison src/core/ngx_cpuinfo.c @ 166:fef68f68bcfd NGINX_0_3_30

nginx 0.3.30 *) Change: the ECONNABORTED error log level was changed to "error" from "crit". *) Bugfix: the ngx_http_perl_module could not be build without the ngx_http_ssi_filter_module. *) Bugfix: nginx could not be built on i386 platform, if the PIC was used; bug appeared in 0.3.27.
author Igor Sysoev <http://sysoev.ru>
date Wed, 22 Feb 2006 00:00:00 +0300
parents 73e8476f9142
children d2ae1c9f1fd3
comparison
equal deleted inserted replaced
165:c461f0beadb0 166:fef68f68bcfd
10 10
11 #if (( __i386__ || __amd64__ ) && ( __GNUC__ || __INTEL_COMPILER )) 11 #if (( __i386__ || __amd64__ ) && ( __GNUC__ || __INTEL_COMPILER ))
12 12
13 13
14 static ngx_inline void ngx_cpuid(uint32_t i, uint32_t *buf); 14 static ngx_inline void ngx_cpuid(uint32_t i, uint32_t *buf);
15
16
17 #if ( __i386__ )
18
19 static ngx_inline void
20 ngx_cpuid(uint32_t i, uint32_t *buf)
21 {
22
23 /*
24 * we could not use %ebx as output parameter if gcc builds PIC,
25 * and we could not save %ebx on stack, because %esp is used,
26 * when the -fomit-frame-pointer optimization is specified.
27 */
28
29 __asm__ (
30
31 " mov %%ebx, %%esi; "
32
33 " cpuid; "
34 " mov %%eax, %0; "
35 " mov %%ebx, %1; "
36 " mov %%edx, %2; "
37 " mov %%ecx, %3; "
38
39 " mov %%esi, %%ebx; "
40
41 : "=m" (buf[0]), "=m" (buf[1]), "=m" (buf[2]), "=m" (buf[3])
42 : "a" (i)
43 : "ecx", "edx", "esi" );
44 }
45
46
47 #else /* __amd64__ */
15 48
16 49
17 static ngx_inline void 50 static ngx_inline void
18 ngx_cpuid(uint32_t i, uint32_t *buf) 51 ngx_cpuid(uint32_t i, uint32_t *buf)
19 { 52 {
28 buf[0] = eax; 61 buf[0] = eax;
29 buf[1] = ebx; 62 buf[1] = ebx;
30 buf[2] = edx; 63 buf[2] = edx;
31 buf[3] = ecx; 64 buf[3] = ecx;
32 } 65 }
66
67
68 #endif
33 69
34 70
35 /* auto detect the L2 cache line size of modern and widespread CPUs */ 71 /* auto detect the L2 cache line size of modern and widespread CPUs */
36 72
37 void 73 void