]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
descrambler: re-add %ebx saving
authorSven Wegener <sven.wegener@stealer.net>
Mon, 9 Nov 2015 19:45:18 +0000 (20:45 +0100)
committerJaroslav Kysela <perex@perex.cz>
Mon, 9 Nov 2015 21:11:16 +0000 (22:11 +0100)
The %ebx saving is necessary when the compiler is generating
position-indepent code.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
src/descrambler/ffdecsa/ffdecsa_interface.c

index 3d299714c45c6d52b238131d97c6cdc3184fc678..d3ee6839374cd2a72ad6d7ddcb4afe04214cf6d1 100644 (file)
@@ -118,9 +118,12 @@ static inline void
 native_cpuid(unsigned int *eax, unsigned int *ebx,
              unsigned int *ecx, unsigned int *edx)
 {
-  asm volatile("cpuid"
+  /* saving ebx is necessary for PIC compatibility */
+  asm volatile("mov %%"REG_b", %%"REG_S"\n\t"
+               "cpuid\n\t"
+               "xchg %%"REG_b", %%"REG_S
                : "=a" (*eax),
-                 "=b" (*ebx),
+                 "=S" (*ebx),
                  "=c" (*ecx),
                  "=d" (*edx)
                : "0" (*eax), "2" (*ecx));