# HG changeset patch # User Wolfgang Rosenauer # Date 1276077584 -7200 # Node ID bc6311ee4f5e431dd819a7da04d84b916389fcae # Parent e0271a18500f49cfb871c8b91bac19a8fc1c4328 use mozilla-cpuid.patch for 11.1 and older diff -r e0271a18500f -r bc6311ee4f5e mozilla-cpuid.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mozilla-cpuid.patch Wed Jun 09 11:59:44 2010 +0200 @@ -0,0 +1,84 @@ +References: +https://bugzilla.mozilla.org/show_bug.cgi?id=513422 + +diff --git a/xpcom/glue/SSE.h b/xpcom/glue/SSE.h +--- a/xpcom/glue/SSE.h ++++ b/xpcom/glue/SSE.h +@@ -234,32 +234,73 @@ + #endif + #ifdef __SSE4_2__ + // It's ok to use SSE4.2 instructions based on the -march option. + #define MOZILLA_PRESUME_SSE4_2 1 + #endif + + #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) + +-// cpuid.h is available on gcc 4.3 and higher on i386 and x86_64 +-#include + #define MOZILLA_SSE_HAVE_CPUID_DETECTION + + namespace mozilla { + + namespace sse_private { + + enum CPUIDRegister { eax = 0, ebx = 1, ecx = 2, edx = 3 }; + ++ inline void my__cpuid(unsigned int* regs, unsigned int level) ++ { ++ regs[0] = level; ++# if defined(__i386__) ++ __asm__ __volatile__( ++ "pushl %%ebx" "\n\t" ++ "movl %0, %%edi" "\n\t" ++ "movl 0(%%edi), %%eax" "\n\t" ++ "cpuid" "\n\t" ++ "movl %%eax, 0(%%edi)" "\n\t" ++ "movl %%ebx, 4(%%edi)" "\n\t" ++ "movl %%ecx, 8(%%edi)" "\n\t" ++ "movl %%edx, 12(%%edi)" "\n\t" ++ "popl %%ebx" "\n" ++ : /*out*/ ++ : /*in*/"r"(regs) ++ : /*trash*/"edi","eax","ecx","edx","memory","cc" ++ ); ++# elif defined(__x86_64__) ++ __asm__ __volatile__( ++ "pushq %%rbx" "\n\t" ++ "movq %0, %%rdi" "\n\t" ++ "movl 0(%%rdi), %%eax" "\n\t" ++ "cpuid" "\n\t" ++ "movl %%eax, 0(%%rdi)" "\n\t" ++ "movl %%ebx, 4(%%rdi)" "\n\t" ++ "movl %%ecx, 8(%%rdi)" "\n\t" ++ "movl %%edx, 12(%%rdi)" "\n\t" ++ "popq %%rbx" "\n" ++ : /*out*/ ++ : /*in*/"r"(regs) ++ : /*trash*/"rdi","rax","rcx","rdx","memory","cc" ++ ); ++# else ++# error "Hmm, unsupported x86-esque platform" ++# endif ++ } ++ + inline bool + has_cpuid_bit(unsigned int level, CPUIDRegister reg, unsigned int bit) + { ++ // Check that the level in question is supported. + unsigned int regs[4]; +- return __get_cpuid(level, ®s[0], ®s[1], ®s[2], ®s[3]) && +- (regs[reg] & bit); ++ my__cpuid(regs, level & 0x80000000u); ++ if (unsigned(regs[0]) < level) ++ return false; ++ ++ my__cpuid(regs, level); ++ return !!(unsigned(regs[reg]) & bit); + } + + } + + } + + #endif + diff -r e0271a18500f -r bc6311ee4f5e mozilla-xulrunner193/mozilla-cpuid.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mozilla-xulrunner193/mozilla-cpuid.patch Wed Jun 09 11:59:44 2010 +0200 @@ -0,0 +1,1 @@ +../mozilla-cpuid.patch \ No newline at end of file diff -r e0271a18500f -r bc6311ee4f5e mozilla-xulrunner193/mozilla-xulrunner193.spec --- a/mozilla-xulrunner193/mozilla-xulrunner193.spec Wed Jun 09 10:40:14 2010 +0200 +++ b/mozilla-xulrunner193/mozilla-xulrunner193.spec Wed Jun 09 11:59:44 2010 +0200 @@ -75,6 +75,7 @@ Patch12: gecko-lockdown.patch Patch13: toolkit-ui-lockdown.patch # --- +Patch14: mozilla-cpuid.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires: mozilla-js193 Requires(post): update-alternatives coreutils @@ -213,6 +214,9 @@ #%patch11 -p1 #%patch12 -p1 #%patch13 -p1 +%if %suse_version < 1120 +%patch14 -p1 +%endif %build #%if %suse_version >= 1110 diff -r e0271a18500f -r bc6311ee4f5e series --- a/series Wed Jun 09 10:40:14 2010 +0200 +++ b/series Wed Jun 09 11:59:44 2010 +0200 @@ -11,6 +11,7 @@ #mozilla-gconf-backend.patch #gecko-lockdown.patch #toolkit-ui-lockdown.patch +mozilla-cpuid.patch # Firefox patches firefox-libxul-sdk.patch