summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@iki.fi>2015-05-04 20:09:51 +0300
committerJussi Kivilinna <jussi.kivilinna@iki.fi>2015-05-14 09:28:33 +0300
commite15beb584a5ebdfc363e1ff15f87102508652d71 (patch)
tree290947175249b2470616c83e7d7c1c0ae297d329
parent5a7d55eed3316f40ca61acbee032bfc285e28803 (diff)
downloadlibgcrypt-e15beb584a5ebdfc363e1ff15f87102508652d71.tar.gz
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 <jussi.kivilinna@iki.fi>
-rw-r--r--src/hwf-x86.c8
1 files 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)
);