From 2c12df9001433b3701e2ee81a4248b2834a13552 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 11 Nov 2009 04:50:32 +0100 Subject: core: make cpuid code compile cleanly with 32bit PIC --- src/pulsecore/core-util.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c index 11e3d696..258e8eec 100644 --- a/src/pulsecore/core-util.c +++ b/src/pulsecore/core-util.c @@ -117,6 +117,7 @@ #include #include #include +#include #include "core-util.h" @@ -2935,10 +2936,13 @@ pa_bool_t pa_running_in_vm(void) { pa_zero(sig); __asm__ __volatile__ ( - " xor %%ebx, %%ebx \n\t" + /* ebx/rbx is being used for PIC! */ + " push %%"PA_REG_b" \n\t" " cpuid \n\t" + " mov %%ebx, %1 \n\t" + " pop %%"PA_REG_b" \n\t" - : "=a" (eax), "=b" (sig.sig32[0]), "=c" (sig.sig32[1]), "=d" (sig.sig32[2]) + : "=a" (eax), "=r" (sig.sig32[0]), "=c" (sig.sig32[1]), "=d" (sig.sig32[2]) : "0" (eax) ); -- cgit