diff -ur ./nginx-0.3.29/src/core/ngx_cpuinfo.c ./nginx-0.3.29.2/src/core/ngx_cpuinfo.c --- ./nginx-0.3.29/src/core/ngx_cpuinfo.c 2006-02-08 14:39:29.000000000 +0300 +++ ./nginx-0.3.29.2/src/core/ngx_cpuinfo.c 2006-02-22 13:25:07.000000000 +0300 @@ -13,6 +13,34 @@ static ngx_inline void ngx_cpuid(uint32_t i, uint32_t *buf); +#if ( __i386__ ) + + +static ngx_inline void ngx_cpuid(uint32_t i, uint32_t *buf) +{ + + /*^ + * we could not use %ebx as parameter if gcc building with -fPIC^ + * and we could not push %ebx on stack^ + */ + + __asm__ ( + + " mov %%ebx, %%esi; " + " cpuid; " + " mov %%eax, %0; " + " mov %%ebx, %1; " + " mov %%edx, %2; " + " mov %%ecx, %3; " + " mov %%esi, %%ebx; " + : "=m" (buf[0]), "=m" (buf[1]), "=m" (buf[2]), "=m" (buf[3]) + : "a" (i) + : "ecx", "edx", "esi" ); +} + + +#else /* __amd64__ */ + static ngx_inline void ngx_cpuid(uint32_t i, uint32_t *buf) @@ -32,6 +60,9 @@ } +#endif + + /* auto detect the L2 cache line size of modern and widespread CPUs */ void @@ -53,6 +84,8 @@ if (vbuf[0] == 0) { return; } + + ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0, "CPU: \"%s\"", vendor); ngx_cpuid(1, cpu);