From e15beb584a5ebdfc363e1ff15f87102508652d71 Mon Sep 17 00:00:00 2001 From: Jussi Kivilinna Date: Mon, 4 May 2015 20:09:51 +0300 Subject: hwf-x86: add EDX as output register for xgetbv asm block * src/hwf-x86.c (get_xgetbv): Add EDX as output. -- XGETBV instruction modifies EAX:EDX register pair, so we need to mark EDX as output to let compiler know that contents in this register are lost. Signed-off-by: Jussi Kivilinna --- src/hwf-x86.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hwf-x86.c b/src/hwf-x86.c index 7ee246d8..baef2df0 100644 --- a/src/hwf-x86.c +++ b/src/hwf-x86.c @@ -100,11 +100,11 @@ get_cpuid(unsigned int in, unsigned int *eax, unsigned int *ebx, static unsigned int get_xgetbv(void) { - unsigned int t_eax; + unsigned int t_eax, t_edx; asm volatile ("xgetbv\n\t" - : "=a" (t_eax) + : "=a" (t_eax), "=d" (t_edx) : "c" (0) ); @@ -151,11 +151,11 @@ get_cpuid(unsigned int in, unsigned int *eax, unsigned int *ebx, static unsigned int get_xgetbv(void) { - unsigned int t_eax; + unsigned int t_eax, t_edx; asm volatile ("xgetbv\n\t" - : "=a" (t_eax) + : "=a" (t_eax), "=d" (t_edx) : "c" (0) ); -- cgit v1.2.1