From: Katy Feng Date: Thu, 6 Apr 2023 18:27:41 +0000 (-0700) Subject: Changes to common header files not applicable to open-vm-tools. X-Git-Tag: stable-12.3.0~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c861f7feade19ef863a46f5ddd59c44d98a7b83;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 9cdb26248..50897381f 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-2021 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2023 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 @@ -71,7 +71,7 @@ extern "C" { * constraints. * */ -#if defined(__GNUC__) && (defined(VMM) || defined(VMKERNEL) || defined(FROBOS)) +#if (defined(VMM) || defined(VMKERNEL) || defined(FROBOS) || defined(ULM)) static INLINE Bool xtest(void) { @@ -80,14 +80,18 @@ xtest(void) __asm__ __volatile__("xtest\n" "setnz %%al" : "=a" (result) : : "cc"); -#else +#elif defined (__GNUC__) __asm__ __volatile__("xtest" : "=@ccnz" (result) : : "cc"); +#elif defined (_WIN32) + result = _xtest(); +#else +#error No xtest implementation for this compiler. #endif return result; } -#endif /* __GNUC__ */ +#endif /* VMM || VMKERNEL || FROBOS || ULM */ /* 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 c8ce8dfcf..5b90840fc 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-2021 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2023 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 @@ -345,7 +345,7 @@ XRSTORS(const void *load, uint64 mask) * constraints. * */ -#if defined(__GNUC__) && (defined(VMM) || defined(VMKERNEL) || defined(FROBOS)) +#if (defined(VMM) || defined(VMKERNEL) || defined(FROBOS) || defined(ULM)) static INLINE Bool xtest(void) { @@ -354,14 +354,18 @@ xtest(void) __asm__ __volatile__("xtest\n" "setnz %%al" : "=a" (result) : : "cc"); -#else +#elif defined(__GNUC__) __asm__ __volatile__("xtest" : "=@ccnz" (result) : : "cc"); +#elif defined (_WIN64) + result = _xtest(); +#else +#error No xtest implementation for this compiler. #endif return result; } -#endif /* __GNUC__ */ +#endif /* VMM || VMKERNEL || FROBOS || ULM */ /* *-----------------------------------------------------------------------------