diff options
Diffstat (limited to 'media-plugins/vdr-analogtv/files/vdr-analogtv-0.9.37-asm-fpic.diff')
-rw-r--r-- | media-plugins/vdr-analogtv/files/vdr-analogtv-0.9.37-asm-fpic.diff | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/media-plugins/vdr-analogtv/files/vdr-analogtv-0.9.37-asm-fpic.diff b/media-plugins/vdr-analogtv/files/vdr-analogtv-0.9.37-asm-fpic.diff new file mode 100644 index 000000000000..93e4638c05cf --- /dev/null +++ b/media-plugins/vdr-analogtv/files/vdr-analogtv-0.9.37-asm-fpic.diff @@ -0,0 +1,94 @@ +diff -ru analogtv-0.9.37.orig/cpu_accel.c analogtv-0.9.37/cpu_accel.c +--- analogtv-0.9.37.orig/cpu_accel.c 2005-05-13 23:49:38.000000000 +0200 ++++ analogtv-0.9.37/cpu_accel.c 2005-05-13 23:57:49.000000000 +0200 +@@ -50,30 +50,44 @@ + int AMD; + uint32_t caps; + ++#if !defined(PIC) && !defined(__PIC__) + #define cpuid(op,eax,ebx,ecx,edx) \ +- asm ("cpuid" \ ++ __asm__ ("cpuid" \ + : "=a" (eax), \ + "=b" (ebx), \ + "=c" (ecx), \ + "=d" (edx) \ + : "a" (op) \ + : "cc") ++#else /* PIC version : save ebx */ ++#define cpuid(op,eax,ebx,ecx,edx) \ ++ __asm__ ("push %%ebx\n\t" \ ++ "cpuid\n\t" \ ++ "movl %%ebx,%1\n\t" \ ++ "pop %%ebx" \ ++ : "=a" (eax), \ ++ "=r" (ebx), \ ++ "=c" (ecx), \ ++ "=d" (edx) \ ++ : "a" (op) \ ++ : "cc") ++#endif + + +- asm ("pushfl\n\t" +- "pushfl\n\t" +- "popl %0\n\t" +- "movl %0,%1\n\t" +- "xorl $0x200000,%0\n\t" +- "pushl %0\n\t" +- "popfl\n\t" +- "pushfl\n\t" +- "popl %0\n\t" +- "popfl" +- : "=a" (eax), +- "=b" (ebx) +- : +- : "cc"); ++ __asm__ ("pushf\n\t" ++ "pushf\n\t" ++ "pop %0\n\t" ++ "movl %0,%1\n\t" ++ "xorl $0x200000,%0\n\t" ++ "push %0\n\t" ++ "popf\n\t" ++ "pushf\n\t" ++ "pop %0\n\t" ++ "popf" ++ : "=r" (eax), ++ "=r" (ebx) ++ : ++ : "cc"); + + if (eax == ebx) /* no cpuid */ + return 0; +diff -ru analogtv-0.9.37-orig/cpuinfo.c analogtv-0.9.37/cpuinfo.c +--- analogtv-0.9.37-orig/cpuinfo.c 2005-12-11 16:51:06.713174250 +0100 ++++ analogtv-0.9.37/cpuinfo.c 2005-12-11 16:51:13.665608750 +0100 +@@ -62,15 +62,18 @@ + unsigned int edx; + } cpuid_regs_t; + +-static cpuid_regs_t cpuid( int func ) { +- cpuid_regs_t regs; +-#define CPUID ".byte 0x0f, 0xa2; " +- asm("movl %4,%%eax; " CPUID +- "movl %%eax,%0; movl %%ebx,%1; movl %%ecx,%2; movl %%edx,%3" +- : "=m" (regs.eax), "=m" (regs.ebx), "=m" (regs.ecx), "=m" (regs.edx) +- : "g" (func) +- : "%eax", "%ebx", "%ecx", "%edx"); +- return regs; ++static cpuid_regs_t ++cpuid(int func) { ++ cpuid_regs_t regs; ++#define CPUID ".byte 0x0f, 0xa2; " ++ __asm__("push %%ebx; " ++ "movl %4,%%eax; " CPUID ++ "movl %%eax,%0; movl %%ebx,%1; movl %%ecx,%2; movl %%edx,%3; " ++ "pop %%ebx" ++ : "=m" (regs.eax), "=m" (regs.ebx), "=m" (regs.ecx), "=m" (regs.edx) ++ : "g" (func) ++ : "%eax", "%ecx", "%edx"); ++ return regs; + } + + #define X86_VENDOR_INTEL 0 |