summaryrefslogtreecommitdiff
path: root/multimedia/libmpeg2/patches/patch-ab
blob: 97d7e9407acf585b7246bd88ee0dd4fb104477a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
$NetBSD: patch-ab,v 1.2 2006/06/19 13:21:14 adam Exp $

--- libmpeg2/cpu_accel.c.orig	2003-10-06 04:31:52.000000000 +0200
+++ libmpeg2/cpu_accel.c
@@ -37,7 +37,7 @@ static inline uint32_t arch_accel (void)
     int AMD;
     uint32_t caps;
 
-#if !defined(PIC) && !defined(__PIC__)
+#if defined(__x86_64__) || (!defined(PIC) && !defined(__PIC__))
 #define cpuid(op,eax,ebx,ecx,edx)	\
     __asm__ ("cpuid"			\
 	     : "=a" (eax),		\
@@ -46,7 +46,7 @@ static inline uint32_t arch_accel (void)
 	       "=d" (edx)		\
 	     : "a" (op)			\
 	     : "cc")
-#else	/* PIC version : save ebx */
+#else	/* PIC version : save ebx (not needed on x86_64) */
 #define cpuid(op,eax,ebx,ecx,edx)	\
     __asm__ ("push %%ebx\n\t"		\
 	     "cpuid\n\t"		\
@@ -60,6 +60,7 @@ static inline uint32_t arch_accel (void)
 	     : "cc")
 #endif
 
+#ifndef __x86_64__ /* x86_64 supports the cpuid op */
     __asm__ ("pushf\n\t"
 	     "pushf\n\t"
 	     "pop %0\n\t"
@@ -77,6 +78,7 @@ static inline uint32_t arch_accel (void)
 
     if (eax == ebx)		/* no cpuid */
 	return 0;
+#endif
 
     cpuid (0x00000000, eax, ebx, ecx, edx);
     if (!eax)			/* vendor string only */
@@ -127,7 +129,7 @@ static RETSIGTYPE sigill_handler (int si
 }
 
 #ifdef ARCH_PPC
-static inline uint32_t arch_accel (void)
+static uint32_t arch_accel (void)
 {
     static RETSIGTYPE (* oldsig) (int);