From: Oliver Kurth Date: Tue, 18 Dec 2018 21:19:48 +0000 (-0800) Subject: Changes to common header files not applicable to open-vm-tools. X-Git-Tag: stable-11.0.0~271 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78c8c4c2e83a6d24e0302e55f21912d7ebee9a2e;p=thirdparty%2Fopen-vm-tools.git Changes to common header files not applicable to open-vm-tools. --- diff --git a/open-vm-tools/lib/include/vm_basic_asm_x86.h b/open-vm-tools/lib/include/vm_basic_asm_x86.h index f88fac329..a78c434f5 100644 --- a/open-vm-tools/lib/include/vm_basic_asm_x86.h +++ b/open-vm-tools/lib/include/vm_basic_asm_x86.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2017 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2018 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -66,16 +66,18 @@ extern "C" { * XTEST * Return TRUE if processor is in transaction region. * + * Using condition codes as output values (=@ccnz) requires gcc6 or + * above. + * */ #if defined(__GNUC__) && (defined(VMM) || defined(VMKERNEL) || defined(FROBOS)) static INLINE Bool xtest(void) { - uint8 al; - __asm__ __volatile__(".byte 0x0f, 0x01, 0xd6 # xtest \n" - "setnz %%al\n" - : "=a"(al) : : "cc"); - return al; + Bool result; + __asm__ __volatile__("xtest" + : "=@ccnz" (result) : : "cc"); + return result; } #endif /* __GNUC__ */ diff --git a/open-vm-tools/lib/include/vm_basic_asm_x86_64.h b/open-vm-tools/lib/include/vm_basic_asm_x86_64.h index 75d14b6f1..1de433be5 100644 --- a/open-vm-tools/lib/include/vm_basic_asm_x86_64.h +++ b/open-vm-tools/lib/include/vm_basic_asm_x86_64.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2017 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2018 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -307,16 +307,18 @@ XRSTOR_AMD_ES0(const void *load, uint64 mask) * XTEST * Return TRUE if processor is in transaction region. * + * Using condition codes as output values (=@ccnz) requires gcc6 or + * above. + * */ #if defined(__GNUC__) && (defined(VMM) || defined(VMKERNEL) || defined(FROBOS)) static INLINE Bool xtest(void) { - uint8 al; - __asm__ __volatile__(".byte 0x0f, 0x01, 0xd6 # xtest \n" - "setnz %%al\n" - : "=a"(al) : : "cc"); - return al; + Bool result; + __asm__ __volatile__("xtest" + : "=@ccnz" (result) : : "cc"); + return result; } #endif /* __GNUC__ */