Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 246771 | Differences between
and this patch

Collapse All | Expand All

(-)upp-x11-src-2361/uppsrc/Core/Cpu.cpp (+14 lines)
Lines 37-44 Link Here
37
#else
37
#else
38
	dword info1;
38
	dword info1;
39
	dword info2;
39
	dword info2;
40
	/* call the cpuid instruction with the registers as input and output
41
	 * modification by Dwokfur based on Sam Hocevar's discussion on
42
	 * how to make Assemly code PIC compatible:
43
	 * http://sam.zoy.org/blog/2007-04-13-shlib-with-non-pic-code-have-inline-assembly-and-pic-mix-well
44
	 */
45
#ifdef __PIC__
46
	__asm__("pushl %%ebx	\n\t" /* save %ebx */
47
		"movl $1, %%eax	\n\t"
48
		"cpuid		\n\t"
49
		"popl %%ebx	\n\t" /* restore the old %ebx */
50
		: "=d" (info1), "=c" (info2)
51
		: : "%eax");
52
#else
40
	__asm__("movl $1, %%eax\n\tcpuid" : "=d" (info1), "=c" (info2) : : "%eax", "%ebx");
53
	__asm__("movl $1, %%eax\n\tcpuid" : "=d" (info1), "=c" (info2) : : "%eax", "%ebx");
41
#endif
54
#endif
55
#endif
42
	sHasMMX = ((info1 >> 23) & 0x1);
56
	sHasMMX = ((info1 >> 23) & 0x1);
43
	sHasSSE = ((info1 >> 25) & 0x1);
57
	sHasSSE = ((info1 >> 25) & 0x1);
44
	sHasSSE2 = ((info1 >> 26) & 0x1);
58
	sHasSSE2 = ((info1 >> 26) & 0x1);

Return to bug 246771