Mercurial > hg > nginx
comparison src/core/ngx_cpuinfo.c @ 617:51b27717f140 release-0.3.30
nginx-0.3.30-RELEASE import
*) 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; the bug had appeared in 0.3.27.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 22 Feb 2006 19:41:39 +0000 |
parents | 3f8a2132b93d |
children | 39b7d7b33c91 |
comparison
equal
deleted
inserted
replaced
616:3ac637aa8f17 | 617:51b27717f140 |
---|---|
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 |