From: Sven Wegener Date: Mon, 9 Nov 2015 19:45:18 +0000 (+0100) Subject: descrambler: re-add %ebx saving X-Git-Tag: v4.2.1~1614 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4f18ff179f1cf9283bf37b82e5cac3ef95580d3a;p=thirdparty%2Ftvheadend.git descrambler: re-add %ebx saving The %ebx saving is necessary when the compiler is generating position-indepent code. Signed-off-by: Sven Wegener --- diff --git a/src/descrambler/ffdecsa/ffdecsa_interface.c b/src/descrambler/ffdecsa/ffdecsa_interface.c index 3d299714c..d3ee68393 100644 --- a/src/descrambler/ffdecsa/ffdecsa_interface.c +++ b/src/descrambler/ffdecsa/ffdecsa_interface.c @@ -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));