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.
diff --git a/src/core/ngx_cpuinfo.c b/src/core/ngx_cpuinfo.c
index a939635..f905cbc 100644
--- a/src/core/ngx_cpuinfo.c
+++ b/src/core/ngx_cpuinfo.c
@@ -14,6 +14,39 @@
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 output parameter if gcc builds PIC,
+ * and we could not save %ebx on stack, because %esp is used,
+ * when the -fomit-frame-pointer optimization is specified.
+ */
+
+ __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 +65,9 @@
}
+#endif
+
+
/* auto detect the L2 cache line size of modern and widespread CPUs */
void